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 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1530 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 1531 | peer_remote_as_vty (struct vty *vty, const char *peer_str, |
| 1532 | const char *as_str, afi_t afi, safi_t safi) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1533 | { |
| 1534 | int ret; |
| 1535 | struct bgp *bgp; |
| 1536 | as_t as; |
| 1537 | union sockunion su; |
| 1538 | |
| 1539 | bgp = vty->index; |
| 1540 | |
| 1541 | /* Get AS number. */ |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 1542 | VTY_GET_INTEGER_RANGE ("AS", as, as_str, 1, BGP_AS4_MAX); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1543 | |
| 1544 | /* If peer is peer group, call proper function. */ |
| 1545 | ret = str2sockunion (peer_str, &su); |
| 1546 | if (ret < 0) |
| 1547 | { |
| 1548 | ret = peer_group_remote_as (bgp, peer_str, &as); |
| 1549 | if (ret < 0) |
| 1550 | { |
| 1551 | vty_out (vty, "%% Create the peer-group first%s", VTY_NEWLINE); |
| 1552 | return CMD_WARNING; |
| 1553 | } |
| 1554 | return CMD_SUCCESS; |
| 1555 | } |
| 1556 | |
| 1557 | if (peer_address_self_check (&su)) |
| 1558 | { |
| 1559 | vty_out (vty, "%% Can not configure the local system as neighbor%s", |
| 1560 | VTY_NEWLINE); |
| 1561 | return CMD_WARNING; |
| 1562 | } |
| 1563 | |
| 1564 | ret = peer_remote_as (bgp, &su, &as, afi, safi); |
| 1565 | |
| 1566 | /* This peer belongs to peer group. */ |
| 1567 | switch (ret) |
| 1568 | { |
| 1569 | case BGP_ERR_PEER_GROUP_MEMBER: |
Denis Ovsienko | aea339f | 2009-04-30 17:16:22 +0400 | [diff] [blame] | 1570 | 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] | 1571 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1572 | case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT: |
Denis Ovsienko | aea339f | 2009-04-30 17:16:22 +0400 | [diff] [blame] | 1573 | 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] | 1574 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1575 | } |
| 1576 | return bgp_vty_return (vty, ret); |
| 1577 | } |
| 1578 | |
| 1579 | DEFUN (neighbor_remote_as, |
| 1580 | neighbor_remote_as_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 1581 | NEIGHBOR_CMD2 "remote-as " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1582 | NEIGHBOR_STR |
| 1583 | NEIGHBOR_ADDR_STR2 |
| 1584 | "Specify a BGP neighbor\n" |
| 1585 | AS_STR) |
| 1586 | { |
| 1587 | return peer_remote_as_vty (vty, argv[0], argv[1], AFI_IP, SAFI_UNICAST); |
| 1588 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1589 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1590 | DEFUN (neighbor_peer_group, |
| 1591 | neighbor_peer_group_cmd, |
| 1592 | "neighbor WORD peer-group", |
| 1593 | NEIGHBOR_STR |
| 1594 | "Neighbor tag\n" |
| 1595 | "Configure peer-group\n") |
| 1596 | { |
| 1597 | struct bgp *bgp; |
| 1598 | struct peer_group *group; |
| 1599 | |
| 1600 | bgp = vty->index; |
| 1601 | |
| 1602 | group = peer_group_get (bgp, argv[0]); |
| 1603 | if (! group) |
| 1604 | return CMD_WARNING; |
| 1605 | |
| 1606 | return CMD_SUCCESS; |
| 1607 | } |
| 1608 | |
| 1609 | DEFUN (no_neighbor, |
| 1610 | no_neighbor_cmd, |
| 1611 | NO_NEIGHBOR_CMD2, |
| 1612 | NO_STR |
| 1613 | NEIGHBOR_STR |
| 1614 | NEIGHBOR_ADDR_STR2) |
| 1615 | { |
| 1616 | int ret; |
| 1617 | union sockunion su; |
| 1618 | struct peer_group *group; |
| 1619 | struct peer *peer; |
| 1620 | |
| 1621 | ret = str2sockunion (argv[0], &su); |
| 1622 | if (ret < 0) |
| 1623 | { |
| 1624 | group = peer_group_lookup (vty->index, argv[0]); |
| 1625 | if (group) |
| 1626 | peer_group_delete (group); |
| 1627 | else |
| 1628 | { |
| 1629 | vty_out (vty, "%% Create the peer-group first%s", VTY_NEWLINE); |
| 1630 | return CMD_WARNING; |
| 1631 | } |
| 1632 | } |
| 1633 | else |
| 1634 | { |
| 1635 | peer = peer_lookup (vty->index, &su); |
| 1636 | if (peer) |
paul | 200df11 | 2005-06-01 11:17:05 +0000 | [diff] [blame] | 1637 | peer_delete (peer); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1638 | } |
| 1639 | |
| 1640 | return CMD_SUCCESS; |
| 1641 | } |
| 1642 | |
| 1643 | ALIAS (no_neighbor, |
| 1644 | no_neighbor_remote_as_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 1645 | NO_NEIGHBOR_CMD "remote-as " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1646 | NO_STR |
| 1647 | NEIGHBOR_STR |
| 1648 | NEIGHBOR_ADDR_STR |
| 1649 | "Specify a BGP neighbor\n" |
| 1650 | AS_STR) |
| 1651 | |
| 1652 | DEFUN (no_neighbor_peer_group, |
| 1653 | no_neighbor_peer_group_cmd, |
| 1654 | "no neighbor WORD peer-group", |
| 1655 | NO_STR |
| 1656 | NEIGHBOR_STR |
| 1657 | "Neighbor tag\n" |
| 1658 | "Configure peer-group\n") |
| 1659 | { |
| 1660 | struct peer_group *group; |
| 1661 | |
| 1662 | group = peer_group_lookup (vty->index, argv[0]); |
| 1663 | if (group) |
| 1664 | peer_group_delete (group); |
| 1665 | else |
| 1666 | { |
| 1667 | vty_out (vty, "%% Create the peer-group first%s", VTY_NEWLINE); |
| 1668 | return CMD_WARNING; |
| 1669 | } |
| 1670 | return CMD_SUCCESS; |
| 1671 | } |
| 1672 | |
| 1673 | DEFUN (no_neighbor_peer_group_remote_as, |
| 1674 | no_neighbor_peer_group_remote_as_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 1675 | "no neighbor WORD remote-as " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1676 | NO_STR |
| 1677 | NEIGHBOR_STR |
| 1678 | "Neighbor tag\n" |
| 1679 | "Specify a BGP neighbor\n" |
| 1680 | AS_STR) |
| 1681 | { |
| 1682 | struct peer_group *group; |
| 1683 | |
| 1684 | group = peer_group_lookup (vty->index, argv[0]); |
| 1685 | if (group) |
| 1686 | peer_group_remote_as_delete (group); |
| 1687 | else |
| 1688 | { |
| 1689 | vty_out (vty, "%% Create the peer-group first%s", VTY_NEWLINE); |
| 1690 | return CMD_WARNING; |
| 1691 | } |
| 1692 | return CMD_SUCCESS; |
| 1693 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1694 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1695 | DEFUN (neighbor_local_as, |
| 1696 | neighbor_local_as_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 1697 | NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1698 | NEIGHBOR_STR |
| 1699 | NEIGHBOR_ADDR_STR2 |
| 1700 | "Specify a local-as number\n" |
| 1701 | "AS number used as local AS\n") |
| 1702 | { |
| 1703 | struct peer *peer; |
| 1704 | int ret; |
| 1705 | |
| 1706 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1707 | if (! peer) |
| 1708 | return CMD_WARNING; |
| 1709 | |
Andrew Certain | 9d3f970 | 2012-11-07 23:50:07 +0000 | [diff] [blame] | 1710 | ret = peer_local_as_set (peer, atoi (argv[1]), 0, 0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1711 | return bgp_vty_return (vty, ret); |
| 1712 | } |
| 1713 | |
| 1714 | DEFUN (neighbor_local_as_no_prepend, |
| 1715 | neighbor_local_as_no_prepend_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 1716 | NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE " no-prepend", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1717 | NEIGHBOR_STR |
| 1718 | NEIGHBOR_ADDR_STR2 |
| 1719 | "Specify a local-as number\n" |
| 1720 | "AS number used as local AS\n" |
| 1721 | "Do not prepend local-as to updates from ebgp peers\n") |
| 1722 | { |
| 1723 | struct peer *peer; |
| 1724 | int ret; |
| 1725 | |
| 1726 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1727 | if (! peer) |
| 1728 | return CMD_WARNING; |
| 1729 | |
Andrew Certain | 9d3f970 | 2012-11-07 23:50:07 +0000 | [diff] [blame] | 1730 | ret = peer_local_as_set (peer, atoi (argv[1]), 1, 0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1731 | return bgp_vty_return (vty, ret); |
| 1732 | } |
| 1733 | |
Andrew Certain | 9d3f970 | 2012-11-07 23:50:07 +0000 | [diff] [blame] | 1734 | DEFUN (neighbor_local_as_no_prepend_replace_as, |
| 1735 | neighbor_local_as_no_prepend_replace_as_cmd, |
| 1736 | NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE " no-prepend replace-as", |
| 1737 | NEIGHBOR_STR |
| 1738 | NEIGHBOR_ADDR_STR2 |
| 1739 | "Specify a local-as number\n" |
| 1740 | "AS number used as local AS\n" |
| 1741 | "Do not prepend local-as to updates from ebgp peers\n" |
| 1742 | "Do not prepend local-as to updates from ibgp peers\n") |
| 1743 | { |
| 1744 | struct peer *peer; |
| 1745 | int ret; |
| 1746 | |
| 1747 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1748 | if (! peer) |
| 1749 | return CMD_WARNING; |
| 1750 | |
| 1751 | ret = peer_local_as_set (peer, atoi (argv[1]), 1, 1); |
| 1752 | return bgp_vty_return (vty, ret); |
| 1753 | } |
| 1754 | |
| 1755 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1756 | DEFUN (no_neighbor_local_as, |
| 1757 | no_neighbor_local_as_cmd, |
| 1758 | NO_NEIGHBOR_CMD2 "local-as", |
| 1759 | NO_STR |
| 1760 | NEIGHBOR_STR |
| 1761 | NEIGHBOR_ADDR_STR2 |
| 1762 | "Specify a local-as number\n") |
| 1763 | { |
| 1764 | struct peer *peer; |
| 1765 | int ret; |
| 1766 | |
| 1767 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1768 | if (! peer) |
| 1769 | return CMD_WARNING; |
| 1770 | |
| 1771 | ret = peer_local_as_unset (peer); |
| 1772 | return bgp_vty_return (vty, ret); |
| 1773 | } |
| 1774 | |
| 1775 | ALIAS (no_neighbor_local_as, |
| 1776 | no_neighbor_local_as_val_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 1777 | NO_NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1778 | NO_STR |
| 1779 | NEIGHBOR_STR |
| 1780 | NEIGHBOR_ADDR_STR2 |
| 1781 | "Specify a local-as number\n" |
| 1782 | "AS number used as local AS\n") |
| 1783 | |
| 1784 | ALIAS (no_neighbor_local_as, |
| 1785 | no_neighbor_local_as_val2_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 1786 | NO_NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE " no-prepend", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1787 | NO_STR |
| 1788 | NEIGHBOR_STR |
| 1789 | NEIGHBOR_ADDR_STR2 |
| 1790 | "Specify a local-as number\n" |
| 1791 | "AS number used as local AS\n" |
| 1792 | "Do not prepend local-as to updates from ebgp peers\n") |
Andrew Certain | 9d3f970 | 2012-11-07 23:50:07 +0000 | [diff] [blame] | 1793 | |
| 1794 | ALIAS (no_neighbor_local_as, |
| 1795 | no_neighbor_local_as_val3_cmd, |
| 1796 | NO_NEIGHBOR_CMD2 "local-as " CMD_AS_RANGE " no-prepend replace-as", |
| 1797 | NO_STR |
| 1798 | NEIGHBOR_STR |
| 1799 | NEIGHBOR_ADDR_STR2 |
| 1800 | "Specify a local-as number\n" |
| 1801 | "AS number used as local AS\n" |
| 1802 | "Do not prepend local-as to updates from ebgp peers\n" |
| 1803 | "Do not prepend local-as to updates from ibgp peers\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1804 | |
Paul Jakma | 0df7c91 | 2008-07-21 21:02:49 +0000 | [diff] [blame] | 1805 | DEFUN (neighbor_password, |
| 1806 | neighbor_password_cmd, |
| 1807 | NEIGHBOR_CMD2 "password LINE", |
| 1808 | NEIGHBOR_STR |
| 1809 | NEIGHBOR_ADDR_STR2 |
| 1810 | "Set a password\n" |
| 1811 | "The password\n") |
| 1812 | { |
| 1813 | struct peer *peer; |
| 1814 | int ret; |
| 1815 | |
| 1816 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1817 | if (! peer) |
| 1818 | return CMD_WARNING; |
| 1819 | |
| 1820 | ret = peer_password_set (peer, argv[1]); |
| 1821 | return bgp_vty_return (vty, ret); |
| 1822 | } |
| 1823 | |
| 1824 | DEFUN (no_neighbor_password, |
| 1825 | no_neighbor_password_cmd, |
| 1826 | NO_NEIGHBOR_CMD2 "password", |
| 1827 | NO_STR |
| 1828 | NEIGHBOR_STR |
| 1829 | NEIGHBOR_ADDR_STR2 |
| 1830 | "Set a password\n") |
| 1831 | { |
| 1832 | struct peer *peer; |
| 1833 | int ret; |
| 1834 | |
| 1835 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1836 | if (! peer) |
| 1837 | return CMD_WARNING; |
| 1838 | |
| 1839 | ret = peer_password_unset (peer); |
| 1840 | return bgp_vty_return (vty, ret); |
| 1841 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1842 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1843 | DEFUN (neighbor_activate, |
| 1844 | neighbor_activate_cmd, |
| 1845 | NEIGHBOR_CMD2 "activate", |
| 1846 | NEIGHBOR_STR |
| 1847 | NEIGHBOR_ADDR_STR2 |
| 1848 | "Enable the Address Family for this Neighbor\n") |
| 1849 | { |
| 1850 | struct peer *peer; |
| 1851 | |
| 1852 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1853 | if (! peer) |
| 1854 | return CMD_WARNING; |
| 1855 | |
| 1856 | peer_activate (peer, bgp_node_afi (vty), bgp_node_safi (vty)); |
| 1857 | |
| 1858 | return CMD_SUCCESS; |
| 1859 | } |
| 1860 | |
| 1861 | DEFUN (no_neighbor_activate, |
| 1862 | no_neighbor_activate_cmd, |
| 1863 | NO_NEIGHBOR_CMD2 "activate", |
| 1864 | NO_STR |
| 1865 | NEIGHBOR_STR |
| 1866 | NEIGHBOR_ADDR_STR2 |
| 1867 | "Enable the Address Family for this Neighbor\n") |
| 1868 | { |
| 1869 | int ret; |
| 1870 | struct peer *peer; |
| 1871 | |
| 1872 | /* Lookup peer. */ |
| 1873 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1874 | if (! peer) |
| 1875 | return CMD_WARNING; |
| 1876 | |
| 1877 | ret = peer_deactivate (peer, bgp_node_afi (vty), bgp_node_safi (vty)); |
| 1878 | |
| 1879 | return bgp_vty_return (vty, ret); |
| 1880 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1881 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1882 | DEFUN (neighbor_set_peer_group, |
| 1883 | neighbor_set_peer_group_cmd, |
| 1884 | NEIGHBOR_CMD "peer-group WORD", |
| 1885 | NEIGHBOR_STR |
| 1886 | NEIGHBOR_ADDR_STR |
| 1887 | "Member of the peer-group\n" |
| 1888 | "peer-group name\n") |
| 1889 | { |
| 1890 | int ret; |
| 1891 | as_t as; |
| 1892 | union sockunion su; |
| 1893 | struct bgp *bgp; |
| 1894 | struct peer_group *group; |
| 1895 | |
| 1896 | bgp = vty->index; |
| 1897 | |
| 1898 | ret = str2sockunion (argv[0], &su); |
| 1899 | if (ret < 0) |
| 1900 | { |
| 1901 | vty_out (vty, "%% Malformed address: %s%s", argv[0], VTY_NEWLINE); |
| 1902 | return CMD_WARNING; |
| 1903 | } |
| 1904 | |
| 1905 | group = peer_group_lookup (bgp, argv[1]); |
| 1906 | if (! group) |
| 1907 | { |
| 1908 | vty_out (vty, "%% Configure the peer-group first%s", VTY_NEWLINE); |
| 1909 | return CMD_WARNING; |
| 1910 | } |
| 1911 | |
| 1912 | if (peer_address_self_check (&su)) |
| 1913 | { |
| 1914 | vty_out (vty, "%% Can not configure the local system as neighbor%s", |
| 1915 | VTY_NEWLINE); |
| 1916 | return CMD_WARNING; |
| 1917 | } |
| 1918 | |
| 1919 | ret = peer_group_bind (bgp, &su, group, bgp_node_afi (vty), |
| 1920 | bgp_node_safi (vty), &as); |
| 1921 | |
| 1922 | if (ret == BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT) |
| 1923 | { |
Denis Ovsienko | aea339f | 2009-04-30 17:16:22 +0400 | [diff] [blame] | 1924 | 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] | 1925 | return CMD_WARNING; |
| 1926 | } |
| 1927 | |
| 1928 | return bgp_vty_return (vty, ret); |
| 1929 | } |
| 1930 | |
| 1931 | DEFUN (no_neighbor_set_peer_group, |
| 1932 | no_neighbor_set_peer_group_cmd, |
| 1933 | NO_NEIGHBOR_CMD "peer-group WORD", |
| 1934 | NO_STR |
| 1935 | NEIGHBOR_STR |
| 1936 | NEIGHBOR_ADDR_STR |
| 1937 | "Member of the peer-group\n" |
| 1938 | "peer-group name\n") |
| 1939 | { |
| 1940 | int ret; |
| 1941 | struct bgp *bgp; |
| 1942 | struct peer *peer; |
| 1943 | struct peer_group *group; |
| 1944 | |
| 1945 | bgp = vty->index; |
| 1946 | |
| 1947 | peer = peer_lookup_vty (vty, argv[0]); |
| 1948 | if (! peer) |
| 1949 | return CMD_WARNING; |
| 1950 | |
| 1951 | group = peer_group_lookup (bgp, argv[1]); |
| 1952 | if (! group) |
| 1953 | { |
| 1954 | vty_out (vty, "%% Configure the peer-group first%s", VTY_NEWLINE); |
| 1955 | return CMD_WARNING; |
| 1956 | } |
| 1957 | |
| 1958 | ret = peer_group_unbind (bgp, peer, group, bgp_node_afi (vty), |
| 1959 | bgp_node_safi (vty)); |
| 1960 | |
| 1961 | return bgp_vty_return (vty, ret); |
| 1962 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 1963 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 1964 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 1965 | peer_flag_modify_vty (struct vty *vty, const char *ip_str, |
| 1966 | u_int16_t flag, int set) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1967 | { |
| 1968 | int ret; |
| 1969 | struct peer *peer; |
| 1970 | |
| 1971 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 1972 | if (! peer) |
| 1973 | return CMD_WARNING; |
| 1974 | |
| 1975 | if (set) |
| 1976 | ret = peer_flag_set (peer, flag); |
| 1977 | else |
| 1978 | ret = peer_flag_unset (peer, flag); |
| 1979 | |
| 1980 | return bgp_vty_return (vty, ret); |
| 1981 | } |
| 1982 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 1983 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 1984 | 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] | 1985 | { |
| 1986 | return peer_flag_modify_vty (vty, ip_str, flag, 1); |
| 1987 | } |
| 1988 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 1989 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 1990 | 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] | 1991 | { |
| 1992 | return peer_flag_modify_vty (vty, ip_str, flag, 0); |
| 1993 | } |
| 1994 | |
| 1995 | /* neighbor passive. */ |
| 1996 | DEFUN (neighbor_passive, |
| 1997 | neighbor_passive_cmd, |
| 1998 | NEIGHBOR_CMD2 "passive", |
| 1999 | NEIGHBOR_STR |
| 2000 | NEIGHBOR_ADDR_STR2 |
| 2001 | "Don't send open messages to this neighbor\n") |
| 2002 | { |
| 2003 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_PASSIVE); |
| 2004 | } |
| 2005 | |
| 2006 | DEFUN (no_neighbor_passive, |
| 2007 | no_neighbor_passive_cmd, |
| 2008 | NO_NEIGHBOR_CMD2 "passive", |
| 2009 | NO_STR |
| 2010 | NEIGHBOR_STR |
| 2011 | NEIGHBOR_ADDR_STR2 |
| 2012 | "Don't send open messages to this neighbor\n") |
| 2013 | { |
| 2014 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_PASSIVE); |
| 2015 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2016 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2017 | /* neighbor shutdown. */ |
| 2018 | DEFUN (neighbor_shutdown, |
| 2019 | neighbor_shutdown_cmd, |
| 2020 | NEIGHBOR_CMD2 "shutdown", |
| 2021 | NEIGHBOR_STR |
| 2022 | NEIGHBOR_ADDR_STR2 |
| 2023 | "Administratively shut down this neighbor\n") |
| 2024 | { |
| 2025 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_SHUTDOWN); |
| 2026 | } |
| 2027 | |
| 2028 | DEFUN (no_neighbor_shutdown, |
| 2029 | no_neighbor_shutdown_cmd, |
| 2030 | NO_NEIGHBOR_CMD2 "shutdown", |
| 2031 | NO_STR |
| 2032 | NEIGHBOR_STR |
| 2033 | NEIGHBOR_ADDR_STR2 |
| 2034 | "Administratively shut down this neighbor\n") |
| 2035 | { |
| 2036 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_SHUTDOWN); |
| 2037 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2038 | |
hasso | c950243 | 2005-02-01 22:01:48 +0000 | [diff] [blame] | 2039 | /* Deprecated neighbor capability route-refresh. */ |
| 2040 | DEFUN_DEPRECATED (neighbor_capability_route_refresh, |
| 2041 | neighbor_capability_route_refresh_cmd, |
| 2042 | NEIGHBOR_CMD2 "capability route-refresh", |
| 2043 | NEIGHBOR_STR |
| 2044 | NEIGHBOR_ADDR_STR2 |
| 2045 | "Advertise capability to the peer\n" |
| 2046 | "Advertise route-refresh capability to this neighbor\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2047 | { |
hasso | c950243 | 2005-02-01 22:01:48 +0000 | [diff] [blame] | 2048 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2049 | } |
| 2050 | |
hasso | c950243 | 2005-02-01 22:01:48 +0000 | [diff] [blame] | 2051 | DEFUN_DEPRECATED (no_neighbor_capability_route_refresh, |
| 2052 | no_neighbor_capability_route_refresh_cmd, |
| 2053 | NO_NEIGHBOR_CMD2 "capability route-refresh", |
| 2054 | NO_STR |
| 2055 | NEIGHBOR_STR |
| 2056 | NEIGHBOR_ADDR_STR2 |
| 2057 | "Advertise capability to the peer\n" |
| 2058 | "Advertise route-refresh capability to this neighbor\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2059 | { |
hasso | c950243 | 2005-02-01 22:01:48 +0000 | [diff] [blame] | 2060 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2061 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2062 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2063 | /* neighbor capability dynamic. */ |
| 2064 | DEFUN (neighbor_capability_dynamic, |
| 2065 | neighbor_capability_dynamic_cmd, |
| 2066 | NEIGHBOR_CMD2 "capability dynamic", |
| 2067 | NEIGHBOR_STR |
| 2068 | NEIGHBOR_ADDR_STR2 |
| 2069 | "Advertise capability to the peer\n" |
| 2070 | "Advertise dynamic capability to this neighbor\n") |
| 2071 | { |
| 2072 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_DYNAMIC_CAPABILITY); |
| 2073 | } |
| 2074 | |
| 2075 | DEFUN (no_neighbor_capability_dynamic, |
| 2076 | no_neighbor_capability_dynamic_cmd, |
| 2077 | NO_NEIGHBOR_CMD2 "capability dynamic", |
| 2078 | NO_STR |
| 2079 | NEIGHBOR_STR |
| 2080 | NEIGHBOR_ADDR_STR2 |
| 2081 | "Advertise capability to the peer\n" |
| 2082 | "Advertise dynamic capability to this neighbor\n") |
| 2083 | { |
| 2084 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_DYNAMIC_CAPABILITY); |
| 2085 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2086 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2087 | /* neighbor dont-capability-negotiate */ |
| 2088 | DEFUN (neighbor_dont_capability_negotiate, |
| 2089 | neighbor_dont_capability_negotiate_cmd, |
| 2090 | NEIGHBOR_CMD2 "dont-capability-negotiate", |
| 2091 | NEIGHBOR_STR |
| 2092 | NEIGHBOR_ADDR_STR2 |
| 2093 | "Do not perform capability negotiation\n") |
| 2094 | { |
| 2095 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_DONT_CAPABILITY); |
| 2096 | } |
| 2097 | |
| 2098 | DEFUN (no_neighbor_dont_capability_negotiate, |
| 2099 | no_neighbor_dont_capability_negotiate_cmd, |
| 2100 | NO_NEIGHBOR_CMD2 "dont-capability-negotiate", |
| 2101 | NO_STR |
| 2102 | NEIGHBOR_STR |
| 2103 | NEIGHBOR_ADDR_STR2 |
| 2104 | "Do not perform capability negotiation\n") |
| 2105 | { |
| 2106 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_DONT_CAPABILITY); |
| 2107 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2108 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2109 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2110 | 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] | 2111 | safi_t safi, u_int32_t flag, int set) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2112 | { |
| 2113 | int ret; |
| 2114 | struct peer *peer; |
| 2115 | |
| 2116 | peer = peer_and_group_lookup_vty (vty, peer_str); |
| 2117 | if (! peer) |
| 2118 | return CMD_WARNING; |
| 2119 | |
| 2120 | if (set) |
| 2121 | ret = peer_af_flag_set (peer, afi, safi, flag); |
| 2122 | else |
| 2123 | ret = peer_af_flag_unset (peer, afi, safi, flag); |
| 2124 | |
| 2125 | return bgp_vty_return (vty, ret); |
| 2126 | } |
| 2127 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2128 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2129 | 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] | 2130 | safi_t safi, u_int32_t flag) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2131 | { |
| 2132 | return peer_af_flag_modify_vty (vty, peer_str, afi, safi, flag, 1); |
| 2133 | } |
| 2134 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2135 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2136 | 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] | 2137 | safi_t safi, u_int32_t flag) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2138 | { |
| 2139 | return peer_af_flag_modify_vty (vty, peer_str, afi, safi, flag, 0); |
| 2140 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2141 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2142 | /* neighbor capability orf prefix-list. */ |
| 2143 | DEFUN (neighbor_capability_orf_prefix, |
| 2144 | neighbor_capability_orf_prefix_cmd, |
| 2145 | NEIGHBOR_CMD2 "capability orf prefix-list (both|send|receive)", |
| 2146 | NEIGHBOR_STR |
| 2147 | NEIGHBOR_ADDR_STR2 |
| 2148 | "Advertise capability to the peer\n" |
| 2149 | "Advertise ORF capability to the peer\n" |
| 2150 | "Advertise prefixlist ORF capability to this neighbor\n" |
| 2151 | "Capability to SEND and RECEIVE the ORF to/from this neighbor\n" |
| 2152 | "Capability to RECEIVE the ORF from this neighbor\n" |
| 2153 | "Capability to SEND the ORF to this neighbor\n") |
| 2154 | { |
| 2155 | u_int16_t flag = 0; |
| 2156 | |
| 2157 | if (strncmp (argv[1], "s", 1) == 0) |
| 2158 | flag = PEER_FLAG_ORF_PREFIX_SM; |
| 2159 | else if (strncmp (argv[1], "r", 1) == 0) |
| 2160 | flag = PEER_FLAG_ORF_PREFIX_RM; |
| 2161 | else if (strncmp (argv[1], "b", 1) == 0) |
| 2162 | flag = PEER_FLAG_ORF_PREFIX_SM|PEER_FLAG_ORF_PREFIX_RM; |
| 2163 | else |
| 2164 | return CMD_WARNING; |
| 2165 | |
| 2166 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2167 | bgp_node_safi (vty), flag); |
| 2168 | } |
| 2169 | |
| 2170 | DEFUN (no_neighbor_capability_orf_prefix, |
| 2171 | no_neighbor_capability_orf_prefix_cmd, |
| 2172 | NO_NEIGHBOR_CMD2 "capability orf prefix-list (both|send|receive)", |
| 2173 | NO_STR |
| 2174 | NEIGHBOR_STR |
| 2175 | NEIGHBOR_ADDR_STR2 |
| 2176 | "Advertise capability to the peer\n" |
| 2177 | "Advertise ORF capability to the peer\n" |
| 2178 | "Advertise prefixlist ORF capability to this neighbor\n" |
| 2179 | "Capability to SEND and RECEIVE the ORF to/from this neighbor\n" |
| 2180 | "Capability to RECEIVE the ORF from this neighbor\n" |
| 2181 | "Capability to SEND the ORF to this neighbor\n") |
| 2182 | { |
| 2183 | u_int16_t flag = 0; |
| 2184 | |
| 2185 | if (strncmp (argv[1], "s", 1) == 0) |
| 2186 | flag = PEER_FLAG_ORF_PREFIX_SM; |
| 2187 | else if (strncmp (argv[1], "r", 1) == 0) |
| 2188 | flag = PEER_FLAG_ORF_PREFIX_RM; |
| 2189 | else if (strncmp (argv[1], "b", 1) == 0) |
| 2190 | flag = PEER_FLAG_ORF_PREFIX_SM|PEER_FLAG_ORF_PREFIX_RM; |
| 2191 | else |
| 2192 | return CMD_WARNING; |
| 2193 | |
| 2194 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2195 | bgp_node_safi (vty), flag); |
| 2196 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2197 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2198 | /* neighbor next-hop-self. */ |
| 2199 | DEFUN (neighbor_nexthop_self, |
| 2200 | neighbor_nexthop_self_cmd, |
Timo Teräs | 9e7a53c | 2014-04-24 10:22:37 +0300 | [diff] [blame] | 2201 | NEIGHBOR_CMD2 "next-hop-self {all}", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2202 | NEIGHBOR_STR |
| 2203 | NEIGHBOR_ADDR_STR2 |
Timo Teräs | 9e7a53c | 2014-04-24 10:22:37 +0300 | [diff] [blame] | 2204 | "Disable the next hop calculation for this neighbor\n" |
| 2205 | "Apply also to ibgp-learned routes when acting as a route reflector\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2206 | { |
Timo Teräs | 9e7a53c | 2014-04-24 10:22:37 +0300 | [diff] [blame] | 2207 | u_int32_t flags = PEER_FLAG_NEXTHOP_SELF, unset = 0; |
| 2208 | int rc; |
| 2209 | |
| 2210 | /* Check if "all" is specified */ |
| 2211 | if (argv[1] != NULL) |
| 2212 | flags |= PEER_FLAG_NEXTHOP_SELF_ALL; |
| 2213 | else |
| 2214 | unset |= PEER_FLAG_NEXTHOP_SELF_ALL; |
| 2215 | |
| 2216 | rc = peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2217 | bgp_node_safi (vty), flags); |
| 2218 | if ( rc == CMD_SUCCESS && unset ) |
| 2219 | rc = peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2220 | bgp_node_safi (vty), unset); |
| 2221 | return rc; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2222 | } |
| 2223 | |
| 2224 | DEFUN (no_neighbor_nexthop_self, |
| 2225 | no_neighbor_nexthop_self_cmd, |
Timo Teräs | 9e7a53c | 2014-04-24 10:22:37 +0300 | [diff] [blame] | 2226 | NO_NEIGHBOR_CMD2 "next-hop-self {all}", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2227 | NO_STR |
| 2228 | NEIGHBOR_STR |
| 2229 | NEIGHBOR_ADDR_STR2 |
Timo Teräs | 9e7a53c | 2014-04-24 10:22:37 +0300 | [diff] [blame] | 2230 | "Disable the next hop calculation for this neighbor\n" |
| 2231 | "Apply also to ibgp-learned routes when acting as a route reflector\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2232 | { |
| 2233 | 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] | 2234 | bgp_node_safi (vty), |
| 2235 | PEER_FLAG_NEXTHOP_SELF|PEER_FLAG_NEXTHOP_SELF_ALL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2236 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2237 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2238 | /* neighbor remove-private-AS. */ |
| 2239 | DEFUN (neighbor_remove_private_as, |
| 2240 | neighbor_remove_private_as_cmd, |
| 2241 | NEIGHBOR_CMD2 "remove-private-AS", |
| 2242 | NEIGHBOR_STR |
| 2243 | NEIGHBOR_ADDR_STR2 |
| 2244 | "Remove private AS number from outbound updates\n") |
| 2245 | { |
| 2246 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2247 | bgp_node_safi (vty), |
| 2248 | PEER_FLAG_REMOVE_PRIVATE_AS); |
| 2249 | } |
| 2250 | |
| 2251 | DEFUN (no_neighbor_remove_private_as, |
| 2252 | no_neighbor_remove_private_as_cmd, |
| 2253 | NO_NEIGHBOR_CMD2 "remove-private-AS", |
| 2254 | NO_STR |
| 2255 | NEIGHBOR_STR |
| 2256 | NEIGHBOR_ADDR_STR2 |
| 2257 | "Remove private AS number from outbound updates\n") |
| 2258 | { |
| 2259 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2260 | bgp_node_safi (vty), |
| 2261 | PEER_FLAG_REMOVE_PRIVATE_AS); |
| 2262 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2263 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2264 | /* neighbor send-community. */ |
| 2265 | DEFUN (neighbor_send_community, |
| 2266 | neighbor_send_community_cmd, |
| 2267 | NEIGHBOR_CMD2 "send-community", |
| 2268 | NEIGHBOR_STR |
| 2269 | NEIGHBOR_ADDR_STR2 |
| 2270 | "Send Community attribute to this neighbor\n") |
| 2271 | { |
| 2272 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2273 | bgp_node_safi (vty), |
| 2274 | PEER_FLAG_SEND_COMMUNITY); |
| 2275 | } |
| 2276 | |
| 2277 | DEFUN (no_neighbor_send_community, |
| 2278 | no_neighbor_send_community_cmd, |
| 2279 | NO_NEIGHBOR_CMD2 "send-community", |
| 2280 | NO_STR |
| 2281 | NEIGHBOR_STR |
| 2282 | NEIGHBOR_ADDR_STR2 |
| 2283 | "Send Community attribute to this neighbor\n") |
| 2284 | { |
| 2285 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2286 | bgp_node_safi (vty), |
| 2287 | PEER_FLAG_SEND_COMMUNITY); |
| 2288 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2289 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2290 | /* neighbor send-community extended. */ |
| 2291 | DEFUN (neighbor_send_community_type, |
| 2292 | neighbor_send_community_type_cmd, |
| 2293 | NEIGHBOR_CMD2 "send-community (both|extended|standard)", |
| 2294 | NEIGHBOR_STR |
| 2295 | NEIGHBOR_ADDR_STR2 |
| 2296 | "Send Community attribute to this neighbor\n" |
| 2297 | "Send Standard and Extended Community attributes\n" |
| 2298 | "Send Extended Community attributes\n" |
| 2299 | "Send Standard Community attributes\n") |
| 2300 | { |
| 2301 | if (strncmp (argv[1], "s", 1) == 0) |
| 2302 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2303 | bgp_node_safi (vty), |
| 2304 | PEER_FLAG_SEND_COMMUNITY); |
| 2305 | if (strncmp (argv[1], "e", 1) == 0) |
| 2306 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2307 | bgp_node_safi (vty), |
| 2308 | PEER_FLAG_SEND_EXT_COMMUNITY); |
| 2309 | |
| 2310 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2311 | bgp_node_safi (vty), |
| 2312 | (PEER_FLAG_SEND_COMMUNITY| |
| 2313 | PEER_FLAG_SEND_EXT_COMMUNITY)); |
| 2314 | } |
| 2315 | |
| 2316 | DEFUN (no_neighbor_send_community_type, |
| 2317 | no_neighbor_send_community_type_cmd, |
| 2318 | NO_NEIGHBOR_CMD2 "send-community (both|extended|standard)", |
| 2319 | NO_STR |
| 2320 | NEIGHBOR_STR |
| 2321 | NEIGHBOR_ADDR_STR2 |
| 2322 | "Send Community attribute to this neighbor\n" |
| 2323 | "Send Standard and Extended Community attributes\n" |
| 2324 | "Send Extended Community attributes\n" |
| 2325 | "Send Standard Community attributes\n") |
| 2326 | { |
| 2327 | if (strncmp (argv[1], "s", 1) == 0) |
| 2328 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2329 | bgp_node_safi (vty), |
| 2330 | PEER_FLAG_SEND_COMMUNITY); |
| 2331 | if (strncmp (argv[1], "e", 1) == 0) |
| 2332 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2333 | bgp_node_safi (vty), |
| 2334 | PEER_FLAG_SEND_EXT_COMMUNITY); |
| 2335 | |
| 2336 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2337 | bgp_node_safi (vty), |
| 2338 | (PEER_FLAG_SEND_COMMUNITY | |
| 2339 | PEER_FLAG_SEND_EXT_COMMUNITY)); |
| 2340 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2341 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2342 | /* neighbor soft-reconfig. */ |
| 2343 | DEFUN (neighbor_soft_reconfiguration, |
| 2344 | neighbor_soft_reconfiguration_cmd, |
| 2345 | NEIGHBOR_CMD2 "soft-reconfiguration inbound", |
| 2346 | NEIGHBOR_STR |
| 2347 | NEIGHBOR_ADDR_STR2 |
| 2348 | "Per neighbor soft reconfiguration\n" |
| 2349 | "Allow inbound soft reconfiguration for this neighbor\n") |
| 2350 | { |
| 2351 | return peer_af_flag_set_vty (vty, argv[0], |
| 2352 | bgp_node_afi (vty), bgp_node_safi (vty), |
| 2353 | PEER_FLAG_SOFT_RECONFIG); |
| 2354 | } |
| 2355 | |
| 2356 | DEFUN (no_neighbor_soft_reconfiguration, |
| 2357 | no_neighbor_soft_reconfiguration_cmd, |
| 2358 | NO_NEIGHBOR_CMD2 "soft-reconfiguration inbound", |
| 2359 | NO_STR |
| 2360 | NEIGHBOR_STR |
| 2361 | NEIGHBOR_ADDR_STR2 |
| 2362 | "Per neighbor soft reconfiguration\n" |
| 2363 | "Allow inbound soft reconfiguration for this neighbor\n") |
| 2364 | { |
| 2365 | return peer_af_flag_unset_vty (vty, argv[0], |
| 2366 | bgp_node_afi (vty), bgp_node_safi (vty), |
| 2367 | PEER_FLAG_SOFT_RECONFIG); |
| 2368 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2369 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2370 | DEFUN (neighbor_route_reflector_client, |
| 2371 | neighbor_route_reflector_client_cmd, |
| 2372 | NEIGHBOR_CMD2 "route-reflector-client", |
| 2373 | NEIGHBOR_STR |
| 2374 | NEIGHBOR_ADDR_STR2 |
| 2375 | "Configure a neighbor as Route Reflector client\n") |
| 2376 | { |
| 2377 | struct peer *peer; |
| 2378 | |
| 2379 | |
| 2380 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 2381 | if (! peer) |
| 2382 | return CMD_WARNING; |
| 2383 | |
| 2384 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2385 | bgp_node_safi (vty), |
| 2386 | PEER_FLAG_REFLECTOR_CLIENT); |
| 2387 | } |
| 2388 | |
| 2389 | DEFUN (no_neighbor_route_reflector_client, |
| 2390 | no_neighbor_route_reflector_client_cmd, |
| 2391 | NO_NEIGHBOR_CMD2 "route-reflector-client", |
| 2392 | NO_STR |
| 2393 | NEIGHBOR_STR |
| 2394 | NEIGHBOR_ADDR_STR2 |
| 2395 | "Configure a neighbor as Route Reflector client\n") |
| 2396 | { |
| 2397 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2398 | bgp_node_safi (vty), |
| 2399 | PEER_FLAG_REFLECTOR_CLIENT); |
| 2400 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2401 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2402 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2403 | peer_rsclient_set_vty (struct vty *vty, const char *peer_str, |
| 2404 | int afi, int safi) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2405 | { |
| 2406 | int ret; |
| 2407 | struct bgp *bgp; |
| 2408 | struct peer *peer; |
| 2409 | struct peer_group *group; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 2410 | struct listnode *node, *nnode; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2411 | struct bgp_filter *pfilter; |
| 2412 | struct bgp_filter *gfilter; |
Chris Caputo | 228da42 | 2009-07-18 05:44:03 +0000 | [diff] [blame] | 2413 | int locked_and_added = 0; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2414 | |
| 2415 | bgp = vty->index; |
| 2416 | |
| 2417 | peer = peer_and_group_lookup_vty (vty, peer_str); |
| 2418 | if ( ! peer ) |
| 2419 | return CMD_WARNING; |
| 2420 | |
| 2421 | /* If it is already a RS-Client, don't do anything. */ |
| 2422 | if ( CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT) ) |
| 2423 | return CMD_SUCCESS; |
| 2424 | |
| 2425 | if ( ! peer_rsclient_active (peer) ) |
paul | 200df11 | 2005-06-01 11:17:05 +0000 | [diff] [blame] | 2426 | { |
| 2427 | peer = peer_lock (peer); /* rsclient peer list reference */ |
| 2428 | listnode_add_sort (bgp->rsclient, peer); |
Chris Caputo | 228da42 | 2009-07-18 05:44:03 +0000 | [diff] [blame] | 2429 | locked_and_added = 1; |
paul | 200df11 | 2005-06-01 11:17:05 +0000 | [diff] [blame] | 2430 | } |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2431 | |
| 2432 | ret = peer_af_flag_set (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT); |
| 2433 | if (ret < 0) |
Chris Caputo | 228da42 | 2009-07-18 05:44:03 +0000 | [diff] [blame] | 2434 | { |
| 2435 | if (locked_and_added) |
| 2436 | { |
| 2437 | listnode_delete (bgp->rsclient, peer); |
| 2438 | peer_unlock (peer); /* rsclient peer list reference */ |
| 2439 | } |
| 2440 | |
| 2441 | return bgp_vty_return (vty, ret); |
| 2442 | } |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2443 | |
Paul Jakma | 64e580a | 2006-02-21 01:09:01 +0000 | [diff] [blame] | 2444 | peer->rib[afi][safi] = bgp_table_init (afi, safi); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2445 | peer->rib[afi][safi]->type = BGP_TABLE_RSCLIENT; |
Chris Caputo | 228da42 | 2009-07-18 05:44:03 +0000 | [diff] [blame] | 2446 | /* RIB peer reference. Released when table is free'd in bgp_table_free. */ |
| 2447 | peer->rib[afi][safi]->owner = peer_lock (peer); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2448 | |
| 2449 | /* Check for existing 'network' and 'redistribute' routes. */ |
| 2450 | bgp_check_local_routes_rsclient (peer, afi, safi); |
| 2451 | |
| 2452 | /* Check for routes for peers configured with 'soft-reconfiguration'. */ |
| 2453 | bgp_soft_reconfig_rsclient (peer, afi, safi); |
| 2454 | |
| 2455 | if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) |
| 2456 | { |
| 2457 | group = peer->group; |
| 2458 | gfilter = &peer->filter[afi][safi]; |
| 2459 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 2460 | for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer)) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2461 | { |
| 2462 | pfilter = &peer->filter[afi][safi]; |
| 2463 | |
| 2464 | /* Members of a non-RS-Client group should not be RS-Clients, as that |
| 2465 | is checked when the become part of the peer-group */ |
| 2466 | ret = peer_af_flag_set (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT); |
| 2467 | if (ret < 0) |
| 2468 | return bgp_vty_return (vty, ret); |
| 2469 | |
| 2470 | /* Make peer's RIB point to group's RIB. */ |
| 2471 | peer->rib[afi][safi] = group->conf->rib[afi][safi]; |
| 2472 | |
| 2473 | /* Import policy. */ |
| 2474 | if (pfilter->map[RMAP_IMPORT].name) |
| 2475 | free (pfilter->map[RMAP_IMPORT].name); |
| 2476 | if (gfilter->map[RMAP_IMPORT].name) |
| 2477 | { |
| 2478 | pfilter->map[RMAP_IMPORT].name = strdup (gfilter->map[RMAP_IMPORT].name); |
| 2479 | pfilter->map[RMAP_IMPORT].map = gfilter->map[RMAP_IMPORT].map; |
| 2480 | } |
| 2481 | else |
| 2482 | { |
| 2483 | pfilter->map[RMAP_IMPORT].name = NULL; |
| 2484 | pfilter->map[RMAP_IMPORT].map =NULL; |
| 2485 | } |
| 2486 | |
| 2487 | /* Export policy. */ |
| 2488 | if (gfilter->map[RMAP_EXPORT].name && ! pfilter->map[RMAP_EXPORT].name) |
| 2489 | { |
| 2490 | pfilter->map[RMAP_EXPORT].name = strdup (gfilter->map[RMAP_EXPORT].name); |
| 2491 | pfilter->map[RMAP_EXPORT].map = gfilter->map[RMAP_EXPORT].map; |
| 2492 | } |
| 2493 | } |
| 2494 | } |
| 2495 | return CMD_SUCCESS; |
| 2496 | } |
| 2497 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2498 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2499 | peer_rsclient_unset_vty (struct vty *vty, const char *peer_str, |
| 2500 | int afi, int safi) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2501 | { |
| 2502 | int ret; |
| 2503 | struct bgp *bgp; |
| 2504 | struct peer *peer; |
| 2505 | struct peer_group *group; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 2506 | struct listnode *node, *nnode; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2507 | |
| 2508 | bgp = vty->index; |
| 2509 | |
| 2510 | peer = peer_and_group_lookup_vty (vty, peer_str); |
| 2511 | if ( ! peer ) |
| 2512 | return CMD_WARNING; |
| 2513 | |
| 2514 | /* If it is not a RS-Client, don't do anything. */ |
| 2515 | if ( ! CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT) ) |
| 2516 | return CMD_SUCCESS; |
| 2517 | |
| 2518 | if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) |
| 2519 | { |
| 2520 | group = peer->group; |
| 2521 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 2522 | for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer)) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2523 | { |
| 2524 | ret = peer_af_flag_unset (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT); |
| 2525 | if (ret < 0) |
| 2526 | return bgp_vty_return (vty, ret); |
| 2527 | |
| 2528 | peer->rib[afi][safi] = NULL; |
| 2529 | } |
| 2530 | |
| 2531 | peer = group->conf; |
| 2532 | } |
| 2533 | |
| 2534 | ret = peer_af_flag_unset (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT); |
| 2535 | if (ret < 0) |
| 2536 | return bgp_vty_return (vty, ret); |
| 2537 | |
| 2538 | if ( ! peer_rsclient_active (peer) ) |
paul | 200df11 | 2005-06-01 11:17:05 +0000 | [diff] [blame] | 2539 | { |
Chris Caputo | 228da42 | 2009-07-18 05:44:03 +0000 | [diff] [blame] | 2540 | bgp_clear_route (peer, afi, safi, BGP_CLEAR_ROUTE_MY_RSCLIENT); |
paul | 200df11 | 2005-06-01 11:17:05 +0000 | [diff] [blame] | 2541 | listnode_delete (bgp->rsclient, peer); |
Chris Caputo | 228da42 | 2009-07-18 05:44:03 +0000 | [diff] [blame] | 2542 | peer_unlock (peer); /* peer bgp rsclient reference */ |
paul | 200df11 | 2005-06-01 11:17:05 +0000 | [diff] [blame] | 2543 | } |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2544 | |
Paul Jakma | b608d5b | 2008-07-02 02:12:07 +0000 | [diff] [blame] | 2545 | bgp_table_finish (&peer->rib[bgp_node_afi(vty)][bgp_node_safi(vty)]); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2546 | |
| 2547 | return CMD_SUCCESS; |
| 2548 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2549 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2550 | /* neighbor route-server-client. */ |
| 2551 | DEFUN (neighbor_route_server_client, |
| 2552 | neighbor_route_server_client_cmd, |
| 2553 | NEIGHBOR_CMD2 "route-server-client", |
| 2554 | NEIGHBOR_STR |
| 2555 | NEIGHBOR_ADDR_STR2 |
| 2556 | "Configure a neighbor as Route Server client\n") |
| 2557 | { |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2558 | return peer_rsclient_set_vty (vty, argv[0], bgp_node_afi(vty), |
| 2559 | bgp_node_safi(vty)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2560 | } |
| 2561 | |
| 2562 | DEFUN (no_neighbor_route_server_client, |
| 2563 | no_neighbor_route_server_client_cmd, |
| 2564 | NO_NEIGHBOR_CMD2 "route-server-client", |
| 2565 | NO_STR |
| 2566 | NEIGHBOR_STR |
| 2567 | NEIGHBOR_ADDR_STR2 |
| 2568 | "Configure a neighbor as Route Server client\n") |
| 2569 | { |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2570 | return peer_rsclient_unset_vty (vty, argv[0], bgp_node_afi(vty), |
| 2571 | bgp_node_safi(vty)); |
| 2572 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2573 | |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2574 | DEFUN (neighbor_nexthop_local_unchanged, |
| 2575 | neighbor_nexthop_local_unchanged_cmd, |
| 2576 | NEIGHBOR_CMD2 "nexthop-local unchanged", |
| 2577 | NEIGHBOR_STR |
| 2578 | NEIGHBOR_ADDR_STR2 |
| 2579 | "Configure treatment of outgoing link-local nexthop attribute\n" |
| 2580 | "Leave link-local nexthop unchanged for this peer\n") |
| 2581 | { |
| 2582 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2583 | bgp_node_safi (vty), |
| 2584 | PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED ); |
| 2585 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2586 | |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2587 | DEFUN (no_neighbor_nexthop_local_unchanged, |
| 2588 | no_neighbor_nexthop_local_unchanged_cmd, |
| 2589 | NO_NEIGHBOR_CMD2 "nexthop-local unchanged", |
| 2590 | NO_STR |
| 2591 | NEIGHBOR_STR |
| 2592 | NEIGHBOR_ADDR_STR2 |
| 2593 | "Configure treatment of outgoing link-local-nexthop attribute\n" |
| 2594 | "Leave link-local nexthop unchanged for this peer\n") |
| 2595 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2596 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2597 | bgp_node_safi (vty), |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2598 | PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED ); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2599 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2600 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2601 | DEFUN (neighbor_attr_unchanged, |
| 2602 | neighbor_attr_unchanged_cmd, |
| 2603 | NEIGHBOR_CMD2 "attribute-unchanged", |
| 2604 | NEIGHBOR_STR |
| 2605 | NEIGHBOR_ADDR_STR2 |
| 2606 | "BGP attribute is propagated unchanged to this neighbor\n") |
| 2607 | { |
| 2608 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2609 | bgp_node_safi (vty), |
| 2610 | (PEER_FLAG_AS_PATH_UNCHANGED | |
| 2611 | PEER_FLAG_NEXTHOP_UNCHANGED | |
| 2612 | PEER_FLAG_MED_UNCHANGED)); |
| 2613 | } |
| 2614 | |
| 2615 | DEFUN (neighbor_attr_unchanged1, |
| 2616 | neighbor_attr_unchanged1_cmd, |
| 2617 | NEIGHBOR_CMD2 "attribute-unchanged (as-path|next-hop|med)", |
| 2618 | NEIGHBOR_STR |
| 2619 | NEIGHBOR_ADDR_STR2 |
| 2620 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2621 | "As-path attribute\n" |
| 2622 | "Nexthop attribute\n" |
| 2623 | "Med attribute\n") |
| 2624 | { |
| 2625 | u_int16_t flags = 0; |
| 2626 | |
| 2627 | if (strncmp (argv[1], "as-path", 1) == 0) |
| 2628 | SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED); |
| 2629 | else if (strncmp (argv[1], "next-hop", 1) == 0) |
| 2630 | SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2631 | else if (strncmp (argv[1], "med", 1) == 0) |
| 2632 | SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED); |
| 2633 | |
| 2634 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2635 | bgp_node_safi (vty), flags); |
| 2636 | } |
| 2637 | |
| 2638 | DEFUN (neighbor_attr_unchanged2, |
| 2639 | neighbor_attr_unchanged2_cmd, |
| 2640 | NEIGHBOR_CMD2 "attribute-unchanged as-path (next-hop|med)", |
| 2641 | NEIGHBOR_STR |
| 2642 | NEIGHBOR_ADDR_STR2 |
| 2643 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2644 | "As-path attribute\n" |
| 2645 | "Nexthop attribute\n" |
| 2646 | "Med attribute\n") |
| 2647 | { |
| 2648 | u_int16_t flags = PEER_FLAG_AS_PATH_UNCHANGED; |
| 2649 | |
| 2650 | if (strncmp (argv[1], "next-hop", 1) == 0) |
| 2651 | SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2652 | else if (strncmp (argv[1], "med", 1) == 0) |
| 2653 | SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED); |
| 2654 | |
| 2655 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2656 | bgp_node_safi (vty), flags); |
| 2657 | |
| 2658 | } |
| 2659 | |
| 2660 | DEFUN (neighbor_attr_unchanged3, |
| 2661 | neighbor_attr_unchanged3_cmd, |
| 2662 | NEIGHBOR_CMD2 "attribute-unchanged next-hop (as-path|med)", |
| 2663 | NEIGHBOR_STR |
| 2664 | NEIGHBOR_ADDR_STR2 |
| 2665 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2666 | "Nexthop attribute\n" |
| 2667 | "As-path attribute\n" |
| 2668 | "Med attribute\n") |
| 2669 | { |
| 2670 | u_int16_t flags = PEER_FLAG_NEXTHOP_UNCHANGED; |
| 2671 | |
| 2672 | if (strncmp (argv[1], "as-path", 1) == 0) |
| 2673 | SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED); |
| 2674 | else if (strncmp (argv[1], "med", 1) == 0) |
| 2675 | SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED); |
| 2676 | |
| 2677 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2678 | bgp_node_safi (vty), flags); |
| 2679 | } |
| 2680 | |
| 2681 | DEFUN (neighbor_attr_unchanged4, |
| 2682 | neighbor_attr_unchanged4_cmd, |
| 2683 | NEIGHBOR_CMD2 "attribute-unchanged med (as-path|next-hop)", |
| 2684 | NEIGHBOR_STR |
| 2685 | NEIGHBOR_ADDR_STR2 |
| 2686 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2687 | "Med attribute\n" |
| 2688 | "As-path attribute\n" |
| 2689 | "Nexthop attribute\n") |
| 2690 | { |
| 2691 | u_int16_t flags = PEER_FLAG_MED_UNCHANGED; |
| 2692 | |
| 2693 | if (strncmp (argv[1], "as-path", 1) == 0) |
| 2694 | SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED); |
| 2695 | else if (strncmp (argv[1], "next-hop", 1) == 0) |
| 2696 | SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2697 | |
| 2698 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2699 | bgp_node_safi (vty), flags); |
| 2700 | } |
| 2701 | |
| 2702 | ALIAS (neighbor_attr_unchanged, |
| 2703 | neighbor_attr_unchanged5_cmd, |
| 2704 | NEIGHBOR_CMD2 "attribute-unchanged as-path next-hop med", |
| 2705 | NEIGHBOR_STR |
| 2706 | NEIGHBOR_ADDR_STR2 |
| 2707 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2708 | "As-path attribute\n" |
| 2709 | "Nexthop attribute\n" |
| 2710 | "Med attribute\n") |
| 2711 | |
| 2712 | ALIAS (neighbor_attr_unchanged, |
| 2713 | neighbor_attr_unchanged6_cmd, |
| 2714 | NEIGHBOR_CMD2 "attribute-unchanged as-path med next-hop", |
| 2715 | NEIGHBOR_STR |
| 2716 | NEIGHBOR_ADDR_STR2 |
| 2717 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2718 | "As-path attribute\n" |
| 2719 | "Med attribute\n" |
| 2720 | "Nexthop attribute\n") |
| 2721 | |
| 2722 | ALIAS (neighbor_attr_unchanged, |
| 2723 | neighbor_attr_unchanged7_cmd, |
| 2724 | NEIGHBOR_CMD2 "attribute-unchanged next-hop med as-path", |
| 2725 | NEIGHBOR_STR |
| 2726 | NEIGHBOR_ADDR_STR2 |
| 2727 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2728 | "Nexthop attribute\n" |
| 2729 | "Med attribute\n" |
| 2730 | "As-path attribute\n") |
| 2731 | |
| 2732 | ALIAS (neighbor_attr_unchanged, |
| 2733 | neighbor_attr_unchanged8_cmd, |
| 2734 | NEIGHBOR_CMD2 "attribute-unchanged next-hop as-path med", |
| 2735 | NEIGHBOR_STR |
| 2736 | NEIGHBOR_ADDR_STR2 |
| 2737 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2738 | "Nexthop attribute\n" |
| 2739 | "As-path attribute\n" |
| 2740 | "Med attribute\n") |
| 2741 | |
| 2742 | ALIAS (neighbor_attr_unchanged, |
| 2743 | neighbor_attr_unchanged9_cmd, |
| 2744 | NEIGHBOR_CMD2 "attribute-unchanged med next-hop as-path", |
| 2745 | NEIGHBOR_STR |
| 2746 | NEIGHBOR_ADDR_STR2 |
| 2747 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2748 | "Med attribute\n" |
| 2749 | "Nexthop attribute\n" |
| 2750 | "As-path attribute\n") |
| 2751 | |
| 2752 | ALIAS (neighbor_attr_unchanged, |
| 2753 | neighbor_attr_unchanged10_cmd, |
| 2754 | NEIGHBOR_CMD2 "attribute-unchanged med as-path next-hop", |
| 2755 | NEIGHBOR_STR |
| 2756 | NEIGHBOR_ADDR_STR2 |
| 2757 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2758 | "Med attribute\n" |
| 2759 | "As-path attribute\n" |
| 2760 | "Nexthop attribute\n") |
| 2761 | |
| 2762 | DEFUN (no_neighbor_attr_unchanged, |
| 2763 | no_neighbor_attr_unchanged_cmd, |
| 2764 | NO_NEIGHBOR_CMD2 "attribute-unchanged", |
| 2765 | NO_STR |
| 2766 | NEIGHBOR_STR |
| 2767 | NEIGHBOR_ADDR_STR2 |
| 2768 | "BGP attribute is propagated unchanged to this neighbor\n") |
| 2769 | { |
| 2770 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2771 | bgp_node_safi (vty), |
| 2772 | (PEER_FLAG_AS_PATH_UNCHANGED | |
| 2773 | PEER_FLAG_NEXTHOP_UNCHANGED | |
| 2774 | PEER_FLAG_MED_UNCHANGED)); |
| 2775 | } |
| 2776 | |
| 2777 | DEFUN (no_neighbor_attr_unchanged1, |
| 2778 | no_neighbor_attr_unchanged1_cmd, |
| 2779 | NO_NEIGHBOR_CMD2 "attribute-unchanged (as-path|next-hop|med)", |
| 2780 | NO_STR |
| 2781 | NEIGHBOR_STR |
| 2782 | NEIGHBOR_ADDR_STR2 |
| 2783 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2784 | "As-path attribute\n" |
| 2785 | "Nexthop attribute\n" |
| 2786 | "Med attribute\n") |
| 2787 | { |
| 2788 | u_int16_t flags = 0; |
| 2789 | |
| 2790 | if (strncmp (argv[1], "as-path", 1) == 0) |
| 2791 | SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED); |
| 2792 | else if (strncmp (argv[1], "next-hop", 1) == 0) |
| 2793 | SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2794 | else if (strncmp (argv[1], "med", 1) == 0) |
| 2795 | SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED); |
| 2796 | |
| 2797 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2798 | bgp_node_safi (vty), flags); |
| 2799 | } |
| 2800 | |
| 2801 | DEFUN (no_neighbor_attr_unchanged2, |
| 2802 | no_neighbor_attr_unchanged2_cmd, |
| 2803 | NO_NEIGHBOR_CMD2 "attribute-unchanged as-path (next-hop|med)", |
| 2804 | NO_STR |
| 2805 | NEIGHBOR_STR |
| 2806 | NEIGHBOR_ADDR_STR2 |
| 2807 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2808 | "As-path attribute\n" |
| 2809 | "Nexthop attribute\n" |
| 2810 | "Med attribute\n") |
| 2811 | { |
| 2812 | u_int16_t flags = PEER_FLAG_AS_PATH_UNCHANGED; |
| 2813 | |
| 2814 | if (strncmp (argv[1], "next-hop", 1) == 0) |
| 2815 | SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2816 | else if (strncmp (argv[1], "med", 1) == 0) |
| 2817 | SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED); |
| 2818 | |
| 2819 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2820 | bgp_node_safi (vty), flags); |
| 2821 | } |
| 2822 | |
| 2823 | DEFUN (no_neighbor_attr_unchanged3, |
| 2824 | no_neighbor_attr_unchanged3_cmd, |
| 2825 | NO_NEIGHBOR_CMD2 "attribute-unchanged next-hop (as-path|med)", |
| 2826 | NO_STR |
| 2827 | NEIGHBOR_STR |
| 2828 | NEIGHBOR_ADDR_STR2 |
| 2829 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2830 | "Nexthop attribute\n" |
| 2831 | "As-path attribute\n" |
| 2832 | "Med attribute\n") |
| 2833 | { |
| 2834 | u_int16_t flags = PEER_FLAG_NEXTHOP_UNCHANGED; |
| 2835 | |
| 2836 | if (strncmp (argv[1], "as-path", 1) == 0) |
| 2837 | SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED); |
| 2838 | else if (strncmp (argv[1], "med", 1) == 0) |
| 2839 | SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED); |
| 2840 | |
| 2841 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2842 | bgp_node_safi (vty), flags); |
| 2843 | } |
| 2844 | |
| 2845 | DEFUN (no_neighbor_attr_unchanged4, |
| 2846 | no_neighbor_attr_unchanged4_cmd, |
| 2847 | NO_NEIGHBOR_CMD2 "attribute-unchanged med (as-path|next-hop)", |
| 2848 | NO_STR |
| 2849 | NEIGHBOR_STR |
| 2850 | NEIGHBOR_ADDR_STR2 |
| 2851 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2852 | "Med attribute\n" |
| 2853 | "As-path attribute\n" |
| 2854 | "Nexthop attribute\n") |
| 2855 | { |
| 2856 | u_int16_t flags = PEER_FLAG_MED_UNCHANGED; |
| 2857 | |
| 2858 | if (strncmp (argv[1], "as-path", 1) == 0) |
| 2859 | SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED); |
| 2860 | else if (strncmp (argv[1], "next-hop", 1) == 0) |
| 2861 | SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2862 | |
| 2863 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2864 | bgp_node_safi (vty), flags); |
| 2865 | } |
| 2866 | |
| 2867 | ALIAS (no_neighbor_attr_unchanged, |
| 2868 | no_neighbor_attr_unchanged5_cmd, |
| 2869 | NO_NEIGHBOR_CMD2 "attribute-unchanged as-path next-hop med", |
| 2870 | NO_STR |
| 2871 | NEIGHBOR_STR |
| 2872 | NEIGHBOR_ADDR_STR2 |
| 2873 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2874 | "As-path attribute\n" |
| 2875 | "Nexthop attribute\n" |
| 2876 | "Med attribute\n") |
| 2877 | |
| 2878 | ALIAS (no_neighbor_attr_unchanged, |
| 2879 | no_neighbor_attr_unchanged6_cmd, |
| 2880 | NO_NEIGHBOR_CMD2 "attribute-unchanged as-path med next-hop", |
| 2881 | NO_STR |
| 2882 | NEIGHBOR_STR |
| 2883 | NEIGHBOR_ADDR_STR2 |
| 2884 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2885 | "As-path attribute\n" |
| 2886 | "Med attribute\n" |
| 2887 | "Nexthop attribute\n") |
| 2888 | |
| 2889 | ALIAS (no_neighbor_attr_unchanged, |
| 2890 | no_neighbor_attr_unchanged7_cmd, |
| 2891 | NO_NEIGHBOR_CMD2 "attribute-unchanged next-hop med as-path", |
| 2892 | NO_STR |
| 2893 | NEIGHBOR_STR |
| 2894 | NEIGHBOR_ADDR_STR2 |
| 2895 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2896 | "Nexthop attribute\n" |
| 2897 | "Med attribute\n" |
| 2898 | "As-path attribute\n") |
| 2899 | |
| 2900 | ALIAS (no_neighbor_attr_unchanged, |
| 2901 | no_neighbor_attr_unchanged8_cmd, |
| 2902 | NO_NEIGHBOR_CMD2 "attribute-unchanged next-hop as-path med", |
| 2903 | NO_STR |
| 2904 | NEIGHBOR_STR |
| 2905 | NEIGHBOR_ADDR_STR2 |
| 2906 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2907 | "Nexthop attribute\n" |
| 2908 | "As-path attribute\n" |
| 2909 | "Med attribute\n") |
| 2910 | |
| 2911 | ALIAS (no_neighbor_attr_unchanged, |
| 2912 | no_neighbor_attr_unchanged9_cmd, |
| 2913 | NO_NEIGHBOR_CMD2 "attribute-unchanged med next-hop as-path", |
| 2914 | NO_STR |
| 2915 | NEIGHBOR_STR |
| 2916 | NEIGHBOR_ADDR_STR2 |
| 2917 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2918 | "Med attribute\n" |
| 2919 | "Nexthop attribute\n" |
| 2920 | "As-path attribute\n") |
| 2921 | |
| 2922 | ALIAS (no_neighbor_attr_unchanged, |
| 2923 | no_neighbor_attr_unchanged10_cmd, |
| 2924 | NO_NEIGHBOR_CMD2 "attribute-unchanged med as-path next-hop", |
| 2925 | NO_STR |
| 2926 | NEIGHBOR_STR |
| 2927 | NEIGHBOR_ADDR_STR2 |
| 2928 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2929 | "Med attribute\n" |
| 2930 | "As-path attribute\n" |
| 2931 | "Nexthop attribute\n") |
| 2932 | |
| 2933 | /* For old version Zebra compatibility. */ |
hasso | dd4c593 | 2005-02-02 17:15:34 +0000 | [diff] [blame] | 2934 | DEFUN_DEPRECATED (neighbor_transparent_as, |
| 2935 | neighbor_transparent_as_cmd, |
| 2936 | NEIGHBOR_CMD "transparent-as", |
| 2937 | NEIGHBOR_STR |
| 2938 | NEIGHBOR_ADDR_STR |
| 2939 | "Do not append my AS number even peer is EBGP peer\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2940 | { |
| 2941 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2942 | bgp_node_safi (vty), |
| 2943 | PEER_FLAG_AS_PATH_UNCHANGED); |
| 2944 | } |
| 2945 | |
hasso | dd4c593 | 2005-02-02 17:15:34 +0000 | [diff] [blame] | 2946 | DEFUN_DEPRECATED (neighbor_transparent_nexthop, |
| 2947 | neighbor_transparent_nexthop_cmd, |
| 2948 | NEIGHBOR_CMD "transparent-nexthop", |
| 2949 | NEIGHBOR_STR |
| 2950 | NEIGHBOR_ADDR_STR |
| 2951 | "Do not change nexthop even peer is EBGP peer\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2952 | { |
| 2953 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2954 | bgp_node_safi (vty), |
| 2955 | PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2956 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 2957 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2958 | /* EBGP multihop configuration. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2959 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2960 | peer_ebgp_multihop_set_vty (struct vty *vty, const char *ip_str, |
| 2961 | const char *ttl_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2962 | { |
| 2963 | struct peer *peer; |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2964 | unsigned int ttl; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2965 | |
| 2966 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 2967 | if (! peer) |
| 2968 | return CMD_WARNING; |
| 2969 | |
| 2970 | if (! ttl_str) |
| 2971 | ttl = TTL_MAX; |
| 2972 | else |
| 2973 | VTY_GET_INTEGER_RANGE ("TTL", ttl, ttl_str, 1, 255); |
| 2974 | |
Stephen Hemminger | 89b6d1f | 2011-03-24 10:51:59 +0000 | [diff] [blame] | 2975 | return bgp_vty_return (vty, peer_ebgp_multihop_set (peer, ttl)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2976 | } |
| 2977 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2978 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2979 | peer_ebgp_multihop_unset_vty (struct vty *vty, const char *ip_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2980 | { |
| 2981 | struct peer *peer; |
| 2982 | |
| 2983 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 2984 | if (! peer) |
| 2985 | return CMD_WARNING; |
| 2986 | |
Stephen Hemminger | 89b6d1f | 2011-03-24 10:51:59 +0000 | [diff] [blame] | 2987 | return bgp_vty_return (vty, peer_ebgp_multihop_unset (peer)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2988 | } |
| 2989 | |
| 2990 | /* neighbor ebgp-multihop. */ |
| 2991 | DEFUN (neighbor_ebgp_multihop, |
| 2992 | neighbor_ebgp_multihop_cmd, |
| 2993 | NEIGHBOR_CMD2 "ebgp-multihop", |
| 2994 | NEIGHBOR_STR |
| 2995 | NEIGHBOR_ADDR_STR2 |
| 2996 | "Allow EBGP neighbors not on directly connected networks\n") |
| 2997 | { |
| 2998 | return peer_ebgp_multihop_set_vty (vty, argv[0], NULL); |
| 2999 | } |
| 3000 | |
| 3001 | DEFUN (neighbor_ebgp_multihop_ttl, |
| 3002 | neighbor_ebgp_multihop_ttl_cmd, |
| 3003 | NEIGHBOR_CMD2 "ebgp-multihop <1-255>", |
| 3004 | NEIGHBOR_STR |
| 3005 | NEIGHBOR_ADDR_STR2 |
| 3006 | "Allow EBGP neighbors not on directly connected networks\n" |
| 3007 | "maximum hop count\n") |
| 3008 | { |
| 3009 | return peer_ebgp_multihop_set_vty (vty, argv[0], argv[1]); |
| 3010 | } |
| 3011 | |
| 3012 | DEFUN (no_neighbor_ebgp_multihop, |
| 3013 | no_neighbor_ebgp_multihop_cmd, |
| 3014 | NO_NEIGHBOR_CMD2 "ebgp-multihop", |
| 3015 | NO_STR |
| 3016 | NEIGHBOR_STR |
| 3017 | NEIGHBOR_ADDR_STR2 |
| 3018 | "Allow EBGP neighbors not on directly connected networks\n") |
| 3019 | { |
| 3020 | return peer_ebgp_multihop_unset_vty (vty, argv[0]); |
| 3021 | } |
| 3022 | |
| 3023 | ALIAS (no_neighbor_ebgp_multihop, |
| 3024 | no_neighbor_ebgp_multihop_ttl_cmd, |
| 3025 | NO_NEIGHBOR_CMD2 "ebgp-multihop <1-255>", |
| 3026 | NO_STR |
| 3027 | NEIGHBOR_STR |
| 3028 | NEIGHBOR_ADDR_STR2 |
| 3029 | "Allow EBGP neighbors not on directly connected networks\n" |
| 3030 | "maximum hop count\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3031 | |
hasso | 6ffd207 | 2005-02-02 14:50:11 +0000 | [diff] [blame] | 3032 | /* disable-connected-check */ |
| 3033 | DEFUN (neighbor_disable_connected_check, |
| 3034 | neighbor_disable_connected_check_cmd, |
| 3035 | NEIGHBOR_CMD2 "disable-connected-check", |
| 3036 | NEIGHBOR_STR |
| 3037 | NEIGHBOR_ADDR_STR2 |
| 3038 | "one-hop away EBGP peer using loopback address\n") |
| 3039 | { |
| 3040 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_DISABLE_CONNECTED_CHECK); |
| 3041 | } |
| 3042 | |
| 3043 | DEFUN (no_neighbor_disable_connected_check, |
| 3044 | no_neighbor_disable_connected_check_cmd, |
| 3045 | NO_NEIGHBOR_CMD2 "disable-connected-check", |
| 3046 | NO_STR |
| 3047 | NEIGHBOR_STR |
| 3048 | NEIGHBOR_ADDR_STR2 |
| 3049 | "one-hop away EBGP peer using loopback address\n") |
| 3050 | { |
| 3051 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_DISABLE_CONNECTED_CHECK); |
| 3052 | } |
| 3053 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3054 | /* Enforce multihop. */ |
hasso | 6ffd207 | 2005-02-02 14:50:11 +0000 | [diff] [blame] | 3055 | ALIAS (neighbor_disable_connected_check, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3056 | neighbor_enforce_multihop_cmd, |
| 3057 | NEIGHBOR_CMD2 "enforce-multihop", |
| 3058 | NEIGHBOR_STR |
| 3059 | NEIGHBOR_ADDR_STR2 |
paul | e8e1946 | 2006-01-19 20:16:55 +0000 | [diff] [blame] | 3060 | "Enforce EBGP neighbors perform multihop\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3061 | |
hasso | 6ffd207 | 2005-02-02 14:50:11 +0000 | [diff] [blame] | 3062 | /* Enforce multihop. */ |
| 3063 | ALIAS (no_neighbor_disable_connected_check, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3064 | no_neighbor_enforce_multihop_cmd, |
| 3065 | NO_NEIGHBOR_CMD2 "enforce-multihop", |
| 3066 | NO_STR |
| 3067 | NEIGHBOR_STR |
| 3068 | NEIGHBOR_ADDR_STR2 |
paul | e8e1946 | 2006-01-19 20:16:55 +0000 | [diff] [blame] | 3069 | "Enforce EBGP neighbors perform multihop\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3070 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3071 | DEFUN (neighbor_description, |
| 3072 | neighbor_description_cmd, |
| 3073 | NEIGHBOR_CMD2 "description .LINE", |
| 3074 | NEIGHBOR_STR |
| 3075 | NEIGHBOR_ADDR_STR2 |
| 3076 | "Neighbor specific description\n" |
| 3077 | "Up to 80 characters describing this neighbor\n") |
| 3078 | { |
| 3079 | struct peer *peer; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3080 | char *str; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3081 | |
| 3082 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 3083 | if (! peer) |
| 3084 | return CMD_WARNING; |
| 3085 | |
| 3086 | if (argc == 1) |
| 3087 | return CMD_SUCCESS; |
| 3088 | |
ajs | 3b8b185 | 2005-01-29 18:19:13 +0000 | [diff] [blame] | 3089 | str = argv_concat(argv, argc, 1); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3090 | |
| 3091 | peer_description_set (peer, str); |
| 3092 | |
ajs | 3b8b185 | 2005-01-29 18:19:13 +0000 | [diff] [blame] | 3093 | XFREE (MTYPE_TMP, str); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3094 | |
| 3095 | return CMD_SUCCESS; |
| 3096 | } |
| 3097 | |
| 3098 | DEFUN (no_neighbor_description, |
| 3099 | no_neighbor_description_cmd, |
| 3100 | NO_NEIGHBOR_CMD2 "description", |
| 3101 | NO_STR |
| 3102 | NEIGHBOR_STR |
| 3103 | NEIGHBOR_ADDR_STR2 |
| 3104 | "Neighbor specific description\n") |
| 3105 | { |
| 3106 | struct peer *peer; |
| 3107 | |
| 3108 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 3109 | if (! peer) |
| 3110 | return CMD_WARNING; |
| 3111 | |
| 3112 | peer_description_unset (peer); |
| 3113 | |
| 3114 | return CMD_SUCCESS; |
| 3115 | } |
| 3116 | |
| 3117 | ALIAS (no_neighbor_description, |
| 3118 | no_neighbor_description_val_cmd, |
| 3119 | NO_NEIGHBOR_CMD2 "description .LINE", |
| 3120 | NO_STR |
| 3121 | NEIGHBOR_STR |
| 3122 | NEIGHBOR_ADDR_STR2 |
| 3123 | "Neighbor specific description\n" |
| 3124 | "Up to 80 characters describing this neighbor\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3125 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3126 | /* Neighbor update-source. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3127 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3128 | peer_update_source_vty (struct vty *vty, const char *peer_str, |
| 3129 | const char *source_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3130 | { |
| 3131 | struct peer *peer; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3132 | |
| 3133 | peer = peer_and_group_lookup_vty (vty, peer_str); |
| 3134 | if (! peer) |
| 3135 | return CMD_WARNING; |
| 3136 | |
| 3137 | if (source_str) |
| 3138 | { |
Jorge Boncompte [DTI2] | c63b83f | 2012-04-10 16:57:24 +0200 | [diff] [blame] | 3139 | union sockunion su; |
| 3140 | int ret = str2sockunion (source_str, &su); |
| 3141 | |
| 3142 | if (ret == 0) |
| 3143 | peer_update_source_addr_set (peer, &su); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3144 | else |
| 3145 | peer_update_source_if_set (peer, source_str); |
| 3146 | } |
| 3147 | else |
| 3148 | peer_update_source_unset (peer); |
| 3149 | |
| 3150 | return CMD_SUCCESS; |
| 3151 | } |
| 3152 | |
Paul Jakma | 9a1a331 | 2009-07-27 12:27:55 +0100 | [diff] [blame] | 3153 | #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] | 3154 | #define BGP_UPDATE_SOURCE_HELP_STR \ |
| 3155 | "IPv4 address\n" \ |
Paul Jakma | 9a1a331 | 2009-07-27 12:27:55 +0100 | [diff] [blame] | 3156 | "IPv6 address\n" \ |
| 3157 | "Interface name (requires zebra to be running)\n" |
Paul Jakma | 369688c | 2006-05-23 22:27:55 +0000 | [diff] [blame] | 3158 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3159 | DEFUN (neighbor_update_source, |
| 3160 | neighbor_update_source_cmd, |
Paul Jakma | 369688c | 2006-05-23 22:27:55 +0000 | [diff] [blame] | 3161 | NEIGHBOR_CMD2 "update-source " BGP_UPDATE_SOURCE_STR, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3162 | NEIGHBOR_STR |
| 3163 | NEIGHBOR_ADDR_STR2 |
| 3164 | "Source of routing updates\n" |
Paul Jakma | 369688c | 2006-05-23 22:27:55 +0000 | [diff] [blame] | 3165 | BGP_UPDATE_SOURCE_HELP_STR) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3166 | { |
| 3167 | return peer_update_source_vty (vty, argv[0], argv[1]); |
| 3168 | } |
| 3169 | |
| 3170 | DEFUN (no_neighbor_update_source, |
| 3171 | no_neighbor_update_source_cmd, |
| 3172 | NO_NEIGHBOR_CMD2 "update-source", |
| 3173 | NO_STR |
| 3174 | NEIGHBOR_STR |
| 3175 | NEIGHBOR_ADDR_STR2 |
Paul Jakma | 369688c | 2006-05-23 22:27:55 +0000 | [diff] [blame] | 3176 | "Source of routing updates\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3177 | { |
| 3178 | return peer_update_source_vty (vty, argv[0], NULL); |
| 3179 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3180 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3181 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3182 | peer_default_originate_set_vty (struct vty *vty, const char *peer_str, |
| 3183 | afi_t afi, safi_t safi, |
| 3184 | const char *rmap, int set) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3185 | { |
| 3186 | int ret; |
| 3187 | struct peer *peer; |
| 3188 | |
| 3189 | peer = peer_and_group_lookup_vty (vty, peer_str); |
| 3190 | if (! peer) |
| 3191 | return CMD_WARNING; |
| 3192 | |
| 3193 | if (set) |
| 3194 | ret = peer_default_originate_set (peer, afi, safi, rmap); |
| 3195 | else |
| 3196 | ret = peer_default_originate_unset (peer, afi, safi); |
| 3197 | |
| 3198 | return bgp_vty_return (vty, ret); |
| 3199 | } |
| 3200 | |
| 3201 | /* neighbor default-originate. */ |
| 3202 | DEFUN (neighbor_default_originate, |
| 3203 | neighbor_default_originate_cmd, |
| 3204 | NEIGHBOR_CMD2 "default-originate", |
| 3205 | NEIGHBOR_STR |
| 3206 | NEIGHBOR_ADDR_STR2 |
| 3207 | "Originate default route to this neighbor\n") |
| 3208 | { |
| 3209 | return peer_default_originate_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3210 | bgp_node_safi (vty), NULL, 1); |
| 3211 | } |
| 3212 | |
| 3213 | DEFUN (neighbor_default_originate_rmap, |
| 3214 | neighbor_default_originate_rmap_cmd, |
| 3215 | NEIGHBOR_CMD2 "default-originate route-map WORD", |
| 3216 | NEIGHBOR_STR |
| 3217 | NEIGHBOR_ADDR_STR2 |
| 3218 | "Originate default route to this neighbor\n" |
| 3219 | "Route-map to specify criteria to originate default\n" |
| 3220 | "route-map name\n") |
| 3221 | { |
| 3222 | return peer_default_originate_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3223 | bgp_node_safi (vty), argv[1], 1); |
| 3224 | } |
| 3225 | |
| 3226 | DEFUN (no_neighbor_default_originate, |
| 3227 | no_neighbor_default_originate_cmd, |
| 3228 | NO_NEIGHBOR_CMD2 "default-originate", |
| 3229 | NO_STR |
| 3230 | NEIGHBOR_STR |
| 3231 | NEIGHBOR_ADDR_STR2 |
| 3232 | "Originate default route to this neighbor\n") |
| 3233 | { |
| 3234 | return peer_default_originate_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3235 | bgp_node_safi (vty), NULL, 0); |
| 3236 | } |
| 3237 | |
| 3238 | ALIAS (no_neighbor_default_originate, |
| 3239 | no_neighbor_default_originate_rmap_cmd, |
| 3240 | NO_NEIGHBOR_CMD2 "default-originate route-map WORD", |
| 3241 | NO_STR |
| 3242 | NEIGHBOR_STR |
| 3243 | NEIGHBOR_ADDR_STR2 |
| 3244 | "Originate default route to this neighbor\n" |
| 3245 | "Route-map to specify criteria to originate default\n" |
| 3246 | "route-map name\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3247 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3248 | /* Set neighbor's BGP port. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3249 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3250 | peer_port_vty (struct vty *vty, const char *ip_str, int afi, |
| 3251 | const char *port_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3252 | { |
| 3253 | struct peer *peer; |
| 3254 | u_int16_t port; |
| 3255 | struct servent *sp; |
| 3256 | |
| 3257 | peer = peer_lookup_vty (vty, ip_str); |
| 3258 | if (! peer) |
| 3259 | return CMD_WARNING; |
| 3260 | |
| 3261 | if (! port_str) |
| 3262 | { |
| 3263 | sp = getservbyname ("bgp", "tcp"); |
| 3264 | port = (sp == NULL) ? BGP_PORT_DEFAULT : ntohs (sp->s_port); |
| 3265 | } |
| 3266 | else |
| 3267 | { |
| 3268 | VTY_GET_INTEGER("port", port, port_str); |
| 3269 | } |
| 3270 | |
| 3271 | peer_port_set (peer, port); |
| 3272 | |
| 3273 | return CMD_SUCCESS; |
| 3274 | } |
| 3275 | |
hasso | f418446 | 2005-02-01 20:13:16 +0000 | [diff] [blame] | 3276 | /* Set specified peer's BGP port. */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3277 | DEFUN (neighbor_port, |
| 3278 | neighbor_port_cmd, |
| 3279 | NEIGHBOR_CMD "port <0-65535>", |
| 3280 | NEIGHBOR_STR |
| 3281 | NEIGHBOR_ADDR_STR |
| 3282 | "Neighbor's BGP port\n" |
| 3283 | "TCP port number\n") |
| 3284 | { |
| 3285 | return peer_port_vty (vty, argv[0], AFI_IP, argv[1]); |
| 3286 | } |
| 3287 | |
| 3288 | DEFUN (no_neighbor_port, |
| 3289 | no_neighbor_port_cmd, |
| 3290 | NO_NEIGHBOR_CMD "port", |
| 3291 | NO_STR |
| 3292 | NEIGHBOR_STR |
| 3293 | NEIGHBOR_ADDR_STR |
| 3294 | "Neighbor's BGP port\n") |
| 3295 | { |
| 3296 | return peer_port_vty (vty, argv[0], AFI_IP, NULL); |
| 3297 | } |
| 3298 | |
| 3299 | ALIAS (no_neighbor_port, |
| 3300 | no_neighbor_port_val_cmd, |
| 3301 | NO_NEIGHBOR_CMD "port <0-65535>", |
| 3302 | NO_STR |
| 3303 | NEIGHBOR_STR |
| 3304 | NEIGHBOR_ADDR_STR |
| 3305 | "Neighbor's BGP port\n" |
| 3306 | "TCP port number\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3307 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3308 | /* neighbor weight. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3309 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3310 | peer_weight_set_vty (struct vty *vty, const char *ip_str, |
| 3311 | const char *weight_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3312 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3313 | struct peer *peer; |
| 3314 | unsigned long weight; |
| 3315 | |
| 3316 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3317 | if (! peer) |
| 3318 | return CMD_WARNING; |
| 3319 | |
| 3320 | VTY_GET_INTEGER_RANGE("weight", weight, weight_str, 0, 65535); |
| 3321 | |
Paul Jakma | 7aa9dce | 2014-09-19 14:42:23 +0100 | [diff] [blame] | 3322 | return bgp_vty_return (vty, peer_weight_set (peer, weight)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3323 | } |
| 3324 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3325 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3326 | peer_weight_unset_vty (struct vty *vty, const char *ip_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3327 | { |
| 3328 | struct peer *peer; |
| 3329 | |
| 3330 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3331 | if (! peer) |
| 3332 | return CMD_WARNING; |
| 3333 | |
Paul Jakma | 7aa9dce | 2014-09-19 14:42:23 +0100 | [diff] [blame] | 3334 | return bgp_vty_return (vty, peer_weight_unset (peer)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3335 | } |
| 3336 | |
| 3337 | DEFUN (neighbor_weight, |
| 3338 | neighbor_weight_cmd, |
| 3339 | NEIGHBOR_CMD2 "weight <0-65535>", |
| 3340 | NEIGHBOR_STR |
| 3341 | NEIGHBOR_ADDR_STR2 |
| 3342 | "Set default weight for routes from this neighbor\n" |
| 3343 | "default weight\n") |
| 3344 | { |
| 3345 | return peer_weight_set_vty (vty, argv[0], argv[1]); |
| 3346 | } |
| 3347 | |
| 3348 | DEFUN (no_neighbor_weight, |
| 3349 | no_neighbor_weight_cmd, |
| 3350 | NO_NEIGHBOR_CMD2 "weight", |
| 3351 | NO_STR |
| 3352 | NEIGHBOR_STR |
| 3353 | NEIGHBOR_ADDR_STR2 |
| 3354 | "Set default weight for routes from this neighbor\n") |
| 3355 | { |
| 3356 | return peer_weight_unset_vty (vty, argv[0]); |
| 3357 | } |
| 3358 | |
| 3359 | ALIAS (no_neighbor_weight, |
| 3360 | no_neighbor_weight_val_cmd, |
| 3361 | NO_NEIGHBOR_CMD2 "weight <0-65535>", |
| 3362 | NO_STR |
| 3363 | NEIGHBOR_STR |
| 3364 | NEIGHBOR_ADDR_STR2 |
| 3365 | "Set default weight for routes from this neighbor\n" |
| 3366 | "default weight\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3367 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3368 | /* Override capability negotiation. */ |
| 3369 | DEFUN (neighbor_override_capability, |
| 3370 | neighbor_override_capability_cmd, |
| 3371 | NEIGHBOR_CMD2 "override-capability", |
| 3372 | NEIGHBOR_STR |
| 3373 | NEIGHBOR_ADDR_STR2 |
| 3374 | "Override capability negotiation result\n") |
| 3375 | { |
| 3376 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_OVERRIDE_CAPABILITY); |
| 3377 | } |
| 3378 | |
| 3379 | DEFUN (no_neighbor_override_capability, |
| 3380 | no_neighbor_override_capability_cmd, |
| 3381 | NO_NEIGHBOR_CMD2 "override-capability", |
| 3382 | NO_STR |
| 3383 | NEIGHBOR_STR |
| 3384 | NEIGHBOR_ADDR_STR2 |
| 3385 | "Override capability negotiation result\n") |
| 3386 | { |
| 3387 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_OVERRIDE_CAPABILITY); |
| 3388 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3389 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3390 | DEFUN (neighbor_strict_capability, |
| 3391 | neighbor_strict_capability_cmd, |
| 3392 | NEIGHBOR_CMD "strict-capability-match", |
| 3393 | NEIGHBOR_STR |
| 3394 | NEIGHBOR_ADDR_STR |
| 3395 | "Strict capability negotiation match\n") |
| 3396 | { |
| 3397 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_STRICT_CAP_MATCH); |
| 3398 | } |
| 3399 | |
| 3400 | DEFUN (no_neighbor_strict_capability, |
| 3401 | no_neighbor_strict_capability_cmd, |
| 3402 | NO_NEIGHBOR_CMD "strict-capability-match", |
| 3403 | NO_STR |
| 3404 | NEIGHBOR_STR |
| 3405 | NEIGHBOR_ADDR_STR |
| 3406 | "Strict capability negotiation match\n") |
| 3407 | { |
| 3408 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_STRICT_CAP_MATCH); |
| 3409 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3410 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3411 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3412 | peer_timers_set_vty (struct vty *vty, const char *ip_str, |
| 3413 | const char *keep_str, const char *hold_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3414 | { |
| 3415 | int ret; |
| 3416 | struct peer *peer; |
| 3417 | u_int32_t keepalive; |
| 3418 | u_int32_t holdtime; |
| 3419 | |
| 3420 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3421 | if (! peer) |
| 3422 | return CMD_WARNING; |
| 3423 | |
| 3424 | VTY_GET_INTEGER_RANGE ("Keepalive", keepalive, keep_str, 0, 65535); |
| 3425 | VTY_GET_INTEGER_RANGE ("Holdtime", holdtime, hold_str, 0, 65535); |
| 3426 | |
| 3427 | ret = peer_timers_set (peer, keepalive, holdtime); |
| 3428 | |
| 3429 | return bgp_vty_return (vty, ret); |
| 3430 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3431 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3432 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3433 | peer_timers_unset_vty (struct vty *vty, const char *ip_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3434 | { |
| 3435 | int ret; |
| 3436 | struct peer *peer; |
| 3437 | |
| 3438 | peer = peer_lookup_vty (vty, ip_str); |
| 3439 | if (! peer) |
| 3440 | return CMD_WARNING; |
| 3441 | |
| 3442 | ret = peer_timers_unset (peer); |
| 3443 | |
| 3444 | return bgp_vty_return (vty, ret); |
| 3445 | } |
| 3446 | |
| 3447 | DEFUN (neighbor_timers, |
| 3448 | neighbor_timers_cmd, |
| 3449 | NEIGHBOR_CMD2 "timers <0-65535> <0-65535>", |
| 3450 | NEIGHBOR_STR |
| 3451 | NEIGHBOR_ADDR_STR2 |
| 3452 | "BGP per neighbor timers\n" |
| 3453 | "Keepalive interval\n" |
| 3454 | "Holdtime\n") |
| 3455 | { |
| 3456 | return peer_timers_set_vty (vty, argv[0], argv[1], argv[2]); |
| 3457 | } |
| 3458 | |
| 3459 | DEFUN (no_neighbor_timers, |
| 3460 | no_neighbor_timers_cmd, |
| 3461 | NO_NEIGHBOR_CMD2 "timers", |
| 3462 | NO_STR |
| 3463 | NEIGHBOR_STR |
| 3464 | NEIGHBOR_ADDR_STR2 |
| 3465 | "BGP per neighbor timers\n") |
| 3466 | { |
| 3467 | return peer_timers_unset_vty (vty, argv[0]); |
| 3468 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3469 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3470 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3471 | peer_timers_connect_set_vty (struct vty *vty, const char *ip_str, |
| 3472 | const char *time_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3473 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3474 | struct peer *peer; |
| 3475 | u_int32_t connect; |
| 3476 | |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3477 | peer = peer_and_group_lookup_vty (vty, ip_str); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3478 | if (! peer) |
| 3479 | return CMD_WARNING; |
| 3480 | |
| 3481 | VTY_GET_INTEGER_RANGE ("Connect time", connect, time_str, 0, 65535); |
| 3482 | |
Paul Jakma | 7aa9dce | 2014-09-19 14:42:23 +0100 | [diff] [blame] | 3483 | return bgp_vty_return (vty, peer_timers_connect_set (peer, connect)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3484 | } |
| 3485 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3486 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3487 | peer_timers_connect_unset_vty (struct vty *vty, const char *ip_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3488 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3489 | struct peer *peer; |
| 3490 | |
| 3491 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3492 | if (! peer) |
| 3493 | return CMD_WARNING; |
| 3494 | |
Paul Jakma | 7aa9dce | 2014-09-19 14:42:23 +0100 | [diff] [blame] | 3495 | return bgp_vty_return (vty, peer_timers_connect_unset (peer)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3496 | } |
| 3497 | |
| 3498 | DEFUN (neighbor_timers_connect, |
| 3499 | neighbor_timers_connect_cmd, |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3500 | NEIGHBOR_CMD2 "timers connect <1-65535>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3501 | NEIGHBOR_STR |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3502 | NEIGHBOR_ADDR_STR2 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3503 | "BGP per neighbor timers\n" |
| 3504 | "BGP connect timer\n" |
| 3505 | "Connect timer\n") |
| 3506 | { |
| 3507 | return peer_timers_connect_set_vty (vty, argv[0], argv[1]); |
| 3508 | } |
| 3509 | |
| 3510 | DEFUN (no_neighbor_timers_connect, |
| 3511 | no_neighbor_timers_connect_cmd, |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3512 | NO_NEIGHBOR_CMD2 "timers connect", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3513 | NO_STR |
| 3514 | NEIGHBOR_STR |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3515 | NEIGHBOR_ADDR_STR2 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3516 | "BGP per neighbor timers\n" |
| 3517 | "BGP connect timer\n") |
| 3518 | { |
| 3519 | return peer_timers_connect_unset_vty (vty, argv[0]); |
| 3520 | } |
| 3521 | |
| 3522 | ALIAS (no_neighbor_timers_connect, |
| 3523 | no_neighbor_timers_connect_val_cmd, |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3524 | NO_NEIGHBOR_CMD2 "timers connect <1-65535>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3525 | NO_STR |
| 3526 | NEIGHBOR_STR |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3527 | NEIGHBOR_ADDR_STR2 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3528 | "BGP per neighbor timers\n" |
| 3529 | "BGP connect timer\n" |
| 3530 | "Connect timer\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3531 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3532 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3533 | peer_advertise_interval_vty (struct vty *vty, const char *ip_str, |
| 3534 | const char *time_str, int set) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3535 | { |
| 3536 | int ret; |
| 3537 | struct peer *peer; |
| 3538 | u_int32_t routeadv = 0; |
| 3539 | |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3540 | peer = peer_and_group_lookup_vty (vty, ip_str); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3541 | if (! peer) |
| 3542 | return CMD_WARNING; |
| 3543 | |
| 3544 | if (time_str) |
| 3545 | VTY_GET_INTEGER_RANGE ("advertise interval", routeadv, time_str, 0, 600); |
| 3546 | |
| 3547 | if (set) |
| 3548 | ret = peer_advertise_interval_set (peer, routeadv); |
| 3549 | else |
| 3550 | ret = peer_advertise_interval_unset (peer); |
| 3551 | |
Paul Jakma | 7aa9dce | 2014-09-19 14:42:23 +0100 | [diff] [blame] | 3552 | return bgp_vty_return (vty, ret); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3553 | } |
| 3554 | |
| 3555 | DEFUN (neighbor_advertise_interval, |
| 3556 | neighbor_advertise_interval_cmd, |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3557 | NEIGHBOR_CMD2 "advertisement-interval <0-600>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3558 | NEIGHBOR_STR |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3559 | NEIGHBOR_ADDR_STR2 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3560 | "Minimum interval between sending BGP routing updates\n" |
| 3561 | "time in seconds\n") |
| 3562 | { |
| 3563 | return peer_advertise_interval_vty (vty, argv[0], argv[1], 1); |
| 3564 | } |
| 3565 | |
| 3566 | DEFUN (no_neighbor_advertise_interval, |
| 3567 | no_neighbor_advertise_interval_cmd, |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3568 | NO_NEIGHBOR_CMD2 "advertisement-interval", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3569 | NO_STR |
| 3570 | NEIGHBOR_STR |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3571 | NEIGHBOR_ADDR_STR2 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3572 | "Minimum interval between sending BGP routing updates\n") |
| 3573 | { |
| 3574 | return peer_advertise_interval_vty (vty, argv[0], NULL, 0); |
| 3575 | } |
| 3576 | |
| 3577 | ALIAS (no_neighbor_advertise_interval, |
| 3578 | no_neighbor_advertise_interval_val_cmd, |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3579 | NO_NEIGHBOR_CMD2 "advertisement-interval <0-600>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3580 | NO_STR |
| 3581 | NEIGHBOR_STR |
Daniel Walton | 0d7435f | 2015-10-22 11:35:20 +0300 | [diff] [blame] | 3582 | NEIGHBOR_ADDR_STR2 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3583 | "Minimum interval between sending BGP routing updates\n" |
| 3584 | "time in seconds\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3585 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3586 | /* neighbor interface */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3587 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3588 | peer_interface_vty (struct vty *vty, const char *ip_str, const char *str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3589 | { |
| 3590 | int ret; |
| 3591 | struct peer *peer; |
| 3592 | |
| 3593 | peer = peer_lookup_vty (vty, ip_str); |
| 3594 | if (! peer) |
| 3595 | return CMD_WARNING; |
| 3596 | |
| 3597 | if (str) |
| 3598 | ret = peer_interface_set (peer, str); |
| 3599 | else |
| 3600 | ret = peer_interface_unset (peer); |
| 3601 | |
Paul Jakma | 7aa9dce | 2014-09-19 14:42:23 +0100 | [diff] [blame] | 3602 | return bgp_vty_return (vty, ret); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3603 | } |
| 3604 | |
| 3605 | DEFUN (neighbor_interface, |
| 3606 | neighbor_interface_cmd, |
| 3607 | NEIGHBOR_CMD "interface WORD", |
| 3608 | NEIGHBOR_STR |
| 3609 | NEIGHBOR_ADDR_STR |
| 3610 | "Interface\n" |
| 3611 | "Interface name\n") |
| 3612 | { |
| 3613 | return peer_interface_vty (vty, argv[0], argv[1]); |
| 3614 | } |
| 3615 | |
| 3616 | DEFUN (no_neighbor_interface, |
| 3617 | no_neighbor_interface_cmd, |
| 3618 | NO_NEIGHBOR_CMD "interface WORD", |
| 3619 | NO_STR |
| 3620 | NEIGHBOR_STR |
| 3621 | NEIGHBOR_ADDR_STR |
| 3622 | "Interface\n" |
| 3623 | "Interface name\n") |
| 3624 | { |
| 3625 | return peer_interface_vty (vty, argv[0], NULL); |
| 3626 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3627 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3628 | /* Set distribute list to the peer. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3629 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3630 | peer_distribute_set_vty (struct vty *vty, const char *ip_str, |
| 3631 | afi_t afi, safi_t safi, |
| 3632 | const char *name_str, const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3633 | { |
| 3634 | int ret; |
| 3635 | struct peer *peer; |
| 3636 | int direct = FILTER_IN; |
| 3637 | |
| 3638 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3639 | if (! peer) |
| 3640 | return CMD_WARNING; |
| 3641 | |
| 3642 | /* Check filter direction. */ |
| 3643 | if (strncmp (direct_str, "i", 1) == 0) |
| 3644 | direct = FILTER_IN; |
| 3645 | else if (strncmp (direct_str, "o", 1) == 0) |
| 3646 | direct = FILTER_OUT; |
| 3647 | |
| 3648 | ret = peer_distribute_set (peer, afi, safi, direct, name_str); |
| 3649 | |
| 3650 | return bgp_vty_return (vty, ret); |
| 3651 | } |
| 3652 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3653 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3654 | peer_distribute_unset_vty (struct vty *vty, const char *ip_str, afi_t afi, |
| 3655 | safi_t safi, const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3656 | { |
| 3657 | int ret; |
| 3658 | struct peer *peer; |
| 3659 | int direct = FILTER_IN; |
| 3660 | |
| 3661 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3662 | if (! peer) |
| 3663 | return CMD_WARNING; |
| 3664 | |
| 3665 | /* Check filter direction. */ |
| 3666 | if (strncmp (direct_str, "i", 1) == 0) |
| 3667 | direct = FILTER_IN; |
| 3668 | else if (strncmp (direct_str, "o", 1) == 0) |
| 3669 | direct = FILTER_OUT; |
| 3670 | |
| 3671 | ret = peer_distribute_unset (peer, afi, safi, direct); |
| 3672 | |
| 3673 | return bgp_vty_return (vty, ret); |
| 3674 | } |
| 3675 | |
| 3676 | DEFUN (neighbor_distribute_list, |
| 3677 | neighbor_distribute_list_cmd, |
| 3678 | NEIGHBOR_CMD2 "distribute-list (<1-199>|<1300-2699>|WORD) (in|out)", |
| 3679 | NEIGHBOR_STR |
| 3680 | NEIGHBOR_ADDR_STR2 |
| 3681 | "Filter updates to/from this neighbor\n" |
| 3682 | "IP access-list number\n" |
| 3683 | "IP access-list number (expanded range)\n" |
| 3684 | "IP Access-list name\n" |
| 3685 | "Filter incoming updates\n" |
| 3686 | "Filter outgoing updates\n") |
| 3687 | { |
| 3688 | return peer_distribute_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3689 | bgp_node_safi (vty), argv[1], argv[2]); |
| 3690 | } |
| 3691 | |
| 3692 | DEFUN (no_neighbor_distribute_list, |
| 3693 | no_neighbor_distribute_list_cmd, |
| 3694 | NO_NEIGHBOR_CMD2 "distribute-list (<1-199>|<1300-2699>|WORD) (in|out)", |
| 3695 | NO_STR |
| 3696 | NEIGHBOR_STR |
| 3697 | NEIGHBOR_ADDR_STR2 |
| 3698 | "Filter updates to/from this neighbor\n" |
| 3699 | "IP access-list number\n" |
| 3700 | "IP access-list number (expanded range)\n" |
| 3701 | "IP Access-list name\n" |
| 3702 | "Filter incoming updates\n" |
| 3703 | "Filter outgoing updates\n") |
| 3704 | { |
| 3705 | return peer_distribute_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 3706 | bgp_node_safi (vty), argv[2]); |
| 3707 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3708 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3709 | /* Set prefix list to the peer. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3710 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3711 | peer_prefix_list_set_vty (struct vty *vty, const char *ip_str, afi_t afi, |
| 3712 | safi_t safi, const char *name_str, |
| 3713 | const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3714 | { |
| 3715 | int ret; |
| 3716 | struct peer *peer; |
| 3717 | int direct = FILTER_IN; |
| 3718 | |
| 3719 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3720 | if (! peer) |
| 3721 | return CMD_WARNING; |
| 3722 | |
| 3723 | /* Check filter direction. */ |
| 3724 | if (strncmp (direct_str, "i", 1) == 0) |
| 3725 | direct = FILTER_IN; |
| 3726 | else if (strncmp (direct_str, "o", 1) == 0) |
| 3727 | direct = FILTER_OUT; |
| 3728 | |
| 3729 | ret = peer_prefix_list_set (peer, afi, safi, direct, name_str); |
| 3730 | |
| 3731 | return bgp_vty_return (vty, ret); |
| 3732 | } |
| 3733 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3734 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3735 | peer_prefix_list_unset_vty (struct vty *vty, const char *ip_str, afi_t afi, |
| 3736 | safi_t safi, const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3737 | { |
| 3738 | int ret; |
| 3739 | struct peer *peer; |
| 3740 | int direct = FILTER_IN; |
| 3741 | |
| 3742 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3743 | if (! peer) |
| 3744 | return CMD_WARNING; |
| 3745 | |
| 3746 | /* Check filter direction. */ |
| 3747 | if (strncmp (direct_str, "i", 1) == 0) |
| 3748 | direct = FILTER_IN; |
| 3749 | else if (strncmp (direct_str, "o", 1) == 0) |
| 3750 | direct = FILTER_OUT; |
| 3751 | |
| 3752 | ret = peer_prefix_list_unset (peer, afi, safi, direct); |
| 3753 | |
| 3754 | return bgp_vty_return (vty, ret); |
| 3755 | } |
| 3756 | |
| 3757 | DEFUN (neighbor_prefix_list, |
| 3758 | neighbor_prefix_list_cmd, |
| 3759 | NEIGHBOR_CMD2 "prefix-list WORD (in|out)", |
| 3760 | NEIGHBOR_STR |
| 3761 | NEIGHBOR_ADDR_STR2 |
| 3762 | "Filter updates to/from this neighbor\n" |
| 3763 | "Name of a prefix list\n" |
| 3764 | "Filter incoming updates\n" |
| 3765 | "Filter outgoing updates\n") |
| 3766 | { |
| 3767 | return peer_prefix_list_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3768 | bgp_node_safi (vty), argv[1], argv[2]); |
| 3769 | } |
| 3770 | |
| 3771 | DEFUN (no_neighbor_prefix_list, |
| 3772 | no_neighbor_prefix_list_cmd, |
| 3773 | NO_NEIGHBOR_CMD2 "prefix-list WORD (in|out)", |
| 3774 | NO_STR |
| 3775 | NEIGHBOR_STR |
| 3776 | NEIGHBOR_ADDR_STR2 |
| 3777 | "Filter updates to/from this neighbor\n" |
| 3778 | "Name of a prefix list\n" |
| 3779 | "Filter incoming updates\n" |
| 3780 | "Filter outgoing updates\n") |
| 3781 | { |
| 3782 | return peer_prefix_list_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 3783 | bgp_node_safi (vty), argv[2]); |
| 3784 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3785 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3786 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3787 | peer_aslist_set_vty (struct vty *vty, const char *ip_str, |
| 3788 | afi_t afi, safi_t safi, |
| 3789 | const char *name_str, const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3790 | { |
| 3791 | int ret; |
| 3792 | struct peer *peer; |
| 3793 | int direct = FILTER_IN; |
| 3794 | |
| 3795 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3796 | if (! peer) |
| 3797 | return CMD_WARNING; |
| 3798 | |
| 3799 | /* Check filter direction. */ |
| 3800 | if (strncmp (direct_str, "i", 1) == 0) |
| 3801 | direct = FILTER_IN; |
| 3802 | else if (strncmp (direct_str, "o", 1) == 0) |
| 3803 | direct = FILTER_OUT; |
| 3804 | |
| 3805 | ret = peer_aslist_set (peer, afi, safi, direct, name_str); |
| 3806 | |
| 3807 | return bgp_vty_return (vty, ret); |
| 3808 | } |
| 3809 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3810 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3811 | peer_aslist_unset_vty (struct vty *vty, const char *ip_str, |
| 3812 | afi_t afi, safi_t safi, |
| 3813 | const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3814 | { |
| 3815 | int ret; |
| 3816 | struct peer *peer; |
| 3817 | int direct = FILTER_IN; |
| 3818 | |
| 3819 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3820 | if (! peer) |
| 3821 | return CMD_WARNING; |
| 3822 | |
| 3823 | /* Check filter direction. */ |
| 3824 | if (strncmp (direct_str, "i", 1) == 0) |
| 3825 | direct = FILTER_IN; |
| 3826 | else if (strncmp (direct_str, "o", 1) == 0) |
| 3827 | direct = FILTER_OUT; |
| 3828 | |
| 3829 | ret = peer_aslist_unset (peer, afi, safi, direct); |
| 3830 | |
| 3831 | return bgp_vty_return (vty, ret); |
| 3832 | } |
| 3833 | |
| 3834 | DEFUN (neighbor_filter_list, |
| 3835 | neighbor_filter_list_cmd, |
| 3836 | NEIGHBOR_CMD2 "filter-list WORD (in|out)", |
| 3837 | NEIGHBOR_STR |
| 3838 | NEIGHBOR_ADDR_STR2 |
| 3839 | "Establish BGP filters\n" |
| 3840 | "AS path access-list name\n" |
| 3841 | "Filter incoming routes\n" |
| 3842 | "Filter outgoing routes\n") |
| 3843 | { |
| 3844 | return peer_aslist_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3845 | bgp_node_safi (vty), argv[1], argv[2]); |
| 3846 | } |
| 3847 | |
| 3848 | DEFUN (no_neighbor_filter_list, |
| 3849 | no_neighbor_filter_list_cmd, |
| 3850 | NO_NEIGHBOR_CMD2 "filter-list WORD (in|out)", |
| 3851 | NO_STR |
| 3852 | NEIGHBOR_STR |
| 3853 | NEIGHBOR_ADDR_STR2 |
| 3854 | "Establish BGP filters\n" |
| 3855 | "AS path access-list name\n" |
| 3856 | "Filter incoming routes\n" |
| 3857 | "Filter outgoing routes\n") |
| 3858 | { |
| 3859 | return peer_aslist_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 3860 | bgp_node_safi (vty), argv[2]); |
| 3861 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3862 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3863 | /* Set route-map to the peer. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3864 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3865 | peer_route_map_set_vty (struct vty *vty, const char *ip_str, |
| 3866 | afi_t afi, safi_t safi, |
| 3867 | const char *name_str, const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3868 | { |
| 3869 | int ret; |
| 3870 | struct peer *peer; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3871 | int direct = RMAP_IN; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3872 | |
| 3873 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3874 | if (! peer) |
| 3875 | return CMD_WARNING; |
| 3876 | |
| 3877 | /* Check filter direction. */ |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3878 | if (strncmp (direct_str, "in", 2) == 0) |
| 3879 | direct = RMAP_IN; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3880 | else if (strncmp (direct_str, "o", 1) == 0) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3881 | direct = RMAP_OUT; |
| 3882 | else if (strncmp (direct_str, "im", 2) == 0) |
| 3883 | direct = RMAP_IMPORT; |
| 3884 | else if (strncmp (direct_str, "e", 1) == 0) |
| 3885 | direct = RMAP_EXPORT; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3886 | |
| 3887 | ret = peer_route_map_set (peer, afi, safi, direct, name_str); |
| 3888 | |
| 3889 | return bgp_vty_return (vty, ret); |
| 3890 | } |
| 3891 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3892 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3893 | peer_route_map_unset_vty (struct vty *vty, const char *ip_str, afi_t afi, |
| 3894 | safi_t safi, const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3895 | { |
| 3896 | int ret; |
| 3897 | struct peer *peer; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3898 | int direct = RMAP_IN; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3899 | |
| 3900 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3901 | if (! peer) |
| 3902 | return CMD_WARNING; |
| 3903 | |
| 3904 | /* Check filter direction. */ |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3905 | if (strncmp (direct_str, "in", 2) == 0) |
| 3906 | direct = RMAP_IN; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3907 | else if (strncmp (direct_str, "o", 1) == 0) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3908 | direct = RMAP_OUT; |
| 3909 | else if (strncmp (direct_str, "im", 2) == 0) |
| 3910 | direct = RMAP_IMPORT; |
| 3911 | else if (strncmp (direct_str, "e", 1) == 0) |
| 3912 | direct = RMAP_EXPORT; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3913 | |
| 3914 | ret = peer_route_map_unset (peer, afi, safi, direct); |
| 3915 | |
| 3916 | return bgp_vty_return (vty, ret); |
| 3917 | } |
| 3918 | |
| 3919 | DEFUN (neighbor_route_map, |
| 3920 | neighbor_route_map_cmd, |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3921 | NEIGHBOR_CMD2 "route-map WORD (in|out|import|export)", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3922 | NEIGHBOR_STR |
| 3923 | NEIGHBOR_ADDR_STR2 |
| 3924 | "Apply route map to neighbor\n" |
| 3925 | "Name of route map\n" |
| 3926 | "Apply map to incoming routes\n" |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3927 | "Apply map to outbound routes\n" |
| 3928 | "Apply map to routes going into a Route-Server client's table\n" |
| 3929 | "Apply map to routes coming from a Route-Server client") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3930 | { |
| 3931 | return peer_route_map_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3932 | bgp_node_safi (vty), argv[1], argv[2]); |
| 3933 | } |
| 3934 | |
| 3935 | DEFUN (no_neighbor_route_map, |
| 3936 | no_neighbor_route_map_cmd, |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3937 | NO_NEIGHBOR_CMD2 "route-map WORD (in|out|import|export)", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3938 | NO_STR |
| 3939 | NEIGHBOR_STR |
| 3940 | NEIGHBOR_ADDR_STR2 |
| 3941 | "Apply route map to neighbor\n" |
| 3942 | "Name of route map\n" |
| 3943 | "Apply map to incoming routes\n" |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3944 | "Apply map to outbound routes\n" |
| 3945 | "Apply map to routes going into a Route-Server client's table\n" |
| 3946 | "Apply map to routes coming from a Route-Server client") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3947 | { |
| 3948 | return peer_route_map_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 3949 | bgp_node_safi (vty), argv[2]); |
| 3950 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 3951 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3952 | /* Set unsuppress-map to the peer. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3953 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3954 | peer_unsuppress_map_set_vty (struct vty *vty, const char *ip_str, afi_t afi, |
| 3955 | safi_t safi, const char *name_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3956 | { |
| 3957 | int ret; |
| 3958 | struct peer *peer; |
| 3959 | |
| 3960 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3961 | if (! peer) |
| 3962 | return CMD_WARNING; |
| 3963 | |
| 3964 | ret = peer_unsuppress_map_set (peer, afi, safi, name_str); |
| 3965 | |
| 3966 | return bgp_vty_return (vty, ret); |
| 3967 | } |
| 3968 | |
| 3969 | /* Unset route-map from the peer. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3970 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3971 | 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] | 3972 | safi_t safi) |
| 3973 | { |
| 3974 | int ret; |
| 3975 | struct peer *peer; |
| 3976 | |
| 3977 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3978 | if (! peer) |
| 3979 | return CMD_WARNING; |
| 3980 | |
| 3981 | ret = peer_unsuppress_map_unset (peer, afi, safi); |
| 3982 | |
| 3983 | return bgp_vty_return (vty, ret); |
| 3984 | } |
| 3985 | |
| 3986 | DEFUN (neighbor_unsuppress_map, |
| 3987 | neighbor_unsuppress_map_cmd, |
| 3988 | NEIGHBOR_CMD2 "unsuppress-map WORD", |
| 3989 | NEIGHBOR_STR |
| 3990 | NEIGHBOR_ADDR_STR2 |
| 3991 | "Route-map to selectively unsuppress suppressed routes\n" |
| 3992 | "Name of route map\n") |
| 3993 | { |
| 3994 | return peer_unsuppress_map_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3995 | bgp_node_safi (vty), argv[1]); |
| 3996 | } |
| 3997 | |
| 3998 | DEFUN (no_neighbor_unsuppress_map, |
| 3999 | no_neighbor_unsuppress_map_cmd, |
| 4000 | NO_NEIGHBOR_CMD2 "unsuppress-map WORD", |
| 4001 | NO_STR |
| 4002 | NEIGHBOR_STR |
| 4003 | NEIGHBOR_ADDR_STR2 |
| 4004 | "Route-map to selectively unsuppress suppressed routes\n" |
| 4005 | "Name of route map\n") |
| 4006 | { |
| 4007 | return peer_unsuppress_map_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 4008 | bgp_node_safi (vty)); |
| 4009 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 4010 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 4011 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 4012 | peer_maximum_prefix_set_vty (struct vty *vty, const char *ip_str, afi_t afi, |
| 4013 | safi_t safi, const char *num_str, |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4014 | const char *threshold_str, int warning, |
| 4015 | const char *restart_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4016 | { |
| 4017 | int ret; |
| 4018 | struct peer *peer; |
| 4019 | u_int32_t max; |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 4020 | u_char threshold; |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4021 | u_int16_t restart; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4022 | |
| 4023 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 4024 | if (! peer) |
| 4025 | return CMD_WARNING; |
| 4026 | |
Denis Ovsienko | e6ec1c3 | 2011-09-10 21:50:53 +0400 | [diff] [blame] | 4027 | VTY_GET_INTEGER ("maximum number", max, num_str); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 4028 | if (threshold_str) |
| 4029 | threshold = atoi (threshold_str); |
| 4030 | else |
| 4031 | threshold = MAXIMUM_PREFIX_THRESHOLD_DEFAULT; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4032 | |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4033 | if (restart_str) |
| 4034 | restart = atoi (restart_str); |
| 4035 | else |
| 4036 | restart = 0; |
| 4037 | |
| 4038 | ret = peer_maximum_prefix_set (peer, afi, safi, max, threshold, warning, restart); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4039 | |
| 4040 | return bgp_vty_return (vty, ret); |
| 4041 | } |
| 4042 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 4043 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 4044 | 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] | 4045 | safi_t safi) |
| 4046 | { |
| 4047 | int ret; |
| 4048 | struct peer *peer; |
| 4049 | |
| 4050 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 4051 | if (! peer) |
| 4052 | return CMD_WARNING; |
| 4053 | |
| 4054 | ret = peer_maximum_prefix_unset (peer, afi, safi); |
| 4055 | |
| 4056 | return bgp_vty_return (vty, ret); |
| 4057 | } |
| 4058 | |
| 4059 | /* Maximum number of prefix configuration. prefix count is different |
| 4060 | for each peer configuration. So this configuration can be set for |
| 4061 | each peer configuration. */ |
| 4062 | DEFUN (neighbor_maximum_prefix, |
| 4063 | neighbor_maximum_prefix_cmd, |
| 4064 | NEIGHBOR_CMD2 "maximum-prefix <1-4294967295>", |
| 4065 | NEIGHBOR_STR |
| 4066 | NEIGHBOR_ADDR_STR2 |
| 4067 | "Maximum number of prefix accept from this peer\n" |
| 4068 | "maximum no. of prefix limit\n") |
| 4069 | { |
| 4070 | return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty), |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4071 | bgp_node_safi (vty), argv[1], NULL, 0, |
| 4072 | NULL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4073 | } |
| 4074 | |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 4075 | DEFUN (neighbor_maximum_prefix_threshold, |
| 4076 | neighbor_maximum_prefix_threshold_cmd, |
| 4077 | NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100>", |
| 4078 | NEIGHBOR_STR |
| 4079 | NEIGHBOR_ADDR_STR2 |
| 4080 | "Maximum number of prefix accept from this peer\n" |
| 4081 | "maximum no. of prefix limit\n" |
| 4082 | "Threshold value (%) at which to generate a warning msg\n") |
| 4083 | { |
| 4084 | return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty), |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4085 | bgp_node_safi (vty), argv[1], argv[2], 0, |
| 4086 | NULL); |
| 4087 | } |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 4088 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4089 | DEFUN (neighbor_maximum_prefix_warning, |
| 4090 | neighbor_maximum_prefix_warning_cmd, |
| 4091 | NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> warning-only", |
| 4092 | NEIGHBOR_STR |
| 4093 | NEIGHBOR_ADDR_STR2 |
| 4094 | "Maximum number of prefix accept from this peer\n" |
| 4095 | "maximum no. of prefix limit\n" |
| 4096 | "Only give warning message when limit is exceeded\n") |
| 4097 | { |
| 4098 | return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty), |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4099 | bgp_node_safi (vty), argv[1], NULL, 1, |
| 4100 | NULL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4101 | } |
| 4102 | |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 4103 | DEFUN (neighbor_maximum_prefix_threshold_warning, |
| 4104 | neighbor_maximum_prefix_threshold_warning_cmd, |
| 4105 | NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100> warning-only", |
| 4106 | NEIGHBOR_STR |
| 4107 | NEIGHBOR_ADDR_STR2 |
| 4108 | "Maximum number of prefix accept from this peer\n" |
| 4109 | "maximum no. of prefix limit\n" |
| 4110 | "Threshold value (%) at which to generate a warning msg\n" |
| 4111 | "Only give warning message when limit is exceeded\n") |
| 4112 | { |
| 4113 | return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty), |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4114 | bgp_node_safi (vty), argv[1], argv[2], 1, NULL); |
| 4115 | } |
| 4116 | |
| 4117 | DEFUN (neighbor_maximum_prefix_restart, |
| 4118 | neighbor_maximum_prefix_restart_cmd, |
| 4119 | NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> restart <1-65535>", |
| 4120 | NEIGHBOR_STR |
| 4121 | NEIGHBOR_ADDR_STR2 |
| 4122 | "Maximum number of prefix accept from this peer\n" |
| 4123 | "maximum no. of prefix limit\n" |
| 4124 | "Restart bgp connection after limit is exceeded\n" |
| 4125 | "Restart interval in minutes") |
| 4126 | { |
| 4127 | return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 4128 | bgp_node_safi (vty), argv[1], NULL, 0, argv[2]); |
| 4129 | } |
| 4130 | |
| 4131 | DEFUN (neighbor_maximum_prefix_threshold_restart, |
| 4132 | neighbor_maximum_prefix_threshold_restart_cmd, |
| 4133 | NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100> restart <1-65535>", |
| 4134 | NEIGHBOR_STR |
| 4135 | NEIGHBOR_ADDR_STR2 |
| 4136 | "Maximum number of prefix accept from this peer\n" |
| 4137 | "maximum no. of prefix limit\n" |
| 4138 | "Threshold value (%) at which to generate a warning msg\n" |
| 4139 | "Restart bgp connection after limit is exceeded\n" |
| 4140 | "Restart interval in minutes") |
| 4141 | { |
| 4142 | return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 4143 | bgp_node_safi (vty), argv[1], argv[2], 0, argv[3]); |
| 4144 | } |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 4145 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4146 | DEFUN (no_neighbor_maximum_prefix, |
| 4147 | no_neighbor_maximum_prefix_cmd, |
| 4148 | NO_NEIGHBOR_CMD2 "maximum-prefix", |
| 4149 | NO_STR |
| 4150 | NEIGHBOR_STR |
| 4151 | NEIGHBOR_ADDR_STR2 |
| 4152 | "Maximum number of prefix accept from this peer\n") |
| 4153 | { |
| 4154 | return peer_maximum_prefix_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 4155 | bgp_node_safi (vty)); |
| 4156 | } |
| 4157 | |
| 4158 | ALIAS (no_neighbor_maximum_prefix, |
| 4159 | no_neighbor_maximum_prefix_val_cmd, |
| 4160 | NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295>", |
| 4161 | NO_STR |
| 4162 | NEIGHBOR_STR |
| 4163 | NEIGHBOR_ADDR_STR2 |
| 4164 | "Maximum number of prefix accept from this peer\n" |
| 4165 | "maximum no. of prefix limit\n") |
| 4166 | |
| 4167 | ALIAS (no_neighbor_maximum_prefix, |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4168 | no_neighbor_maximum_prefix_threshold_cmd, |
| 4169 | NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> warning-only", |
| 4170 | NO_STR |
| 4171 | NEIGHBOR_STR |
| 4172 | NEIGHBOR_ADDR_STR2 |
| 4173 | "Maximum number of prefix accept from this peer\n" |
| 4174 | "maximum no. of prefix limit\n" |
| 4175 | "Threshold value (%) at which to generate a warning msg\n") |
| 4176 | |
| 4177 | ALIAS (no_neighbor_maximum_prefix, |
| 4178 | no_neighbor_maximum_prefix_warning_cmd, |
| 4179 | NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> warning-only", |
| 4180 | NO_STR |
| 4181 | NEIGHBOR_STR |
| 4182 | NEIGHBOR_ADDR_STR2 |
| 4183 | "Maximum number of prefix accept from this peer\n" |
| 4184 | "maximum no. of prefix limit\n" |
paul | e8e1946 | 2006-01-19 20:16:55 +0000 | [diff] [blame] | 4185 | "Only give warning message when limit is exceeded\n") |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4186 | |
| 4187 | ALIAS (no_neighbor_maximum_prefix, |
| 4188 | no_neighbor_maximum_prefix_threshold_warning_cmd, |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 4189 | NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100> warning-only", |
| 4190 | NO_STR |
| 4191 | NEIGHBOR_STR |
| 4192 | NEIGHBOR_ADDR_STR2 |
| 4193 | "Maximum number of prefix accept from this peer\n" |
| 4194 | "maximum no. of prefix limit\n" |
| 4195 | "Threshold value (%) at which to generate a warning msg\n" |
paul | e8e1946 | 2006-01-19 20:16:55 +0000 | [diff] [blame] | 4196 | "Only give warning message when limit is exceeded\n") |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 4197 | |
| 4198 | ALIAS (no_neighbor_maximum_prefix, |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4199 | no_neighbor_maximum_prefix_restart_cmd, |
| 4200 | NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> restart <1-65535>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4201 | NO_STR |
| 4202 | NEIGHBOR_STR |
| 4203 | NEIGHBOR_ADDR_STR2 |
| 4204 | "Maximum number of prefix accept from this peer\n" |
| 4205 | "maximum no. of prefix limit\n" |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 4206 | "Restart bgp connection after limit is exceeded\n" |
| 4207 | "Restart interval in minutes") |
| 4208 | |
| 4209 | ALIAS (no_neighbor_maximum_prefix, |
| 4210 | no_neighbor_maximum_prefix_threshold_restart_cmd, |
| 4211 | NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100> restart <1-65535>", |
| 4212 | NO_STR |
| 4213 | NEIGHBOR_STR |
| 4214 | NEIGHBOR_ADDR_STR2 |
| 4215 | "Maximum number of prefix accept from this peer\n" |
| 4216 | "maximum no. of prefix limit\n" |
| 4217 | "Threshold value (%) at which to generate a warning msg\n" |
| 4218 | "Restart bgp connection after limit is exceeded\n" |
| 4219 | "Restart interval in minutes") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 4220 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4221 | /* "neighbor allowas-in" */ |
| 4222 | DEFUN (neighbor_allowas_in, |
| 4223 | neighbor_allowas_in_cmd, |
| 4224 | NEIGHBOR_CMD2 "allowas-in", |
| 4225 | NEIGHBOR_STR |
| 4226 | NEIGHBOR_ADDR_STR2 |
| 4227 | "Accept as-path with my AS present in it\n") |
| 4228 | { |
| 4229 | int ret; |
| 4230 | struct peer *peer; |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 4231 | unsigned int allow_num; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4232 | |
| 4233 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 4234 | if (! peer) |
| 4235 | return CMD_WARNING; |
| 4236 | |
| 4237 | if (argc == 1) |
| 4238 | allow_num = 3; |
| 4239 | else |
| 4240 | VTY_GET_INTEGER_RANGE ("AS number", allow_num, argv[1], 1, 10); |
| 4241 | |
| 4242 | ret = peer_allowas_in_set (peer, bgp_node_afi (vty), bgp_node_safi (vty), |
| 4243 | allow_num); |
| 4244 | |
| 4245 | return bgp_vty_return (vty, ret); |
| 4246 | } |
| 4247 | |
| 4248 | ALIAS (neighbor_allowas_in, |
| 4249 | neighbor_allowas_in_arg_cmd, |
| 4250 | NEIGHBOR_CMD2 "allowas-in <1-10>", |
| 4251 | NEIGHBOR_STR |
| 4252 | NEIGHBOR_ADDR_STR2 |
| 4253 | "Accept as-path with my AS present in it\n" |
| 4254 | "Number of occurances of AS number\n") |
| 4255 | |
| 4256 | DEFUN (no_neighbor_allowas_in, |
| 4257 | no_neighbor_allowas_in_cmd, |
| 4258 | NO_NEIGHBOR_CMD2 "allowas-in", |
| 4259 | NO_STR |
| 4260 | NEIGHBOR_STR |
| 4261 | NEIGHBOR_ADDR_STR2 |
| 4262 | "allow local ASN appears in aspath attribute\n") |
| 4263 | { |
| 4264 | int ret; |
| 4265 | struct peer *peer; |
| 4266 | |
| 4267 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 4268 | if (! peer) |
| 4269 | return CMD_WARNING; |
| 4270 | |
| 4271 | ret = peer_allowas_in_unset (peer, bgp_node_afi (vty), bgp_node_safi (vty)); |
| 4272 | |
| 4273 | return bgp_vty_return (vty, ret); |
| 4274 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 4275 | |
Nick Hilliard | fa411a2 | 2011-03-23 15:33:17 +0000 | [diff] [blame] | 4276 | DEFUN (neighbor_ttl_security, |
| 4277 | neighbor_ttl_security_cmd, |
| 4278 | NEIGHBOR_CMD2 "ttl-security hops <1-254>", |
| 4279 | NEIGHBOR_STR |
| 4280 | NEIGHBOR_ADDR_STR2 |
| 4281 | "Specify the maximum number of hops to the BGP peer\n") |
| 4282 | { |
| 4283 | struct peer *peer; |
Stephen Hemminger | 89b6d1f | 2011-03-24 10:51:59 +0000 | [diff] [blame] | 4284 | int gtsm_hops; |
Nick Hilliard | fa411a2 | 2011-03-23 15:33:17 +0000 | [diff] [blame] | 4285 | |
| 4286 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 4287 | if (! peer) |
| 4288 | return CMD_WARNING; |
| 4289 | |
| 4290 | VTY_GET_INTEGER_RANGE ("", gtsm_hops, argv[1], 1, 254); |
| 4291 | |
Stephen Hemminger | 89b6d1f | 2011-03-24 10:51:59 +0000 | [diff] [blame] | 4292 | 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] | 4293 | } |
| 4294 | |
| 4295 | DEFUN (no_neighbor_ttl_security, |
| 4296 | no_neighbor_ttl_security_cmd, |
| 4297 | NO_NEIGHBOR_CMD2 "ttl-security hops <1-254>", |
| 4298 | NO_STR |
| 4299 | NEIGHBOR_STR |
| 4300 | NEIGHBOR_ADDR_STR2 |
| 4301 | "Specify the maximum number of hops to the BGP peer\n") |
| 4302 | { |
| 4303 | struct peer *peer; |
Nick Hilliard | fa411a2 | 2011-03-23 15:33:17 +0000 | [diff] [blame] | 4304 | |
| 4305 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 4306 | if (! peer) |
| 4307 | return CMD_WARNING; |
| 4308 | |
Stephen Hemminger | 89b6d1f | 2011-03-24 10:51:59 +0000 | [diff] [blame] | 4309 | return bgp_vty_return (vty, peer_ttl_security_hops_unset (peer)); |
Nick Hilliard | fa411a2 | 2011-03-23 15:33:17 +0000 | [diff] [blame] | 4310 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 4311 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4312 | /* Address family configuration. */ |
| 4313 | DEFUN (address_family_ipv4, |
| 4314 | address_family_ipv4_cmd, |
| 4315 | "address-family ipv4", |
| 4316 | "Enter Address Family command mode\n" |
| 4317 | "Address family\n") |
| 4318 | { |
| 4319 | vty->node = BGP_IPV4_NODE; |
| 4320 | return CMD_SUCCESS; |
| 4321 | } |
| 4322 | |
| 4323 | DEFUN (address_family_ipv4_safi, |
| 4324 | address_family_ipv4_safi_cmd, |
| 4325 | "address-family ipv4 (unicast|multicast)", |
| 4326 | "Enter Address Family command mode\n" |
| 4327 | "Address family\n" |
| 4328 | "Address Family modifier\n" |
| 4329 | "Address Family modifier\n") |
| 4330 | { |
| 4331 | if (strncmp (argv[0], "m", 1) == 0) |
| 4332 | vty->node = BGP_IPV4M_NODE; |
| 4333 | else |
| 4334 | vty->node = BGP_IPV4_NODE; |
| 4335 | |
| 4336 | return CMD_SUCCESS; |
| 4337 | } |
| 4338 | |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 4339 | DEFUN (address_family_ipv6, |
| 4340 | address_family_ipv6_cmd, |
| 4341 | "address-family ipv6", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4342 | "Enter Address Family command mode\n" |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 4343 | "Address family\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4344 | { |
| 4345 | vty->node = BGP_IPV6_NODE; |
| 4346 | return CMD_SUCCESS; |
| 4347 | } |
| 4348 | |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 4349 | DEFUN (address_family_ipv6_safi, |
| 4350 | address_family_ipv6_safi_cmd, |
| 4351 | "address-family ipv6 (unicast|multicast)", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4352 | "Enter Address Family command mode\n" |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 4353 | "Address family\n" |
| 4354 | "Address Family modifier\n" |
| 4355 | "Address Family modifier\n") |
| 4356 | { |
| 4357 | if (strncmp (argv[0], "m", 1) == 0) |
| 4358 | vty->node = BGP_IPV6M_NODE; |
| 4359 | else |
| 4360 | vty->node = BGP_IPV6_NODE; |
| 4361 | |
| 4362 | return CMD_SUCCESS; |
| 4363 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4364 | |
| 4365 | DEFUN (address_family_vpnv4, |
| 4366 | address_family_vpnv4_cmd, |
| 4367 | "address-family vpnv4", |
| 4368 | "Enter Address Family command mode\n" |
| 4369 | "Address family\n") |
| 4370 | { |
| 4371 | vty->node = BGP_VPNV4_NODE; |
| 4372 | return CMD_SUCCESS; |
| 4373 | } |
| 4374 | |
| 4375 | ALIAS (address_family_vpnv4, |
| 4376 | address_family_vpnv4_unicast_cmd, |
| 4377 | "address-family vpnv4 unicast", |
| 4378 | "Enter Address Family command mode\n" |
| 4379 | "Address family\n" |
| 4380 | "Address Family Modifier\n") |
| 4381 | |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 4382 | DEFUN (address_family_vpnv6, |
| 4383 | address_family_vpnv6_cmd, |
| 4384 | "address-family vpnv6", |
| 4385 | "Enter Address Family command mode\n" |
| 4386 | "Address family\n") |
| 4387 | { |
| 4388 | vty->node = BGP_VPNV6_NODE; |
| 4389 | return CMD_SUCCESS; |
| 4390 | } |
| 4391 | |
| 4392 | ALIAS (address_family_vpnv6, |
| 4393 | address_family_vpnv6_unicast_cmd, |
| 4394 | "address-family vpnv6 unicast", |
| 4395 | "Enter Address Family command mode\n" |
| 4396 | "Address family\n" |
| 4397 | "Address Family Modifier\n") |
| 4398 | |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 4399 | DEFUN (address_family_encap, |
| 4400 | address_family_encap_cmd, |
| 4401 | "address-family encap", |
| 4402 | "Enter Address Family command mode\n" |
| 4403 | "Address family\n") |
| 4404 | { |
| 4405 | vty->node = BGP_ENCAP_NODE; |
| 4406 | return CMD_SUCCESS; |
| 4407 | } |
| 4408 | |
| 4409 | ALIAS (address_family_encap, |
| 4410 | address_family_encapv4_cmd, |
| 4411 | "address-family encapv4", |
| 4412 | "Enter Address Family command mode\n" |
| 4413 | "Address family\n") |
| 4414 | |
| 4415 | DEFUN (address_family_encapv6, |
| 4416 | address_family_encapv6_cmd, |
| 4417 | "address-family encapv6", |
| 4418 | "Enter Address Family command mode\n" |
| 4419 | "Address family\n") |
| 4420 | { |
| 4421 | vty->node = BGP_ENCAPV6_NODE; |
| 4422 | return CMD_SUCCESS; |
| 4423 | } |
| 4424 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4425 | DEFUN (exit_address_family, |
| 4426 | exit_address_family_cmd, |
| 4427 | "exit-address-family", |
| 4428 | "Exit from Address Family configuration mode\n") |
| 4429 | { |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 4430 | /* should match list in command.c:config_exit */ |
hasso | a8a80d5 | 2005-04-09 13:07:47 +0000 | [diff] [blame] | 4431 | if (vty->node == BGP_IPV4_NODE |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 4432 | || vty->node == BGP_ENCAP_NODE |
| 4433 | || vty->node == BGP_ENCAPV6_NODE |
hasso | a8a80d5 | 2005-04-09 13:07:47 +0000 | [diff] [blame] | 4434 | || vty->node == BGP_IPV4M_NODE |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4435 | || vty->node == BGP_VPNV4_NODE |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 4436 | || vty->node == BGP_VPNV6_NODE |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 4437 | || vty->node == BGP_IPV6_NODE |
| 4438 | || vty->node == BGP_IPV6M_NODE) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4439 | vty->node = BGP_NODE; |
| 4440 | return CMD_SUCCESS; |
| 4441 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 4442 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4443 | /* BGP clear sort. */ |
| 4444 | enum clear_sort |
| 4445 | { |
| 4446 | clear_all, |
| 4447 | clear_peer, |
| 4448 | clear_group, |
| 4449 | clear_external, |
| 4450 | clear_as |
| 4451 | }; |
| 4452 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 4453 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4454 | bgp_clear_vty_error (struct vty *vty, struct peer *peer, afi_t afi, |
| 4455 | safi_t safi, int error) |
| 4456 | { |
| 4457 | switch (error) |
| 4458 | { |
| 4459 | case BGP_ERR_AF_UNCONFIGURED: |
| 4460 | vty_out (vty, |
| 4461 | "%%BGP: Enable %s %s address family for the neighbor %s%s", |
| 4462 | afi == AFI_IP6 ? "IPv6" : safi == SAFI_MPLS_VPN ? "VPNv4" : "IPv4", |
| 4463 | safi == SAFI_MULTICAST ? "Multicast" : "Unicast", |
| 4464 | peer->host, VTY_NEWLINE); |
| 4465 | break; |
| 4466 | case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED: |
| 4467 | 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); |
| 4468 | break; |
| 4469 | default: |
| 4470 | break; |
| 4471 | } |
| 4472 | } |
| 4473 | |
| 4474 | /* `clear ip bgp' functions. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 4475 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4476 | 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] | 4477 | enum clear_sort sort,enum bgp_clear_type stype, const char *arg) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4478 | { |
| 4479 | int ret; |
| 4480 | struct peer *peer; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 4481 | struct listnode *node, *nnode; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4482 | |
| 4483 | /* Clear all neighbors. */ |
| 4484 | if (sort == clear_all) |
| 4485 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 4486 | for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4487 | { |
| 4488 | if (stype == BGP_CLEAR_SOFT_NONE) |
| 4489 | ret = peer_clear (peer); |
| 4490 | else |
| 4491 | ret = peer_clear_soft (peer, afi, safi, stype); |
| 4492 | |
| 4493 | if (ret < 0) |
| 4494 | bgp_clear_vty_error (vty, peer, afi, safi, ret); |
| 4495 | } |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4496 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4497 | } |
| 4498 | |
| 4499 | /* Clear specified neighbors. */ |
| 4500 | if (sort == clear_peer) |
| 4501 | { |
| 4502 | union sockunion su; |
| 4503 | int ret; |
| 4504 | |
| 4505 | /* Make sockunion for lookup. */ |
| 4506 | ret = str2sockunion (arg, &su); |
| 4507 | if (ret < 0) |
| 4508 | { |
| 4509 | vty_out (vty, "Malformed address: %s%s", arg, VTY_NEWLINE); |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4510 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4511 | } |
| 4512 | peer = peer_lookup (bgp, &su); |
| 4513 | if (! peer) |
| 4514 | { |
| 4515 | vty_out (vty, "%%BGP: Unknown neighbor - \"%s\"%s", arg, VTY_NEWLINE); |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4516 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4517 | } |
| 4518 | |
| 4519 | if (stype == BGP_CLEAR_SOFT_NONE) |
| 4520 | ret = peer_clear (peer); |
| 4521 | else |
| 4522 | ret = peer_clear_soft (peer, afi, safi, stype); |
| 4523 | |
| 4524 | if (ret < 0) |
| 4525 | bgp_clear_vty_error (vty, peer, afi, safi, ret); |
| 4526 | |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4527 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4528 | } |
| 4529 | |
| 4530 | /* Clear all peer-group members. */ |
| 4531 | if (sort == clear_group) |
| 4532 | { |
| 4533 | struct peer_group *group; |
| 4534 | |
| 4535 | group = peer_group_lookup (bgp, arg); |
| 4536 | if (! group) |
| 4537 | { |
| 4538 | 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] | 4539 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4540 | } |
| 4541 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 4542 | for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4543 | { |
| 4544 | if (stype == BGP_CLEAR_SOFT_NONE) |
| 4545 | { |
| 4546 | ret = peer_clear (peer); |
| 4547 | continue; |
| 4548 | } |
| 4549 | |
| 4550 | if (! peer->af_group[afi][safi]) |
| 4551 | continue; |
| 4552 | |
| 4553 | ret = peer_clear_soft (peer, afi, safi, stype); |
| 4554 | |
| 4555 | if (ret < 0) |
| 4556 | bgp_clear_vty_error (vty, peer, afi, safi, ret); |
| 4557 | } |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4558 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4559 | } |
| 4560 | |
| 4561 | if (sort == clear_external) |
| 4562 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 4563 | for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4564 | { |
Jorge Boncompte [DTI2] | 6d85b15 | 2012-05-07 16:52:54 +0000 | [diff] [blame] | 4565 | if (peer->sort == BGP_PEER_IBGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4566 | continue; |
| 4567 | |
| 4568 | if (stype == BGP_CLEAR_SOFT_NONE) |
| 4569 | ret = peer_clear (peer); |
| 4570 | else |
| 4571 | ret = peer_clear_soft (peer, afi, safi, stype); |
| 4572 | |
| 4573 | if (ret < 0) |
| 4574 | bgp_clear_vty_error (vty, peer, afi, safi, ret); |
| 4575 | } |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4576 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4577 | } |
| 4578 | |
| 4579 | if (sort == clear_as) |
| 4580 | { |
| 4581 | as_t as; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4582 | int find = 0; |
| 4583 | |
Ulrich Weber | bde12e3 | 2011-11-16 19:32:12 +0400 | [diff] [blame] | 4584 | VTY_GET_INTEGER_RANGE ("AS", as, arg, 1, BGP_AS4_MAX); |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4585 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 4586 | for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4587 | { |
| 4588 | if (peer->as != as) |
| 4589 | continue; |
| 4590 | |
| 4591 | find = 1; |
| 4592 | if (stype == BGP_CLEAR_SOFT_NONE) |
| 4593 | ret = peer_clear (peer); |
| 4594 | else |
| 4595 | ret = peer_clear_soft (peer, afi, safi, stype); |
| 4596 | |
| 4597 | if (ret < 0) |
| 4598 | bgp_clear_vty_error (vty, peer, afi, safi, ret); |
| 4599 | } |
| 4600 | if (! find) |
| 4601 | vty_out (vty, "%%BGP: No peer is configured with AS %s%s", arg, |
| 4602 | VTY_NEWLINE); |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4603 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4604 | } |
| 4605 | |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4606 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4607 | } |
| 4608 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 4609 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 4610 | bgp_clear_vty (struct vty *vty, const char *name, afi_t afi, safi_t safi, |
| 4611 | enum clear_sort sort, enum bgp_clear_type stype, |
| 4612 | const char *arg) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4613 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4614 | struct bgp *bgp; |
| 4615 | |
| 4616 | /* BGP structure lookup. */ |
| 4617 | if (name) |
| 4618 | { |
| 4619 | bgp = bgp_lookup_by_name (name); |
| 4620 | if (bgp == NULL) |
| 4621 | { |
| 4622 | vty_out (vty, "Can't find BGP view %s%s", name, VTY_NEWLINE); |
| 4623 | return CMD_WARNING; |
| 4624 | } |
| 4625 | } |
| 4626 | else |
| 4627 | { |
| 4628 | bgp = bgp_get_default (); |
| 4629 | if (bgp == NULL) |
| 4630 | { |
| 4631 | vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE); |
| 4632 | return CMD_WARNING; |
| 4633 | } |
| 4634 | } |
| 4635 | |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 4636 | return bgp_clear (vty, bgp, afi, safi, sort, stype, arg); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4637 | } |
| 4638 | |
| 4639 | DEFUN (clear_ip_bgp_all, |
| 4640 | clear_ip_bgp_all_cmd, |
| 4641 | "clear ip bgp *", |
| 4642 | CLEAR_STR |
| 4643 | IP_STR |
| 4644 | BGP_STR |
| 4645 | "Clear all peers\n") |
| 4646 | { |
| 4647 | if (argc == 1) |
| 4648 | return bgp_clear_vty (vty, argv[0], 0, 0, clear_all, BGP_CLEAR_SOFT_NONE, NULL); |
| 4649 | |
| 4650 | return bgp_clear_vty (vty, NULL, 0, 0, clear_all, BGP_CLEAR_SOFT_NONE, NULL); |
| 4651 | } |
| 4652 | |
| 4653 | ALIAS (clear_ip_bgp_all, |
| 4654 | clear_bgp_all_cmd, |
| 4655 | "clear bgp *", |
| 4656 | CLEAR_STR |
| 4657 | BGP_STR |
| 4658 | "Clear all peers\n") |
| 4659 | |
| 4660 | ALIAS (clear_ip_bgp_all, |
| 4661 | clear_bgp_ipv6_all_cmd, |
| 4662 | "clear bgp ipv6 *", |
| 4663 | CLEAR_STR |
| 4664 | BGP_STR |
| 4665 | "Address family\n" |
| 4666 | "Clear all peers\n") |
| 4667 | |
| 4668 | ALIAS (clear_ip_bgp_all, |
| 4669 | clear_ip_bgp_instance_all_cmd, |
| 4670 | "clear ip bgp view WORD *", |
| 4671 | CLEAR_STR |
| 4672 | IP_STR |
| 4673 | BGP_STR |
| 4674 | "BGP view\n" |
| 4675 | "view name\n" |
| 4676 | "Clear all peers\n") |
| 4677 | |
| 4678 | ALIAS (clear_ip_bgp_all, |
| 4679 | clear_bgp_instance_all_cmd, |
| 4680 | "clear bgp view WORD *", |
| 4681 | CLEAR_STR |
| 4682 | BGP_STR |
| 4683 | "BGP view\n" |
| 4684 | "view name\n" |
| 4685 | "Clear all peers\n") |
| 4686 | |
| 4687 | DEFUN (clear_ip_bgp_peer, |
| 4688 | clear_ip_bgp_peer_cmd, |
| 4689 | "clear ip bgp (A.B.C.D|X:X::X:X)", |
| 4690 | CLEAR_STR |
| 4691 | IP_STR |
| 4692 | BGP_STR |
| 4693 | "BGP neighbor IP address to clear\n" |
| 4694 | "BGP IPv6 neighbor to clear\n") |
| 4695 | { |
| 4696 | return bgp_clear_vty (vty, NULL, 0, 0, clear_peer, BGP_CLEAR_SOFT_NONE, argv[0]); |
| 4697 | } |
| 4698 | |
| 4699 | ALIAS (clear_ip_bgp_peer, |
| 4700 | clear_bgp_peer_cmd, |
| 4701 | "clear bgp (A.B.C.D|X:X::X:X)", |
| 4702 | CLEAR_STR |
| 4703 | BGP_STR |
| 4704 | "BGP neighbor address to clear\n" |
| 4705 | "BGP IPv6 neighbor to clear\n") |
| 4706 | |
| 4707 | ALIAS (clear_ip_bgp_peer, |
| 4708 | clear_bgp_ipv6_peer_cmd, |
| 4709 | "clear bgp ipv6 (A.B.C.D|X:X::X:X)", |
| 4710 | CLEAR_STR |
| 4711 | BGP_STR |
| 4712 | "Address family\n" |
| 4713 | "BGP neighbor address to clear\n" |
| 4714 | "BGP IPv6 neighbor to clear\n") |
| 4715 | |
| 4716 | DEFUN (clear_ip_bgp_peer_group, |
| 4717 | clear_ip_bgp_peer_group_cmd, |
| 4718 | "clear ip bgp peer-group WORD", |
| 4719 | CLEAR_STR |
| 4720 | IP_STR |
| 4721 | BGP_STR |
| 4722 | "Clear all members of peer-group\n" |
| 4723 | "BGP peer-group name\n") |
| 4724 | { |
| 4725 | return bgp_clear_vty (vty, NULL, 0, 0, clear_group, BGP_CLEAR_SOFT_NONE, argv[0]); |
| 4726 | } |
| 4727 | |
| 4728 | ALIAS (clear_ip_bgp_peer_group, |
| 4729 | clear_bgp_peer_group_cmd, |
| 4730 | "clear bgp peer-group WORD", |
| 4731 | CLEAR_STR |
| 4732 | BGP_STR |
| 4733 | "Clear all members of peer-group\n" |
| 4734 | "BGP peer-group name\n") |
| 4735 | |
| 4736 | ALIAS (clear_ip_bgp_peer_group, |
| 4737 | clear_bgp_ipv6_peer_group_cmd, |
| 4738 | "clear bgp ipv6 peer-group WORD", |
| 4739 | CLEAR_STR |
| 4740 | BGP_STR |
| 4741 | "Address family\n" |
| 4742 | "Clear all members of peer-group\n" |
| 4743 | "BGP peer-group name\n") |
| 4744 | |
| 4745 | DEFUN (clear_ip_bgp_external, |
| 4746 | clear_ip_bgp_external_cmd, |
| 4747 | "clear ip bgp external", |
| 4748 | CLEAR_STR |
| 4749 | IP_STR |
| 4750 | BGP_STR |
| 4751 | "Clear all external peers\n") |
| 4752 | { |
| 4753 | return bgp_clear_vty (vty, NULL, 0, 0, clear_external, BGP_CLEAR_SOFT_NONE, NULL); |
| 4754 | } |
| 4755 | |
| 4756 | ALIAS (clear_ip_bgp_external, |
| 4757 | clear_bgp_external_cmd, |
| 4758 | "clear bgp external", |
| 4759 | CLEAR_STR |
| 4760 | BGP_STR |
| 4761 | "Clear all external peers\n") |
| 4762 | |
| 4763 | ALIAS (clear_ip_bgp_external, |
| 4764 | clear_bgp_ipv6_external_cmd, |
| 4765 | "clear bgp ipv6 external", |
| 4766 | CLEAR_STR |
| 4767 | BGP_STR |
| 4768 | "Address family\n" |
| 4769 | "Clear all external peers\n") |
| 4770 | |
| 4771 | DEFUN (clear_ip_bgp_as, |
| 4772 | clear_ip_bgp_as_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 4773 | "clear ip bgp " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4774 | CLEAR_STR |
| 4775 | IP_STR |
| 4776 | BGP_STR |
| 4777 | "Clear peers with the AS number\n") |
| 4778 | { |
| 4779 | return bgp_clear_vty (vty, NULL, 0, 0, clear_as, BGP_CLEAR_SOFT_NONE, argv[0]); |
| 4780 | } |
| 4781 | |
| 4782 | ALIAS (clear_ip_bgp_as, |
| 4783 | clear_bgp_as_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 4784 | "clear bgp " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4785 | CLEAR_STR |
| 4786 | BGP_STR |
| 4787 | "Clear peers with the AS number\n") |
| 4788 | |
| 4789 | ALIAS (clear_ip_bgp_as, |
| 4790 | clear_bgp_ipv6_as_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 4791 | "clear bgp ipv6 " CMD_AS_RANGE, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4792 | CLEAR_STR |
| 4793 | BGP_STR |
| 4794 | "Address family\n" |
| 4795 | "Clear peers with the AS number\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 4796 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4797 | /* Outbound soft-reconfiguration */ |
| 4798 | DEFUN (clear_ip_bgp_all_soft_out, |
| 4799 | clear_ip_bgp_all_soft_out_cmd, |
| 4800 | "clear ip bgp * soft out", |
| 4801 | CLEAR_STR |
| 4802 | IP_STR |
| 4803 | BGP_STR |
| 4804 | "Clear all peers\n" |
| 4805 | "Soft reconfig\n" |
| 4806 | "Soft reconfig outbound update\n") |
| 4807 | { |
| 4808 | if (argc == 1) |
| 4809 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 4810 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4811 | |
| 4812 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 4813 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4814 | } |
| 4815 | |
| 4816 | ALIAS (clear_ip_bgp_all_soft_out, |
| 4817 | clear_ip_bgp_all_out_cmd, |
| 4818 | "clear ip bgp * out", |
| 4819 | CLEAR_STR |
| 4820 | IP_STR |
| 4821 | BGP_STR |
| 4822 | "Clear all peers\n" |
| 4823 | "Soft reconfig outbound update\n") |
| 4824 | |
| 4825 | ALIAS (clear_ip_bgp_all_soft_out, |
| 4826 | clear_ip_bgp_instance_all_soft_out_cmd, |
| 4827 | "clear ip bgp view WORD * soft out", |
| 4828 | CLEAR_STR |
| 4829 | IP_STR |
| 4830 | BGP_STR |
| 4831 | "BGP view\n" |
| 4832 | "view name\n" |
| 4833 | "Clear all peers\n" |
| 4834 | "Soft reconfig\n" |
| 4835 | "Soft reconfig outbound update\n") |
| 4836 | |
| 4837 | DEFUN (clear_ip_bgp_all_ipv4_soft_out, |
| 4838 | clear_ip_bgp_all_ipv4_soft_out_cmd, |
| 4839 | "clear ip bgp * ipv4 (unicast|multicast) soft out", |
| 4840 | CLEAR_STR |
| 4841 | IP_STR |
| 4842 | BGP_STR |
| 4843 | "Clear all peers\n" |
| 4844 | "Address family\n" |
| 4845 | "Address Family modifier\n" |
| 4846 | "Address Family modifier\n" |
| 4847 | "Soft reconfig\n" |
| 4848 | "Soft reconfig outbound update\n") |
| 4849 | { |
| 4850 | if (strncmp (argv[0], "m", 1) == 0) |
| 4851 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all, |
| 4852 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4853 | |
| 4854 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 4855 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4856 | } |
| 4857 | |
| 4858 | ALIAS (clear_ip_bgp_all_ipv4_soft_out, |
| 4859 | clear_ip_bgp_all_ipv4_out_cmd, |
| 4860 | "clear ip bgp * ipv4 (unicast|multicast) out", |
| 4861 | CLEAR_STR |
| 4862 | IP_STR |
| 4863 | BGP_STR |
| 4864 | "Clear all peers\n" |
| 4865 | "Address family\n" |
| 4866 | "Address Family modifier\n" |
| 4867 | "Address Family modifier\n" |
| 4868 | "Soft reconfig outbound update\n") |
| 4869 | |
| 4870 | DEFUN (clear_ip_bgp_instance_all_ipv4_soft_out, |
| 4871 | clear_ip_bgp_instance_all_ipv4_soft_out_cmd, |
| 4872 | "clear ip bgp view WORD * ipv4 (unicast|multicast) soft out", |
| 4873 | CLEAR_STR |
| 4874 | IP_STR |
| 4875 | BGP_STR |
| 4876 | "BGP view\n" |
| 4877 | "view name\n" |
| 4878 | "Clear all peers\n" |
| 4879 | "Address family\n" |
| 4880 | "Address Family modifier\n" |
| 4881 | "Address Family modifier\n" |
| 4882 | "Soft reconfig outbound update\n") |
| 4883 | { |
| 4884 | if (strncmp (argv[1], "m", 1) == 0) |
| 4885 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST, clear_all, |
| 4886 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4887 | |
| 4888 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 4889 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4890 | } |
| 4891 | |
| 4892 | DEFUN (clear_ip_bgp_all_vpnv4_soft_out, |
| 4893 | clear_ip_bgp_all_vpnv4_soft_out_cmd, |
| 4894 | "clear ip bgp * vpnv4 unicast soft out", |
| 4895 | CLEAR_STR |
| 4896 | IP_STR |
| 4897 | BGP_STR |
| 4898 | "Clear all peers\n" |
| 4899 | "Address family\n" |
| 4900 | "Address Family Modifier\n" |
| 4901 | "Soft reconfig\n" |
| 4902 | "Soft reconfig outbound update\n") |
| 4903 | { |
| 4904 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_all, |
| 4905 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4906 | } |
| 4907 | |
| 4908 | ALIAS (clear_ip_bgp_all_vpnv4_soft_out, |
| 4909 | clear_ip_bgp_all_vpnv4_out_cmd, |
| 4910 | "clear ip bgp * vpnv4 unicast out", |
| 4911 | CLEAR_STR |
| 4912 | IP_STR |
| 4913 | BGP_STR |
| 4914 | "Clear all peers\n" |
| 4915 | "Address family\n" |
| 4916 | "Address Family Modifier\n" |
| 4917 | "Soft reconfig outbound update\n") |
| 4918 | |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 4919 | DEFUN (clear_ip_bgp_all_encap_soft_out, |
| 4920 | clear_ip_bgp_all_encap_soft_out_cmd, |
| 4921 | "clear ip bgp * encap unicast soft out", |
| 4922 | CLEAR_STR |
| 4923 | IP_STR |
| 4924 | BGP_STR |
| 4925 | "Clear all peers\n" |
| 4926 | "Address family\n" |
| 4927 | "Address Family Modifier\n" |
| 4928 | "Soft reconfig\n" |
| 4929 | "Soft reconfig outbound update\n") |
| 4930 | { |
| 4931 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_all, |
| 4932 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4933 | } |
| 4934 | |
| 4935 | ALIAS (clear_ip_bgp_all_encap_soft_out, |
| 4936 | clear_ip_bgp_all_encap_out_cmd, |
| 4937 | "clear ip bgp * encap unicast out", |
| 4938 | CLEAR_STR |
| 4939 | IP_STR |
| 4940 | BGP_STR |
| 4941 | "Clear all peers\n" |
| 4942 | "Address family\n" |
| 4943 | "Address Family Modifier\n" |
| 4944 | "Soft reconfig outbound update\n") |
| 4945 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4946 | DEFUN (clear_bgp_all_soft_out, |
| 4947 | clear_bgp_all_soft_out_cmd, |
| 4948 | "clear bgp * soft out", |
| 4949 | CLEAR_STR |
| 4950 | BGP_STR |
| 4951 | "Clear all peers\n" |
| 4952 | "Soft reconfig\n" |
| 4953 | "Soft reconfig outbound update\n") |
| 4954 | { |
| 4955 | if (argc == 1) |
| 4956 | return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_all, |
| 4957 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4958 | |
| 4959 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all, |
| 4960 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4961 | } |
| 4962 | |
| 4963 | ALIAS (clear_bgp_all_soft_out, |
| 4964 | clear_bgp_instance_all_soft_out_cmd, |
| 4965 | "clear bgp view WORD * soft out", |
| 4966 | CLEAR_STR |
| 4967 | BGP_STR |
| 4968 | "BGP view\n" |
| 4969 | "view name\n" |
| 4970 | "Clear all peers\n" |
| 4971 | "Soft reconfig\n" |
| 4972 | "Soft reconfig outbound update\n") |
| 4973 | |
| 4974 | ALIAS (clear_bgp_all_soft_out, |
| 4975 | clear_bgp_all_out_cmd, |
| 4976 | "clear bgp * out", |
| 4977 | CLEAR_STR |
| 4978 | BGP_STR |
| 4979 | "Clear all peers\n" |
| 4980 | "Soft reconfig outbound update\n") |
| 4981 | |
| 4982 | ALIAS (clear_bgp_all_soft_out, |
| 4983 | clear_bgp_ipv6_all_soft_out_cmd, |
| 4984 | "clear bgp ipv6 * soft out", |
| 4985 | CLEAR_STR |
| 4986 | BGP_STR |
| 4987 | "Address family\n" |
| 4988 | "Clear all peers\n" |
| 4989 | "Soft reconfig\n" |
| 4990 | "Soft reconfig outbound update\n") |
| 4991 | |
| 4992 | ALIAS (clear_bgp_all_soft_out, |
| 4993 | clear_bgp_ipv6_all_out_cmd, |
| 4994 | "clear bgp ipv6 * out", |
| 4995 | CLEAR_STR |
| 4996 | BGP_STR |
| 4997 | "Address family\n" |
| 4998 | "Clear all peers\n" |
| 4999 | "Soft reconfig outbound update\n") |
| 5000 | |
| 5001 | DEFUN (clear_ip_bgp_peer_soft_out, |
| 5002 | clear_ip_bgp_peer_soft_out_cmd, |
| 5003 | "clear ip bgp A.B.C.D soft out", |
| 5004 | CLEAR_STR |
| 5005 | IP_STR |
| 5006 | BGP_STR |
| 5007 | "BGP neighbor address to clear\n" |
| 5008 | "Soft reconfig\n" |
| 5009 | "Soft reconfig outbound update\n") |
| 5010 | { |
| 5011 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 5012 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5013 | } |
| 5014 | |
| 5015 | ALIAS (clear_ip_bgp_peer_soft_out, |
| 5016 | clear_ip_bgp_peer_out_cmd, |
| 5017 | "clear ip bgp A.B.C.D out", |
| 5018 | CLEAR_STR |
| 5019 | IP_STR |
| 5020 | BGP_STR |
| 5021 | "BGP neighbor address to clear\n" |
| 5022 | "Soft reconfig outbound update\n") |
| 5023 | |
| 5024 | DEFUN (clear_ip_bgp_peer_ipv4_soft_out, |
| 5025 | clear_ip_bgp_peer_ipv4_soft_out_cmd, |
| 5026 | "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft out", |
| 5027 | CLEAR_STR |
| 5028 | IP_STR |
| 5029 | BGP_STR |
| 5030 | "BGP neighbor address to clear\n" |
| 5031 | "Address family\n" |
| 5032 | "Address Family modifier\n" |
| 5033 | "Address Family modifier\n" |
| 5034 | "Soft reconfig\n" |
| 5035 | "Soft reconfig outbound update\n") |
| 5036 | { |
| 5037 | if (strncmp (argv[1], "m", 1) == 0) |
| 5038 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer, |
| 5039 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5040 | |
| 5041 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 5042 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5043 | } |
| 5044 | |
| 5045 | ALIAS (clear_ip_bgp_peer_ipv4_soft_out, |
| 5046 | clear_ip_bgp_peer_ipv4_out_cmd, |
| 5047 | "clear ip bgp A.B.C.D ipv4 (unicast|multicast) out", |
| 5048 | CLEAR_STR |
| 5049 | IP_STR |
| 5050 | BGP_STR |
| 5051 | "BGP neighbor address to clear\n" |
| 5052 | "Address family\n" |
| 5053 | "Address Family modifier\n" |
| 5054 | "Address Family modifier\n" |
| 5055 | "Soft reconfig outbound update\n") |
| 5056 | |
| 5057 | DEFUN (clear_ip_bgp_peer_vpnv4_soft_out, |
| 5058 | clear_ip_bgp_peer_vpnv4_soft_out_cmd, |
| 5059 | "clear ip bgp A.B.C.D vpnv4 unicast soft out", |
| 5060 | CLEAR_STR |
| 5061 | IP_STR |
| 5062 | BGP_STR |
| 5063 | "BGP neighbor address to clear\n" |
| 5064 | "Address family\n" |
| 5065 | "Address Family Modifier\n" |
| 5066 | "Soft reconfig\n" |
| 5067 | "Soft reconfig outbound update\n") |
| 5068 | { |
| 5069 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_peer, |
| 5070 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5071 | } |
| 5072 | |
| 5073 | ALIAS (clear_ip_bgp_peer_vpnv4_soft_out, |
| 5074 | clear_ip_bgp_peer_vpnv4_out_cmd, |
| 5075 | "clear ip bgp A.B.C.D vpnv4 unicast out", |
| 5076 | CLEAR_STR |
| 5077 | IP_STR |
| 5078 | BGP_STR |
| 5079 | "BGP neighbor address to clear\n" |
| 5080 | "Address family\n" |
| 5081 | "Address Family Modifier\n" |
| 5082 | "Soft reconfig outbound update\n") |
| 5083 | |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 5084 | DEFUN (clear_ip_bgp_peer_encap_soft_out, |
| 5085 | clear_ip_bgp_peer_encap_soft_out_cmd, |
| 5086 | "clear ip bgp A.B.C.D encap unicast soft out", |
| 5087 | CLEAR_STR |
| 5088 | IP_STR |
| 5089 | BGP_STR |
| 5090 | "BGP neighbor address to clear\n" |
| 5091 | "Address family\n" |
| 5092 | "Address Family Modifier\n" |
| 5093 | "Soft reconfig\n" |
| 5094 | "Soft reconfig outbound update\n") |
| 5095 | { |
| 5096 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_peer, |
| 5097 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5098 | } |
| 5099 | |
| 5100 | ALIAS (clear_ip_bgp_peer_encap_soft_out, |
| 5101 | clear_ip_bgp_peer_encap_out_cmd, |
| 5102 | "clear ip bgp A.B.C.D encap unicast out", |
| 5103 | CLEAR_STR |
| 5104 | IP_STR |
| 5105 | BGP_STR |
| 5106 | "BGP neighbor address to clear\n" |
| 5107 | "Address family\n" |
| 5108 | "Address Family Modifier\n" |
| 5109 | "Soft reconfig outbound update\n") |
| 5110 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5111 | DEFUN (clear_bgp_peer_soft_out, |
| 5112 | clear_bgp_peer_soft_out_cmd, |
| 5113 | "clear bgp (A.B.C.D|X:X::X:X) soft out", |
| 5114 | CLEAR_STR |
| 5115 | BGP_STR |
| 5116 | "BGP neighbor address to clear\n" |
| 5117 | "BGP IPv6 neighbor to clear\n" |
| 5118 | "Soft reconfig\n" |
| 5119 | "Soft reconfig outbound update\n") |
| 5120 | { |
| 5121 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer, |
| 5122 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5123 | } |
| 5124 | |
| 5125 | ALIAS (clear_bgp_peer_soft_out, |
| 5126 | clear_bgp_ipv6_peer_soft_out_cmd, |
| 5127 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft out", |
| 5128 | CLEAR_STR |
| 5129 | BGP_STR |
| 5130 | "Address family\n" |
| 5131 | "BGP neighbor address to clear\n" |
| 5132 | "BGP IPv6 neighbor to clear\n" |
| 5133 | "Soft reconfig\n" |
| 5134 | "Soft reconfig outbound update\n") |
| 5135 | |
| 5136 | ALIAS (clear_bgp_peer_soft_out, |
| 5137 | clear_bgp_peer_out_cmd, |
| 5138 | "clear bgp (A.B.C.D|X:X::X:X) out", |
| 5139 | CLEAR_STR |
| 5140 | BGP_STR |
| 5141 | "BGP neighbor address to clear\n" |
| 5142 | "BGP IPv6 neighbor to clear\n" |
| 5143 | "Soft reconfig outbound update\n") |
| 5144 | |
| 5145 | ALIAS (clear_bgp_peer_soft_out, |
| 5146 | clear_bgp_ipv6_peer_out_cmd, |
| 5147 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) out", |
| 5148 | CLEAR_STR |
| 5149 | BGP_STR |
| 5150 | "Address family\n" |
| 5151 | "BGP neighbor address to clear\n" |
| 5152 | "BGP IPv6 neighbor to clear\n" |
| 5153 | "Soft reconfig outbound update\n") |
| 5154 | |
| 5155 | DEFUN (clear_ip_bgp_peer_group_soft_out, |
| 5156 | clear_ip_bgp_peer_group_soft_out_cmd, |
| 5157 | "clear ip bgp peer-group WORD soft out", |
| 5158 | CLEAR_STR |
| 5159 | IP_STR |
| 5160 | BGP_STR |
| 5161 | "Clear all members of peer-group\n" |
| 5162 | "BGP peer-group name\n" |
| 5163 | "Soft reconfig\n" |
| 5164 | "Soft reconfig outbound update\n") |
| 5165 | { |
| 5166 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 5167 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5168 | } |
| 5169 | |
| 5170 | ALIAS (clear_ip_bgp_peer_group_soft_out, |
| 5171 | clear_ip_bgp_peer_group_out_cmd, |
| 5172 | "clear ip bgp peer-group WORD out", |
| 5173 | CLEAR_STR |
| 5174 | IP_STR |
| 5175 | BGP_STR |
| 5176 | "Clear all members of peer-group\n" |
| 5177 | "BGP peer-group name\n" |
| 5178 | "Soft reconfig outbound update\n") |
| 5179 | |
| 5180 | DEFUN (clear_ip_bgp_peer_group_ipv4_soft_out, |
| 5181 | clear_ip_bgp_peer_group_ipv4_soft_out_cmd, |
| 5182 | "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft out", |
| 5183 | CLEAR_STR |
| 5184 | IP_STR |
| 5185 | BGP_STR |
| 5186 | "Clear all members of peer-group\n" |
| 5187 | "BGP peer-group name\n" |
| 5188 | "Address family\n" |
| 5189 | "Address Family modifier\n" |
| 5190 | "Address Family modifier\n" |
| 5191 | "Soft reconfig\n" |
| 5192 | "Soft reconfig outbound update\n") |
| 5193 | { |
| 5194 | if (strncmp (argv[1], "m", 1) == 0) |
| 5195 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group, |
| 5196 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5197 | |
| 5198 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 5199 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5200 | } |
| 5201 | |
| 5202 | ALIAS (clear_ip_bgp_peer_group_ipv4_soft_out, |
| 5203 | clear_ip_bgp_peer_group_ipv4_out_cmd, |
| 5204 | "clear ip bgp peer-group WORD ipv4 (unicast|multicast) out", |
| 5205 | CLEAR_STR |
| 5206 | IP_STR |
| 5207 | BGP_STR |
| 5208 | "Clear all members of peer-group\n" |
| 5209 | "BGP peer-group name\n" |
| 5210 | "Address family\n" |
| 5211 | "Address Family modifier\n" |
| 5212 | "Address Family modifier\n" |
| 5213 | "Soft reconfig outbound update\n") |
| 5214 | |
| 5215 | DEFUN (clear_bgp_peer_group_soft_out, |
| 5216 | clear_bgp_peer_group_soft_out_cmd, |
| 5217 | "clear bgp peer-group WORD soft out", |
| 5218 | CLEAR_STR |
| 5219 | BGP_STR |
| 5220 | "Clear all members of peer-group\n" |
| 5221 | "BGP peer-group name\n" |
| 5222 | "Soft reconfig\n" |
| 5223 | "Soft reconfig outbound update\n") |
| 5224 | { |
| 5225 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_group, |
| 5226 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5227 | } |
| 5228 | |
| 5229 | ALIAS (clear_bgp_peer_group_soft_out, |
| 5230 | clear_bgp_ipv6_peer_group_soft_out_cmd, |
| 5231 | "clear bgp ipv6 peer-group WORD soft out", |
| 5232 | CLEAR_STR |
| 5233 | BGP_STR |
| 5234 | "Address family\n" |
| 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 | ALIAS (clear_bgp_peer_group_soft_out, |
| 5241 | clear_bgp_peer_group_out_cmd, |
| 5242 | "clear bgp peer-group WORD out", |
| 5243 | CLEAR_STR |
| 5244 | BGP_STR |
| 5245 | "Clear all members of peer-group\n" |
| 5246 | "BGP peer-group name\n" |
| 5247 | "Soft reconfig outbound update\n") |
| 5248 | |
| 5249 | ALIAS (clear_bgp_peer_group_soft_out, |
| 5250 | clear_bgp_ipv6_peer_group_out_cmd, |
| 5251 | "clear bgp ipv6 peer-group WORD out", |
| 5252 | CLEAR_STR |
| 5253 | BGP_STR |
| 5254 | "Address family\n" |
| 5255 | "Clear all members of peer-group\n" |
| 5256 | "BGP peer-group name\n" |
| 5257 | "Soft reconfig outbound update\n") |
| 5258 | |
| 5259 | DEFUN (clear_ip_bgp_external_soft_out, |
| 5260 | clear_ip_bgp_external_soft_out_cmd, |
| 5261 | "clear ip bgp external soft out", |
| 5262 | CLEAR_STR |
| 5263 | IP_STR |
| 5264 | BGP_STR |
| 5265 | "Clear all external peers\n" |
| 5266 | "Soft reconfig\n" |
| 5267 | "Soft reconfig outbound update\n") |
| 5268 | { |
| 5269 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 5270 | BGP_CLEAR_SOFT_OUT, NULL); |
| 5271 | } |
| 5272 | |
| 5273 | ALIAS (clear_ip_bgp_external_soft_out, |
| 5274 | clear_ip_bgp_external_out_cmd, |
| 5275 | "clear ip bgp external out", |
| 5276 | CLEAR_STR |
| 5277 | IP_STR |
| 5278 | BGP_STR |
| 5279 | "Clear all external peers\n" |
| 5280 | "Soft reconfig outbound update\n") |
| 5281 | |
| 5282 | DEFUN (clear_ip_bgp_external_ipv4_soft_out, |
| 5283 | clear_ip_bgp_external_ipv4_soft_out_cmd, |
| 5284 | "clear ip bgp external ipv4 (unicast|multicast) soft out", |
| 5285 | CLEAR_STR |
| 5286 | IP_STR |
| 5287 | BGP_STR |
| 5288 | "Clear all external peers\n" |
| 5289 | "Address family\n" |
| 5290 | "Address Family modifier\n" |
| 5291 | "Address Family modifier\n" |
| 5292 | "Soft reconfig\n" |
| 5293 | "Soft reconfig outbound update\n") |
| 5294 | { |
| 5295 | if (strncmp (argv[0], "m", 1) == 0) |
| 5296 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external, |
| 5297 | BGP_CLEAR_SOFT_OUT, NULL); |
| 5298 | |
| 5299 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 5300 | BGP_CLEAR_SOFT_OUT, NULL); |
| 5301 | } |
| 5302 | |
| 5303 | ALIAS (clear_ip_bgp_external_ipv4_soft_out, |
| 5304 | clear_ip_bgp_external_ipv4_out_cmd, |
| 5305 | "clear ip bgp external ipv4 (unicast|multicast) out", |
| 5306 | CLEAR_STR |
| 5307 | IP_STR |
| 5308 | BGP_STR |
| 5309 | "Clear all external peers\n" |
| 5310 | "Address family\n" |
| 5311 | "Address Family modifier\n" |
| 5312 | "Address Family modifier\n" |
| 5313 | "Soft reconfig outbound update\n") |
| 5314 | |
| 5315 | DEFUN (clear_bgp_external_soft_out, |
| 5316 | clear_bgp_external_soft_out_cmd, |
| 5317 | "clear bgp external soft out", |
| 5318 | CLEAR_STR |
| 5319 | BGP_STR |
| 5320 | "Clear all external peers\n" |
| 5321 | "Soft reconfig\n" |
| 5322 | "Soft reconfig outbound update\n") |
| 5323 | { |
| 5324 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_external, |
| 5325 | BGP_CLEAR_SOFT_OUT, NULL); |
| 5326 | } |
| 5327 | |
| 5328 | ALIAS (clear_bgp_external_soft_out, |
| 5329 | clear_bgp_ipv6_external_soft_out_cmd, |
| 5330 | "clear bgp ipv6 external soft out", |
| 5331 | CLEAR_STR |
| 5332 | BGP_STR |
| 5333 | "Address family\n" |
| 5334 | "Clear all external peers\n" |
| 5335 | "Soft reconfig\n" |
| 5336 | "Soft reconfig outbound update\n") |
| 5337 | |
| 5338 | ALIAS (clear_bgp_external_soft_out, |
| 5339 | clear_bgp_external_out_cmd, |
| 5340 | "clear bgp external out", |
| 5341 | CLEAR_STR |
| 5342 | BGP_STR |
| 5343 | "Clear all external peers\n" |
| 5344 | "Soft reconfig outbound update\n") |
| 5345 | |
| 5346 | ALIAS (clear_bgp_external_soft_out, |
| 5347 | clear_bgp_ipv6_external_out_cmd, |
| 5348 | "clear bgp ipv6 external WORD out", |
| 5349 | CLEAR_STR |
| 5350 | BGP_STR |
| 5351 | "Address family\n" |
| 5352 | "Clear all external peers\n" |
| 5353 | "Soft reconfig outbound update\n") |
| 5354 | |
| 5355 | DEFUN (clear_ip_bgp_as_soft_out, |
| 5356 | clear_ip_bgp_as_soft_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5357 | "clear ip bgp " CMD_AS_RANGE " soft out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5358 | CLEAR_STR |
| 5359 | IP_STR |
| 5360 | BGP_STR |
| 5361 | "Clear peers with the AS number\n" |
| 5362 | "Soft reconfig\n" |
| 5363 | "Soft reconfig outbound update\n") |
| 5364 | { |
| 5365 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 5366 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5367 | } |
| 5368 | |
| 5369 | ALIAS (clear_ip_bgp_as_soft_out, |
| 5370 | clear_ip_bgp_as_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5371 | "clear ip bgp " CMD_AS_RANGE " out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5372 | CLEAR_STR |
| 5373 | IP_STR |
| 5374 | BGP_STR |
| 5375 | "Clear peers with the AS number\n" |
| 5376 | "Soft reconfig outbound update\n") |
| 5377 | |
| 5378 | DEFUN (clear_ip_bgp_as_ipv4_soft_out, |
| 5379 | clear_ip_bgp_as_ipv4_soft_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5380 | "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) soft out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5381 | CLEAR_STR |
| 5382 | IP_STR |
| 5383 | BGP_STR |
| 5384 | "Clear peers with the AS number\n" |
| 5385 | "Address family\n" |
| 5386 | "Address Family modifier\n" |
| 5387 | "Address Family modifier\n" |
| 5388 | "Soft reconfig\n" |
| 5389 | "Soft reconfig outbound update\n") |
| 5390 | { |
| 5391 | if (strncmp (argv[1], "m", 1) == 0) |
| 5392 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as, |
| 5393 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5394 | |
| 5395 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 5396 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5397 | } |
| 5398 | |
| 5399 | ALIAS (clear_ip_bgp_as_ipv4_soft_out, |
| 5400 | clear_ip_bgp_as_ipv4_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5401 | "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5402 | CLEAR_STR |
| 5403 | IP_STR |
| 5404 | BGP_STR |
| 5405 | "Clear peers with the AS number\n" |
| 5406 | "Address family\n" |
| 5407 | "Address Family modifier\n" |
| 5408 | "Address Family modifier\n" |
| 5409 | "Soft reconfig outbound update\n") |
| 5410 | |
| 5411 | DEFUN (clear_ip_bgp_as_vpnv4_soft_out, |
| 5412 | clear_ip_bgp_as_vpnv4_soft_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5413 | "clear ip bgp " CMD_AS_RANGE " vpnv4 unicast soft out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5414 | CLEAR_STR |
| 5415 | IP_STR |
| 5416 | BGP_STR |
| 5417 | "Clear peers with the AS number\n" |
| 5418 | "Address family\n" |
| 5419 | "Address Family modifier\n" |
| 5420 | "Soft reconfig\n" |
| 5421 | "Soft reconfig outbound update\n") |
| 5422 | { |
| 5423 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_as, |
| 5424 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5425 | } |
| 5426 | |
| 5427 | ALIAS (clear_ip_bgp_as_vpnv4_soft_out, |
| 5428 | clear_ip_bgp_as_vpnv4_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5429 | "clear ip bgp " CMD_AS_RANGE " vpnv4 unicast out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5430 | CLEAR_STR |
| 5431 | IP_STR |
| 5432 | BGP_STR |
| 5433 | "Clear peers with the AS number\n" |
| 5434 | "Address family\n" |
| 5435 | "Address Family modifier\n" |
| 5436 | "Soft reconfig outbound update\n") |
| 5437 | |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 5438 | DEFUN (clear_ip_bgp_as_encap_soft_out, |
| 5439 | clear_ip_bgp_as_encap_soft_out_cmd, |
| 5440 | "clear ip bgp " CMD_AS_RANGE " encap unicast soft out", |
| 5441 | CLEAR_STR |
| 5442 | IP_STR |
| 5443 | BGP_STR |
| 5444 | "Clear peers with the AS number\n" |
| 5445 | "Address family\n" |
| 5446 | "Address Family modifier\n" |
| 5447 | "Soft reconfig\n" |
| 5448 | "Soft reconfig outbound update\n") |
| 5449 | { |
| 5450 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_as, |
| 5451 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5452 | } |
| 5453 | |
| 5454 | ALIAS (clear_ip_bgp_as_encap_soft_out, |
| 5455 | clear_ip_bgp_as_encap_out_cmd, |
| 5456 | "clear ip bgp " CMD_AS_RANGE " encap unicast out", |
| 5457 | CLEAR_STR |
| 5458 | IP_STR |
| 5459 | BGP_STR |
| 5460 | "Clear peers with the AS number\n" |
| 5461 | "Address family\n" |
| 5462 | "Address Family modifier\n" |
| 5463 | "Soft reconfig outbound update\n") |
| 5464 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5465 | DEFUN (clear_bgp_as_soft_out, |
| 5466 | clear_bgp_as_soft_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5467 | "clear bgp " CMD_AS_RANGE " soft out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5468 | CLEAR_STR |
| 5469 | BGP_STR |
| 5470 | "Clear peers with the AS number\n" |
| 5471 | "Soft reconfig\n" |
| 5472 | "Soft reconfig outbound update\n") |
| 5473 | { |
| 5474 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_as, |
| 5475 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 5476 | } |
| 5477 | |
| 5478 | ALIAS (clear_bgp_as_soft_out, |
| 5479 | clear_bgp_ipv6_as_soft_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5480 | "clear bgp ipv6 " CMD_AS_RANGE " soft out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5481 | CLEAR_STR |
| 5482 | BGP_STR |
| 5483 | "Address family\n" |
| 5484 | "Clear peers with the AS number\n" |
| 5485 | "Soft reconfig\n" |
| 5486 | "Soft reconfig outbound update\n") |
| 5487 | |
| 5488 | ALIAS (clear_bgp_as_soft_out, |
| 5489 | clear_bgp_as_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5490 | "clear bgp " CMD_AS_RANGE " out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5491 | CLEAR_STR |
| 5492 | BGP_STR |
| 5493 | "Clear peers with the AS number\n" |
| 5494 | "Soft reconfig outbound update\n") |
| 5495 | |
| 5496 | ALIAS (clear_bgp_as_soft_out, |
| 5497 | clear_bgp_ipv6_as_out_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 5498 | "clear bgp ipv6 " CMD_AS_RANGE " out", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5499 | CLEAR_STR |
| 5500 | BGP_STR |
| 5501 | "Address family\n" |
| 5502 | "Clear peers with the AS number\n" |
| 5503 | "Soft reconfig outbound update\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 5504 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5505 | /* Inbound soft-reconfiguration */ |
| 5506 | DEFUN (clear_ip_bgp_all_soft_in, |
| 5507 | clear_ip_bgp_all_soft_in_cmd, |
| 5508 | "clear ip bgp * soft in", |
| 5509 | CLEAR_STR |
| 5510 | IP_STR |
| 5511 | BGP_STR |
| 5512 | "Clear all peers\n" |
| 5513 | "Soft reconfig\n" |
| 5514 | "Soft reconfig inbound update\n") |
| 5515 | { |
| 5516 | if (argc == 1) |
| 5517 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 5518 | BGP_CLEAR_SOFT_IN, NULL); |
| 5519 | |
| 5520 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 5521 | BGP_CLEAR_SOFT_IN, NULL); |
| 5522 | } |
| 5523 | |
| 5524 | ALIAS (clear_ip_bgp_all_soft_in, |
| 5525 | clear_ip_bgp_instance_all_soft_in_cmd, |
| 5526 | "clear ip bgp view WORD * soft in", |
| 5527 | CLEAR_STR |
| 5528 | IP_STR |
| 5529 | BGP_STR |
| 5530 | "BGP view\n" |
| 5531 | "view name\n" |
| 5532 | "Clear all peers\n" |
| 5533 | "Soft reconfig\n" |
| 5534 | "Soft reconfig inbound update\n") |
| 5535 | |
| 5536 | ALIAS (clear_ip_bgp_all_soft_in, |
| 5537 | clear_ip_bgp_all_in_cmd, |
| 5538 | "clear ip bgp * in", |
| 5539 | CLEAR_STR |
| 5540 | IP_STR |
| 5541 | BGP_STR |
| 5542 | "Clear all peers\n" |
| 5543 | "Soft reconfig inbound update\n") |
| 5544 | |
| 5545 | DEFUN (clear_ip_bgp_all_in_prefix_filter, |
| 5546 | clear_ip_bgp_all_in_prefix_filter_cmd, |
| 5547 | "clear ip bgp * in prefix-filter", |
| 5548 | CLEAR_STR |
| 5549 | IP_STR |
| 5550 | BGP_STR |
| 5551 | "Clear all peers\n" |
| 5552 | "Soft reconfig inbound update\n" |
| 5553 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5554 | { |
| 5555 | if (argc== 1) |
| 5556 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 5557 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5558 | |
| 5559 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 5560 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5561 | } |
| 5562 | |
| 5563 | ALIAS (clear_ip_bgp_all_in_prefix_filter, |
| 5564 | clear_ip_bgp_instance_all_in_prefix_filter_cmd, |
| 5565 | "clear ip bgp view WORD * in prefix-filter", |
| 5566 | CLEAR_STR |
| 5567 | IP_STR |
| 5568 | BGP_STR |
| 5569 | "BGP view\n" |
| 5570 | "view name\n" |
| 5571 | "Clear all peers\n" |
| 5572 | "Soft reconfig inbound update\n" |
| 5573 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5574 | |
| 5575 | |
| 5576 | DEFUN (clear_ip_bgp_all_ipv4_soft_in, |
| 5577 | clear_ip_bgp_all_ipv4_soft_in_cmd, |
| 5578 | "clear ip bgp * ipv4 (unicast|multicast) soft in", |
| 5579 | CLEAR_STR |
| 5580 | IP_STR |
| 5581 | BGP_STR |
| 5582 | "Clear all peers\n" |
| 5583 | "Address family\n" |
| 5584 | "Address Family modifier\n" |
| 5585 | "Address Family modifier\n" |
| 5586 | "Soft reconfig\n" |
| 5587 | "Soft reconfig inbound update\n") |
| 5588 | { |
| 5589 | if (strncmp (argv[0], "m", 1) == 0) |
| 5590 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all, |
| 5591 | BGP_CLEAR_SOFT_IN, NULL); |
| 5592 | |
| 5593 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 5594 | BGP_CLEAR_SOFT_IN, NULL); |
| 5595 | } |
| 5596 | |
| 5597 | ALIAS (clear_ip_bgp_all_ipv4_soft_in, |
| 5598 | clear_ip_bgp_all_ipv4_in_cmd, |
| 5599 | "clear ip bgp * ipv4 (unicast|multicast) in", |
| 5600 | CLEAR_STR |
| 5601 | IP_STR |
| 5602 | BGP_STR |
| 5603 | "Clear all peers\n" |
| 5604 | "Address family\n" |
| 5605 | "Address Family modifier\n" |
| 5606 | "Address Family modifier\n" |
| 5607 | "Soft reconfig inbound update\n") |
| 5608 | |
| 5609 | DEFUN (clear_ip_bgp_instance_all_ipv4_soft_in, |
| 5610 | clear_ip_bgp_instance_all_ipv4_soft_in_cmd, |
| 5611 | "clear ip bgp view WORD * ipv4 (unicast|multicast) soft in", |
| 5612 | CLEAR_STR |
| 5613 | IP_STR |
| 5614 | BGP_STR |
| 5615 | "BGP view\n" |
| 5616 | "view name\n" |
| 5617 | "Clear all peers\n" |
| 5618 | "Address family\n" |
| 5619 | "Address Family modifier\n" |
| 5620 | "Address Family modifier\n" |
| 5621 | "Soft reconfig\n" |
| 5622 | "Soft reconfig inbound update\n") |
| 5623 | { |
| 5624 | if (strncmp (argv[1], "m", 1) == 0) |
| 5625 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST, clear_all, |
| 5626 | BGP_CLEAR_SOFT_IN, NULL); |
| 5627 | |
| 5628 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 5629 | BGP_CLEAR_SOFT_IN, NULL); |
| 5630 | } |
| 5631 | |
| 5632 | DEFUN (clear_ip_bgp_all_ipv4_in_prefix_filter, |
| 5633 | clear_ip_bgp_all_ipv4_in_prefix_filter_cmd, |
| 5634 | "clear ip bgp * ipv4 (unicast|multicast) in prefix-filter", |
| 5635 | CLEAR_STR |
| 5636 | IP_STR |
| 5637 | BGP_STR |
| 5638 | "Clear all peers\n" |
| 5639 | "Address family\n" |
| 5640 | "Address Family modifier\n" |
| 5641 | "Address Family modifier\n" |
| 5642 | "Soft reconfig inbound update\n" |
| 5643 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5644 | { |
| 5645 | if (strncmp (argv[0], "m", 1) == 0) |
| 5646 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all, |
| 5647 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5648 | |
| 5649 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 5650 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5651 | } |
| 5652 | |
| 5653 | DEFUN (clear_ip_bgp_instance_all_ipv4_in_prefix_filter, |
| 5654 | clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd, |
| 5655 | "clear ip bgp view WORD * ipv4 (unicast|multicast) in prefix-filter", |
| 5656 | CLEAR_STR |
| 5657 | IP_STR |
| 5658 | BGP_STR |
| 5659 | "Clear all peers\n" |
| 5660 | "Address family\n" |
| 5661 | "Address Family modifier\n" |
| 5662 | "Address Family modifier\n" |
| 5663 | "Soft reconfig inbound update\n" |
| 5664 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5665 | { |
| 5666 | if (strncmp (argv[1], "m", 1) == 0) |
| 5667 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST, clear_all, |
| 5668 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5669 | |
| 5670 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 5671 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5672 | } |
| 5673 | |
| 5674 | DEFUN (clear_ip_bgp_all_vpnv4_soft_in, |
| 5675 | clear_ip_bgp_all_vpnv4_soft_in_cmd, |
| 5676 | "clear ip bgp * vpnv4 unicast soft in", |
| 5677 | CLEAR_STR |
| 5678 | IP_STR |
| 5679 | BGP_STR |
| 5680 | "Clear all peers\n" |
| 5681 | "Address family\n" |
| 5682 | "Address Family Modifier\n" |
| 5683 | "Soft reconfig\n" |
| 5684 | "Soft reconfig inbound update\n") |
| 5685 | { |
| 5686 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_all, |
| 5687 | BGP_CLEAR_SOFT_IN, NULL); |
| 5688 | } |
| 5689 | |
| 5690 | ALIAS (clear_ip_bgp_all_vpnv4_soft_in, |
| 5691 | clear_ip_bgp_all_vpnv4_in_cmd, |
| 5692 | "clear ip bgp * vpnv4 unicast in", |
| 5693 | CLEAR_STR |
| 5694 | IP_STR |
| 5695 | BGP_STR |
| 5696 | "Clear all peers\n" |
| 5697 | "Address family\n" |
| 5698 | "Address Family Modifier\n" |
| 5699 | "Soft reconfig inbound update\n") |
| 5700 | |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 5701 | DEFUN (clear_ip_bgp_all_encap_soft_in, |
| 5702 | clear_ip_bgp_all_encap_soft_in_cmd, |
| 5703 | "clear ip bgp * encap unicast soft in", |
| 5704 | CLEAR_STR |
| 5705 | IP_STR |
| 5706 | BGP_STR |
| 5707 | "Clear all peers\n" |
| 5708 | "Address family\n" |
| 5709 | "Address Family Modifier\n" |
| 5710 | "Soft reconfig\n" |
| 5711 | "Soft reconfig inbound update\n") |
| 5712 | { |
| 5713 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_all, |
| 5714 | BGP_CLEAR_SOFT_IN, NULL); |
| 5715 | } |
| 5716 | |
| 5717 | ALIAS (clear_ip_bgp_all_encap_soft_in, |
| 5718 | clear_ip_bgp_all_encap_in_cmd, |
| 5719 | "clear ip bgp * encap unicast in", |
| 5720 | CLEAR_STR |
| 5721 | IP_STR |
| 5722 | BGP_STR |
| 5723 | "Clear all peers\n" |
| 5724 | "Address family\n" |
| 5725 | "Address Family Modifier\n" |
| 5726 | "Soft reconfig inbound update\n") |
| 5727 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5728 | DEFUN (clear_bgp_all_soft_in, |
| 5729 | clear_bgp_all_soft_in_cmd, |
| 5730 | "clear bgp * soft in", |
| 5731 | CLEAR_STR |
| 5732 | BGP_STR |
| 5733 | "Clear all peers\n" |
| 5734 | "Soft reconfig\n" |
| 5735 | "Soft reconfig inbound update\n") |
| 5736 | { |
| 5737 | if (argc == 1) |
| 5738 | return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_all, |
| 5739 | BGP_CLEAR_SOFT_IN, NULL); |
| 5740 | |
| 5741 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all, |
| 5742 | BGP_CLEAR_SOFT_IN, NULL); |
| 5743 | } |
| 5744 | |
| 5745 | ALIAS (clear_bgp_all_soft_in, |
| 5746 | clear_bgp_instance_all_soft_in_cmd, |
| 5747 | "clear bgp view WORD * soft in", |
| 5748 | CLEAR_STR |
| 5749 | BGP_STR |
| 5750 | "BGP view\n" |
| 5751 | "view name\n" |
| 5752 | "Clear all peers\n" |
| 5753 | "Soft reconfig\n" |
| 5754 | "Soft reconfig inbound update\n") |
| 5755 | |
| 5756 | ALIAS (clear_bgp_all_soft_in, |
| 5757 | clear_bgp_ipv6_all_soft_in_cmd, |
| 5758 | "clear bgp ipv6 * soft in", |
| 5759 | CLEAR_STR |
| 5760 | BGP_STR |
| 5761 | "Address family\n" |
| 5762 | "Clear all peers\n" |
| 5763 | "Soft reconfig\n" |
| 5764 | "Soft reconfig inbound update\n") |
| 5765 | |
| 5766 | ALIAS (clear_bgp_all_soft_in, |
| 5767 | clear_bgp_all_in_cmd, |
| 5768 | "clear bgp * in", |
| 5769 | CLEAR_STR |
| 5770 | BGP_STR |
| 5771 | "Clear all peers\n" |
| 5772 | "Soft reconfig inbound update\n") |
| 5773 | |
| 5774 | ALIAS (clear_bgp_all_soft_in, |
| 5775 | clear_bgp_ipv6_all_in_cmd, |
| 5776 | "clear bgp ipv6 * in", |
| 5777 | CLEAR_STR |
| 5778 | BGP_STR |
| 5779 | "Address family\n" |
| 5780 | "Clear all peers\n" |
| 5781 | "Soft reconfig inbound update\n") |
| 5782 | |
| 5783 | DEFUN (clear_bgp_all_in_prefix_filter, |
| 5784 | clear_bgp_all_in_prefix_filter_cmd, |
| 5785 | "clear bgp * in prefix-filter", |
| 5786 | CLEAR_STR |
| 5787 | BGP_STR |
| 5788 | "Clear all peers\n" |
| 5789 | "Soft reconfig inbound update\n" |
| 5790 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5791 | { |
| 5792 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all, |
| 5793 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5794 | } |
| 5795 | |
| 5796 | ALIAS (clear_bgp_all_in_prefix_filter, |
| 5797 | clear_bgp_ipv6_all_in_prefix_filter_cmd, |
| 5798 | "clear bgp ipv6 * in prefix-filter", |
| 5799 | CLEAR_STR |
| 5800 | BGP_STR |
| 5801 | "Address family\n" |
| 5802 | "Clear all peers\n" |
| 5803 | "Soft reconfig inbound update\n" |
| 5804 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5805 | |
| 5806 | DEFUN (clear_ip_bgp_peer_soft_in, |
| 5807 | clear_ip_bgp_peer_soft_in_cmd, |
| 5808 | "clear ip bgp A.B.C.D soft in", |
| 5809 | CLEAR_STR |
| 5810 | IP_STR |
| 5811 | BGP_STR |
| 5812 | "BGP neighbor address to clear\n" |
| 5813 | "Soft reconfig\n" |
| 5814 | "Soft reconfig inbound update\n") |
| 5815 | { |
| 5816 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 5817 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5818 | } |
| 5819 | |
| 5820 | ALIAS (clear_ip_bgp_peer_soft_in, |
| 5821 | clear_ip_bgp_peer_in_cmd, |
| 5822 | "clear ip bgp A.B.C.D in", |
| 5823 | CLEAR_STR |
| 5824 | IP_STR |
| 5825 | BGP_STR |
| 5826 | "BGP neighbor address to clear\n" |
| 5827 | "Soft reconfig inbound update\n") |
| 5828 | |
| 5829 | DEFUN (clear_ip_bgp_peer_in_prefix_filter, |
| 5830 | clear_ip_bgp_peer_in_prefix_filter_cmd, |
| 5831 | "clear ip bgp A.B.C.D in prefix-filter", |
| 5832 | CLEAR_STR |
| 5833 | IP_STR |
| 5834 | BGP_STR |
| 5835 | "BGP neighbor address to clear\n" |
| 5836 | "Soft reconfig inbound update\n" |
| 5837 | "Push out the existing ORF prefix-list\n") |
| 5838 | { |
| 5839 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 5840 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 5841 | } |
| 5842 | |
| 5843 | DEFUN (clear_ip_bgp_peer_ipv4_soft_in, |
| 5844 | clear_ip_bgp_peer_ipv4_soft_in_cmd, |
| 5845 | "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft in", |
| 5846 | CLEAR_STR |
| 5847 | IP_STR |
| 5848 | BGP_STR |
| 5849 | "BGP neighbor address to clear\n" |
| 5850 | "Address family\n" |
| 5851 | "Address Family modifier\n" |
| 5852 | "Address Family modifier\n" |
| 5853 | "Soft reconfig\n" |
| 5854 | "Soft reconfig inbound update\n") |
| 5855 | { |
| 5856 | if (strncmp (argv[1], "m", 1) == 0) |
| 5857 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer, |
| 5858 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5859 | |
| 5860 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 5861 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5862 | } |
| 5863 | |
| 5864 | ALIAS (clear_ip_bgp_peer_ipv4_soft_in, |
| 5865 | clear_ip_bgp_peer_ipv4_in_cmd, |
| 5866 | "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in", |
| 5867 | CLEAR_STR |
| 5868 | IP_STR |
| 5869 | BGP_STR |
| 5870 | "BGP neighbor address to clear\n" |
| 5871 | "Address family\n" |
| 5872 | "Address Family modifier\n" |
| 5873 | "Address Family modifier\n" |
| 5874 | "Soft reconfig inbound update\n") |
| 5875 | |
| 5876 | DEFUN (clear_ip_bgp_peer_ipv4_in_prefix_filter, |
| 5877 | clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd, |
| 5878 | "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in prefix-filter", |
| 5879 | CLEAR_STR |
| 5880 | IP_STR |
| 5881 | BGP_STR |
| 5882 | "BGP neighbor address to clear\n" |
| 5883 | "Address family\n" |
| 5884 | "Address Family modifier\n" |
| 5885 | "Address Family modifier\n" |
| 5886 | "Soft reconfig inbound update\n" |
| 5887 | "Push out the existing ORF prefix-list\n") |
| 5888 | { |
| 5889 | if (strncmp (argv[1], "m", 1) == 0) |
| 5890 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer, |
| 5891 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 5892 | |
| 5893 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 5894 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 5895 | } |
| 5896 | |
| 5897 | DEFUN (clear_ip_bgp_peer_vpnv4_soft_in, |
| 5898 | clear_ip_bgp_peer_vpnv4_soft_in_cmd, |
| 5899 | "clear ip bgp A.B.C.D vpnv4 unicast soft in", |
| 5900 | CLEAR_STR |
| 5901 | IP_STR |
| 5902 | BGP_STR |
| 5903 | "BGP neighbor address to clear\n" |
| 5904 | "Address family\n" |
| 5905 | "Address Family Modifier\n" |
| 5906 | "Soft reconfig\n" |
| 5907 | "Soft reconfig inbound update\n") |
| 5908 | { |
| 5909 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_peer, |
| 5910 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5911 | } |
| 5912 | |
| 5913 | ALIAS (clear_ip_bgp_peer_vpnv4_soft_in, |
| 5914 | clear_ip_bgp_peer_vpnv4_in_cmd, |
| 5915 | "clear ip bgp A.B.C.D vpnv4 unicast in", |
| 5916 | CLEAR_STR |
| 5917 | IP_STR |
| 5918 | BGP_STR |
| 5919 | "BGP neighbor address to clear\n" |
| 5920 | "Address family\n" |
| 5921 | "Address Family Modifier\n" |
| 5922 | "Soft reconfig inbound update\n") |
| 5923 | |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 5924 | DEFUN (clear_ip_bgp_peer_encap_soft_in, |
| 5925 | clear_ip_bgp_peer_encap_soft_in_cmd, |
| 5926 | "clear ip bgp A.B.C.D encap unicast soft in", |
| 5927 | CLEAR_STR |
| 5928 | IP_STR |
| 5929 | BGP_STR |
| 5930 | "BGP neighbor address to clear\n" |
| 5931 | "Address family\n" |
| 5932 | "Address Family Modifier\n" |
| 5933 | "Soft reconfig\n" |
| 5934 | "Soft reconfig inbound update\n") |
| 5935 | { |
| 5936 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_peer, |
| 5937 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5938 | } |
| 5939 | |
| 5940 | ALIAS (clear_ip_bgp_peer_encap_soft_in, |
| 5941 | clear_ip_bgp_peer_encap_in_cmd, |
| 5942 | "clear ip bgp A.B.C.D encap unicast in", |
| 5943 | CLEAR_STR |
| 5944 | IP_STR |
| 5945 | BGP_STR |
| 5946 | "BGP neighbor address to clear\n" |
| 5947 | "Address family\n" |
| 5948 | "Address Family Modifier\n" |
| 5949 | "Soft reconfig inbound update\n") |
| 5950 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 5951 | DEFUN (clear_bgp_peer_soft_in, |
| 5952 | clear_bgp_peer_soft_in_cmd, |
| 5953 | "clear bgp (A.B.C.D|X:X::X:X) soft in", |
| 5954 | CLEAR_STR |
| 5955 | BGP_STR |
| 5956 | "BGP neighbor address to clear\n" |
| 5957 | "BGP IPv6 neighbor to clear\n" |
| 5958 | "Soft reconfig\n" |
| 5959 | "Soft reconfig inbound update\n") |
| 5960 | { |
| 5961 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer, |
| 5962 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5963 | } |
| 5964 | |
| 5965 | ALIAS (clear_bgp_peer_soft_in, |
| 5966 | clear_bgp_ipv6_peer_soft_in_cmd, |
| 5967 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft in", |
| 5968 | CLEAR_STR |
| 5969 | BGP_STR |
| 5970 | "Address family\n" |
| 5971 | "BGP neighbor address to clear\n" |
| 5972 | "BGP IPv6 neighbor to clear\n" |
| 5973 | "Soft reconfig\n" |
| 5974 | "Soft reconfig inbound update\n") |
| 5975 | |
| 5976 | ALIAS (clear_bgp_peer_soft_in, |
| 5977 | clear_bgp_peer_in_cmd, |
| 5978 | "clear bgp (A.B.C.D|X:X::X:X) in", |
| 5979 | CLEAR_STR |
| 5980 | BGP_STR |
| 5981 | "BGP neighbor address to clear\n" |
| 5982 | "BGP IPv6 neighbor to clear\n" |
| 5983 | "Soft reconfig inbound update\n") |
| 5984 | |
| 5985 | ALIAS (clear_bgp_peer_soft_in, |
| 5986 | clear_bgp_ipv6_peer_in_cmd, |
| 5987 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) in", |
| 5988 | CLEAR_STR |
| 5989 | BGP_STR |
| 5990 | "Address family\n" |
| 5991 | "BGP neighbor address to clear\n" |
| 5992 | "BGP IPv6 neighbor to clear\n" |
| 5993 | "Soft reconfig inbound update\n") |
| 5994 | |
| 5995 | DEFUN (clear_bgp_peer_in_prefix_filter, |
| 5996 | clear_bgp_peer_in_prefix_filter_cmd, |
| 5997 | "clear bgp (A.B.C.D|X:X::X:X) in prefix-filter", |
| 5998 | CLEAR_STR |
| 5999 | BGP_STR |
| 6000 | "BGP neighbor address to clear\n" |
| 6001 | "BGP IPv6 neighbor to clear\n" |
| 6002 | "Soft reconfig inbound update\n" |
| 6003 | "Push out the existing ORF prefix-list\n") |
| 6004 | { |
| 6005 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer, |
| 6006 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 6007 | } |
| 6008 | |
| 6009 | ALIAS (clear_bgp_peer_in_prefix_filter, |
| 6010 | clear_bgp_ipv6_peer_in_prefix_filter_cmd, |
| 6011 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) in prefix-filter", |
| 6012 | CLEAR_STR |
| 6013 | BGP_STR |
| 6014 | "Address family\n" |
| 6015 | "BGP neighbor address to clear\n" |
| 6016 | "BGP IPv6 neighbor to clear\n" |
| 6017 | "Soft reconfig inbound update\n" |
| 6018 | "Push out the existing ORF prefix-list\n") |
| 6019 | |
| 6020 | DEFUN (clear_ip_bgp_peer_group_soft_in, |
| 6021 | clear_ip_bgp_peer_group_soft_in_cmd, |
| 6022 | "clear ip bgp peer-group WORD soft in", |
| 6023 | CLEAR_STR |
| 6024 | IP_STR |
| 6025 | BGP_STR |
| 6026 | "Clear all members of peer-group\n" |
| 6027 | "BGP peer-group name\n" |
| 6028 | "Soft reconfig\n" |
| 6029 | "Soft reconfig inbound update\n") |
| 6030 | { |
| 6031 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 6032 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6033 | } |
| 6034 | |
| 6035 | ALIAS (clear_ip_bgp_peer_group_soft_in, |
| 6036 | clear_ip_bgp_peer_group_in_cmd, |
| 6037 | "clear ip bgp peer-group WORD in", |
| 6038 | CLEAR_STR |
| 6039 | IP_STR |
| 6040 | BGP_STR |
| 6041 | "Clear all members of peer-group\n" |
| 6042 | "BGP peer-group name\n" |
| 6043 | "Soft reconfig inbound update\n") |
| 6044 | |
| 6045 | DEFUN (clear_ip_bgp_peer_group_in_prefix_filter, |
| 6046 | clear_ip_bgp_peer_group_in_prefix_filter_cmd, |
| 6047 | "clear ip bgp peer-group WORD in prefix-filter", |
| 6048 | CLEAR_STR |
| 6049 | IP_STR |
| 6050 | BGP_STR |
| 6051 | "Clear all members of peer-group\n" |
| 6052 | "BGP peer-group name\n" |
| 6053 | "Soft reconfig inbound update\n" |
| 6054 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6055 | { |
| 6056 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 6057 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 6058 | } |
| 6059 | |
| 6060 | DEFUN (clear_ip_bgp_peer_group_ipv4_soft_in, |
| 6061 | clear_ip_bgp_peer_group_ipv4_soft_in_cmd, |
| 6062 | "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft in", |
| 6063 | CLEAR_STR |
| 6064 | IP_STR |
| 6065 | BGP_STR |
| 6066 | "Clear all members of peer-group\n" |
| 6067 | "BGP peer-group name\n" |
| 6068 | "Address family\n" |
| 6069 | "Address Family modifier\n" |
| 6070 | "Address Family modifier\n" |
| 6071 | "Soft reconfig\n" |
| 6072 | "Soft reconfig inbound update\n") |
| 6073 | { |
| 6074 | if (strncmp (argv[1], "m", 1) == 0) |
| 6075 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group, |
| 6076 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6077 | |
| 6078 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 6079 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6080 | } |
| 6081 | |
| 6082 | ALIAS (clear_ip_bgp_peer_group_ipv4_soft_in, |
| 6083 | clear_ip_bgp_peer_group_ipv4_in_cmd, |
| 6084 | "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in", |
| 6085 | CLEAR_STR |
| 6086 | IP_STR |
| 6087 | BGP_STR |
| 6088 | "Clear all members of peer-group\n" |
| 6089 | "BGP peer-group name\n" |
| 6090 | "Address family\n" |
| 6091 | "Address Family modifier\n" |
| 6092 | "Address Family modifier\n" |
| 6093 | "Soft reconfig inbound update\n") |
| 6094 | |
| 6095 | DEFUN (clear_ip_bgp_peer_group_ipv4_in_prefix_filter, |
| 6096 | clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd, |
| 6097 | "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in prefix-filter", |
| 6098 | CLEAR_STR |
| 6099 | IP_STR |
| 6100 | BGP_STR |
| 6101 | "Clear all members of peer-group\n" |
| 6102 | "BGP peer-group name\n" |
| 6103 | "Address family\n" |
| 6104 | "Address Family modifier\n" |
| 6105 | "Address Family modifier\n" |
| 6106 | "Soft reconfig inbound update\n" |
| 6107 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6108 | { |
| 6109 | if (strncmp (argv[1], "m", 1) == 0) |
| 6110 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group, |
| 6111 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 6112 | |
| 6113 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 6114 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 6115 | } |
| 6116 | |
| 6117 | DEFUN (clear_bgp_peer_group_soft_in, |
| 6118 | clear_bgp_peer_group_soft_in_cmd, |
| 6119 | "clear bgp peer-group WORD soft in", |
| 6120 | CLEAR_STR |
| 6121 | BGP_STR |
| 6122 | "Clear all members of peer-group\n" |
| 6123 | "BGP peer-group name\n" |
| 6124 | "Soft reconfig\n" |
| 6125 | "Soft reconfig inbound update\n") |
| 6126 | { |
| 6127 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_group, |
| 6128 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6129 | } |
| 6130 | |
| 6131 | ALIAS (clear_bgp_peer_group_soft_in, |
| 6132 | clear_bgp_ipv6_peer_group_soft_in_cmd, |
| 6133 | "clear bgp ipv6 peer-group WORD soft in", |
| 6134 | CLEAR_STR |
| 6135 | BGP_STR |
| 6136 | "Address family\n" |
| 6137 | "Clear all members of peer-group\n" |
| 6138 | "BGP peer-group name\n" |
| 6139 | "Soft reconfig\n" |
| 6140 | "Soft reconfig inbound update\n") |
| 6141 | |
| 6142 | ALIAS (clear_bgp_peer_group_soft_in, |
| 6143 | clear_bgp_peer_group_in_cmd, |
| 6144 | "clear bgp peer-group WORD in", |
| 6145 | CLEAR_STR |
| 6146 | BGP_STR |
| 6147 | "Clear all members of peer-group\n" |
| 6148 | "BGP peer-group name\n" |
| 6149 | "Soft reconfig inbound update\n") |
| 6150 | |
| 6151 | ALIAS (clear_bgp_peer_group_soft_in, |
| 6152 | clear_bgp_ipv6_peer_group_in_cmd, |
| 6153 | "clear bgp ipv6 peer-group WORD in", |
| 6154 | CLEAR_STR |
| 6155 | BGP_STR |
| 6156 | "Address family\n" |
| 6157 | "Clear all members of peer-group\n" |
| 6158 | "BGP peer-group name\n" |
| 6159 | "Soft reconfig inbound update\n") |
| 6160 | |
| 6161 | DEFUN (clear_bgp_peer_group_in_prefix_filter, |
| 6162 | clear_bgp_peer_group_in_prefix_filter_cmd, |
| 6163 | "clear bgp peer-group WORD in prefix-filter", |
| 6164 | CLEAR_STR |
| 6165 | BGP_STR |
| 6166 | "Clear all members of peer-group\n" |
| 6167 | "BGP peer-group name\n" |
| 6168 | "Soft reconfig inbound update\n" |
| 6169 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6170 | { |
| 6171 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_group, |
| 6172 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 6173 | } |
| 6174 | |
| 6175 | ALIAS (clear_bgp_peer_group_in_prefix_filter, |
| 6176 | clear_bgp_ipv6_peer_group_in_prefix_filter_cmd, |
| 6177 | "clear bgp ipv6 peer-group WORD in prefix-filter", |
| 6178 | CLEAR_STR |
| 6179 | BGP_STR |
| 6180 | "Address family\n" |
| 6181 | "Clear all members of peer-group\n" |
| 6182 | "BGP peer-group name\n" |
| 6183 | "Soft reconfig inbound update\n" |
| 6184 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6185 | |
| 6186 | DEFUN (clear_ip_bgp_external_soft_in, |
| 6187 | clear_ip_bgp_external_soft_in_cmd, |
| 6188 | "clear ip bgp external soft in", |
| 6189 | CLEAR_STR |
| 6190 | IP_STR |
| 6191 | BGP_STR |
| 6192 | "Clear all external peers\n" |
| 6193 | "Soft reconfig\n" |
| 6194 | "Soft reconfig inbound update\n") |
| 6195 | { |
| 6196 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 6197 | BGP_CLEAR_SOFT_IN, NULL); |
| 6198 | } |
| 6199 | |
| 6200 | ALIAS (clear_ip_bgp_external_soft_in, |
| 6201 | clear_ip_bgp_external_in_cmd, |
| 6202 | "clear ip bgp external in", |
| 6203 | CLEAR_STR |
| 6204 | IP_STR |
| 6205 | BGP_STR |
| 6206 | "Clear all external peers\n" |
| 6207 | "Soft reconfig inbound update\n") |
| 6208 | |
| 6209 | DEFUN (clear_ip_bgp_external_in_prefix_filter, |
| 6210 | clear_ip_bgp_external_in_prefix_filter_cmd, |
| 6211 | "clear ip bgp external in prefix-filter", |
| 6212 | CLEAR_STR |
| 6213 | IP_STR |
| 6214 | BGP_STR |
| 6215 | "Clear all external peers\n" |
| 6216 | "Soft reconfig inbound update\n" |
| 6217 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6218 | { |
| 6219 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 6220 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 6221 | } |
| 6222 | |
| 6223 | DEFUN (clear_ip_bgp_external_ipv4_soft_in, |
| 6224 | clear_ip_bgp_external_ipv4_soft_in_cmd, |
| 6225 | "clear ip bgp external ipv4 (unicast|multicast) soft in", |
| 6226 | CLEAR_STR |
| 6227 | IP_STR |
| 6228 | BGP_STR |
| 6229 | "Clear all external peers\n" |
| 6230 | "Address family\n" |
| 6231 | "Address Family modifier\n" |
| 6232 | "Address Family modifier\n" |
| 6233 | "Soft reconfig\n" |
| 6234 | "Soft reconfig inbound update\n") |
| 6235 | { |
| 6236 | if (strncmp (argv[0], "m", 1) == 0) |
| 6237 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external, |
| 6238 | BGP_CLEAR_SOFT_IN, NULL); |
| 6239 | |
| 6240 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 6241 | BGP_CLEAR_SOFT_IN, NULL); |
| 6242 | } |
| 6243 | |
| 6244 | ALIAS (clear_ip_bgp_external_ipv4_soft_in, |
| 6245 | clear_ip_bgp_external_ipv4_in_cmd, |
| 6246 | "clear ip bgp external ipv4 (unicast|multicast) in", |
| 6247 | CLEAR_STR |
| 6248 | IP_STR |
| 6249 | BGP_STR |
| 6250 | "Clear all external peers\n" |
| 6251 | "Address family\n" |
| 6252 | "Address Family modifier\n" |
| 6253 | "Address Family modifier\n" |
| 6254 | "Soft reconfig inbound update\n") |
| 6255 | |
| 6256 | DEFUN (clear_ip_bgp_external_ipv4_in_prefix_filter, |
| 6257 | clear_ip_bgp_external_ipv4_in_prefix_filter_cmd, |
| 6258 | "clear ip bgp external ipv4 (unicast|multicast) in prefix-filter", |
| 6259 | CLEAR_STR |
| 6260 | IP_STR |
| 6261 | BGP_STR |
| 6262 | "Clear all external peers\n" |
| 6263 | "Address family\n" |
| 6264 | "Address Family modifier\n" |
| 6265 | "Address Family modifier\n" |
| 6266 | "Soft reconfig inbound update\n" |
| 6267 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6268 | { |
| 6269 | if (strncmp (argv[0], "m", 1) == 0) |
| 6270 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external, |
| 6271 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 6272 | |
| 6273 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 6274 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 6275 | } |
| 6276 | |
| 6277 | DEFUN (clear_bgp_external_soft_in, |
| 6278 | clear_bgp_external_soft_in_cmd, |
| 6279 | "clear bgp external soft in", |
| 6280 | CLEAR_STR |
| 6281 | BGP_STR |
| 6282 | "Clear all external peers\n" |
| 6283 | "Soft reconfig\n" |
| 6284 | "Soft reconfig inbound update\n") |
| 6285 | { |
| 6286 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_external, |
| 6287 | BGP_CLEAR_SOFT_IN, NULL); |
| 6288 | } |
| 6289 | |
| 6290 | ALIAS (clear_bgp_external_soft_in, |
| 6291 | clear_bgp_ipv6_external_soft_in_cmd, |
| 6292 | "clear bgp ipv6 external soft in", |
| 6293 | CLEAR_STR |
| 6294 | BGP_STR |
| 6295 | "Address family\n" |
| 6296 | "Clear all external peers\n" |
| 6297 | "Soft reconfig\n" |
| 6298 | "Soft reconfig inbound update\n") |
| 6299 | |
| 6300 | ALIAS (clear_bgp_external_soft_in, |
| 6301 | clear_bgp_external_in_cmd, |
| 6302 | "clear bgp external in", |
| 6303 | CLEAR_STR |
| 6304 | BGP_STR |
| 6305 | "Clear all external peers\n" |
| 6306 | "Soft reconfig inbound update\n") |
| 6307 | |
| 6308 | ALIAS (clear_bgp_external_soft_in, |
| 6309 | clear_bgp_ipv6_external_in_cmd, |
| 6310 | "clear bgp ipv6 external WORD in", |
| 6311 | CLEAR_STR |
| 6312 | BGP_STR |
| 6313 | "Address family\n" |
| 6314 | "Clear all external peers\n" |
| 6315 | "Soft reconfig inbound update\n") |
| 6316 | |
| 6317 | DEFUN (clear_bgp_external_in_prefix_filter, |
| 6318 | clear_bgp_external_in_prefix_filter_cmd, |
| 6319 | "clear bgp external in prefix-filter", |
| 6320 | CLEAR_STR |
| 6321 | BGP_STR |
| 6322 | "Clear all external peers\n" |
| 6323 | "Soft reconfig inbound update\n" |
| 6324 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6325 | { |
| 6326 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_external, |
| 6327 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 6328 | } |
| 6329 | |
| 6330 | ALIAS (clear_bgp_external_in_prefix_filter, |
| 6331 | clear_bgp_ipv6_external_in_prefix_filter_cmd, |
| 6332 | "clear bgp ipv6 external in prefix-filter", |
| 6333 | CLEAR_STR |
| 6334 | BGP_STR |
| 6335 | "Address family\n" |
| 6336 | "Clear all external peers\n" |
| 6337 | "Soft reconfig inbound update\n" |
| 6338 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6339 | |
| 6340 | DEFUN (clear_ip_bgp_as_soft_in, |
| 6341 | clear_ip_bgp_as_soft_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6342 | "clear ip bgp " CMD_AS_RANGE " soft in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6343 | CLEAR_STR |
| 6344 | IP_STR |
| 6345 | BGP_STR |
| 6346 | "Clear peers with the AS number\n" |
| 6347 | "Soft reconfig\n" |
| 6348 | "Soft reconfig inbound update\n") |
| 6349 | { |
| 6350 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 6351 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6352 | } |
| 6353 | |
| 6354 | ALIAS (clear_ip_bgp_as_soft_in, |
| 6355 | clear_ip_bgp_as_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6356 | "clear ip bgp " CMD_AS_RANGE " in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6357 | CLEAR_STR |
| 6358 | IP_STR |
| 6359 | BGP_STR |
| 6360 | "Clear peers with the AS number\n" |
| 6361 | "Soft reconfig inbound update\n") |
| 6362 | |
| 6363 | DEFUN (clear_ip_bgp_as_in_prefix_filter, |
| 6364 | clear_ip_bgp_as_in_prefix_filter_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6365 | "clear ip bgp " CMD_AS_RANGE " in prefix-filter", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6366 | CLEAR_STR |
| 6367 | IP_STR |
| 6368 | BGP_STR |
| 6369 | "Clear peers with the AS number\n" |
| 6370 | "Soft reconfig inbound update\n" |
| 6371 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6372 | { |
| 6373 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 6374 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 6375 | } |
| 6376 | |
| 6377 | DEFUN (clear_ip_bgp_as_ipv4_soft_in, |
| 6378 | clear_ip_bgp_as_ipv4_soft_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6379 | "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) soft in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6380 | CLEAR_STR |
| 6381 | IP_STR |
| 6382 | BGP_STR |
| 6383 | "Clear peers with the AS number\n" |
| 6384 | "Address family\n" |
| 6385 | "Address Family modifier\n" |
| 6386 | "Address Family modifier\n" |
| 6387 | "Soft reconfig\n" |
| 6388 | "Soft reconfig inbound update\n") |
| 6389 | { |
| 6390 | if (strncmp (argv[1], "m", 1) == 0) |
| 6391 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as, |
| 6392 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6393 | |
| 6394 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 6395 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6396 | } |
| 6397 | |
| 6398 | ALIAS (clear_ip_bgp_as_ipv4_soft_in, |
| 6399 | clear_ip_bgp_as_ipv4_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6400 | "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6401 | CLEAR_STR |
| 6402 | IP_STR |
| 6403 | BGP_STR |
| 6404 | "Clear peers with the AS number\n" |
| 6405 | "Address family\n" |
| 6406 | "Address Family modifier\n" |
| 6407 | "Address Family modifier\n" |
| 6408 | "Soft reconfig inbound update\n") |
| 6409 | |
| 6410 | DEFUN (clear_ip_bgp_as_ipv4_in_prefix_filter, |
| 6411 | clear_ip_bgp_as_ipv4_in_prefix_filter_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6412 | "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) in prefix-filter", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6413 | CLEAR_STR |
| 6414 | IP_STR |
| 6415 | BGP_STR |
| 6416 | "Clear peers with the AS number\n" |
| 6417 | "Address family\n" |
| 6418 | "Address Family modifier\n" |
| 6419 | "Address Family modifier\n" |
| 6420 | "Soft reconfig inbound update\n" |
| 6421 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6422 | { |
| 6423 | if (strncmp (argv[1], "m", 1) == 0) |
| 6424 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as, |
| 6425 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 6426 | |
| 6427 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 6428 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 6429 | } |
| 6430 | |
| 6431 | DEFUN (clear_ip_bgp_as_vpnv4_soft_in, |
| 6432 | clear_ip_bgp_as_vpnv4_soft_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6433 | "clear ip bgp " CMD_AS_RANGE " vpnv4 unicast soft in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6434 | CLEAR_STR |
| 6435 | IP_STR |
| 6436 | BGP_STR |
| 6437 | "Clear peers with the AS number\n" |
| 6438 | "Address family\n" |
| 6439 | "Address Family modifier\n" |
| 6440 | "Soft reconfig\n" |
| 6441 | "Soft reconfig inbound update\n") |
| 6442 | { |
| 6443 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_as, |
| 6444 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6445 | } |
| 6446 | |
| 6447 | ALIAS (clear_ip_bgp_as_vpnv4_soft_in, |
| 6448 | clear_ip_bgp_as_vpnv4_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6449 | "clear ip bgp " CMD_AS_RANGE " vpnv4 unicast in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6450 | CLEAR_STR |
| 6451 | IP_STR |
| 6452 | BGP_STR |
| 6453 | "Clear peers with the AS number\n" |
| 6454 | "Address family\n" |
| 6455 | "Address Family modifier\n" |
| 6456 | "Soft reconfig inbound update\n") |
| 6457 | |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 6458 | DEFUN (clear_ip_bgp_as_encap_soft_in, |
| 6459 | clear_ip_bgp_as_encap_soft_in_cmd, |
| 6460 | "clear ip bgp " CMD_AS_RANGE " encap unicast soft in", |
| 6461 | CLEAR_STR |
| 6462 | IP_STR |
| 6463 | BGP_STR |
| 6464 | "Clear peers with the AS number\n" |
| 6465 | "Address family\n" |
| 6466 | "Address Family modifier\n" |
| 6467 | "Soft reconfig\n" |
| 6468 | "Soft reconfig inbound update\n") |
| 6469 | { |
| 6470 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_as, |
| 6471 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6472 | } |
| 6473 | |
| 6474 | ALIAS (clear_ip_bgp_as_encap_soft_in, |
| 6475 | clear_ip_bgp_as_encap_in_cmd, |
| 6476 | "clear ip bgp " CMD_AS_RANGE " encap unicast in", |
| 6477 | CLEAR_STR |
| 6478 | IP_STR |
| 6479 | BGP_STR |
| 6480 | "Clear peers with the AS number\n" |
| 6481 | "Address family\n" |
| 6482 | "Address Family modifier\n" |
| 6483 | "Soft reconfig inbound update\n") |
| 6484 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6485 | DEFUN (clear_bgp_as_soft_in, |
| 6486 | clear_bgp_as_soft_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6487 | "clear bgp " CMD_AS_RANGE " soft in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6488 | CLEAR_STR |
| 6489 | BGP_STR |
| 6490 | "Clear peers with the AS number\n" |
| 6491 | "Soft reconfig\n" |
| 6492 | "Soft reconfig inbound update\n") |
| 6493 | { |
| 6494 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_as, |
| 6495 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 6496 | } |
| 6497 | |
| 6498 | ALIAS (clear_bgp_as_soft_in, |
| 6499 | clear_bgp_ipv6_as_soft_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6500 | "clear bgp ipv6 " CMD_AS_RANGE " soft in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6501 | CLEAR_STR |
| 6502 | BGP_STR |
| 6503 | "Address family\n" |
| 6504 | "Clear peers with the AS number\n" |
| 6505 | "Soft reconfig\n" |
| 6506 | "Soft reconfig inbound update\n") |
| 6507 | |
| 6508 | ALIAS (clear_bgp_as_soft_in, |
| 6509 | clear_bgp_as_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6510 | "clear bgp " CMD_AS_RANGE " in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6511 | CLEAR_STR |
| 6512 | BGP_STR |
| 6513 | "Clear peers with the AS number\n" |
| 6514 | "Soft reconfig inbound update\n") |
| 6515 | |
| 6516 | ALIAS (clear_bgp_as_soft_in, |
| 6517 | clear_bgp_ipv6_as_in_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6518 | "clear bgp ipv6 " CMD_AS_RANGE " in", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6519 | CLEAR_STR |
| 6520 | BGP_STR |
| 6521 | "Address family\n" |
| 6522 | "Clear peers with the AS number\n" |
| 6523 | "Soft reconfig inbound update\n") |
| 6524 | |
| 6525 | DEFUN (clear_bgp_as_in_prefix_filter, |
| 6526 | clear_bgp_as_in_prefix_filter_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6527 | "clear bgp " CMD_AS_RANGE " in prefix-filter", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6528 | CLEAR_STR |
| 6529 | BGP_STR |
| 6530 | "Clear peers with the AS number\n" |
| 6531 | "Soft reconfig inbound update\n" |
| 6532 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 6533 | { |
| 6534 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_as, |
| 6535 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 6536 | } |
| 6537 | |
| 6538 | ALIAS (clear_bgp_as_in_prefix_filter, |
| 6539 | clear_bgp_ipv6_as_in_prefix_filter_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6540 | "clear bgp ipv6 " CMD_AS_RANGE " in prefix-filter", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6541 | CLEAR_STR |
| 6542 | BGP_STR |
| 6543 | "Address family\n" |
| 6544 | "Clear peers with the AS number\n" |
| 6545 | "Soft reconfig inbound update\n" |
| 6546 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 6547 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6548 | /* Both soft-reconfiguration */ |
| 6549 | DEFUN (clear_ip_bgp_all_soft, |
| 6550 | clear_ip_bgp_all_soft_cmd, |
| 6551 | "clear ip bgp * soft", |
| 6552 | CLEAR_STR |
| 6553 | IP_STR |
| 6554 | BGP_STR |
| 6555 | "Clear all peers\n" |
| 6556 | "Soft reconfig\n") |
| 6557 | { |
| 6558 | if (argc == 1) |
| 6559 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 6560 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6561 | |
| 6562 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 6563 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6564 | } |
| 6565 | |
| 6566 | ALIAS (clear_ip_bgp_all_soft, |
| 6567 | clear_ip_bgp_instance_all_soft_cmd, |
| 6568 | "clear ip bgp view WORD * soft", |
| 6569 | CLEAR_STR |
| 6570 | IP_STR |
| 6571 | BGP_STR |
| 6572 | "BGP view\n" |
| 6573 | "view name\n" |
| 6574 | "Clear all peers\n" |
| 6575 | "Soft reconfig\n") |
| 6576 | |
| 6577 | |
| 6578 | DEFUN (clear_ip_bgp_all_ipv4_soft, |
| 6579 | clear_ip_bgp_all_ipv4_soft_cmd, |
| 6580 | "clear ip bgp * ipv4 (unicast|multicast) soft", |
| 6581 | CLEAR_STR |
| 6582 | IP_STR |
| 6583 | BGP_STR |
| 6584 | "Clear all peers\n" |
| 6585 | "Address family\n" |
| 6586 | "Address Family Modifier\n" |
| 6587 | "Address Family Modifier\n" |
| 6588 | "Soft reconfig\n") |
| 6589 | { |
| 6590 | if (strncmp (argv[0], "m", 1) == 0) |
| 6591 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all, |
| 6592 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6593 | |
| 6594 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 6595 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6596 | } |
| 6597 | |
| 6598 | DEFUN (clear_ip_bgp_instance_all_ipv4_soft, |
| 6599 | clear_ip_bgp_instance_all_ipv4_soft_cmd, |
| 6600 | "clear ip bgp view WORD * ipv4 (unicast|multicast) soft", |
| 6601 | CLEAR_STR |
| 6602 | IP_STR |
| 6603 | BGP_STR |
| 6604 | "BGP view\n" |
| 6605 | "view name\n" |
| 6606 | "Clear all peers\n" |
| 6607 | "Address family\n" |
| 6608 | "Address Family Modifier\n" |
| 6609 | "Address Family Modifier\n" |
| 6610 | "Soft reconfig\n") |
| 6611 | { |
| 6612 | if (strncmp (argv[1], "m", 1) == 0) |
| 6613 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all, |
| 6614 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6615 | |
| 6616 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 6617 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6618 | } |
| 6619 | |
| 6620 | DEFUN (clear_ip_bgp_all_vpnv4_soft, |
| 6621 | clear_ip_bgp_all_vpnv4_soft_cmd, |
| 6622 | "clear ip bgp * vpnv4 unicast soft", |
| 6623 | CLEAR_STR |
| 6624 | IP_STR |
| 6625 | BGP_STR |
| 6626 | "Clear all peers\n" |
| 6627 | "Address family\n" |
| 6628 | "Address Family Modifier\n" |
| 6629 | "Soft reconfig\n") |
| 6630 | { |
| 6631 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_all, |
| 6632 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6633 | } |
| 6634 | |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 6635 | DEFUN (clear_ip_bgp_all_encap_soft, |
| 6636 | clear_ip_bgp_all_encap_soft_cmd, |
| 6637 | "clear ip bgp * encap unicast soft", |
| 6638 | CLEAR_STR |
| 6639 | IP_STR |
| 6640 | BGP_STR |
| 6641 | "Clear all peers\n" |
| 6642 | "Address family\n" |
| 6643 | "Address Family Modifier\n" |
| 6644 | "Soft reconfig\n") |
| 6645 | { |
| 6646 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_all, |
| 6647 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6648 | } |
| 6649 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6650 | DEFUN (clear_bgp_all_soft, |
| 6651 | clear_bgp_all_soft_cmd, |
| 6652 | "clear bgp * soft", |
| 6653 | CLEAR_STR |
| 6654 | BGP_STR |
| 6655 | "Clear all peers\n" |
| 6656 | "Soft reconfig\n") |
| 6657 | { |
| 6658 | if (argc == 1) |
| 6659 | return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_all, |
| 6660 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6661 | |
| 6662 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all, |
| 6663 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6664 | } |
| 6665 | |
| 6666 | ALIAS (clear_bgp_all_soft, |
| 6667 | clear_bgp_instance_all_soft_cmd, |
| 6668 | "clear bgp view WORD * soft", |
| 6669 | CLEAR_STR |
| 6670 | BGP_STR |
| 6671 | "BGP view\n" |
| 6672 | "view name\n" |
| 6673 | "Clear all peers\n" |
| 6674 | "Soft reconfig\n") |
| 6675 | |
| 6676 | ALIAS (clear_bgp_all_soft, |
| 6677 | clear_bgp_ipv6_all_soft_cmd, |
| 6678 | "clear bgp ipv6 * soft", |
| 6679 | CLEAR_STR |
| 6680 | BGP_STR |
| 6681 | "Address family\n" |
| 6682 | "Clear all peers\n" |
| 6683 | "Soft reconfig\n") |
| 6684 | |
| 6685 | DEFUN (clear_ip_bgp_peer_soft, |
| 6686 | clear_ip_bgp_peer_soft_cmd, |
| 6687 | "clear ip bgp A.B.C.D soft", |
| 6688 | CLEAR_STR |
| 6689 | IP_STR |
| 6690 | BGP_STR |
| 6691 | "BGP neighbor address to clear\n" |
| 6692 | "Soft reconfig\n") |
| 6693 | { |
| 6694 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 6695 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6696 | } |
| 6697 | |
| 6698 | DEFUN (clear_ip_bgp_peer_ipv4_soft, |
| 6699 | clear_ip_bgp_peer_ipv4_soft_cmd, |
| 6700 | "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft", |
| 6701 | CLEAR_STR |
| 6702 | IP_STR |
| 6703 | BGP_STR |
| 6704 | "BGP neighbor address to clear\n" |
| 6705 | "Address family\n" |
| 6706 | "Address Family Modifier\n" |
| 6707 | "Address Family Modifier\n" |
| 6708 | "Soft reconfig\n") |
| 6709 | { |
| 6710 | if (strncmp (argv[1], "m", 1) == 0) |
| 6711 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer, |
| 6712 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6713 | |
| 6714 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 6715 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6716 | } |
| 6717 | |
| 6718 | DEFUN (clear_ip_bgp_peer_vpnv4_soft, |
| 6719 | clear_ip_bgp_peer_vpnv4_soft_cmd, |
| 6720 | "clear ip bgp A.B.C.D vpnv4 unicast soft", |
| 6721 | CLEAR_STR |
| 6722 | IP_STR |
| 6723 | BGP_STR |
| 6724 | "BGP neighbor address to clear\n" |
| 6725 | "Address family\n" |
| 6726 | "Address Family Modifier\n" |
| 6727 | "Soft reconfig\n") |
| 6728 | { |
| 6729 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_peer, |
| 6730 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6731 | } |
| 6732 | |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 6733 | DEFUN (clear_ip_bgp_peer_encap_soft, |
| 6734 | clear_ip_bgp_peer_encap_soft_cmd, |
| 6735 | "clear ip bgp A.B.C.D encap unicast soft", |
| 6736 | CLEAR_STR |
| 6737 | IP_STR |
| 6738 | BGP_STR |
| 6739 | "BGP neighbor address to clear\n" |
| 6740 | "Address family\n" |
| 6741 | "Address Family Modifier\n" |
| 6742 | "Soft reconfig\n") |
| 6743 | { |
| 6744 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_peer, |
| 6745 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6746 | } |
| 6747 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6748 | DEFUN (clear_bgp_peer_soft, |
| 6749 | clear_bgp_peer_soft_cmd, |
| 6750 | "clear bgp (A.B.C.D|X:X::X:X) soft", |
| 6751 | CLEAR_STR |
| 6752 | BGP_STR |
| 6753 | "BGP neighbor address to clear\n" |
| 6754 | "BGP IPv6 neighbor to clear\n" |
| 6755 | "Soft reconfig\n") |
| 6756 | { |
| 6757 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer, |
| 6758 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6759 | } |
| 6760 | |
| 6761 | ALIAS (clear_bgp_peer_soft, |
| 6762 | clear_bgp_ipv6_peer_soft_cmd, |
| 6763 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft", |
| 6764 | CLEAR_STR |
| 6765 | BGP_STR |
| 6766 | "Address family\n" |
| 6767 | "BGP neighbor address to clear\n" |
| 6768 | "BGP IPv6 neighbor to clear\n" |
| 6769 | "Soft reconfig\n") |
| 6770 | |
| 6771 | DEFUN (clear_ip_bgp_peer_group_soft, |
| 6772 | clear_ip_bgp_peer_group_soft_cmd, |
| 6773 | "clear ip bgp peer-group WORD soft", |
| 6774 | CLEAR_STR |
| 6775 | IP_STR |
| 6776 | BGP_STR |
| 6777 | "Clear all members of peer-group\n" |
| 6778 | "BGP peer-group name\n" |
| 6779 | "Soft reconfig\n") |
| 6780 | { |
| 6781 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 6782 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6783 | } |
| 6784 | |
| 6785 | DEFUN (clear_ip_bgp_peer_group_ipv4_soft, |
| 6786 | clear_ip_bgp_peer_group_ipv4_soft_cmd, |
| 6787 | "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft", |
| 6788 | CLEAR_STR |
| 6789 | IP_STR |
| 6790 | BGP_STR |
| 6791 | "Clear all members of peer-group\n" |
| 6792 | "BGP peer-group name\n" |
| 6793 | "Address family\n" |
| 6794 | "Address Family modifier\n" |
| 6795 | "Address Family modifier\n" |
| 6796 | "Soft reconfig\n") |
| 6797 | { |
| 6798 | if (strncmp (argv[1], "m", 1) == 0) |
| 6799 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group, |
| 6800 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6801 | |
| 6802 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 6803 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6804 | } |
| 6805 | |
| 6806 | DEFUN (clear_bgp_peer_group_soft, |
| 6807 | clear_bgp_peer_group_soft_cmd, |
| 6808 | "clear bgp peer-group WORD soft", |
| 6809 | CLEAR_STR |
| 6810 | BGP_STR |
| 6811 | "Clear all members of peer-group\n" |
| 6812 | "BGP peer-group name\n" |
| 6813 | "Soft reconfig\n") |
| 6814 | { |
| 6815 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_group, |
| 6816 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6817 | } |
| 6818 | |
| 6819 | ALIAS (clear_bgp_peer_group_soft, |
| 6820 | clear_bgp_ipv6_peer_group_soft_cmd, |
| 6821 | "clear bgp ipv6 peer-group WORD soft", |
| 6822 | CLEAR_STR |
| 6823 | BGP_STR |
| 6824 | "Address family\n" |
| 6825 | "Clear all members of peer-group\n" |
| 6826 | "BGP peer-group name\n" |
| 6827 | "Soft reconfig\n") |
| 6828 | |
| 6829 | DEFUN (clear_ip_bgp_external_soft, |
| 6830 | clear_ip_bgp_external_soft_cmd, |
| 6831 | "clear ip bgp external soft", |
| 6832 | CLEAR_STR |
| 6833 | IP_STR |
| 6834 | BGP_STR |
| 6835 | "Clear all external peers\n" |
| 6836 | "Soft reconfig\n") |
| 6837 | { |
| 6838 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 6839 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6840 | } |
| 6841 | |
| 6842 | DEFUN (clear_ip_bgp_external_ipv4_soft, |
| 6843 | clear_ip_bgp_external_ipv4_soft_cmd, |
| 6844 | "clear ip bgp external ipv4 (unicast|multicast) soft", |
| 6845 | CLEAR_STR |
| 6846 | IP_STR |
| 6847 | BGP_STR |
| 6848 | "Clear all external peers\n" |
| 6849 | "Address family\n" |
| 6850 | "Address Family modifier\n" |
| 6851 | "Address Family modifier\n" |
| 6852 | "Soft reconfig\n") |
| 6853 | { |
| 6854 | if (strncmp (argv[0], "m", 1) == 0) |
| 6855 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external, |
| 6856 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6857 | |
| 6858 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 6859 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6860 | } |
| 6861 | |
| 6862 | DEFUN (clear_bgp_external_soft, |
| 6863 | clear_bgp_external_soft_cmd, |
| 6864 | "clear bgp external soft", |
| 6865 | CLEAR_STR |
| 6866 | BGP_STR |
| 6867 | "Clear all external peers\n" |
| 6868 | "Soft reconfig\n") |
| 6869 | { |
| 6870 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_external, |
| 6871 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6872 | } |
| 6873 | |
| 6874 | ALIAS (clear_bgp_external_soft, |
| 6875 | clear_bgp_ipv6_external_soft_cmd, |
| 6876 | "clear bgp ipv6 external soft", |
| 6877 | CLEAR_STR |
| 6878 | BGP_STR |
| 6879 | "Address family\n" |
| 6880 | "Clear all external peers\n" |
| 6881 | "Soft reconfig\n") |
| 6882 | |
| 6883 | DEFUN (clear_ip_bgp_as_soft, |
| 6884 | clear_ip_bgp_as_soft_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6885 | "clear ip bgp " CMD_AS_RANGE " soft", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6886 | CLEAR_STR |
| 6887 | IP_STR |
| 6888 | BGP_STR |
| 6889 | "Clear peers with the AS number\n" |
| 6890 | "Soft reconfig\n") |
| 6891 | { |
| 6892 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 6893 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6894 | } |
| 6895 | |
| 6896 | DEFUN (clear_ip_bgp_as_ipv4_soft, |
| 6897 | clear_ip_bgp_as_ipv4_soft_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6898 | "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) soft", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6899 | CLEAR_STR |
| 6900 | IP_STR |
| 6901 | BGP_STR |
| 6902 | "Clear peers with the AS number\n" |
| 6903 | "Address family\n" |
| 6904 | "Address Family Modifier\n" |
| 6905 | "Address Family Modifier\n" |
| 6906 | "Soft reconfig\n") |
| 6907 | { |
| 6908 | if (strncmp (argv[1], "m", 1) == 0) |
| 6909 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as, |
| 6910 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6911 | |
| 6912 | return bgp_clear_vty (vty, NULL,AFI_IP, SAFI_UNICAST, clear_as, |
| 6913 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6914 | } |
| 6915 | |
| 6916 | DEFUN (clear_ip_bgp_as_vpnv4_soft, |
| 6917 | clear_ip_bgp_as_vpnv4_soft_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6918 | "clear ip bgp " CMD_AS_RANGE " vpnv4 unicast soft", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6919 | CLEAR_STR |
| 6920 | IP_STR |
| 6921 | BGP_STR |
| 6922 | "Clear peers with the AS number\n" |
| 6923 | "Address family\n" |
| 6924 | "Address Family Modifier\n" |
| 6925 | "Soft reconfig\n") |
| 6926 | { |
| 6927 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_as, |
| 6928 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6929 | } |
| 6930 | |
Lou Berger | 298cc2f | 2016-01-12 13:42:02 -0500 | [diff] [blame] | 6931 | DEFUN (clear_ip_bgp_as_encap_soft, |
| 6932 | clear_ip_bgp_as_encap_soft_cmd, |
| 6933 | "clear ip bgp " CMD_AS_RANGE " encap unicast soft", |
| 6934 | CLEAR_STR |
| 6935 | IP_STR |
| 6936 | BGP_STR |
| 6937 | "Clear peers with the AS number\n" |
| 6938 | "Address family\n" |
| 6939 | "Address Family Modifier\n" |
| 6940 | "Soft reconfig\n") |
| 6941 | { |
| 6942 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_ENCAP, clear_as, |
| 6943 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6944 | } |
| 6945 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6946 | DEFUN (clear_bgp_as_soft, |
| 6947 | clear_bgp_as_soft_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6948 | "clear bgp " CMD_AS_RANGE " soft", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6949 | CLEAR_STR |
| 6950 | BGP_STR |
| 6951 | "Clear peers with the AS number\n" |
| 6952 | "Soft reconfig\n") |
| 6953 | { |
| 6954 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_as, |
| 6955 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6956 | } |
| 6957 | |
| 6958 | ALIAS (clear_bgp_as_soft, |
| 6959 | clear_bgp_ipv6_as_soft_cmd, |
Paul Jakma | 320da87 | 2008-07-02 13:40:33 +0000 | [diff] [blame] | 6960 | "clear bgp ipv6 " CMD_AS_RANGE " soft", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6961 | CLEAR_STR |
| 6962 | BGP_STR |
| 6963 | "Address family\n" |
| 6964 | "Clear peers with the AS number\n" |
| 6965 | "Soft reconfig\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 6966 | |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 6967 | /* RS-client soft reconfiguration. */ |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 6968 | DEFUN (clear_bgp_all_rsclient, |
| 6969 | clear_bgp_all_rsclient_cmd, |
| 6970 | "clear bgp * rsclient", |
| 6971 | CLEAR_STR |
| 6972 | BGP_STR |
| 6973 | "Clear all peers\n" |
| 6974 | "Soft reconfig for rsclient RIB\n") |
| 6975 | { |
| 6976 | if (argc == 1) |
| 6977 | return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_all, |
| 6978 | BGP_CLEAR_SOFT_RSCLIENT, NULL); |
| 6979 | |
| 6980 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all, |
| 6981 | BGP_CLEAR_SOFT_RSCLIENT, NULL); |
| 6982 | } |
| 6983 | |
| 6984 | ALIAS (clear_bgp_all_rsclient, |
| 6985 | clear_bgp_ipv6_all_rsclient_cmd, |
| 6986 | "clear bgp ipv6 * rsclient", |
| 6987 | CLEAR_STR |
| 6988 | BGP_STR |
| 6989 | "Address family\n" |
| 6990 | "Clear all peers\n" |
| 6991 | "Soft reconfig for rsclient RIB\n") |
| 6992 | |
| 6993 | ALIAS (clear_bgp_all_rsclient, |
| 6994 | clear_bgp_instance_all_rsclient_cmd, |
| 6995 | "clear bgp view WORD * rsclient", |
| 6996 | CLEAR_STR |
| 6997 | BGP_STR |
| 6998 | "BGP view\n" |
| 6999 | "view name\n" |
| 7000 | "Clear all peers\n" |
| 7001 | "Soft reconfig for rsclient RIB\n") |
| 7002 | |
| 7003 | ALIAS (clear_bgp_all_rsclient, |
| 7004 | clear_bgp_ipv6_instance_all_rsclient_cmd, |
| 7005 | "clear bgp ipv6 view WORD * rsclient", |
| 7006 | CLEAR_STR |
| 7007 | BGP_STR |
| 7008 | "Address family\n" |
| 7009 | "BGP view\n" |
| 7010 | "view name\n" |
| 7011 | "Clear all peers\n" |
| 7012 | "Soft reconfig for rsclient RIB\n") |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7013 | |
| 7014 | DEFUN (clear_ip_bgp_all_rsclient, |
| 7015 | clear_ip_bgp_all_rsclient_cmd, |
| 7016 | "clear ip bgp * rsclient", |
| 7017 | CLEAR_STR |
| 7018 | IP_STR |
| 7019 | BGP_STR |
| 7020 | "Clear all peers\n" |
| 7021 | "Soft reconfig for rsclient RIB\n") |
| 7022 | { |
| 7023 | if (argc == 1) |
| 7024 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 7025 | BGP_CLEAR_SOFT_RSCLIENT, NULL); |
| 7026 | |
| 7027 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 7028 | BGP_CLEAR_SOFT_RSCLIENT, NULL); |
| 7029 | } |
| 7030 | |
| 7031 | ALIAS (clear_ip_bgp_all_rsclient, |
| 7032 | clear_ip_bgp_instance_all_rsclient_cmd, |
| 7033 | "clear ip bgp view WORD * rsclient", |
| 7034 | CLEAR_STR |
| 7035 | IP_STR |
| 7036 | BGP_STR |
| 7037 | "BGP view\n" |
| 7038 | "view name\n" |
| 7039 | "Clear all peers\n" |
| 7040 | "Soft reconfig for rsclient RIB\n") |
| 7041 | |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7042 | DEFUN (clear_bgp_peer_rsclient, |
| 7043 | clear_bgp_peer_rsclient_cmd, |
| 7044 | "clear bgp (A.B.C.D|X:X::X:X) rsclient", |
| 7045 | CLEAR_STR |
| 7046 | BGP_STR |
| 7047 | "BGP neighbor IP address to clear\n" |
| 7048 | "BGP IPv6 neighbor to clear\n" |
| 7049 | "Soft reconfig for rsclient RIB\n") |
| 7050 | { |
| 7051 | if (argc == 2) |
| 7052 | return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_peer, |
| 7053 | BGP_CLEAR_SOFT_RSCLIENT, argv[1]); |
| 7054 | |
| 7055 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer, |
| 7056 | BGP_CLEAR_SOFT_RSCLIENT, argv[0]); |
| 7057 | } |
| 7058 | |
| 7059 | ALIAS (clear_bgp_peer_rsclient, |
| 7060 | clear_bgp_ipv6_peer_rsclient_cmd, |
| 7061 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) rsclient", |
| 7062 | CLEAR_STR |
| 7063 | BGP_STR |
| 7064 | "Address family\n" |
| 7065 | "BGP neighbor IP address to clear\n" |
| 7066 | "BGP IPv6 neighbor to clear\n" |
| 7067 | "Soft reconfig for rsclient RIB\n") |
| 7068 | |
| 7069 | ALIAS (clear_bgp_peer_rsclient, |
| 7070 | clear_bgp_instance_peer_rsclient_cmd, |
| 7071 | "clear bgp view WORD (A.B.C.D|X:X::X:X) rsclient", |
| 7072 | CLEAR_STR |
| 7073 | BGP_STR |
| 7074 | "BGP view\n" |
| 7075 | "view name\n" |
| 7076 | "BGP neighbor IP address to clear\n" |
| 7077 | "BGP IPv6 neighbor to clear\n" |
| 7078 | "Soft reconfig for rsclient RIB\n") |
| 7079 | |
| 7080 | ALIAS (clear_bgp_peer_rsclient, |
| 7081 | clear_bgp_ipv6_instance_peer_rsclient_cmd, |
| 7082 | "clear bgp ipv6 view WORD (A.B.C.D|X:X::X:X) rsclient", |
| 7083 | CLEAR_STR |
| 7084 | BGP_STR |
| 7085 | "Address family\n" |
| 7086 | "BGP view\n" |
| 7087 | "view name\n" |
| 7088 | "BGP neighbor IP address to clear\n" |
| 7089 | "BGP IPv6 neighbor to clear\n" |
| 7090 | "Soft reconfig for rsclient RIB\n") |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7091 | |
| 7092 | DEFUN (clear_ip_bgp_peer_rsclient, |
| 7093 | clear_ip_bgp_peer_rsclient_cmd, |
| 7094 | "clear ip bgp (A.B.C.D|X:X::X:X) rsclient", |
| 7095 | CLEAR_STR |
| 7096 | IP_STR |
| 7097 | BGP_STR |
| 7098 | "BGP neighbor IP address to clear\n" |
| 7099 | "BGP IPv6 neighbor to clear\n" |
| 7100 | "Soft reconfig for rsclient RIB\n") |
| 7101 | { |
| 7102 | if (argc == 2) |
| 7103 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_peer, |
| 7104 | BGP_CLEAR_SOFT_RSCLIENT, argv[1]); |
| 7105 | |
| 7106 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 7107 | BGP_CLEAR_SOFT_RSCLIENT, argv[0]); |
| 7108 | } |
| 7109 | |
| 7110 | ALIAS (clear_ip_bgp_peer_rsclient, |
| 7111 | clear_ip_bgp_instance_peer_rsclient_cmd, |
| 7112 | "clear ip bgp view WORD (A.B.C.D|X:X::X:X) rsclient", |
| 7113 | CLEAR_STR |
| 7114 | IP_STR |
| 7115 | BGP_STR |
| 7116 | "BGP view\n" |
| 7117 | "view name\n" |
| 7118 | "BGP neighbor IP address to clear\n" |
| 7119 | "BGP IPv6 neighbor to clear\n" |
| 7120 | "Soft reconfig for rsclient RIB\n") |
| 7121 | |
Michael Lambert | e0081f7 | 2008-11-16 20:12:04 +0000 | [diff] [blame] | 7122 | DEFUN (show_bgp_views, |
| 7123 | show_bgp_views_cmd, |
| 7124 | "show bgp views", |
| 7125 | SHOW_STR |
| 7126 | BGP_STR |
| 7127 | "Show the defined BGP views\n") |
| 7128 | { |
| 7129 | struct list *inst = bm->bgp; |
| 7130 | struct listnode *node; |
| 7131 | struct bgp *bgp; |
| 7132 | |
| 7133 | if (!bgp_option_check (BGP_OPT_MULTIPLE_INSTANCE)) |
| 7134 | { |
| 7135 | vty_out (vty, "Multiple BGP views are not defined%s", VTY_NEWLINE); |
| 7136 | return CMD_WARNING; |
| 7137 | } |
| 7138 | |
| 7139 | vty_out (vty, "Defined BGP views:%s", VTY_NEWLINE); |
| 7140 | for (ALL_LIST_ELEMENTS_RO(inst, node, bgp)) |
| 7141 | vty_out (vty, "\t%s (AS%u)%s", |
| 7142 | bgp->name ? bgp->name : "(null)", |
| 7143 | bgp->as, VTY_NEWLINE); |
| 7144 | |
| 7145 | return CMD_SUCCESS; |
| 7146 | } |
| 7147 | |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 7148 | DEFUN (show_bgp_memory, |
| 7149 | show_bgp_memory_cmd, |
| 7150 | "show bgp memory", |
| 7151 | SHOW_STR |
| 7152 | BGP_STR |
| 7153 | "Global BGP memory statistics\n") |
| 7154 | { |
| 7155 | char memstrbuf[MTYPE_MEMSTR_LEN]; |
| 7156 | unsigned long count; |
| 7157 | |
| 7158 | /* RIB related usage stats */ |
| 7159 | count = mtype_stats_alloc (MTYPE_BGP_NODE); |
| 7160 | vty_out (vty, "%ld RIB nodes, using %s of memory%s", count, |
| 7161 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7162 | count * sizeof (struct bgp_node)), |
| 7163 | VTY_NEWLINE); |
| 7164 | |
| 7165 | count = mtype_stats_alloc (MTYPE_BGP_ROUTE); |
| 7166 | vty_out (vty, "%ld BGP routes, using %s of memory%s", count, |
| 7167 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7168 | count * sizeof (struct bgp_info)), |
| 7169 | VTY_NEWLINE); |
Paul Jakma | fb982c2 | 2007-05-04 20:15:47 +0000 | [diff] [blame] | 7170 | if ((count = mtype_stats_alloc (MTYPE_BGP_ROUTE_EXTRA))) |
| 7171 | vty_out (vty, "%ld BGP route ancillaries, using %s of memory%s", count, |
| 7172 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7173 | count * sizeof (struct bgp_info_extra)), |
| 7174 | VTY_NEWLINE); |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 7175 | |
| 7176 | if ((count = mtype_stats_alloc (MTYPE_BGP_STATIC))) |
| 7177 | vty_out (vty, "%ld Static routes, using %s of memory%s", count, |
| 7178 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7179 | count * sizeof (struct bgp_static)), |
| 7180 | VTY_NEWLINE); |
| 7181 | |
| 7182 | /* Adj-In/Out */ |
| 7183 | if ((count = mtype_stats_alloc (MTYPE_BGP_ADJ_IN))) |
| 7184 | vty_out (vty, "%ld Adj-In entries, using %s of memory%s", count, |
| 7185 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7186 | count * sizeof (struct bgp_adj_in)), |
| 7187 | VTY_NEWLINE); |
| 7188 | if ((count = mtype_stats_alloc (MTYPE_BGP_ADJ_OUT))) |
| 7189 | vty_out (vty, "%ld Adj-Out entries, using %s of memory%s", count, |
| 7190 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7191 | count * sizeof (struct bgp_adj_out)), |
| 7192 | VTY_NEWLINE); |
| 7193 | |
| 7194 | if ((count = mtype_stats_alloc (MTYPE_BGP_NEXTHOP_CACHE))) |
| 7195 | vty_out (vty, "%ld Nexthop cache entries, using %s of memory%s", count, |
| 7196 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7197 | count * sizeof (struct bgp_nexthop_cache)), |
| 7198 | VTY_NEWLINE); |
| 7199 | |
| 7200 | if ((count = mtype_stats_alloc (MTYPE_BGP_DAMP_INFO))) |
| 7201 | vty_out (vty, "%ld Dampening entries, using %s of memory%s", count, |
| 7202 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7203 | count * sizeof (struct bgp_damp_info)), |
| 7204 | VTY_NEWLINE); |
| 7205 | |
| 7206 | /* Attributes */ |
| 7207 | count = attr_count(); |
| 7208 | vty_out (vty, "%ld BGP attributes, using %s of memory%s", count, |
| 7209 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7210 | count * sizeof(struct attr)), |
| 7211 | VTY_NEWLINE); |
Paul Jakma | fb982c2 | 2007-05-04 20:15:47 +0000 | [diff] [blame] | 7212 | if ((count = mtype_stats_alloc (MTYPE_ATTR_EXTRA))) |
| 7213 | vty_out (vty, "%ld BGP extra attributes, using %s of memory%s", count, |
| 7214 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7215 | count * sizeof(struct attr_extra)), |
| 7216 | VTY_NEWLINE); |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 7217 | |
| 7218 | if ((count = attr_unknown_count())) |
| 7219 | vty_out (vty, "%ld unknown attributes%s", count, VTY_NEWLINE); |
| 7220 | |
| 7221 | /* AS_PATH attributes */ |
| 7222 | count = aspath_count (); |
| 7223 | vty_out (vty, "%ld BGP AS-PATH entries, using %s of memory%s", count, |
| 7224 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7225 | count * sizeof (struct aspath)), |
| 7226 | VTY_NEWLINE); |
| 7227 | |
| 7228 | count = mtype_stats_alloc (MTYPE_AS_SEG); |
| 7229 | vty_out (vty, "%ld BGP AS-PATH segments, using %s of memory%s", count, |
| 7230 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7231 | count * sizeof (struct assegment)), |
| 7232 | VTY_NEWLINE); |
| 7233 | |
| 7234 | /* Other attributes */ |
| 7235 | if ((count = community_count ())) |
| 7236 | vty_out (vty, "%ld BGP community entries, using %s of memory%s", count, |
| 7237 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7238 | count * sizeof (struct community)), |
| 7239 | VTY_NEWLINE); |
| 7240 | if ((count = mtype_stats_alloc (MTYPE_ECOMMUNITY))) |
| 7241 | vty_out (vty, "%ld BGP community entries, using %s of memory%s", count, |
| 7242 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7243 | count * sizeof (struct ecommunity)), |
| 7244 | VTY_NEWLINE); |
| 7245 | |
| 7246 | if ((count = mtype_stats_alloc (MTYPE_CLUSTER))) |
| 7247 | vty_out (vty, "%ld Cluster lists, using %s of memory%s", count, |
| 7248 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7249 | count * sizeof (struct cluster_list)), |
| 7250 | VTY_NEWLINE); |
| 7251 | |
| 7252 | /* Peer related usage */ |
| 7253 | count = mtype_stats_alloc (MTYPE_BGP_PEER); |
| 7254 | vty_out (vty, "%ld peers, using %s of memory%s", count, |
| 7255 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7256 | count * sizeof (struct peer)), |
| 7257 | VTY_NEWLINE); |
| 7258 | |
| 7259 | if ((count = mtype_stats_alloc (MTYPE_PEER_GROUP))) |
| 7260 | vty_out (vty, "%ld peer groups, using %s of memory%s", count, |
| 7261 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7262 | count * sizeof (struct peer_group)), |
| 7263 | VTY_NEWLINE); |
| 7264 | |
| 7265 | /* Other */ |
| 7266 | if ((count = mtype_stats_alloc (MTYPE_HASH))) |
| 7267 | vty_out (vty, "%ld hash tables, using %s of memory%s", count, |
| 7268 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7269 | count * sizeof (struct hash)), |
| 7270 | VTY_NEWLINE); |
| 7271 | if ((count = mtype_stats_alloc (MTYPE_HASH_BACKET))) |
| 7272 | vty_out (vty, "%ld hash buckets, using %s of memory%s", count, |
| 7273 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7274 | count * sizeof (struct hash_backet)), |
| 7275 | VTY_NEWLINE); |
| 7276 | if ((count = mtype_stats_alloc (MTYPE_BGP_REGEXP))) |
| 7277 | vty_out (vty, "%ld compiled regexes, using %s of memory%s", count, |
| 7278 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7279 | count * sizeof (regex_t)), |
| 7280 | VTY_NEWLINE); |
| 7281 | return CMD_SUCCESS; |
| 7282 | } |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7283 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7284 | /* Show BGP peer's summary information. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 7285 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7286 | bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi) |
| 7287 | { |
| 7288 | struct peer *peer; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 7289 | struct listnode *node, *nnode; |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 7290 | unsigned int count = 0; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7291 | char timebuf[BGP_UPTIME_LEN]; |
| 7292 | int len; |
| 7293 | |
| 7294 | /* Header string for each address family. */ |
Milan Kocian | cb4fc59 | 2014-12-01 12:48:25 +0000 | [diff] [blame] | 7295 | 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] | 7296 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 7297 | for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7298 | { |
| 7299 | if (peer->afc[afi][safi]) |
| 7300 | { |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 7301 | if (!count) |
| 7302 | { |
| 7303 | unsigned long ents; |
| 7304 | char memstrbuf[MTYPE_MEMSTR_LEN]; |
| 7305 | |
| 7306 | /* Usage summary and header */ |
| 7307 | vty_out (vty, |
Denis Ovsienko | aea339f | 2009-04-30 17:16:22 +0400 | [diff] [blame] | 7308 | "BGP router identifier %s, local AS number %u%s", |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 7309 | inet_ntoa (bgp->router_id), bgp->as, VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7310 | |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 7311 | ents = bgp_table_count (bgp->rib[afi][safi]); |
| 7312 | vty_out (vty, "RIB entries %ld, using %s of memory%s", ents, |
| 7313 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7314 | ents * sizeof (struct bgp_node)), |
| 7315 | VTY_NEWLINE); |
| 7316 | |
| 7317 | /* Peer related usage */ |
| 7318 | ents = listcount (bgp->peer); |
| 7319 | vty_out (vty, "Peers %ld, using %s of memory%s", |
| 7320 | ents, |
| 7321 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7322 | ents * sizeof (struct peer)), |
| 7323 | VTY_NEWLINE); |
| 7324 | |
| 7325 | if ((ents = listcount (bgp->rsclient))) |
| 7326 | vty_out (vty, "RS-Client peers %ld, using %s of memory%s", |
| 7327 | ents, |
| 7328 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7329 | ents * sizeof (struct peer)), |
| 7330 | VTY_NEWLINE); |
| 7331 | |
| 7332 | if ((ents = listcount (bgp->group))) |
| 7333 | vty_out (vty, "Peer groups %ld, using %s of memory%s", ents, |
| 7334 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 7335 | ents * sizeof (struct peer_group)), |
| 7336 | VTY_NEWLINE); |
| 7337 | |
| 7338 | if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING)) |
| 7339 | vty_out (vty, "Dampening enabled.%s", VTY_NEWLINE); |
| 7340 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7341 | vty_out (vty, "%s%s", header, VTY_NEWLINE); |
| 7342 | } |
| 7343 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7344 | count++; |
| 7345 | |
| 7346 | len = vty_out (vty, "%s", peer->host); |
| 7347 | len = 16 - len; |
| 7348 | if (len < 1) |
| 7349 | vty_out (vty, "%s%*s", VTY_NEWLINE, 16, " "); |
| 7350 | else |
| 7351 | vty_out (vty, "%*s", len, " "); |
| 7352 | |
hasso | 3d515fd | 2005-02-01 21:30:04 +0000 | [diff] [blame] | 7353 | vty_out (vty, "4 "); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7354 | |
Denis Ovsienko | aea339f | 2009-04-30 17:16:22 +0400 | [diff] [blame] | 7355 | vty_out (vty, "%5u %7d %7d %8d %4d %4lu ", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7356 | peer->as, |
| 7357 | peer->open_in + peer->update_in + peer->keepalive_in |
| 7358 | + peer->notify_in + peer->refresh_in + peer->dynamic_cap_in, |
| 7359 | peer->open_out + peer->update_out + peer->keepalive_out |
| 7360 | + peer->notify_out + peer->refresh_out |
| 7361 | + peer->dynamic_cap_out, |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 7362 | 0, 0, (unsigned long) peer->obuf->count); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7363 | |
| 7364 | vty_out (vty, "%8s", |
| 7365 | peer_uptime (peer->uptime, timebuf, BGP_UPTIME_LEN)); |
| 7366 | |
| 7367 | if (peer->status == Established) |
| 7368 | { |
| 7369 | vty_out (vty, " %8ld", peer->pcount[afi][safi]); |
| 7370 | } |
| 7371 | else |
| 7372 | { |
| 7373 | if (CHECK_FLAG (peer->flags, PEER_FLAG_SHUTDOWN)) |
| 7374 | vty_out (vty, " Idle (Admin)"); |
| 7375 | else if (CHECK_FLAG (peer->sflags, PEER_STATUS_PREFIX_OVERFLOW)) |
| 7376 | vty_out (vty, " Idle (PfxCt)"); |
| 7377 | else |
| 7378 | vty_out (vty, " %-11s", LOOKUP(bgp_status_msg, peer->status)); |
| 7379 | } |
| 7380 | |
| 7381 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7382 | } |
| 7383 | } |
| 7384 | |
| 7385 | if (count) |
| 7386 | vty_out (vty, "%sTotal number of neighbors %d%s", VTY_NEWLINE, |
| 7387 | count, VTY_NEWLINE); |
| 7388 | else |
| 7389 | vty_out (vty, "No %s neighbor is configured%s", |
| 7390 | afi == AFI_IP ? "IPv4" : "IPv6", VTY_NEWLINE); |
| 7391 | return CMD_SUCCESS; |
| 7392 | } |
| 7393 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 7394 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 7395 | bgp_show_summary_vty (struct vty *vty, const char *name, |
| 7396 | afi_t afi, safi_t safi) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7397 | { |
| 7398 | struct bgp *bgp; |
| 7399 | |
| 7400 | if (name) |
| 7401 | { |
| 7402 | bgp = bgp_lookup_by_name (name); |
| 7403 | |
| 7404 | if (! bgp) |
| 7405 | { |
| 7406 | vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE); |
| 7407 | return CMD_WARNING; |
| 7408 | } |
| 7409 | |
| 7410 | bgp_show_summary (vty, bgp, afi, safi); |
| 7411 | return CMD_SUCCESS; |
| 7412 | } |
| 7413 | |
| 7414 | bgp = bgp_get_default (); |
| 7415 | |
| 7416 | if (bgp) |
| 7417 | bgp_show_summary (vty, bgp, afi, safi); |
| 7418 | |
| 7419 | return CMD_SUCCESS; |
| 7420 | } |
| 7421 | |
| 7422 | /* `show ip bgp summary' commands. */ |
Lou Berger | f9b6c39 | 2016-01-12 13:42:09 -0500 | [diff] [blame] | 7423 | DEFUN (show_ip_bgp_summary, |
| 7424 | show_ip_bgp_summary_cmd, |
| 7425 | "show ip bgp summary", |
| 7426 | SHOW_STR |
| 7427 | IP_STR |
| 7428 | BGP_STR |
| 7429 | "Summary of BGP neighbor status\n") |
| 7430 | { |
| 7431 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 7432 | } |
| 7433 | |
| 7434 | DEFUN (show_ip_bgp_instance_summary, |
| 7435 | show_ip_bgp_instance_summary_cmd, |
| 7436 | "show ip bgp view WORD summary", |
| 7437 | SHOW_STR |
| 7438 | IP_STR |
| 7439 | BGP_STR |
| 7440 | "BGP view\n" |
| 7441 | "View name\n" |
| 7442 | "Summary of BGP neighbor status\n") |
| 7443 | { |
| 7444 | return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 7445 | } |
| 7446 | |
| 7447 | DEFUN (show_ip_bgp_ipv4_summary, |
| 7448 | show_ip_bgp_ipv4_summary_cmd, |
| 7449 | "show ip bgp ipv4 (unicast|multicast) summary", |
| 7450 | SHOW_STR |
| 7451 | IP_STR |
| 7452 | BGP_STR |
| 7453 | "Address family\n" |
| 7454 | "Address Family modifier\n" |
| 7455 | "Address Family modifier\n" |
| 7456 | "Summary of BGP neighbor status\n") |
| 7457 | { |
| 7458 | if (strncmp (argv[0], "m", 1) == 0) |
| 7459 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); |
| 7460 | |
| 7461 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 7462 | } |
| 7463 | |
| 7464 | DEFUN (show_ip_bgp_instance_ipv4_summary, |
| 7465 | show_ip_bgp_instance_ipv4_summary_cmd, |
| 7466 | "show ip bgp view WORD ipv4 (unicast|multicast) summary", |
| 7467 | SHOW_STR |
| 7468 | IP_STR |
| 7469 | BGP_STR |
| 7470 | "BGP view\n" |
| 7471 | "View name\n" |
| 7472 | "Address family\n" |
| 7473 | "Address Family modifier\n" |
| 7474 | "Address Family modifier\n" |
| 7475 | "Summary of BGP neighbor status\n") |
| 7476 | { |
| 7477 | if (strncmp (argv[1], "m", 1) == 0) |
| 7478 | return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST); |
| 7479 | else |
| 7480 | return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 7481 | } |
| 7482 | |
| 7483 | DEFUN (show_ip_bgp_vpnv4_all_summary, |
| 7484 | show_ip_bgp_vpnv4_all_summary_cmd, |
| 7485 | "show ip bgp vpnv4 all summary", |
| 7486 | SHOW_STR |
| 7487 | IP_STR |
| 7488 | BGP_STR |
| 7489 | "Display VPNv4 NLRI specific information\n" |
| 7490 | "Display information about all VPNv4 NLRIs\n" |
| 7491 | "Summary of BGP neighbor status\n") |
| 7492 | { |
| 7493 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); |
| 7494 | } |
| 7495 | |
| 7496 | DEFUN (show_ip_bgp_vpnv4_rd_summary, |
| 7497 | show_ip_bgp_vpnv4_rd_summary_cmd, |
| 7498 | "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn summary", |
| 7499 | SHOW_STR |
| 7500 | IP_STR |
| 7501 | BGP_STR |
| 7502 | "Display VPNv4 NLRI specific information\n" |
| 7503 | "Display information for a route distinguisher\n" |
| 7504 | "VPN Route Distinguisher\n" |
| 7505 | "Summary of BGP neighbor status\n") |
| 7506 | { |
| 7507 | int ret; |
| 7508 | struct prefix_rd prd; |
| 7509 | |
| 7510 | ret = str2prefix_rd (argv[0], &prd); |
| 7511 | if (! ret) |
| 7512 | { |
| 7513 | vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE); |
| 7514 | return CMD_WARNING; |
| 7515 | } |
| 7516 | |
| 7517 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); |
| 7518 | } |
| 7519 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7520 | DEFUN (show_bgp_ipv4_safi_summary, |
| 7521 | show_bgp_ipv4_safi_summary_cmd, |
| 7522 | "show bgp ipv4 (unicast|multicast) summary", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7523 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7524 | BGP_STR |
| 7525 | "Address family\n" |
| 7526 | "Address Family modifier\n" |
| 7527 | "Address Family modifier\n" |
| 7528 | "Summary of BGP neighbor status\n") |
| 7529 | { |
| 7530 | if (strncmp (argv[0], "m", 1) == 0) |
| 7531 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); |
| 7532 | |
| 7533 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 7534 | } |
| 7535 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7536 | DEFUN (show_bgp_instance_ipv4_safi_summary, |
| 7537 | show_bgp_instance_ipv4_safi_summary_cmd, |
| 7538 | "show bgp view WORD ipv4 (unicast|multicast) summary", |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 7539 | SHOW_STR |
| 7540 | BGP_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7541 | "BGP view\n" |
| 7542 | "View name\n" |
| 7543 | "Address family\n" |
| 7544 | "Address Family modifier\n" |
| 7545 | "Address Family modifier\n" |
| 7546 | "Summary of BGP neighbor status\n") |
| 7547 | { |
| 7548 | if (strncmp (argv[1], "m", 1) == 0) |
| 7549 | return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST); |
| 7550 | else |
| 7551 | return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 7552 | } |
| 7553 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7554 | DEFUN (show_bgp_ipv4_vpn_summary, |
| 7555 | show_bgp_ipv4_vpn_summary_cmd, |
| 7556 | "show bgp ipv4 vpn summary", |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 7557 | SHOW_STR |
| 7558 | BGP_STR |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7559 | "IPv4\n" |
| 7560 | "Display VPN NLRI specific information\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7561 | "Summary of BGP neighbor status\n") |
| 7562 | { |
| 7563 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); |
| 7564 | } |
| 7565 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7566 | /* `show ip bgp summary' commands. */ |
| 7567 | DEFUN (show_bgp_ipv6_vpn_summary, |
| 7568 | show_bgp_ipv6_vpn_summary_cmd, |
| 7569 | "show bgp ipv6 vpn summary", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7570 | SHOW_STR |
| 7571 | BGP_STR |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7572 | "IPv6\n" |
| 7573 | "Display VPN NLRI specific information\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7574 | "Summary of BGP neighbor status\n") |
| 7575 | { |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7576 | return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7577 | } |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7578 | |
| 7579 | DEFUN (show_bgp_ipv4_encap_summary, |
| 7580 | show_bgp_ipv4_encap_summary_cmd, |
| 7581 | "show bgp ipv4 encap summary", |
| 7582 | SHOW_STR |
| 7583 | BGP_STR |
| 7584 | "IPv4\n" |
| 7585 | "Display ENCAP NLRI specific information\n" |
| 7586 | "Summary of BGP neighbor status\n") |
| 7587 | { |
| 7588 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP); |
| 7589 | } |
| 7590 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7591 | DEFUN (show_bgp_ipv6_encap_summary, |
| 7592 | show_bgp_ipv6_encap_summary_cmd, |
| 7593 | "show bgp ipv6 encap summary", |
| 7594 | SHOW_STR |
| 7595 | BGP_STR |
| 7596 | "IPv6\n" |
| 7597 | "Display ENCAP NLRI specific information\n" |
| 7598 | "Summary of BGP neighbor status\n") |
| 7599 | { |
| 7600 | return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP); |
| 7601 | } |
| 7602 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7603 | DEFUN (show_bgp_instance_summary, |
| 7604 | show_bgp_instance_summary_cmd, |
| 7605 | "show bgp view WORD summary", |
| 7606 | SHOW_STR |
| 7607 | BGP_STR |
| 7608 | "BGP view\n" |
| 7609 | "View name\n" |
| 7610 | "Summary of BGP neighbor status\n") |
| 7611 | { |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7612 | vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7613 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7614 | bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 7615 | vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7616 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7617 | bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST); |
| 7618 | vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7619 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7620 | bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MPLS_VPN); |
| 7621 | vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7622 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7623 | bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_ENCAP); |
| 7624 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7625 | vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7626 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7627 | bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST); |
| 7628 | vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7629 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7630 | bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST); |
| 7631 | vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7632 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7633 | bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MPLS_VPN); |
| 7634 | vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7635 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7636 | bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_ENCAP); |
Lou Berger | 205e674 | 2016-01-12 13:42:11 -0500 | [diff] [blame] | 7637 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7638 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7639 | } |
| 7640 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7641 | DEFUN (show_bgp_instance_ipv4_summary, |
| 7642 | show_bgp_instance_ipv4_summary_cmd, |
| 7643 | "show bgp view WORD ipv4 summary", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7644 | SHOW_STR |
| 7645 | BGP_STR |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7646 | IP_STR |
| 7647 | "Address Family modifier\n" |
| 7648 | "Address Family modifier\n" |
| 7649 | "BGP view\n" |
| 7650 | "View name\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7651 | "Summary of BGP neighbor status\n") |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7652 | { |
| 7653 | vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7654 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7655 | bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 7656 | vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7657 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7658 | bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST); |
| 7659 | vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7660 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7661 | bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MPLS_VPN); |
| 7662 | vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7663 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7664 | bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_ENCAP); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7665 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7666 | return CMD_SUCCESS; |
| 7667 | } |
| 7668 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7669 | DEFUN (show_bgp_instance_ipv6_summary, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7670 | show_bgp_instance_ipv6_summary_cmd, |
| 7671 | "show bgp view WORD ipv6 summary", |
| 7672 | SHOW_STR |
| 7673 | BGP_STR |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7674 | IPV6_STR |
| 7675 | "Address Family modifier\n" |
| 7676 | "Address Family modifier\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7677 | "BGP view\n" |
| 7678 | "View name\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7679 | "Summary of BGP neighbor status\n") |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7680 | { |
| 7681 | vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7682 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7683 | bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST); |
| 7684 | vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7685 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7686 | bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST); |
| 7687 | vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7688 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7689 | bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MPLS_VPN); |
| 7690 | vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7691 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7692 | bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_ENCAP); |
| 7693 | |
| 7694 | return CMD_SUCCESS; |
| 7695 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7696 | |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 7697 | DEFUN (show_bgp_ipv6_safi_summary, |
| 7698 | show_bgp_ipv6_safi_summary_cmd, |
| 7699 | "show bgp ipv6 (unicast|multicast) summary", |
| 7700 | SHOW_STR |
| 7701 | BGP_STR |
| 7702 | "Address family\n" |
| 7703 | "Address Family modifier\n" |
| 7704 | "Address Family modifier\n" |
| 7705 | "Summary of BGP neighbor status\n") |
| 7706 | { |
| 7707 | if (strncmp (argv[0], "m", 1) == 0) |
| 7708 | return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); |
| 7709 | |
| 7710 | return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); |
| 7711 | } |
| 7712 | |
| 7713 | DEFUN (show_bgp_instance_ipv6_safi_summary, |
| 7714 | show_bgp_instance_ipv6_safi_summary_cmd, |
| 7715 | "show bgp view WORD ipv6 (unicast|multicast) summary", |
| 7716 | SHOW_STR |
| 7717 | BGP_STR |
| 7718 | "BGP view\n" |
| 7719 | "View name\n" |
| 7720 | "Address family\n" |
| 7721 | "Address Family modifier\n" |
| 7722 | "Address Family modifier\n" |
| 7723 | "Summary of BGP neighbor status\n") |
| 7724 | { |
| 7725 | if (strncmp (argv[1], "m", 1) == 0) |
| 7726 | return bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST); |
| 7727 | |
| 7728 | return bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST); |
| 7729 | } |
| 7730 | |
Lou Berger | f9b6c39 | 2016-01-12 13:42:09 -0500 | [diff] [blame] | 7731 | /* old command */ |
| 7732 | DEFUN (show_ipv6_bgp_summary, |
| 7733 | show_ipv6_bgp_summary_cmd, |
| 7734 | "show ipv6 bgp summary", |
| 7735 | SHOW_STR |
| 7736 | IPV6_STR |
| 7737 | BGP_STR |
| 7738 | "Summary of BGP neighbor status\n") |
| 7739 | { |
| 7740 | return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); |
| 7741 | } |
| 7742 | |
| 7743 | /* old command */ |
| 7744 | DEFUN (show_ipv6_mbgp_summary, |
| 7745 | show_ipv6_mbgp_summary_cmd, |
| 7746 | "show ipv6 mbgp summary", |
| 7747 | SHOW_STR |
| 7748 | IPV6_STR |
| 7749 | MBGP_STR |
| 7750 | "Summary of BGP neighbor status\n") |
| 7751 | { |
| 7752 | return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); |
| 7753 | } |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7754 | |
| 7755 | /* variations of show bgp [...] summary */ |
| 7756 | |
| 7757 | /* This one is for the 0-keyword variant */ |
| 7758 | DEFUN (show_bgp_summary, |
| 7759 | show_bgp_summary_cmd, |
| 7760 | "show bgp summary", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7761 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7762 | BGP_STR |
| 7763 | "Summary of BGP neighbor status\n") |
| 7764 | { |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7765 | vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7766 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7767 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 7768 | vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7769 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7770 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); |
| 7771 | vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7772 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7773 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); |
| 7774 | vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7775 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7776 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP); |
| 7777 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7778 | vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7779 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7780 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); |
| 7781 | vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7782 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7783 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); |
| 7784 | vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7785 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7786 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN); |
| 7787 | vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7788 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7789 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP); |
Lou Berger | 205e674 | 2016-01-12 13:42:11 -0500 | [diff] [blame] | 7790 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7791 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7792 | } |
| 7793 | |
Lou Berger | f9b6c39 | 2016-01-12 13:42:09 -0500 | [diff] [blame] | 7794 | ALIAS (show_bgp_summary, |
| 7795 | show_bgp_ipv6_summary_cmd, |
| 7796 | "show bgp ipv6 summary", |
| 7797 | SHOW_STR |
| 7798 | BGP_STR |
| 7799 | "Address family\n" |
| 7800 | "Summary of BGP neighbor status\n") |
| 7801 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7802 | DEFUN (show_bgp_summary_1w, |
| 7803 | show_bgp_summary_1w_cmd, |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7804 | "show bgp (ipv4|ipv6|unicast|multicast|vpn|encap) summary", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7805 | SHOW_STR |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7806 | BGP_STR |
| 7807 | IP_STR |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7808 | IP6_STR |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7809 | "Address Family modifier\n" |
| 7810 | "Address Family modifier\n" |
| 7811 | "Address Family modifier\n" |
| 7812 | "Address Family modifier\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7813 | "Summary of BGP neighbor status\n") |
| 7814 | { |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7815 | if (strcmp (argv[0], "ipv4") == 0) { |
| 7816 | vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7817 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7818 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 7819 | vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7820 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7821 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); |
| 7822 | vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7823 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7824 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); |
| 7825 | vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7826 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7827 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP); |
| 7828 | return CMD_SUCCESS; |
| 7829 | } |
Lou Berger | 205e674 | 2016-01-12 13:42:11 -0500 | [diff] [blame] | 7830 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7831 | if (strcmp (argv[0], "ipv6") == 0) { |
| 7832 | vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7833 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7834 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); |
| 7835 | vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7836 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7837 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); |
| 7838 | vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7839 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7840 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN); |
| 7841 | vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 7842 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7843 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP); |
| 7844 | return CMD_SUCCESS; |
| 7845 | } |
Lou Berger | 205e674 | 2016-01-12 13:42:11 -0500 | [diff] [blame] | 7846 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7847 | if (strcmp (argv[0], "unicast") == 0) { |
| 7848 | vty_out(vty, "IPv4 Unicast Summary:%s", VTY_NEWLINE); |
| 7849 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7850 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7851 | vty_out(vty, "%s", VTY_NEWLINE); |
| 7852 | vty_out(vty, "IPv6 Unicast Summary:%s", VTY_NEWLINE); |
| 7853 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 7854 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7855 | return CMD_SUCCESS; |
| 7856 | } |
| 7857 | if (strcmp (argv[0], "multicast") == 0) { |
| 7858 | vty_out(vty, "IPv4 Multicast Summary:%s", VTY_NEWLINE); |
| 7859 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7860 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7861 | vty_out(vty, "%s", VTY_NEWLINE); |
| 7862 | vty_out(vty, "IPv6 Multicast Summary:%s", VTY_NEWLINE); |
| 7863 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 7864 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7865 | return CMD_SUCCESS; |
| 7866 | } |
| 7867 | if (strcmp (argv[0], "vpn") == 0) { |
| 7868 | vty_out(vty, "IPv4 VPN Summary:%s", VTY_NEWLINE); |
| 7869 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7870 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7871 | vty_out(vty, "%s", VTY_NEWLINE); |
| 7872 | vty_out(vty, "IPv6 VPN Summary:%s", VTY_NEWLINE); |
| 7873 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 7874 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7875 | return CMD_SUCCESS; |
| 7876 | } |
| 7877 | if (strcmp (argv[0], "encap") == 0) { |
| 7878 | vty_out(vty, "IPv4 Encap Summary:%s", VTY_NEWLINE); |
| 7879 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7880 | bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7881 | vty_out(vty, "%s", VTY_NEWLINE); |
| 7882 | vty_out(vty, "IPv6 Encap Summary:%s", VTY_NEWLINE); |
| 7883 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 7884 | bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP); |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7885 | return CMD_SUCCESS; |
| 7886 | } |
| 7887 | vty_out(vty, "Unknown keyword: %s%s", argv[0], VTY_NEWLINE); |
| 7888 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7889 | } |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 7890 | |
| 7891 | |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 7892 | |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 7893 | const char * |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7894 | afi_safi_print (afi_t afi, safi_t safi) |
| 7895 | { |
| 7896 | if (afi == AFI_IP && safi == SAFI_UNICAST) |
| 7897 | return "IPv4 Unicast"; |
| 7898 | else if (afi == AFI_IP && safi == SAFI_MULTICAST) |
| 7899 | return "IPv4 Multicast"; |
| 7900 | else if (afi == AFI_IP && safi == SAFI_MPLS_VPN) |
Lou Berger | 9da04bc | 2016-01-12 13:41:55 -0500 | [diff] [blame] | 7901 | return "VPN-IPv4 Unicast"; |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 7902 | else if (afi == AFI_IP && safi == SAFI_ENCAP) |
| 7903 | return "ENCAP-IPv4 Unicast"; |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7904 | else if (afi == AFI_IP6 && safi == SAFI_UNICAST) |
| 7905 | return "IPv6 Unicast"; |
| 7906 | else if (afi == AFI_IP6 && safi == SAFI_MULTICAST) |
| 7907 | return "IPv6 Multicast"; |
Lou Berger | 9da04bc | 2016-01-12 13:41:55 -0500 | [diff] [blame] | 7908 | else if (afi == AFI_IP6 && safi == SAFI_MPLS_VPN) |
| 7909 | return "VPN-IPv6 Unicast"; |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 7910 | else if (afi == AFI_IP6 && safi == SAFI_ENCAP) |
| 7911 | return "ENCAP-IPv6 Unicast"; |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7912 | else |
| 7913 | return "Unknown"; |
| 7914 | } |
| 7915 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7916 | /* Show BGP peer's information. */ |
| 7917 | enum show_type |
| 7918 | { |
| 7919 | show_all, |
| 7920 | show_peer |
| 7921 | }; |
| 7922 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 7923 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7924 | bgp_show_peer_afi_orf_cap (struct vty *vty, struct peer *p, |
| 7925 | afi_t afi, safi_t safi, |
| 7926 | u_int16_t adv_smcap, u_int16_t adv_rmcap, |
| 7927 | u_int16_t rcv_smcap, u_int16_t rcv_rmcap) |
| 7928 | { |
| 7929 | /* Send-Mode */ |
| 7930 | if (CHECK_FLAG (p->af_cap[afi][safi], adv_smcap) |
| 7931 | || CHECK_FLAG (p->af_cap[afi][safi], rcv_smcap)) |
| 7932 | { |
| 7933 | vty_out (vty, " Send-mode: "); |
| 7934 | if (CHECK_FLAG (p->af_cap[afi][safi], adv_smcap)) |
| 7935 | vty_out (vty, "advertised"); |
| 7936 | if (CHECK_FLAG (p->af_cap[afi][safi], rcv_smcap)) |
| 7937 | vty_out (vty, "%sreceived", |
| 7938 | CHECK_FLAG (p->af_cap[afi][safi], adv_smcap) ? |
| 7939 | ", " : ""); |
| 7940 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7941 | } |
| 7942 | |
| 7943 | /* Receive-Mode */ |
| 7944 | if (CHECK_FLAG (p->af_cap[afi][safi], adv_rmcap) |
| 7945 | || CHECK_FLAG (p->af_cap[afi][safi], rcv_rmcap)) |
| 7946 | { |
| 7947 | vty_out (vty, " Receive-mode: "); |
| 7948 | if (CHECK_FLAG (p->af_cap[afi][safi], adv_rmcap)) |
| 7949 | vty_out (vty, "advertised"); |
| 7950 | if (CHECK_FLAG (p->af_cap[afi][safi], rcv_rmcap)) |
| 7951 | vty_out (vty, "%sreceived", |
| 7952 | CHECK_FLAG (p->af_cap[afi][safi], adv_rmcap) ? |
| 7953 | ", " : ""); |
| 7954 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7955 | } |
| 7956 | } |
| 7957 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 7958 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7959 | bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi) |
| 7960 | { |
| 7961 | struct bgp_filter *filter; |
| 7962 | char orf_pfx_name[BUFSIZ]; |
| 7963 | int orf_pfx_count; |
| 7964 | |
| 7965 | filter = &p->filter[afi][safi]; |
| 7966 | |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7967 | vty_out (vty, " For address family: %s%s", afi_safi_print (afi, safi), |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7968 | VTY_NEWLINE); |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7969 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7970 | if (p->af_group[afi][safi]) |
| 7971 | vty_out (vty, " %s peer-group member%s", p->group->name, VTY_NEWLINE); |
| 7972 | |
| 7973 | if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV) |
| 7974 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_RCV) |
| 7975 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_OLD_RCV) |
| 7976 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV) |
| 7977 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_RCV) |
| 7978 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_OLD_RCV)) |
| 7979 | vty_out (vty, " AF-dependant capabilities:%s", VTY_NEWLINE); |
| 7980 | |
| 7981 | if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV) |
| 7982 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_RCV) |
| 7983 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV) |
| 7984 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_RCV)) |
| 7985 | { |
| 7986 | vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s", |
| 7987 | ORF_TYPE_PREFIX, VTY_NEWLINE); |
| 7988 | bgp_show_peer_afi_orf_cap (vty, p, afi, safi, |
| 7989 | PEER_CAP_ORF_PREFIX_SM_ADV, |
| 7990 | PEER_CAP_ORF_PREFIX_RM_ADV, |
| 7991 | PEER_CAP_ORF_PREFIX_SM_RCV, |
| 7992 | PEER_CAP_ORF_PREFIX_RM_RCV); |
| 7993 | } |
| 7994 | if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV) |
| 7995 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_OLD_RCV) |
| 7996 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV) |
| 7997 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_OLD_RCV)) |
| 7998 | { |
| 7999 | vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s", |
| 8000 | ORF_TYPE_PREFIX_OLD, VTY_NEWLINE); |
| 8001 | bgp_show_peer_afi_orf_cap (vty, p, afi, safi, |
| 8002 | PEER_CAP_ORF_PREFIX_SM_ADV, |
| 8003 | PEER_CAP_ORF_PREFIX_RM_ADV, |
| 8004 | PEER_CAP_ORF_PREFIX_SM_OLD_RCV, |
| 8005 | PEER_CAP_ORF_PREFIX_RM_OLD_RCV); |
| 8006 | } |
| 8007 | |
| 8008 | sprintf (orf_pfx_name, "%s.%d.%d", p->host, afi, safi); |
| 8009 | orf_pfx_count = prefix_bgp_show_prefix_list (NULL, afi, orf_pfx_name); |
| 8010 | |
| 8011 | if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_ORF_PREFIX_SEND) |
| 8012 | || orf_pfx_count) |
| 8013 | { |
| 8014 | vty_out (vty, " Outbound Route Filter (ORF):"); |
| 8015 | if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_ORF_PREFIX_SEND)) |
| 8016 | vty_out (vty, " sent;"); |
| 8017 | if (orf_pfx_count) |
| 8018 | vty_out (vty, " received (%d entries)", orf_pfx_count); |
| 8019 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8020 | } |
| 8021 | if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_ORF_WAIT_REFRESH)) |
| 8022 | vty_out (vty, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTY_NEWLINE); |
| 8023 | |
| 8024 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REFLECTOR_CLIENT)) |
| 8025 | vty_out (vty, " Route-Reflector Client%s", VTY_NEWLINE); |
| 8026 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT)) |
| 8027 | vty_out (vty, " Route-Server Client%s", VTY_NEWLINE); |
| 8028 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SOFT_RECONFIG)) |
| 8029 | vty_out (vty, " Inbound soft reconfiguration allowed%s", VTY_NEWLINE); |
| 8030 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REMOVE_PRIVATE_AS)) |
| 8031 | vty_out (vty, " Private AS number removed from updates to this neighbor%s", VTY_NEWLINE); |
| 8032 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_NEXTHOP_SELF)) |
| 8033 | vty_out (vty, " NEXT_HOP is always this router%s", VTY_NEWLINE); |
| 8034 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_AS_PATH_UNCHANGED)) |
| 8035 | vty_out (vty, " AS_PATH is propagated unchanged to this neighbor%s", VTY_NEWLINE); |
| 8036 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_NEXTHOP_UNCHANGED)) |
| 8037 | vty_out (vty, " NEXT_HOP is propagated unchanged to this neighbor%s", VTY_NEWLINE); |
| 8038 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MED_UNCHANGED)) |
| 8039 | vty_out (vty, " MED is propagated unchanged to this neighbor%s", VTY_NEWLINE); |
| 8040 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY) |
| 8041 | || CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY)) |
| 8042 | { |
| 8043 | vty_out (vty, " Community attribute sent to this neighbor"); |
| 8044 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY) |
| 8045 | && CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY)) |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8046 | vty_out (vty, "(both)%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8047 | 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] | 8048 | vty_out (vty, "(extended)%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8049 | else |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8050 | vty_out (vty, "(standard)%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8051 | } |
| 8052 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_DEFAULT_ORIGINATE)) |
| 8053 | { |
| 8054 | vty_out (vty, " Default information originate,"); |
| 8055 | |
| 8056 | if (p->default_rmap[afi][safi].name) |
| 8057 | vty_out (vty, " default route-map %s%s,", |
| 8058 | p->default_rmap[afi][safi].map ? "*" : "", |
| 8059 | p->default_rmap[afi][safi].name); |
| 8060 | if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_DEFAULT_ORIGINATE)) |
| 8061 | vty_out (vty, " default sent%s", VTY_NEWLINE); |
| 8062 | else |
| 8063 | vty_out (vty, " default not sent%s", VTY_NEWLINE); |
| 8064 | } |
| 8065 | |
| 8066 | if (filter->plist[FILTER_IN].name |
| 8067 | || filter->dlist[FILTER_IN].name |
| 8068 | || filter->aslist[FILTER_IN].name |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8069 | || filter->map[RMAP_IN].name) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8070 | vty_out (vty, " Inbound path policy configured%s", VTY_NEWLINE); |
| 8071 | if (filter->plist[FILTER_OUT].name |
| 8072 | || filter->dlist[FILTER_OUT].name |
| 8073 | || filter->aslist[FILTER_OUT].name |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8074 | || filter->map[RMAP_OUT].name |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8075 | || filter->usmap.name) |
| 8076 | vty_out (vty, " Outbound path policy configured%s", VTY_NEWLINE); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8077 | if (filter->map[RMAP_IMPORT].name) |
| 8078 | vty_out (vty, " Import policy for this RS-client configured%s", VTY_NEWLINE); |
| 8079 | if (filter->map[RMAP_EXPORT].name) |
| 8080 | vty_out (vty, " Export policy for this RS-client configured%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8081 | |
| 8082 | /* prefix-list */ |
| 8083 | if (filter->plist[FILTER_IN].name) |
| 8084 | vty_out (vty, " Incoming update prefix filter list is %s%s%s", |
| 8085 | filter->plist[FILTER_IN].plist ? "*" : "", |
| 8086 | filter->plist[FILTER_IN].name, |
| 8087 | VTY_NEWLINE); |
| 8088 | if (filter->plist[FILTER_OUT].name) |
| 8089 | vty_out (vty, " Outgoing update prefix filter list is %s%s%s", |
| 8090 | filter->plist[FILTER_OUT].plist ? "*" : "", |
| 8091 | filter->plist[FILTER_OUT].name, |
| 8092 | VTY_NEWLINE); |
| 8093 | |
| 8094 | /* distribute-list */ |
| 8095 | if (filter->dlist[FILTER_IN].name) |
| 8096 | vty_out (vty, " Incoming update network filter list is %s%s%s", |
| 8097 | filter->dlist[FILTER_IN].alist ? "*" : "", |
| 8098 | filter->dlist[FILTER_IN].name, |
| 8099 | VTY_NEWLINE); |
| 8100 | if (filter->dlist[FILTER_OUT].name) |
| 8101 | vty_out (vty, " Outgoing update network filter list is %s%s%s", |
| 8102 | filter->dlist[FILTER_OUT].alist ? "*" : "", |
| 8103 | filter->dlist[FILTER_OUT].name, |
| 8104 | VTY_NEWLINE); |
| 8105 | |
| 8106 | /* filter-list. */ |
| 8107 | if (filter->aslist[FILTER_IN].name) |
| 8108 | vty_out (vty, " Incoming update AS path filter list is %s%s%s", |
| 8109 | filter->aslist[FILTER_IN].aslist ? "*" : "", |
| 8110 | filter->aslist[FILTER_IN].name, |
| 8111 | VTY_NEWLINE); |
| 8112 | if (filter->aslist[FILTER_OUT].name) |
| 8113 | vty_out (vty, " Outgoing update AS path filter list is %s%s%s", |
| 8114 | filter->aslist[FILTER_OUT].aslist ? "*" : "", |
| 8115 | filter->aslist[FILTER_OUT].name, |
| 8116 | VTY_NEWLINE); |
| 8117 | |
| 8118 | /* route-map. */ |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8119 | if (filter->map[RMAP_IN].name) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8120 | vty_out (vty, " Route map for incoming advertisements is %s%s%s", |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8121 | filter->map[RMAP_IN].map ? "*" : "", |
| 8122 | filter->map[RMAP_IN].name, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8123 | VTY_NEWLINE); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8124 | if (filter->map[RMAP_OUT].name) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8125 | vty_out (vty, " Route map for outgoing advertisements is %s%s%s", |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8126 | filter->map[RMAP_OUT].map ? "*" : "", |
| 8127 | filter->map[RMAP_OUT].name, |
| 8128 | VTY_NEWLINE); |
| 8129 | if (filter->map[RMAP_IMPORT].name) |
| 8130 | vty_out (vty, " Route map for advertisements going into this RS-client's table is %s%s%s", |
| 8131 | filter->map[RMAP_IMPORT].map ? "*" : "", |
| 8132 | filter->map[RMAP_IMPORT].name, |
| 8133 | VTY_NEWLINE); |
| 8134 | if (filter->map[RMAP_EXPORT].name) |
| 8135 | vty_out (vty, " Route map for advertisements coming from this RS-client is %s%s%s", |
| 8136 | filter->map[RMAP_EXPORT].map ? "*" : "", |
| 8137 | filter->map[RMAP_EXPORT].name, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8138 | VTY_NEWLINE); |
| 8139 | |
| 8140 | /* unsuppress-map */ |
| 8141 | if (filter->usmap.name) |
| 8142 | vty_out (vty, " Route map for selective unsuppress is %s%s%s", |
| 8143 | filter->usmap.map ? "*" : "", |
| 8144 | filter->usmap.name, VTY_NEWLINE); |
| 8145 | |
| 8146 | /* Receive prefix count */ |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 8147 | vty_out (vty, " %ld accepted prefixes%s", p->pcount[afi][safi], VTY_NEWLINE); |
| 8148 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8149 | /* Maximum prefix */ |
| 8150 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX)) |
| 8151 | { |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 8152 | vty_out (vty, " Maximum prefixes allowed %ld%s%s", p->pmax[afi][safi], |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8153 | CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX_WARNING) |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 8154 | ? " (warning-only)" : "", VTY_NEWLINE); |
| 8155 | vty_out (vty, " Threshold for warning message %d%%", |
| 8156 | p->pmax_threshold[afi][safi]); |
| 8157 | if (p->pmax_restart[afi][safi]) |
| 8158 | vty_out (vty, ", restart interval %d min", p->pmax_restart[afi][safi]); |
| 8159 | vty_out (vty, "%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8160 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8161 | |
| 8162 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8163 | } |
| 8164 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 8165 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8166 | bgp_show_peer (struct vty *vty, struct peer *p) |
| 8167 | { |
| 8168 | struct bgp *bgp; |
| 8169 | char buf1[BUFSIZ]; |
| 8170 | char timebuf[BGP_UPTIME_LEN]; |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8171 | afi_t afi; |
| 8172 | safi_t safi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8173 | |
| 8174 | bgp = p->bgp; |
| 8175 | |
| 8176 | /* Configured IP address. */ |
| 8177 | vty_out (vty, "BGP neighbor is %s, ", p->host); |
Denis Ovsienko | aea339f | 2009-04-30 17:16:22 +0400 | [diff] [blame] | 8178 | vty_out (vty, "remote AS %u, ", p->as); |
Andrew Certain | 9d3f970 | 2012-11-07 23:50:07 +0000 | [diff] [blame] | 8179 | vty_out (vty, "local AS %u%s%s, ", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8180 | p->change_local_as ? p->change_local_as : p->local_as, |
| 8181 | CHECK_FLAG (p->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND) ? |
Andrew Certain | 9d3f970 | 2012-11-07 23:50:07 +0000 | [diff] [blame] | 8182 | " no-prepend" : "", |
| 8183 | CHECK_FLAG (p->flags, PEER_FLAG_LOCAL_AS_REPLACE_AS) ? |
| 8184 | " replace-as" : ""); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8185 | vty_out (vty, "%s link%s", |
| 8186 | p->as == p->local_as ? "internal" : "external", |
| 8187 | VTY_NEWLINE); |
| 8188 | |
| 8189 | /* Description. */ |
| 8190 | if (p->desc) |
| 8191 | vty_out (vty, " Description: %s%s", p->desc, VTY_NEWLINE); |
| 8192 | |
| 8193 | /* Peer-group */ |
| 8194 | if (p->group) |
| 8195 | vty_out (vty, " Member of peer-group %s for session parameters%s", |
| 8196 | p->group->name, VTY_NEWLINE); |
| 8197 | |
| 8198 | /* Administrative shutdown. */ |
| 8199 | if (CHECK_FLAG (p->flags, PEER_FLAG_SHUTDOWN)) |
| 8200 | vty_out (vty, " Administratively shut down%s", VTY_NEWLINE); |
| 8201 | |
| 8202 | /* BGP Version. */ |
| 8203 | vty_out (vty, " BGP version 4"); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8204 | vty_out (vty, ", remote router ID %s%s", |
| 8205 | inet_ntop (AF_INET, &p->remote_id, buf1, BUFSIZ), |
| 8206 | VTY_NEWLINE); |
| 8207 | |
| 8208 | /* Confederation */ |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 8209 | if (CHECK_FLAG (bgp->config, BGP_CONFIG_CONFEDERATION) |
| 8210 | && bgp_confederation_peers_check (bgp, p->as)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8211 | vty_out (vty, " Neighbor under common administration%s", VTY_NEWLINE); |
| 8212 | |
| 8213 | /* Status. */ |
| 8214 | vty_out (vty, " BGP state = %s", |
| 8215 | LOOKUP (bgp_status_msg, p->status)); |
| 8216 | if (p->status == Established) |
| 8217 | vty_out (vty, ", up for %8s", |
| 8218 | peer_uptime (p->uptime, timebuf, BGP_UPTIME_LEN)); |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8219 | else if (p->status == Active) |
| 8220 | { |
| 8221 | if (CHECK_FLAG (p->flags, PEER_FLAG_PASSIVE)) |
| 8222 | vty_out (vty, " (passive)"); |
| 8223 | else if (CHECK_FLAG (p->sflags, PEER_STATUS_NSF_WAIT)) |
| 8224 | vty_out (vty, " (NSF passive)"); |
| 8225 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8226 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8227 | |
| 8228 | /* read timer */ |
| 8229 | vty_out (vty, " Last read %s", peer_uptime (p->readtime, timebuf, BGP_UPTIME_LEN)); |
| 8230 | |
| 8231 | /* Configured timer values. */ |
| 8232 | vty_out (vty, ", hold time is %d, keepalive interval is %d seconds%s", |
| 8233 | p->v_holdtime, p->v_keepalive, VTY_NEWLINE); |
| 8234 | if (CHECK_FLAG (p->config, PEER_CONFIG_TIMER)) |
| 8235 | { |
| 8236 | vty_out (vty, " Configured hold time is %d", p->holdtime); |
| 8237 | vty_out (vty, ", keepalive interval is %d seconds%s", |
| 8238 | p->keepalive, VTY_NEWLINE); |
| 8239 | } |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8240 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8241 | /* Capability. */ |
| 8242 | if (p->status == Established) |
| 8243 | { |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8244 | if (p->cap |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8245 | || p->afc_adv[AFI_IP][SAFI_UNICAST] |
| 8246 | || p->afc_recv[AFI_IP][SAFI_UNICAST] |
| 8247 | || p->afc_adv[AFI_IP][SAFI_MULTICAST] |
| 8248 | || p->afc_recv[AFI_IP][SAFI_MULTICAST] |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8249 | || p->afc_adv[AFI_IP6][SAFI_UNICAST] |
| 8250 | || p->afc_recv[AFI_IP6][SAFI_UNICAST] |
| 8251 | || p->afc_adv[AFI_IP6][SAFI_MULTICAST] |
| 8252 | || p->afc_recv[AFI_IP6][SAFI_MULTICAST] |
Lou Berger | 9da04bc | 2016-01-12 13:41:55 -0500 | [diff] [blame] | 8253 | || p->afc_adv[AFI_IP6][SAFI_MPLS_VPN] |
| 8254 | || p->afc_recv[AFI_IP6][SAFI_MPLS_VPN] |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 8255 | || p->afc_adv[AFI_IP6][SAFI_ENCAP] |
| 8256 | || p->afc_recv[AFI_IP6][SAFI_ENCAP] |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 8257 | || p->afc_adv[AFI_IP][SAFI_ENCAP] |
| 8258 | || p->afc_recv[AFI_IP][SAFI_ENCAP] |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8259 | || p->afc_adv[AFI_IP][SAFI_MPLS_VPN] |
| 8260 | || p->afc_recv[AFI_IP][SAFI_MPLS_VPN]) |
| 8261 | { |
| 8262 | vty_out (vty, " Neighbor capabilities:%s", VTY_NEWLINE); |
| 8263 | |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 8264 | /* AS4 */ |
| 8265 | if (CHECK_FLAG (p->cap, PEER_CAP_AS4_RCV) |
| 8266 | || CHECK_FLAG (p->cap, PEER_CAP_AS4_ADV)) |
| 8267 | { |
| 8268 | vty_out (vty, " 4 Byte AS:"); |
| 8269 | if (CHECK_FLAG (p->cap, PEER_CAP_AS4_ADV)) |
| 8270 | vty_out (vty, " advertised"); |
| 8271 | if (CHECK_FLAG (p->cap, PEER_CAP_AS4_RCV)) |
| 8272 | vty_out (vty, " %sreceived", |
| 8273 | CHECK_FLAG (p->cap, PEER_CAP_AS4_ADV) ? "and " : ""); |
| 8274 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8275 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8276 | /* Dynamic */ |
| 8277 | if (CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_RCV) |
| 8278 | || CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_ADV)) |
| 8279 | { |
| 8280 | vty_out (vty, " Dynamic:"); |
| 8281 | if (CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_ADV)) |
| 8282 | vty_out (vty, " advertised"); |
| 8283 | if (CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_RCV)) |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8284 | vty_out (vty, " %sreceived", |
| 8285 | CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_ADV) ? "and " : ""); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8286 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8287 | } |
| 8288 | |
| 8289 | /* Route Refresh */ |
| 8290 | if (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_ADV) |
| 8291 | || CHECK_FLAG (p->cap, PEER_CAP_REFRESH_NEW_RCV) |
| 8292 | || CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV)) |
| 8293 | { |
| 8294 | vty_out (vty, " Route refresh:"); |
| 8295 | if (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_ADV)) |
| 8296 | vty_out (vty, " advertised"); |
| 8297 | if (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_NEW_RCV) |
| 8298 | || CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV)) |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8299 | vty_out (vty, " %sreceived(%s)", |
| 8300 | CHECK_FLAG (p->cap, PEER_CAP_REFRESH_ADV) ? "and " : "", |
| 8301 | (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV) |
| 8302 | && CHECK_FLAG (p->cap, PEER_CAP_REFRESH_NEW_RCV)) ? |
| 8303 | "old & new" : CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV) ? "old" : "new"); |
| 8304 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8305 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8306 | } |
| 8307 | |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8308 | /* Multiprotocol Extensions */ |
| 8309 | for (afi = AFI_IP ; afi < AFI_MAX ; afi++) |
| 8310 | for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) |
| 8311 | if (p->afc_adv[afi][safi] || p->afc_recv[afi][safi]) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8312 | { |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8313 | vty_out (vty, " Address family %s:", afi_safi_print (afi, safi)); |
| 8314 | if (p->afc_adv[afi][safi]) |
| 8315 | vty_out (vty, " advertised"); |
| 8316 | if (p->afc_recv[afi][safi]) |
| 8317 | vty_out (vty, " %sreceived", p->afc_adv[afi][safi] ? "and " : ""); |
| 8318 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8319 | } |
| 8320 | |
| 8321 | /* Gracefull Restart */ |
| 8322 | if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV) |
| 8323 | || CHECK_FLAG (p->cap, PEER_CAP_RESTART_ADV)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8324 | { |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8325 | vty_out (vty, " Graceful Restart Capabilty:"); |
| 8326 | if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_ADV)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8327 | vty_out (vty, " advertised"); |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8328 | if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV)) |
| 8329 | vty_out (vty, " %sreceived", |
| 8330 | CHECK_FLAG (p->cap, PEER_CAP_RESTART_ADV) ? "and " : ""); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8331 | vty_out (vty, "%s", VTY_NEWLINE); |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8332 | |
| 8333 | if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8334 | { |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8335 | int restart_af_count = 0; |
| 8336 | |
| 8337 | vty_out (vty, " Remote Restart timer is %d seconds%s", |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8338 | p->v_gr_restart, VTY_NEWLINE); |
| 8339 | vty_out (vty, " Address families by peer:%s ", VTY_NEWLINE); |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8340 | |
| 8341 | for (afi = AFI_IP ; afi < AFI_MAX ; afi++) |
| 8342 | for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) |
| 8343 | if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_RESTART_AF_RCV)) |
| 8344 | { |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8345 | vty_out (vty, "%s%s(%s)", restart_af_count ? ", " : "", |
| 8346 | afi_safi_print (afi, safi), |
| 8347 | CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_RESTART_AF_PRESERVE_RCV) ? |
| 8348 | "preserved" : "not preserved"); |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8349 | restart_af_count++; |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8350 | } |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8351 | if (! restart_af_count) |
| 8352 | vty_out (vty, "none"); |
| 8353 | vty_out (vty, "%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8354 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8355 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8356 | } |
| 8357 | } |
| 8358 | |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8359 | /* graceful restart information */ |
| 8360 | if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV) |
| 8361 | || p->t_gr_restart |
| 8362 | || p->t_gr_stale) |
| 8363 | { |
| 8364 | int eor_send_af_count = 0; |
| 8365 | int eor_receive_af_count = 0; |
| 8366 | |
| 8367 | vty_out (vty, " Graceful restart informations:%s", VTY_NEWLINE); |
| 8368 | if (p->status == Established) |
| 8369 | { |
| 8370 | vty_out (vty, " End-of-RIB send: "); |
| 8371 | for (afi = AFI_IP ; afi < AFI_MAX ; afi++) |
| 8372 | for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) |
| 8373 | if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_EOR_SEND)) |
| 8374 | { |
| 8375 | vty_out (vty, "%s%s", eor_send_af_count ? ", " : "", |
| 8376 | afi_safi_print (afi, safi)); |
| 8377 | eor_send_af_count++; |
| 8378 | } |
| 8379 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8380 | |
| 8381 | vty_out (vty, " End-of-RIB received: "); |
| 8382 | for (afi = AFI_IP ; afi < AFI_MAX ; afi++) |
| 8383 | for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) |
| 8384 | if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_EOR_RECEIVED)) |
| 8385 | { |
| 8386 | vty_out (vty, "%s%s", eor_receive_af_count ? ", " : "", |
| 8387 | afi_safi_print (afi, safi)); |
| 8388 | eor_receive_af_count++; |
| 8389 | } |
| 8390 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8391 | } |
| 8392 | |
| 8393 | if (p->t_gr_restart) |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 8394 | vty_out (vty, " The remaining time of restart timer is %ld%s", |
| 8395 | thread_timer_remain_second (p->t_gr_restart), VTY_NEWLINE); |
| 8396 | |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8397 | if (p->t_gr_stale) |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 8398 | vty_out (vty, " The remaining time of stalepath timer is %ld%s", |
| 8399 | thread_timer_remain_second (p->t_gr_stale), VTY_NEWLINE); |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8400 | } |
| 8401 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8402 | /* Packet counts. */ |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8403 | vty_out (vty, " Message statistics:%s", VTY_NEWLINE); |
| 8404 | vty_out (vty, " Inq depth is 0%s", VTY_NEWLINE); |
Paul Jakma | 0b2aa3a | 2007-10-14 22:32:21 +0000 | [diff] [blame] | 8405 | 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] | 8406 | vty_out (vty, " Sent Rcvd%s", VTY_NEWLINE); |
| 8407 | vty_out (vty, " Opens: %10d %10d%s", p->open_out, p->open_in, VTY_NEWLINE); |
| 8408 | vty_out (vty, " Notifications: %10d %10d%s", p->notify_out, p->notify_in, VTY_NEWLINE); |
| 8409 | vty_out (vty, " Updates: %10d %10d%s", p->update_out, p->update_in, VTY_NEWLINE); |
| 8410 | vty_out (vty, " Keepalives: %10d %10d%s", p->keepalive_out, p->keepalive_in, VTY_NEWLINE); |
| 8411 | vty_out (vty, " Route Refresh: %10d %10d%s", p->refresh_out, p->refresh_in, VTY_NEWLINE); |
| 8412 | vty_out (vty, " Capability: %10d %10d%s", p->dynamic_cap_out, p->dynamic_cap_in, VTY_NEWLINE); |
| 8413 | vty_out (vty, " Total: %10d %10d%s", p->open_out + p->notify_out + |
| 8414 | p->update_out + p->keepalive_out + p->refresh_out + p->dynamic_cap_out, |
| 8415 | p->open_in + p->notify_in + p->update_in + p->keepalive_in + p->refresh_in + |
| 8416 | p->dynamic_cap_in, VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8417 | |
| 8418 | /* advertisement-interval */ |
| 8419 | vty_out (vty, " Minimum time between advertisement runs is %d seconds%s", |
| 8420 | p->v_routeadv, VTY_NEWLINE); |
| 8421 | |
| 8422 | /* Update-source. */ |
| 8423 | if (p->update_if || p->update_source) |
| 8424 | { |
| 8425 | vty_out (vty, " Update source is "); |
| 8426 | if (p->update_if) |
| 8427 | vty_out (vty, "%s", p->update_if); |
| 8428 | else if (p->update_source) |
| 8429 | vty_out (vty, "%s", |
| 8430 | sockunion2str (p->update_source, buf1, SU_ADDRSTRLEN)); |
| 8431 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8432 | } |
| 8433 | |
| 8434 | /* Default weight */ |
| 8435 | if (CHECK_FLAG (p->config, PEER_CONFIG_WEIGHT)) |
| 8436 | vty_out (vty, " Default weight %d%s", p->weight, |
| 8437 | VTY_NEWLINE); |
| 8438 | |
| 8439 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8440 | |
| 8441 | /* Address Family Information */ |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8442 | for (afi = AFI_IP ; afi < AFI_MAX ; afi++) |
| 8443 | for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) |
| 8444 | if (p->afc[afi][safi]) |
| 8445 | bgp_show_peer_afi (vty, p, afi, safi); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8446 | |
| 8447 | vty_out (vty, " Connections established %d; dropped %d%s", |
| 8448 | p->established, p->dropped, |
| 8449 | VTY_NEWLINE); |
| 8450 | |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 8451 | if (! p->dropped) |
| 8452 | vty_out (vty, " Last reset never%s", VTY_NEWLINE); |
| 8453 | else |
| 8454 | vty_out (vty, " Last reset %s, due to %s%s", |
| 8455 | peer_uptime (p->resettime, timebuf, BGP_UPTIME_LEN), |
| 8456 | peer_down_str[(int) p->last_reset], VTY_NEWLINE); |
paul | 848973c | 2003-08-13 00:32:49 +0000 | [diff] [blame] | 8457 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8458 | if (CHECK_FLAG (p->sflags, PEER_STATUS_PREFIX_OVERFLOW)) |
| 8459 | { |
| 8460 | 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] | 8461 | |
| 8462 | if (p->t_pmax_restart) |
| 8463 | vty_out (vty, " Reduce the no. of prefix from %s, will restart in %ld seconds%s", |
| 8464 | p->host, thread_timer_remain_second (p->t_pmax_restart), |
| 8465 | VTY_NEWLINE); |
| 8466 | else |
| 8467 | vty_out (vty, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s", |
| 8468 | p->host, VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8469 | } |
| 8470 | |
Stephen Hemminger | f5a4827 | 2011-03-24 17:30:21 +0000 | [diff] [blame] | 8471 | /* EBGP Multihop and GTSM */ |
Jorge Boncompte [DTI2] | 6d85b15 | 2012-05-07 16:52:54 +0000 | [diff] [blame] | 8472 | if (p->sort != BGP_PEER_IBGP) |
Stephen Hemminger | f5a4827 | 2011-03-24 17:30:21 +0000 | [diff] [blame] | 8473 | { |
| 8474 | if (p->gtsm_hops > 0) |
| 8475 | vty_out (vty, " External BGP neighbor may be up to %d hops away.%s", |
| 8476 | p->gtsm_hops, VTY_NEWLINE); |
| 8477 | else if (p->ttl > 1) |
| 8478 | vty_out (vty, " External BGP neighbor may be up to %d hops away.%s", |
| 8479 | p->ttl, VTY_NEWLINE); |
| 8480 | } |
Pradosh Mohapatra | 5d804b4 | 2013-09-12 03:37:07 +0000 | [diff] [blame] | 8481 | else |
| 8482 | { |
| 8483 | if (p->gtsm_hops > 0) |
| 8484 | vty_out (vty, " Internal BGP neighbor may be up to %d hops away.%s", |
| 8485 | p->gtsm_hops, VTY_NEWLINE); |
| 8486 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8487 | |
| 8488 | /* Local address. */ |
| 8489 | if (p->su_local) |
| 8490 | { |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8491 | vty_out (vty, "Local host: %s, Local port: %d%s", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8492 | sockunion2str (p->su_local, buf1, SU_ADDRSTRLEN), |
| 8493 | ntohs (p->su_local->sin.sin_port), |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8494 | VTY_NEWLINE); |
| 8495 | } |
| 8496 | |
| 8497 | /* Remote address. */ |
| 8498 | if (p->su_remote) |
| 8499 | { |
| 8500 | vty_out (vty, "Foreign host: %s, Foreign port: %d%s", |
| 8501 | sockunion2str (p->su_remote, buf1, SU_ADDRSTRLEN), |
| 8502 | ntohs (p->su_remote->sin.sin_port), |
| 8503 | VTY_NEWLINE); |
| 8504 | } |
| 8505 | |
| 8506 | /* Nexthop display. */ |
| 8507 | if (p->su_local) |
| 8508 | { |
| 8509 | vty_out (vty, "Nexthop: %s%s", |
| 8510 | inet_ntop (AF_INET, &p->nexthop.v4, buf1, BUFSIZ), |
| 8511 | VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8512 | vty_out (vty, "Nexthop global: %s%s", |
| 8513 | inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, BUFSIZ), |
| 8514 | VTY_NEWLINE); |
| 8515 | vty_out (vty, "Nexthop local: %s%s", |
| 8516 | inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, BUFSIZ), |
| 8517 | VTY_NEWLINE); |
| 8518 | vty_out (vty, "BGP connection: %s%s", |
| 8519 | p->shared_network ? "shared network" : "non shared network", |
| 8520 | VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8521 | } |
| 8522 | |
Timo Teräs | ef75770 | 2015-04-29 09:43:04 +0300 | [diff] [blame] | 8523 | /* TCP metrics. */ |
| 8524 | if (p->status == Established && p->rtt) |
| 8525 | vty_out (vty, "Estimated round trip time: %d ms%s", |
| 8526 | p->rtt, VTY_NEWLINE); |
| 8527 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8528 | /* Timer information. */ |
| 8529 | if (p->t_start) |
| 8530 | vty_out (vty, "Next start timer due in %ld seconds%s", |
| 8531 | thread_timer_remain_second (p->t_start), VTY_NEWLINE); |
| 8532 | if (p->t_connect) |
| 8533 | vty_out (vty, "Next connect timer due in %ld seconds%s", |
| 8534 | thread_timer_remain_second (p->t_connect), VTY_NEWLINE); |
| 8535 | |
| 8536 | vty_out (vty, "Read thread: %s Write thread: %s%s", |
| 8537 | p->t_read ? "on" : "off", |
| 8538 | p->t_write ? "on" : "off", |
| 8539 | VTY_NEWLINE); |
| 8540 | |
| 8541 | if (p->notify.code == BGP_NOTIFY_OPEN_ERR |
| 8542 | && p->notify.subcode == BGP_NOTIFY_OPEN_UNSUP_CAPBL) |
| 8543 | bgp_capability_vty_out (vty, p); |
| 8544 | |
| 8545 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8546 | } |
| 8547 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 8548 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8549 | bgp_show_neighbor (struct vty *vty, struct bgp *bgp, |
| 8550 | enum show_type type, union sockunion *su) |
| 8551 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 8552 | struct listnode *node, *nnode; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8553 | struct peer *peer; |
| 8554 | int find = 0; |
| 8555 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 8556 | for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8557 | { |
| 8558 | switch (type) |
| 8559 | { |
| 8560 | case show_all: |
| 8561 | bgp_show_peer (vty, peer); |
| 8562 | break; |
| 8563 | case show_peer: |
| 8564 | if (sockunion_same (&peer->su, su)) |
| 8565 | { |
| 8566 | find = 1; |
| 8567 | bgp_show_peer (vty, peer); |
| 8568 | } |
| 8569 | break; |
| 8570 | } |
| 8571 | } |
| 8572 | |
| 8573 | if (type == show_peer && ! find) |
| 8574 | vty_out (vty, "%% No such neighbor%s", VTY_NEWLINE); |
| 8575 | |
| 8576 | return CMD_SUCCESS; |
| 8577 | } |
| 8578 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 8579 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 8580 | bgp_show_neighbor_vty (struct vty *vty, const char *name, |
| 8581 | enum show_type type, const char *ip_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8582 | { |
| 8583 | int ret; |
| 8584 | struct bgp *bgp; |
| 8585 | union sockunion su; |
| 8586 | |
| 8587 | if (ip_str) |
| 8588 | { |
| 8589 | ret = str2sockunion (ip_str, &su); |
| 8590 | if (ret < 0) |
| 8591 | { |
| 8592 | vty_out (vty, "%% Malformed address: %s%s", ip_str, VTY_NEWLINE); |
| 8593 | return CMD_WARNING; |
| 8594 | } |
| 8595 | } |
| 8596 | |
| 8597 | if (name) |
| 8598 | { |
| 8599 | bgp = bgp_lookup_by_name (name); |
| 8600 | |
| 8601 | if (! bgp) |
| 8602 | { |
| 8603 | vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE); |
| 8604 | return CMD_WARNING; |
| 8605 | } |
| 8606 | |
| 8607 | bgp_show_neighbor (vty, bgp, type, &su); |
| 8608 | |
| 8609 | return CMD_SUCCESS; |
| 8610 | } |
| 8611 | |
| 8612 | bgp = bgp_get_default (); |
| 8613 | |
| 8614 | if (bgp) |
| 8615 | bgp_show_neighbor (vty, bgp, type, &su); |
| 8616 | |
| 8617 | return CMD_SUCCESS; |
| 8618 | } |
| 8619 | |
Lou Berger | f9b6c39 | 2016-01-12 13:42:09 -0500 | [diff] [blame] | 8620 | /* "show ip bgp neighbors" commands. */DEFUN (show_ip_bgp_neighbors, |
| 8621 | show_ip_bgp_neighbors_cmd, |
| 8622 | "show ip bgp neighbors", |
| 8623 | SHOW_STR |
| 8624 | IP_STR |
| 8625 | BGP_STR |
| 8626 | "Detailed information on TCP and BGP neighbor connections\n") |
| 8627 | { |
| 8628 | return bgp_show_neighbor_vty (vty, NULL, show_all, NULL); |
| 8629 | } |
| 8630 | |
| 8631 | ALIAS (show_ip_bgp_neighbors, |
| 8632 | show_ip_bgp_ipv4_neighbors_cmd, |
| 8633 | "show ip bgp ipv4 (unicast|multicast) neighbors", |
| 8634 | SHOW_STR |
| 8635 | IP_STR |
| 8636 | BGP_STR |
| 8637 | "Address family\n" |
| 8638 | "Address Family modifier\n" |
| 8639 | "Address Family modifier\n" |
| 8640 | "Detailed information on TCP and BGP neighbor connections\n") |
| 8641 | |
| 8642 | ALIAS (show_ip_bgp_neighbors, |
| 8643 | show_ip_bgp_vpnv4_all_neighbors_cmd, |
| 8644 | "show ip bgp vpnv4 all neighbors", |
| 8645 | SHOW_STR |
| 8646 | IP_STR |
| 8647 | BGP_STR |
| 8648 | "Display VPNv4 NLRI specific information\n" |
| 8649 | "Display information about all VPNv4 NLRIs\n" |
| 8650 | "Detailed information on TCP and BGP neighbor connections\n") |
| 8651 | |
| 8652 | ALIAS (show_ip_bgp_neighbors, |
| 8653 | show_ip_bgp_vpnv4_rd_neighbors_cmd, |
| 8654 | "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors", |
| 8655 | SHOW_STR |
| 8656 | IP_STR |
| 8657 | BGP_STR |
| 8658 | "Display VPNv4 NLRI specific information\n" |
| 8659 | "Display information for a route distinguisher\n" |
| 8660 | "VPN Route Distinguisher\n" |
| 8661 | "Detailed information on TCP and BGP neighbor connections\n") |
| 8662 | |
| 8663 | ALIAS (show_ip_bgp_neighbors, |
| 8664 | show_bgp_ipv6_neighbors_cmd, |
| 8665 | "show bgp ipv6 neighbors", |
| 8666 | SHOW_STR |
| 8667 | BGP_STR |
| 8668 | "Address family\n" |
| 8669 | "Detailed information on TCP and BGP neighbor connections\n") |
| 8670 | |
| 8671 | DEFUN (show_ip_bgp_neighbors_peer, |
| 8672 | show_ip_bgp_neighbors_peer_cmd, |
| 8673 | "show ip bgp neighbors (A.B.C.D|X:X::X:X)", |
| 8674 | SHOW_STR |
| 8675 | IP_STR |
| 8676 | BGP_STR |
| 8677 | "Detailed information on TCP and BGP neighbor connections\n" |
| 8678 | "Neighbor to display information about\n" |
| 8679 | "Neighbor to display information about\n") |
| 8680 | { |
| 8681 | return bgp_show_neighbor_vty (vty, NULL, show_peer, argv[argc - 1]); |
| 8682 | } |
| 8683 | |
| 8684 | ALIAS (show_ip_bgp_neighbors_peer, |
| 8685 | show_ip_bgp_ipv4_neighbors_peer_cmd, |
| 8686 | "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X)", |
| 8687 | SHOW_STR |
| 8688 | IP_STR |
| 8689 | BGP_STR |
| 8690 | "Address family\n" |
| 8691 | "Address Family modifier\n" |
| 8692 | "Address Family modifier\n" |
| 8693 | "Detailed information on TCP and BGP neighbor connections\n" |
| 8694 | "Neighbor to display information about\n" |
| 8695 | "Neighbor to display information about\n") |
| 8696 | |
| 8697 | ALIAS (show_ip_bgp_neighbors_peer, |
| 8698 | show_ip_bgp_vpnv4_all_neighbors_peer_cmd, |
| 8699 | "show ip bgp vpnv4 all neighbors A.B.C.D", |
| 8700 | SHOW_STR |
| 8701 | IP_STR |
| 8702 | BGP_STR |
| 8703 | "Display VPNv4 NLRI specific information\n" |
| 8704 | "Display information about all VPNv4 NLRIs\n" |
| 8705 | "Detailed information on TCP and BGP neighbor connections\n" |
| 8706 | "Neighbor to display information about\n") |
| 8707 | |
| 8708 | ALIAS (show_ip_bgp_neighbors_peer, |
| 8709 | show_ip_bgp_vpnv4_rd_neighbors_peer_cmd, |
| 8710 | "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D", |
| 8711 | SHOW_STR |
| 8712 | IP_STR |
| 8713 | BGP_STR |
| 8714 | "Display VPNv4 NLRI specific information\n" |
| 8715 | "Display information about all VPNv4 NLRIs\n" |
| 8716 | "Detailed information on TCP and BGP neighbor connections\n" |
| 8717 | "Neighbor to display information about\n") |
| 8718 | |
| 8719 | ALIAS (show_ip_bgp_neighbors_peer, |
| 8720 | show_bgp_ipv6_neighbors_peer_cmd, |
| 8721 | "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X)", |
| 8722 | SHOW_STR |
| 8723 | BGP_STR |
| 8724 | "Address family\n" |
| 8725 | "Detailed information on TCP and BGP neighbor connections\n" |
| 8726 | "Neighbor to display information about\n" |
| 8727 | "Neighbor to display information about\n") |
| 8728 | |
| 8729 | DEFUN (show_ip_bgp_instance_neighbors, |
| 8730 | show_ip_bgp_instance_neighbors_cmd, |
| 8731 | "show ip bgp view WORD neighbors", |
| 8732 | SHOW_STR |
| 8733 | IP_STR |
| 8734 | BGP_STR |
| 8735 | "BGP view\n" |
| 8736 | "View name\n" |
| 8737 | "Detailed information on TCP and BGP neighbor connections\n") |
| 8738 | { |
| 8739 | return bgp_show_neighbor_vty (vty, argv[0], show_all, NULL); |
| 8740 | } |
| 8741 | |
| 8742 | ALIAS (show_ip_bgp_instance_neighbors, |
| 8743 | show_bgp_instance_ipv6_neighbors_cmd, |
| 8744 | "show bgp view WORD ipv6 neighbors", |
| 8745 | SHOW_STR |
| 8746 | BGP_STR |
| 8747 | "BGP view\n" |
| 8748 | "View name\n" |
| 8749 | "Address family\n" |
| 8750 | "Detailed information on TCP and BGP neighbor connections\n") |
| 8751 | |
| 8752 | DEFUN (show_ip_bgp_instance_neighbors_peer, |
| 8753 | show_ip_bgp_instance_neighbors_peer_cmd, |
| 8754 | "show ip bgp view WORD neighbors (A.B.C.D|X:X::X:X)", |
| 8755 | SHOW_STR |
| 8756 | IP_STR |
| 8757 | BGP_STR |
| 8758 | "BGP view\n" |
| 8759 | "View name\n" |
| 8760 | "Detailed information on TCP and BGP neighbor connections\n" |
| 8761 | "Neighbor to display information about\n" |
| 8762 | "Neighbor to display information about\n") |
| 8763 | { |
| 8764 | return bgp_show_neighbor_vty (vty, argv[0], show_peer, argv[1]); |
| 8765 | } |
| 8766 | |
| 8767 | /* Show BGP's AS paths internal data. There are both `show ip bgp |
| 8768 | paths' and `show ip mbgp paths'. Those functions results are the |
| 8769 | same.*/ |
| 8770 | DEFUN (show_ip_bgp_paths, |
| 8771 | show_ip_bgp_paths_cmd, |
| 8772 | "show ip bgp paths", |
| 8773 | SHOW_STR |
| 8774 | IP_STR |
| 8775 | BGP_STR |
| 8776 | "Path information\n") |
| 8777 | { |
| 8778 | vty_out (vty, "Address Refcnt Path%s", VTY_NEWLINE); |
| 8779 | aspath_print_all_vty (vty); |
| 8780 | return CMD_SUCCESS; |
| 8781 | } |
| 8782 | |
| 8783 | DEFUN (show_ip_bgp_ipv4_paths, |
| 8784 | show_ip_bgp_ipv4_paths_cmd, |
| 8785 | "show ip bgp ipv4 (unicast|multicast) paths", |
| 8786 | SHOW_STR |
| 8787 | IP_STR |
| 8788 | BGP_STR |
| 8789 | "Address family\n" |
| 8790 | "Address Family modifier\n" |
| 8791 | "Address Family modifier\n" |
| 8792 | "Path information\n") |
| 8793 | { |
| 8794 | vty_out (vty, "Address Refcnt Path\r\n"); |
| 8795 | aspath_print_all_vty (vty); |
| 8796 | |
| 8797 | return CMD_SUCCESS; |
| 8798 | } |
| 8799 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 8800 | DEFUN (show_bgp_neighbors, |
| 8801 | show_bgp_neighbors_cmd, |
| 8802 | "show bgp neighbors", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8803 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8804 | BGP_STR |
| 8805 | "Detailed information on TCP and BGP neighbor connections\n") |
| 8806 | { |
| 8807 | return bgp_show_neighbor_vty (vty, NULL, show_all, NULL); |
| 8808 | } |
| 8809 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 8810 | DEFUN (show_bgp_neighbors_peer, |
| 8811 | show_bgp_neighbors_peer_cmd, |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 8812 | "show bgp neighbors (A.B.C.D|X:X::X:X)", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8813 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8814 | BGP_STR |
| 8815 | "Detailed information on TCP and BGP neighbor connections\n" |
| 8816 | "Neighbor to display information about\n" |
| 8817 | "Neighbor to display information about\n") |
| 8818 | { |
| 8819 | return bgp_show_neighbor_vty (vty, NULL, show_peer, argv[argc - 1]); |
| 8820 | } |
| 8821 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 8822 | DEFUN (show_bgp_instance_neighbors, |
| 8823 | show_bgp_instance_neighbors_cmd, |
| 8824 | "show bgp view WORD neighbors", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8825 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8826 | BGP_STR |
| 8827 | "BGP view\n" |
| 8828 | "View name\n" |
| 8829 | "Detailed information on TCP and BGP neighbor connections\n") |
| 8830 | { |
| 8831 | return bgp_show_neighbor_vty (vty, argv[0], show_all, NULL); |
| 8832 | } |
| 8833 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 8834 | DEFUN (show_bgp_instance_neighbors_peer, |
| 8835 | show_bgp_instance_neighbors_peer_cmd, |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 8836 | "show bgp view WORD neighbors (A.B.C.D|X:X::X:X)", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8837 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8838 | BGP_STR |
| 8839 | "BGP view\n" |
| 8840 | "View name\n" |
| 8841 | "Detailed information on TCP and BGP neighbor connections\n" |
| 8842 | "Neighbor to display information about\n" |
| 8843 | "Neighbor to display information about\n") |
| 8844 | { |
| 8845 | return bgp_show_neighbor_vty (vty, argv[0], show_peer, argv[1]); |
| 8846 | } |
paul | bb46e94 | 2003-10-24 19:02:03 +0000 | [diff] [blame] | 8847 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 8848 | ALIAS (show_bgp_instance_neighbors_peer, |
paul | bb46e94 | 2003-10-24 19:02:03 +0000 | [diff] [blame] | 8849 | show_bgp_instance_ipv6_neighbors_peer_cmd, |
| 8850 | "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X)", |
| 8851 | SHOW_STR |
| 8852 | BGP_STR |
| 8853 | "BGP view\n" |
| 8854 | "View name\n" |
| 8855 | "Address family\n" |
| 8856 | "Detailed information on TCP and BGP neighbor connections\n" |
| 8857 | "Neighbor to display information about\n" |
| 8858 | "Neighbor to display information about\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 8859 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8860 | /* Show BGP's AS paths internal data. There are both `show ip bgp |
| 8861 | paths' and `show ip mbgp paths'. Those functions results are the |
| 8862 | same.*/ |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 8863 | DEFUN (show_bgp_ipv4_paths, |
| 8864 | show_bgp_ipv4_paths_cmd, |
| 8865 | "show bgp paths", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8866 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8867 | BGP_STR |
| 8868 | "Path information\n") |
| 8869 | { |
| 8870 | vty_out (vty, "Address Refcnt Path%s", VTY_NEWLINE); |
| 8871 | aspath_print_all_vty (vty); |
| 8872 | return CMD_SUCCESS; |
| 8873 | } |
| 8874 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8875 | #include "hash.h" |
| 8876 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 8877 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8878 | community_show_all_iterator (struct hash_backet *backet, struct vty *vty) |
| 8879 | { |
| 8880 | struct community *com; |
| 8881 | |
| 8882 | com = (struct community *) backet->data; |
David Lamparter | eed3c48 | 2015-03-03 08:51:53 +0100 | [diff] [blame] | 8883 | vty_out (vty, "[%p] (%ld) %s%s", (void *)backet, com->refcnt, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8884 | community_str (com), VTY_NEWLINE); |
| 8885 | } |
| 8886 | |
| 8887 | /* Show BGP's community internal data. */ |
| 8888 | DEFUN (show_ip_bgp_community_info, |
| 8889 | show_ip_bgp_community_info_cmd, |
| 8890 | "show ip bgp community-info", |
| 8891 | SHOW_STR |
| 8892 | IP_STR |
| 8893 | BGP_STR |
| 8894 | "List all bgp community information\n") |
| 8895 | { |
| 8896 | vty_out (vty, "Address Refcnt Community%s", VTY_NEWLINE); |
| 8897 | |
| 8898 | hash_iterate (community_hash (), |
| 8899 | (void (*) (struct hash_backet *, void *)) |
| 8900 | community_show_all_iterator, |
| 8901 | vty); |
| 8902 | |
| 8903 | return CMD_SUCCESS; |
| 8904 | } |
| 8905 | |
| 8906 | DEFUN (show_ip_bgp_attr_info, |
| 8907 | show_ip_bgp_attr_info_cmd, |
| 8908 | "show ip bgp attribute-info", |
| 8909 | SHOW_STR |
| 8910 | IP_STR |
| 8911 | BGP_STR |
| 8912 | "List all bgp attribute information\n") |
| 8913 | { |
| 8914 | attr_show_all (vty); |
| 8915 | return CMD_SUCCESS; |
| 8916 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 8917 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 8918 | static int |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8919 | bgp_write_rsclient_summary (struct vty *vty, struct peer *rsclient, |
| 8920 | afi_t afi, safi_t safi) |
| 8921 | { |
| 8922 | char timebuf[BGP_UPTIME_LEN]; |
| 8923 | char rmbuf[14]; |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 8924 | const char *rmname; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8925 | struct peer *peer; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 8926 | struct listnode *node, *nnode; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8927 | int len; |
| 8928 | int count = 0; |
| 8929 | |
| 8930 | if (CHECK_FLAG (rsclient->sflags, PEER_STATUS_GROUP)) |
| 8931 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 8932 | for (ALL_LIST_ELEMENTS (rsclient->group->peer, node, nnode, peer)) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8933 | { |
| 8934 | count++; |
| 8935 | bgp_write_rsclient_summary (vty, peer, afi, safi); |
| 8936 | } |
| 8937 | return count; |
| 8938 | } |
| 8939 | |
| 8940 | len = vty_out (vty, "%s", rsclient->host); |
| 8941 | len = 16 - len; |
| 8942 | |
| 8943 | if (len < 1) |
| 8944 | vty_out (vty, "%s%*s", VTY_NEWLINE, 16, " "); |
| 8945 | else |
| 8946 | vty_out (vty, "%*s", len, " "); |
| 8947 | |
hasso | 3d515fd | 2005-02-01 21:30:04 +0000 | [diff] [blame] | 8948 | vty_out (vty, "4 "); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8949 | |
Milan Kocian | cb4fc59 | 2014-12-01 12:48:25 +0000 | [diff] [blame] | 8950 | vty_out (vty, "%10u ", rsclient->as); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8951 | |
| 8952 | rmname = ROUTE_MAP_EXPORT_NAME(&rsclient->filter[afi][safi]); |
| 8953 | if ( rmname && strlen (rmname) > 13 ) |
| 8954 | { |
| 8955 | sprintf (rmbuf, "%13s", "..."); |
| 8956 | rmname = strncpy (rmbuf, rmname, 10); |
| 8957 | } |
| 8958 | else if (! rmname) |
| 8959 | rmname = "<none>"; |
| 8960 | vty_out (vty, " %13s ", rmname); |
| 8961 | |
| 8962 | rmname = ROUTE_MAP_IMPORT_NAME(&rsclient->filter[afi][safi]); |
| 8963 | if ( rmname && strlen (rmname) > 13 ) |
| 8964 | { |
| 8965 | sprintf (rmbuf, "%13s", "..."); |
| 8966 | rmname = strncpy (rmbuf, rmname, 10); |
| 8967 | } |
| 8968 | else if (! rmname) |
| 8969 | rmname = "<none>"; |
| 8970 | vty_out (vty, " %13s ", rmname); |
| 8971 | |
| 8972 | vty_out (vty, "%8s", peer_uptime (rsclient->uptime, timebuf, BGP_UPTIME_LEN)); |
| 8973 | |
| 8974 | if (CHECK_FLAG (rsclient->flags, PEER_FLAG_SHUTDOWN)) |
| 8975 | vty_out (vty, " Idle (Admin)"); |
| 8976 | else if (CHECK_FLAG (rsclient->sflags, PEER_STATUS_PREFIX_OVERFLOW)) |
| 8977 | vty_out (vty, " Idle (PfxCt)"); |
| 8978 | else |
| 8979 | vty_out (vty, " %-11s", LOOKUP(bgp_status_msg, rsclient->status)); |
| 8980 | |
| 8981 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8982 | |
| 8983 | return 1; |
| 8984 | } |
| 8985 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 8986 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 8987 | bgp_show_rsclient_summary (struct vty *vty, struct bgp *bgp, |
| 8988 | afi_t afi, safi_t safi) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8989 | { |
| 8990 | struct peer *peer; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 8991 | struct listnode *node, *nnode; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8992 | int count = 0; |
| 8993 | |
| 8994 | /* Header string for each address family. */ |
Milan Kocian | cb4fc59 | 2014-12-01 12:48:25 +0000 | [diff] [blame] | 8995 | static char header[] = "Neighbor V AS Export-Policy Import-Policy Up/Down State"; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8996 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 8997 | for (ALL_LIST_ELEMENTS (bgp->rsclient, node, nnode, peer)) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 8998 | { |
| 8999 | if (peer->afc[afi][safi] && |
| 9000 | CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT)) |
| 9001 | { |
| 9002 | if (! count) |
| 9003 | { |
| 9004 | vty_out (vty, |
| 9005 | "Route Server's BGP router identifier %s%s", |
| 9006 | inet_ntoa (bgp->router_id), VTY_NEWLINE); |
| 9007 | vty_out (vty, |
Denis Ovsienko | aea339f | 2009-04-30 17:16:22 +0400 | [diff] [blame] | 9008 | "Route Server's local AS number %u%s", bgp->as, |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9009 | VTY_NEWLINE); |
| 9010 | |
| 9011 | vty_out (vty, "%s", VTY_NEWLINE); |
| 9012 | vty_out (vty, "%s%s", header, VTY_NEWLINE); |
| 9013 | } |
| 9014 | |
| 9015 | count += bgp_write_rsclient_summary (vty, peer, afi, safi); |
| 9016 | } |
| 9017 | } |
| 9018 | |
| 9019 | if (count) |
| 9020 | vty_out (vty, "%sTotal number of Route Server Clients %d%s", VTY_NEWLINE, |
| 9021 | count, VTY_NEWLINE); |
| 9022 | else |
| 9023 | vty_out (vty, "No %s Route Server Client is configured%s", |
| 9024 | afi == AFI_IP ? "IPv4" : "IPv6", VTY_NEWLINE); |
| 9025 | |
| 9026 | return CMD_SUCCESS; |
| 9027 | } |
| 9028 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 9029 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 9030 | bgp_show_rsclient_summary_vty (struct vty *vty, const char *name, |
| 9031 | afi_t afi, safi_t safi) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9032 | { |
| 9033 | struct bgp *bgp; |
| 9034 | |
| 9035 | if (name) |
| 9036 | { |
| 9037 | bgp = bgp_lookup_by_name (name); |
| 9038 | |
| 9039 | if (! bgp) |
| 9040 | { |
| 9041 | vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE); |
| 9042 | return CMD_WARNING; |
| 9043 | } |
| 9044 | |
| 9045 | bgp_show_rsclient_summary (vty, bgp, afi, safi); |
| 9046 | return CMD_SUCCESS; |
| 9047 | } |
| 9048 | |
| 9049 | bgp = bgp_get_default (); |
| 9050 | |
| 9051 | if (bgp) |
| 9052 | bgp_show_rsclient_summary (vty, bgp, afi, safi); |
| 9053 | |
| 9054 | return CMD_SUCCESS; |
| 9055 | } |
| 9056 | |
| 9057 | /* 'show bgp rsclient' commands. */ |
Lou Berger | f9b6c39 | 2016-01-12 13:42:09 -0500 | [diff] [blame] | 9058 | DEFUN (show_ip_bgp_rsclient_summary, |
| 9059 | show_ip_bgp_rsclient_summary_cmd, |
| 9060 | "show ip bgp rsclient summary", |
| 9061 | SHOW_STR |
| 9062 | IP_STR |
| 9063 | BGP_STR |
| 9064 | "Information about Route Server Clients\n" |
| 9065 | "Summary of all Route Server Clients\n") |
| 9066 | { |
| 9067 | return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 9068 | } |
| 9069 | |
| 9070 | DEFUN (show_ip_bgp_instance_rsclient_summary, |
| 9071 | show_ip_bgp_instance_rsclient_summary_cmd, |
| 9072 | "show ip bgp view WORD rsclient summary", |
| 9073 | SHOW_STR |
| 9074 | IP_STR |
| 9075 | BGP_STR |
| 9076 | "BGP view\n" |
| 9077 | "View name\n" |
| 9078 | "Information about Route Server Clients\n" |
| 9079 | "Summary of all Route Server Clients\n") |
| 9080 | { |
| 9081 | return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 9082 | } |
| 9083 | |
| 9084 | DEFUN (show_ip_bgp_ipv4_rsclient_summary, |
| 9085 | show_ip_bgp_ipv4_rsclient_summary_cmd, |
| 9086 | "show ip bgp ipv4 (unicast|multicast) rsclient summary", |
| 9087 | SHOW_STR |
| 9088 | IP_STR |
| 9089 | BGP_STR |
| 9090 | "Address family\n" |
| 9091 | "Address Family modifier\n" |
| 9092 | "Address Family modifier\n" |
| 9093 | "Information about Route Server Clients\n" |
| 9094 | "Summary of all Route Server Clients\n") |
| 9095 | { |
| 9096 | if (strncmp (argv[0], "m", 1) == 0) |
| 9097 | return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); |
| 9098 | |
| 9099 | return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 9100 | } |
| 9101 | |
| 9102 | DEFUN (show_ip_bgp_instance_ipv4_rsclient_summary, |
| 9103 | show_ip_bgp_instance_ipv4_rsclient_summary_cmd, |
| 9104 | "show ip bgp view WORD ipv4 (unicast|multicast) rsclient summary", |
| 9105 | SHOW_STR |
| 9106 | IP_STR |
| 9107 | BGP_STR |
| 9108 | "BGP view\n" |
| 9109 | "View name\n" |
| 9110 | "Address family\n" |
| 9111 | "Address Family modifier\n" |
| 9112 | "Address Family modifier\n" |
| 9113 | "Information about Route Server Clients\n" |
| 9114 | "Summary of all Route Server Clients\n") |
| 9115 | { |
| 9116 | if (strncmp (argv[1], "m", 1) == 0) |
| 9117 | return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST); |
| 9118 | |
| 9119 | return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 9120 | } |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9121 | |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 9122 | DEFUN (show_bgp_instance_ipv4_safi_rsclient_summary, |
| 9123 | show_bgp_instance_ipv4_safi_rsclient_summary_cmd, |
| 9124 | "show bgp view WORD ipv4 (unicast|multicast) rsclient summary", |
| 9125 | SHOW_STR |
| 9126 | BGP_STR |
| 9127 | "BGP view\n" |
| 9128 | "View name\n" |
| 9129 | "Address family\n" |
| 9130 | "Address Family modifier\n" |
| 9131 | "Address Family modifier\n" |
| 9132 | "Information about Route Server Clients\n" |
| 9133 | "Summary of all Route Server Clients\n") |
| 9134 | { |
| 9135 | safi_t safi; |
| 9136 | |
| 9137 | if (argc == 2) { |
| 9138 | safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; |
| 9139 | return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, safi); |
| 9140 | } else { |
| 9141 | safi = (strncmp (argv[0], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; |
| 9142 | return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, safi); |
| 9143 | } |
| 9144 | } |
| 9145 | |
| 9146 | ALIAS (show_bgp_instance_ipv4_safi_rsclient_summary, |
| 9147 | show_bgp_ipv4_safi_rsclient_summary_cmd, |
| 9148 | "show bgp ipv4 (unicast|multicast) rsclient summary", |
| 9149 | SHOW_STR |
| 9150 | BGP_STR |
| 9151 | "Address family\n" |
| 9152 | "Address Family modifier\n" |
| 9153 | "Address Family modifier\n" |
| 9154 | "Information about Route Server Clients\n" |
| 9155 | "Summary of all Route Server Clients\n") |
| 9156 | |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9157 | DEFUN (show_bgp_rsclient_summary, |
| 9158 | show_bgp_rsclient_summary_cmd, |
| 9159 | "show bgp rsclient summary", |
| 9160 | SHOW_STR |
| 9161 | BGP_STR |
| 9162 | "Information about Route Server Clients\n" |
| 9163 | "Summary of all Route Server Clients\n") |
| 9164 | { |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9165 | vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9166 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 9167 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 9168 | vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9169 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 9170 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); |
| 9171 | vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9172 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 9173 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); |
| 9174 | vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9175 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 9176 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_ENCAP); |
| 9177 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9178 | vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9179 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 9180 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); |
| 9181 | vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9182 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 9183 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); |
| 9184 | vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9185 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 9186 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN); |
| 9187 | vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9188 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 9189 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP); |
Lou Berger | 205e674 | 2016-01-12 13:42:11 -0500 | [diff] [blame] | 9190 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9191 | return CMD_SUCCESS; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9192 | } |
| 9193 | |
| 9194 | DEFUN (show_bgp_instance_rsclient_summary, |
| 9195 | show_bgp_instance_rsclient_summary_cmd, |
| 9196 | "show bgp view WORD rsclient summary", |
| 9197 | SHOW_STR |
| 9198 | BGP_STR |
| 9199 | "BGP view\n" |
| 9200 | "View name\n" |
| 9201 | "Information about Route Server Clients\n" |
| 9202 | "Summary of all Route Server Clients\n") |
| 9203 | { |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9204 | vty_out(vty, "%sIPv4 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9205 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 9206 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 9207 | vty_out(vty, "%sIPv4 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9208 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 9209 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST); |
| 9210 | vty_out(vty, "%sIPv4 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9211 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 9212 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_MPLS_VPN); |
| 9213 | vty_out(vty, "%sIPv4 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9214 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 9215 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_ENCAP); |
| 9216 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9217 | vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9218 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 9219 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST); |
| 9220 | vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9221 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 9222 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST); |
| 9223 | vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9224 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 9225 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_MPLS_VPN); |
| 9226 | vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9227 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 9228 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_ENCAP); |
Lou Berger | 205e674 | 2016-01-12 13:42:11 -0500 | [diff] [blame] | 9229 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9230 | return CMD_SUCCESS; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9231 | } |
| 9232 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9233 | DEFUN (show_bgp_ipv6_rsclient_summary, |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9234 | show_bgp_ipv6_rsclient_summary_cmd, |
| 9235 | "show bgp ipv6 rsclient summary", |
| 9236 | SHOW_STR |
| 9237 | BGP_STR |
| 9238 | "Address family\n" |
| 9239 | "Information about Route Server Clients\n" |
| 9240 | "Summary of all Route Server Clients\n") |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9241 | { |
| 9242 | vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9243 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 9244 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); |
| 9245 | vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9246 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 9247 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); |
| 9248 | vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9249 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 9250 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_MPLS_VPN); |
| 9251 | vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9252 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 9253 | bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_ENCAP); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9254 | |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9255 | return CMD_SUCCESS; |
| 9256 | } |
| 9257 | |
| 9258 | DEFUN (show_bgp_instance_ipv6_rsclient_summary, |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9259 | show_bgp_instance_ipv6_rsclient_summary_cmd, |
| 9260 | "show bgp view WORD ipv6 rsclient summary", |
| 9261 | SHOW_STR |
| 9262 | BGP_STR |
| 9263 | "BGP view\n" |
| 9264 | "View name\n" |
| 9265 | "Address family\n" |
| 9266 | "Information about Route Server Clients\n" |
| 9267 | "Summary of all Route Server Clients\n") |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9268 | { |
| 9269 | vty_out(vty, "%sIPv6 Unicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9270 | vty_out(vty, "---------------------%s", VTY_NEWLINE); |
| 9271 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST); |
| 9272 | vty_out(vty, "%sIPv6 Multicast Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9273 | vty_out(vty, "-----------------------%s", VTY_NEWLINE); |
| 9274 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST); |
| 9275 | vty_out(vty, "%sIPv6 VPN Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9276 | vty_out(vty, "-----------------%s", VTY_NEWLINE); |
| 9277 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_MPLS_VPN); |
| 9278 | vty_out(vty, "%sIPv6 Encap Summary:%s", VTY_NEWLINE, VTY_NEWLINE); |
| 9279 | vty_out(vty, "-------------------%s", VTY_NEWLINE); |
| 9280 | bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_ENCAP); |
| 9281 | |
| 9282 | return CMD_SUCCESS; |
| 9283 | } |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 9284 | |
| 9285 | DEFUN (show_bgp_instance_ipv6_safi_rsclient_summary, |
| 9286 | show_bgp_instance_ipv6_safi_rsclient_summary_cmd, |
| 9287 | "show bgp view WORD ipv6 (unicast|multicast) rsclient summary", |
| 9288 | SHOW_STR |
| 9289 | BGP_STR |
| 9290 | "BGP view\n" |
| 9291 | "View name\n" |
| 9292 | "Address family\n" |
| 9293 | "Address Family modifier\n" |
| 9294 | "Address Family modifier\n" |
| 9295 | "Information about Route Server Clients\n" |
| 9296 | "Summary of all Route Server Clients\n") |
| 9297 | { |
| 9298 | safi_t safi; |
| 9299 | |
| 9300 | if (argc == 2) { |
| 9301 | safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; |
| 9302 | return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, safi); |
| 9303 | } else { |
| 9304 | safi = (strncmp (argv[0], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; |
| 9305 | return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, safi); |
| 9306 | } |
| 9307 | } |
| 9308 | |
| 9309 | ALIAS (show_bgp_instance_ipv6_safi_rsclient_summary, |
| 9310 | show_bgp_ipv6_safi_rsclient_summary_cmd, |
| 9311 | "show bgp ipv6 (unicast|multicast) rsclient summary", |
| 9312 | SHOW_STR |
| 9313 | BGP_STR |
Lou Berger | 651b402 | 2016-01-12 13:42:07 -0500 | [diff] [blame] | 9314 | IPV6_STR |
Michael Lambert | 95cbbd2 | 2010-07-23 14:43:04 -0400 | [diff] [blame] | 9315 | "Address Family modifier\n" |
| 9316 | "Address Family modifier\n" |
| 9317 | "Information about Route Server Clients\n" |
| 9318 | "Summary of all Route Server Clients\n") |
| 9319 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9320 | /* Redistribute VTY commands. */ |
| 9321 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9322 | DEFUN (bgp_redistribute_ipv4, |
| 9323 | bgp_redistribute_ipv4_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9324 | "redistribute " QUAGGA_IP_REDIST_STR_BGPD, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9325 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9326 | QUAGGA_IP_REDIST_HELP_STR_BGPD) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9327 | { |
| 9328 | int type; |
| 9329 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9330 | type = proto_redistnum (AFI_IP, argv[0]); |
| 9331 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9332 | { |
| 9333 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9334 | return CMD_WARNING; |
| 9335 | } |
| 9336 | return bgp_redistribute_set (vty->index, AFI_IP, type); |
| 9337 | } |
| 9338 | |
| 9339 | DEFUN (bgp_redistribute_ipv4_rmap, |
| 9340 | bgp_redistribute_ipv4_rmap_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9341 | "redistribute " QUAGGA_IP_REDIST_STR_BGPD " route-map WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9342 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9343 | QUAGGA_IP_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9344 | "Route map reference\n" |
| 9345 | "Pointer to route-map entries\n") |
| 9346 | { |
| 9347 | int type; |
| 9348 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9349 | type = proto_redistnum (AFI_IP, argv[0]); |
| 9350 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9351 | { |
| 9352 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9353 | return CMD_WARNING; |
| 9354 | } |
| 9355 | |
| 9356 | bgp_redistribute_rmap_set (vty->index, AFI_IP, type, argv[1]); |
| 9357 | return bgp_redistribute_set (vty->index, AFI_IP, type); |
| 9358 | } |
| 9359 | |
| 9360 | DEFUN (bgp_redistribute_ipv4_metric, |
| 9361 | bgp_redistribute_ipv4_metric_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9362 | "redistribute " QUAGGA_IP_REDIST_STR_BGPD " metric <0-4294967295>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9363 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9364 | QUAGGA_IP_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9365 | "Metric for redistributed routes\n" |
| 9366 | "Default metric\n") |
| 9367 | { |
| 9368 | int type; |
| 9369 | u_int32_t metric; |
| 9370 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9371 | type = proto_redistnum (AFI_IP, argv[0]); |
| 9372 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9373 | { |
| 9374 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9375 | return CMD_WARNING; |
| 9376 | } |
| 9377 | VTY_GET_INTEGER ("metric", metric, argv[1]); |
| 9378 | |
| 9379 | bgp_redistribute_metric_set (vty->index, AFI_IP, type, metric); |
| 9380 | return bgp_redistribute_set (vty->index, AFI_IP, type); |
| 9381 | } |
| 9382 | |
| 9383 | DEFUN (bgp_redistribute_ipv4_rmap_metric, |
| 9384 | bgp_redistribute_ipv4_rmap_metric_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9385 | "redistribute " QUAGGA_IP_REDIST_STR_BGPD " route-map WORD metric <0-4294967295>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9386 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9387 | QUAGGA_IP_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9388 | "Route map reference\n" |
| 9389 | "Pointer to route-map entries\n" |
| 9390 | "Metric for redistributed routes\n" |
| 9391 | "Default metric\n") |
| 9392 | { |
| 9393 | int type; |
| 9394 | u_int32_t metric; |
| 9395 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9396 | type = proto_redistnum (AFI_IP, argv[0]); |
| 9397 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9398 | { |
| 9399 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9400 | return CMD_WARNING; |
| 9401 | } |
| 9402 | VTY_GET_INTEGER ("metric", metric, argv[2]); |
| 9403 | |
| 9404 | bgp_redistribute_rmap_set (vty->index, AFI_IP, type, argv[1]); |
| 9405 | bgp_redistribute_metric_set (vty->index, AFI_IP, type, metric); |
| 9406 | return bgp_redistribute_set (vty->index, AFI_IP, type); |
| 9407 | } |
| 9408 | |
| 9409 | DEFUN (bgp_redistribute_ipv4_metric_rmap, |
| 9410 | bgp_redistribute_ipv4_metric_rmap_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9411 | "redistribute " QUAGGA_IP_REDIST_STR_BGPD " metric <0-4294967295> route-map WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9412 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9413 | QUAGGA_IP_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9414 | "Metric for redistributed routes\n" |
| 9415 | "Default metric\n" |
| 9416 | "Route map reference\n" |
| 9417 | "Pointer to route-map entries\n") |
| 9418 | { |
| 9419 | int type; |
| 9420 | u_int32_t metric; |
| 9421 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9422 | type = proto_redistnum (AFI_IP, argv[0]); |
| 9423 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9424 | { |
| 9425 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9426 | return CMD_WARNING; |
| 9427 | } |
| 9428 | VTY_GET_INTEGER ("metric", metric, argv[1]); |
| 9429 | |
| 9430 | bgp_redistribute_metric_set (vty->index, AFI_IP, type, metric); |
| 9431 | bgp_redistribute_rmap_set (vty->index, AFI_IP, type, argv[2]); |
| 9432 | return bgp_redistribute_set (vty->index, AFI_IP, type); |
| 9433 | } |
| 9434 | |
| 9435 | DEFUN (no_bgp_redistribute_ipv4, |
| 9436 | no_bgp_redistribute_ipv4_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9437 | "no redistribute " QUAGGA_IP_REDIST_STR_BGPD, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9438 | NO_STR |
| 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 | { |
| 9442 | int type; |
| 9443 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9444 | type = proto_redistnum (AFI_IP, argv[0]); |
| 9445 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9446 | { |
| 9447 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9448 | return CMD_WARNING; |
| 9449 | } |
| 9450 | |
| 9451 | return bgp_redistribute_unset (vty->index, AFI_IP, type); |
| 9452 | } |
| 9453 | |
| 9454 | DEFUN (no_bgp_redistribute_ipv4_rmap, |
| 9455 | no_bgp_redistribute_ipv4_rmap_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9456 | "no redistribute " QUAGGA_IP_REDIST_STR_BGPD " route-map WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9457 | NO_STR |
| 9458 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9459 | QUAGGA_IP_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9460 | "Route map reference\n" |
| 9461 | "Pointer to route-map entries\n") |
| 9462 | { |
| 9463 | int type; |
| 9464 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9465 | type = proto_redistnum (AFI_IP, argv[0]); |
| 9466 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9467 | { |
| 9468 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9469 | return CMD_WARNING; |
| 9470 | } |
| 9471 | |
| 9472 | bgp_redistribute_routemap_unset (vty->index, AFI_IP, type); |
| 9473 | return CMD_SUCCESS; |
| 9474 | } |
| 9475 | |
| 9476 | DEFUN (no_bgp_redistribute_ipv4_metric, |
| 9477 | no_bgp_redistribute_ipv4_metric_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9478 | "no redistribute " QUAGGA_IP_REDIST_STR_BGPD " metric <0-4294967295>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9479 | NO_STR |
| 9480 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9481 | QUAGGA_IP_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9482 | "Metric for redistributed routes\n" |
| 9483 | "Default metric\n") |
| 9484 | { |
| 9485 | int type; |
| 9486 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9487 | type = proto_redistnum (AFI_IP, argv[0]); |
| 9488 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9489 | { |
| 9490 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9491 | return CMD_WARNING; |
| 9492 | } |
| 9493 | |
| 9494 | bgp_redistribute_metric_unset (vty->index, AFI_IP, type); |
| 9495 | return CMD_SUCCESS; |
| 9496 | } |
| 9497 | |
| 9498 | DEFUN (no_bgp_redistribute_ipv4_rmap_metric, |
| 9499 | no_bgp_redistribute_ipv4_rmap_metric_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9500 | "no redistribute " QUAGGA_IP_REDIST_STR_BGPD " route-map WORD metric <0-4294967295>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9501 | NO_STR |
| 9502 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9503 | QUAGGA_IP_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9504 | "Route map reference\n" |
| 9505 | "Pointer to route-map entries\n" |
| 9506 | "Metric for redistributed routes\n" |
| 9507 | "Default metric\n") |
| 9508 | { |
| 9509 | int type; |
| 9510 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9511 | type = proto_redistnum (AFI_IP, argv[0]); |
| 9512 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9513 | { |
| 9514 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9515 | return CMD_WARNING; |
| 9516 | } |
| 9517 | |
| 9518 | bgp_redistribute_metric_unset (vty->index, AFI_IP, type); |
| 9519 | bgp_redistribute_routemap_unset (vty->index, AFI_IP, type); |
| 9520 | return CMD_SUCCESS; |
| 9521 | } |
| 9522 | |
| 9523 | ALIAS (no_bgp_redistribute_ipv4_rmap_metric, |
| 9524 | no_bgp_redistribute_ipv4_metric_rmap_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9525 | "no redistribute " QUAGGA_IP_REDIST_STR_BGPD " metric <0-4294967295> route-map WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9526 | NO_STR |
| 9527 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9528 | QUAGGA_IP_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9529 | "Metric for redistributed routes\n" |
| 9530 | "Default metric\n" |
| 9531 | "Route map reference\n" |
| 9532 | "Pointer to route-map entries\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 9533 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9534 | DEFUN (bgp_redistribute_ipv6, |
| 9535 | bgp_redistribute_ipv6_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9536 | "redistribute " QUAGGA_IP6_REDIST_STR_BGPD, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9537 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9538 | QUAGGA_IP6_REDIST_HELP_STR_BGPD) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9539 | { |
| 9540 | int type; |
| 9541 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9542 | type = proto_redistnum (AFI_IP6, argv[0]); |
| 9543 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9544 | { |
| 9545 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9546 | return CMD_WARNING; |
| 9547 | } |
| 9548 | |
| 9549 | return bgp_redistribute_set (vty->index, AFI_IP6, type); |
| 9550 | } |
| 9551 | |
| 9552 | DEFUN (bgp_redistribute_ipv6_rmap, |
| 9553 | bgp_redistribute_ipv6_rmap_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9554 | "redistribute " QUAGGA_IP6_REDIST_STR_BGPD " route-map WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9555 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9556 | QUAGGA_IP6_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9557 | "Route map reference\n" |
| 9558 | "Pointer to route-map entries\n") |
| 9559 | { |
| 9560 | int type; |
| 9561 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9562 | type = proto_redistnum (AFI_IP6, argv[0]); |
| 9563 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9564 | { |
| 9565 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9566 | return CMD_WARNING; |
| 9567 | } |
| 9568 | |
| 9569 | bgp_redistribute_rmap_set (vty->index, AFI_IP6, type, argv[1]); |
| 9570 | return bgp_redistribute_set (vty->index, AFI_IP6, type); |
| 9571 | } |
| 9572 | |
| 9573 | DEFUN (bgp_redistribute_ipv6_metric, |
| 9574 | bgp_redistribute_ipv6_metric_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9575 | "redistribute " QUAGGA_IP6_REDIST_STR_BGPD " metric <0-4294967295>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9576 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9577 | QUAGGA_IP6_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9578 | "Metric for redistributed routes\n" |
| 9579 | "Default metric\n") |
| 9580 | { |
| 9581 | int type; |
| 9582 | u_int32_t metric; |
| 9583 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9584 | type = proto_redistnum (AFI_IP6, argv[0]); |
| 9585 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9586 | { |
| 9587 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9588 | return CMD_WARNING; |
| 9589 | } |
| 9590 | VTY_GET_INTEGER ("metric", metric, argv[1]); |
| 9591 | |
| 9592 | bgp_redistribute_metric_set (vty->index, AFI_IP6, type, metric); |
| 9593 | return bgp_redistribute_set (vty->index, AFI_IP6, type); |
| 9594 | } |
| 9595 | |
| 9596 | DEFUN (bgp_redistribute_ipv6_rmap_metric, |
| 9597 | bgp_redistribute_ipv6_rmap_metric_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9598 | "redistribute " QUAGGA_IP6_REDIST_STR_BGPD " route-map WORD metric <0-4294967295>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9599 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9600 | QUAGGA_IP6_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9601 | "Route map reference\n" |
| 9602 | "Pointer to route-map entries\n" |
| 9603 | "Metric for redistributed routes\n" |
| 9604 | "Default metric\n") |
| 9605 | { |
| 9606 | int type; |
| 9607 | u_int32_t metric; |
| 9608 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9609 | type = proto_redistnum (AFI_IP6, argv[0]); |
| 9610 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9611 | { |
| 9612 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9613 | return CMD_WARNING; |
| 9614 | } |
| 9615 | VTY_GET_INTEGER ("metric", metric, argv[2]); |
| 9616 | |
| 9617 | bgp_redistribute_rmap_set (vty->index, AFI_IP6, type, argv[1]); |
| 9618 | bgp_redistribute_metric_set (vty->index, AFI_IP6, type, metric); |
| 9619 | return bgp_redistribute_set (vty->index, AFI_IP6, type); |
| 9620 | } |
| 9621 | |
| 9622 | DEFUN (bgp_redistribute_ipv6_metric_rmap, |
| 9623 | bgp_redistribute_ipv6_metric_rmap_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9624 | "redistribute " QUAGGA_IP6_REDIST_STR_BGPD " metric <0-4294967295> route-map WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9625 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9626 | QUAGGA_IP6_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9627 | "Metric for redistributed routes\n" |
| 9628 | "Default metric\n" |
| 9629 | "Route map reference\n" |
| 9630 | "Pointer to route-map entries\n") |
| 9631 | { |
| 9632 | int type; |
| 9633 | u_int32_t metric; |
| 9634 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9635 | type = proto_redistnum (AFI_IP6, argv[0]); |
| 9636 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9637 | { |
| 9638 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9639 | return CMD_WARNING; |
| 9640 | } |
| 9641 | VTY_GET_INTEGER ("metric", metric, argv[1]); |
| 9642 | |
| 9643 | bgp_redistribute_metric_set (vty->index, AFI_IP6, type, metric); |
| 9644 | bgp_redistribute_rmap_set (vty->index, AFI_IP6, type, argv[2]); |
| 9645 | return bgp_redistribute_set (vty->index, AFI_IP6, type); |
| 9646 | } |
| 9647 | |
| 9648 | DEFUN (no_bgp_redistribute_ipv6, |
| 9649 | no_bgp_redistribute_ipv6_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9650 | "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9651 | NO_STR |
| 9652 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9653 | QUAGGA_IP6_REDIST_HELP_STR_BGPD) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9654 | { |
| 9655 | int type; |
| 9656 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9657 | type = proto_redistnum (AFI_IP6, argv[0]); |
| 9658 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9659 | { |
| 9660 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9661 | return CMD_WARNING; |
| 9662 | } |
| 9663 | |
| 9664 | return bgp_redistribute_unset (vty->index, AFI_IP6, type); |
| 9665 | } |
| 9666 | |
| 9667 | DEFUN (no_bgp_redistribute_ipv6_rmap, |
| 9668 | no_bgp_redistribute_ipv6_rmap_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9669 | "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD " route-map WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9670 | NO_STR |
| 9671 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9672 | QUAGGA_IP6_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9673 | "Route map reference\n" |
| 9674 | "Pointer to route-map entries\n") |
| 9675 | { |
| 9676 | int type; |
| 9677 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9678 | type = proto_redistnum (AFI_IP6, argv[0]); |
| 9679 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9680 | { |
| 9681 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9682 | return CMD_WARNING; |
| 9683 | } |
| 9684 | |
| 9685 | bgp_redistribute_routemap_unset (vty->index, AFI_IP6, type); |
| 9686 | return CMD_SUCCESS; |
| 9687 | } |
| 9688 | |
| 9689 | DEFUN (no_bgp_redistribute_ipv6_metric, |
| 9690 | no_bgp_redistribute_ipv6_metric_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9691 | "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD " metric <0-4294967295>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9692 | NO_STR |
| 9693 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9694 | QUAGGA_IP6_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9695 | "Metric for redistributed routes\n" |
| 9696 | "Default metric\n") |
| 9697 | { |
| 9698 | int type; |
| 9699 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9700 | type = proto_redistnum (AFI_IP6, argv[0]); |
| 9701 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9702 | { |
| 9703 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9704 | return CMD_WARNING; |
| 9705 | } |
| 9706 | |
| 9707 | bgp_redistribute_metric_unset (vty->index, AFI_IP6, type); |
| 9708 | return CMD_SUCCESS; |
| 9709 | } |
| 9710 | |
| 9711 | DEFUN (no_bgp_redistribute_ipv6_rmap_metric, |
| 9712 | no_bgp_redistribute_ipv6_rmap_metric_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9713 | "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD " route-map WORD metric <0-4294967295>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9714 | NO_STR |
| 9715 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9716 | QUAGGA_IP6_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9717 | "Route map reference\n" |
| 9718 | "Pointer to route-map entries\n" |
| 9719 | "Metric for redistributed routes\n" |
| 9720 | "Default metric\n") |
| 9721 | { |
| 9722 | int type; |
| 9723 | |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9724 | type = proto_redistnum (AFI_IP6, argv[0]); |
| 9725 | if (type < 0 || type == ZEBRA_ROUTE_BGP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9726 | { |
| 9727 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 9728 | return CMD_WARNING; |
| 9729 | } |
| 9730 | |
| 9731 | bgp_redistribute_metric_unset (vty->index, AFI_IP6, type); |
| 9732 | bgp_redistribute_routemap_unset (vty->index, AFI_IP6, type); |
| 9733 | return CMD_SUCCESS; |
| 9734 | } |
| 9735 | |
| 9736 | ALIAS (no_bgp_redistribute_ipv6_rmap_metric, |
| 9737 | no_bgp_redistribute_ipv6_metric_rmap_cmd, |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9738 | "no redistribute " QUAGGA_IP6_REDIST_STR_BGPD " metric <0-4294967295> route-map WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9739 | NO_STR |
| 9740 | "Redistribute information from another routing protocol\n" |
David Lamparter | e0ca5fd | 2009-09-16 01:52:42 +0200 | [diff] [blame] | 9741 | QUAGGA_IP6_REDIST_HELP_STR_BGPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9742 | "Metric for redistributed routes\n" |
| 9743 | "Default metric\n" |
| 9744 | "Route map reference\n" |
| 9745 | "Pointer to route-map entries\n") |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 9746 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9747 | int |
| 9748 | bgp_config_write_redistribute (struct vty *vty, struct bgp *bgp, afi_t afi, |
| 9749 | safi_t safi, int *write) |
| 9750 | { |
| 9751 | int i; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9752 | |
| 9753 | /* Unicast redistribution only. */ |
| 9754 | if (safi != SAFI_UNICAST) |
| 9755 | return 0; |
| 9756 | |
| 9757 | for (i = 0; i < ZEBRA_ROUTE_MAX; i++) |
| 9758 | { |
| 9759 | /* Redistribute BGP does not make sense. */ |
| 9760 | if (bgp->redist[afi][i] && i != ZEBRA_ROUTE_BGP) |
| 9761 | { |
| 9762 | /* Display "address-family" when it is not yet diplayed. */ |
| 9763 | bgp_config_write_family_header (vty, afi, safi, write); |
| 9764 | |
| 9765 | /* "redistribute" configuration. */ |
ajs | f52d13c | 2005-10-01 17:38:06 +0000 | [diff] [blame] | 9766 | vty_out (vty, " redistribute %s", zebra_route_string(i)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9767 | |
| 9768 | if (bgp->redist_metric_flag[afi][i]) |
Jorge Boncompte [DTI2] | ddc943d | 2012-04-13 13:46:07 +0200 | [diff] [blame] | 9769 | vty_out (vty, " metric %u", bgp->redist_metric[afi][i]); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9770 | |
| 9771 | if (bgp->rmap[afi][i].name) |
| 9772 | vty_out (vty, " route-map %s", bgp->rmap[afi][i].name); |
| 9773 | |
| 9774 | vty_out (vty, "%s", VTY_NEWLINE); |
| 9775 | } |
| 9776 | } |
| 9777 | return *write; |
| 9778 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 9779 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9780 | /* BGP node structure. */ |
Stephen Hemminger | 7fc626d | 2008-12-01 11:10:34 -0800 | [diff] [blame] | 9781 | static struct cmd_node bgp_node = |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9782 | { |
| 9783 | BGP_NODE, |
| 9784 | "%s(config-router)# ", |
| 9785 | 1, |
| 9786 | }; |
| 9787 | |
Stephen Hemminger | 7fc626d | 2008-12-01 11:10:34 -0800 | [diff] [blame] | 9788 | static struct cmd_node bgp_ipv4_unicast_node = |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9789 | { |
| 9790 | BGP_IPV4_NODE, |
| 9791 | "%s(config-router-af)# ", |
| 9792 | 1, |
| 9793 | }; |
| 9794 | |
Stephen Hemminger | 7fc626d | 2008-12-01 11:10:34 -0800 | [diff] [blame] | 9795 | static struct cmd_node bgp_ipv4_multicast_node = |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9796 | { |
| 9797 | BGP_IPV4M_NODE, |
| 9798 | "%s(config-router-af)# ", |
| 9799 | 1, |
| 9800 | }; |
| 9801 | |
Stephen Hemminger | 7fc626d | 2008-12-01 11:10:34 -0800 | [diff] [blame] | 9802 | static struct cmd_node bgp_ipv6_unicast_node = |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9803 | { |
| 9804 | BGP_IPV6_NODE, |
| 9805 | "%s(config-router-af)# ", |
| 9806 | 1, |
| 9807 | }; |
| 9808 | |
Stephen Hemminger | 7fc626d | 2008-12-01 11:10:34 -0800 | [diff] [blame] | 9809 | static struct cmd_node bgp_ipv6_multicast_node = |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9810 | { |
| 9811 | BGP_IPV6M_NODE, |
| 9812 | "%s(config-router-af)# ", |
| 9813 | 1, |
| 9814 | }; |
| 9815 | |
Stephen Hemminger | 7fc626d | 2008-12-01 11:10:34 -0800 | [diff] [blame] | 9816 | static struct cmd_node bgp_vpnv4_node = |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9817 | { |
| 9818 | BGP_VPNV4_NODE, |
| 9819 | "%s(config-router-af)# ", |
| 9820 | 1 |
| 9821 | }; |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 9822 | |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 9823 | static struct cmd_node bgp_vpnv6_node = |
| 9824 | { |
| 9825 | BGP_VPNV6_NODE, |
| 9826 | "%s(config-router-af-vpnv6)# ", |
| 9827 | 1 |
| 9828 | }; |
| 9829 | |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 9830 | static struct cmd_node bgp_encap_node = |
| 9831 | { |
| 9832 | BGP_ENCAP_NODE, |
| 9833 | "%s(config-router-af-encap)# ", |
| 9834 | 1 |
| 9835 | }; |
| 9836 | |
| 9837 | static struct cmd_node bgp_encapv6_node = |
| 9838 | { |
| 9839 | BGP_ENCAPV6_NODE, |
| 9840 | "%s(config-router-af-encapv6)# ", |
| 9841 | 1 |
| 9842 | }; |
| 9843 | |
paul | 1f8ae70 | 2005-09-09 23:49:49 +0000 | [diff] [blame] | 9844 | static void community_list_vty (void); |
| 9845 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9846 | void |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 9847 | bgp_vty_init (void) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9848 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9849 | /* Install bgp top node. */ |
| 9850 | install_node (&bgp_node, bgp_config_write); |
| 9851 | install_node (&bgp_ipv4_unicast_node, NULL); |
| 9852 | install_node (&bgp_ipv4_multicast_node, NULL); |
| 9853 | install_node (&bgp_ipv6_unicast_node, NULL); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9854 | install_node (&bgp_ipv6_multicast_node, NULL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9855 | install_node (&bgp_vpnv4_node, NULL); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 9856 | install_node (&bgp_vpnv6_node, NULL); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 9857 | install_node (&bgp_encap_node, NULL); |
| 9858 | install_node (&bgp_encapv6_node, NULL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9859 | |
| 9860 | /* Install default VTY commands to new nodes. */ |
| 9861 | install_default (BGP_NODE); |
| 9862 | install_default (BGP_IPV4_NODE); |
| 9863 | install_default (BGP_IPV4M_NODE); |
| 9864 | install_default (BGP_IPV6_NODE); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9865 | install_default (BGP_IPV6M_NODE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9866 | install_default (BGP_VPNV4_NODE); |
Lou Berger | 13c378d | 2016-01-12 13:41:56 -0500 | [diff] [blame] | 9867 | install_default (BGP_VPNV6_NODE); |
Lou Berger | a3fda88 | 2016-01-12 13:42:04 -0500 | [diff] [blame] | 9868 | install_default (BGP_ENCAP_NODE); |
| 9869 | install_default (BGP_ENCAPV6_NODE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9870 | |
| 9871 | /* "bgp multiple-instance" commands. */ |
| 9872 | install_element (CONFIG_NODE, &bgp_multiple_instance_cmd); |
| 9873 | install_element (CONFIG_NODE, &no_bgp_multiple_instance_cmd); |
| 9874 | |
| 9875 | /* "bgp config-type" commands. */ |
| 9876 | install_element (CONFIG_NODE, &bgp_config_type_cmd); |
| 9877 | install_element (CONFIG_NODE, &no_bgp_config_type_cmd); |
| 9878 | |
| 9879 | /* Dummy commands (Currently not supported) */ |
| 9880 | install_element (BGP_NODE, &no_synchronization_cmd); |
| 9881 | install_element (BGP_NODE, &no_auto_summary_cmd); |
| 9882 | |
| 9883 | /* "router bgp" commands. */ |
| 9884 | install_element (CONFIG_NODE, &router_bgp_cmd); |
| 9885 | install_element (CONFIG_NODE, &router_bgp_view_cmd); |
| 9886 | |
| 9887 | /* "no router bgp" commands. */ |
| 9888 | install_element (CONFIG_NODE, &no_router_bgp_cmd); |
| 9889 | install_element (CONFIG_NODE, &no_router_bgp_view_cmd); |
| 9890 | |
| 9891 | /* "bgp router-id" commands. */ |
| 9892 | install_element (BGP_NODE, &bgp_router_id_cmd); |
| 9893 | install_element (BGP_NODE, &no_bgp_router_id_cmd); |
| 9894 | install_element (BGP_NODE, &no_bgp_router_id_val_cmd); |
| 9895 | |
| 9896 | /* "bgp cluster-id" commands. */ |
| 9897 | install_element (BGP_NODE, &bgp_cluster_id_cmd); |
| 9898 | install_element (BGP_NODE, &bgp_cluster_id32_cmd); |
| 9899 | install_element (BGP_NODE, &no_bgp_cluster_id_cmd); |
| 9900 | install_element (BGP_NODE, &no_bgp_cluster_id_arg_cmd); |
| 9901 | |
| 9902 | /* "bgp confederation" commands. */ |
| 9903 | install_element (BGP_NODE, &bgp_confederation_identifier_cmd); |
| 9904 | install_element (BGP_NODE, &no_bgp_confederation_identifier_cmd); |
| 9905 | install_element (BGP_NODE, &no_bgp_confederation_identifier_arg_cmd); |
| 9906 | |
| 9907 | /* "bgp confederation peers" commands. */ |
| 9908 | install_element (BGP_NODE, &bgp_confederation_peers_cmd); |
| 9909 | install_element (BGP_NODE, &no_bgp_confederation_peers_cmd); |
| 9910 | |
Josh Bailey | 165b5ff | 2011-07-20 20:43:22 -0700 | [diff] [blame] | 9911 | /* "maximum-paths" commands. */ |
| 9912 | install_element (BGP_NODE, &bgp_maxpaths_cmd); |
| 9913 | install_element (BGP_NODE, &no_bgp_maxpaths_cmd); |
| 9914 | install_element (BGP_NODE, &no_bgp_maxpaths_arg_cmd); |
| 9915 | install_element (BGP_IPV4_NODE, &bgp_maxpaths_cmd); |
| 9916 | install_element (BGP_IPV4_NODE, &no_bgp_maxpaths_cmd); |
| 9917 | install_element (BGP_IPV4_NODE, &no_bgp_maxpaths_arg_cmd); |
Ayan Banerjee | b8d1f71 | 2015-11-09 20:14:54 -0500 | [diff] [blame] | 9918 | install_element (BGP_IPV6_NODE, &bgp_maxpaths_cmd); |
| 9919 | install_element (BGP_IPV6_NODE, &no_bgp_maxpaths_cmd); |
| 9920 | install_element (BGP_IPV6_NODE, &no_bgp_maxpaths_arg_cmd); |
Josh Bailey | 165b5ff | 2011-07-20 20:43:22 -0700 | [diff] [blame] | 9921 | install_element (BGP_NODE, &bgp_maxpaths_ibgp_cmd); |
| 9922 | install_element (BGP_NODE, &no_bgp_maxpaths_ibgp_cmd); |
| 9923 | install_element (BGP_NODE, &no_bgp_maxpaths_ibgp_arg_cmd); |
| 9924 | install_element (BGP_IPV4_NODE, &bgp_maxpaths_ibgp_cmd); |
| 9925 | install_element (BGP_IPV4_NODE, &no_bgp_maxpaths_ibgp_cmd); |
| 9926 | install_element (BGP_IPV4_NODE, &no_bgp_maxpaths_ibgp_arg_cmd); |
Ayan Banerjee | b8d1f71 | 2015-11-09 20:14:54 -0500 | [diff] [blame] | 9927 | install_element (BGP_IPV6_NODE, &bgp_maxpaths_ibgp_cmd); |
| 9928 | install_element (BGP_IPV6_NODE, &no_bgp_maxpaths_ibgp_cmd); |
| 9929 | install_element (BGP_IPV6_NODE, &no_bgp_maxpaths_ibgp_arg_cmd); |
Josh Bailey | 165b5ff | 2011-07-20 20:43:22 -0700 | [diff] [blame] | 9930 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9931 | /* "timers bgp" commands. */ |
| 9932 | install_element (BGP_NODE, &bgp_timers_cmd); |
| 9933 | install_element (BGP_NODE, &no_bgp_timers_cmd); |
| 9934 | install_element (BGP_NODE, &no_bgp_timers_arg_cmd); |
| 9935 | |
| 9936 | /* "bgp client-to-client reflection" commands */ |
| 9937 | install_element (BGP_NODE, &no_bgp_client_to_client_reflection_cmd); |
| 9938 | install_element (BGP_NODE, &bgp_client_to_client_reflection_cmd); |
| 9939 | |
| 9940 | /* "bgp always-compare-med" commands */ |
| 9941 | install_element (BGP_NODE, &bgp_always_compare_med_cmd); |
| 9942 | install_element (BGP_NODE, &no_bgp_always_compare_med_cmd); |
| 9943 | |
| 9944 | /* "bgp deterministic-med" commands */ |
| 9945 | install_element (BGP_NODE, &bgp_deterministic_med_cmd); |
| 9946 | install_element (BGP_NODE, &no_bgp_deterministic_med_cmd); |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 9947 | |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 9948 | /* "bgp graceful-restart" commands */ |
| 9949 | install_element (BGP_NODE, &bgp_graceful_restart_cmd); |
| 9950 | install_element (BGP_NODE, &no_bgp_graceful_restart_cmd); |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 9951 | install_element (BGP_NODE, &bgp_graceful_restart_stalepath_time_cmd); |
| 9952 | install_element (BGP_NODE, &no_bgp_graceful_restart_stalepath_time_cmd); |
| 9953 | install_element (BGP_NODE, &no_bgp_graceful_restart_stalepath_time_val_cmd); |
Philippe Guibert | 4afa3dd | 2016-05-24 16:52:02 +0200 | [diff] [blame] | 9954 | install_element (BGP_NODE, &bgp_graceful_restart_restart_time_cmd); |
| 9955 | install_element (BGP_NODE, &no_bgp_graceful_restart_restart_time_cmd); |
| 9956 | install_element (BGP_NODE, &no_bgp_graceful_restart_restart_time_val_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9957 | |
| 9958 | /* "bgp fast-external-failover" commands */ |
| 9959 | install_element (BGP_NODE, &bgp_fast_external_failover_cmd); |
| 9960 | install_element (BGP_NODE, &no_bgp_fast_external_failover_cmd); |
| 9961 | |
| 9962 | /* "bgp enforce-first-as" commands */ |
| 9963 | install_element (BGP_NODE, &bgp_enforce_first_as_cmd); |
| 9964 | install_element (BGP_NODE, &no_bgp_enforce_first_as_cmd); |
| 9965 | |
| 9966 | /* "bgp bestpath compare-routerid" commands */ |
| 9967 | install_element (BGP_NODE, &bgp_bestpath_compare_router_id_cmd); |
| 9968 | install_element (BGP_NODE, &no_bgp_bestpath_compare_router_id_cmd); |
| 9969 | |
| 9970 | /* "bgp bestpath as-path ignore" commands */ |
| 9971 | install_element (BGP_NODE, &bgp_bestpath_aspath_ignore_cmd); |
| 9972 | install_element (BGP_NODE, &no_bgp_bestpath_aspath_ignore_cmd); |
| 9973 | |
hasso | 6811845 | 2005-04-08 15:40:36 +0000 | [diff] [blame] | 9974 | /* "bgp bestpath as-path confed" commands */ |
| 9975 | install_element (BGP_NODE, &bgp_bestpath_aspath_confed_cmd); |
| 9976 | install_element (BGP_NODE, &no_bgp_bestpath_aspath_confed_cmd); |
| 9977 | |
Pradosh Mohapatra | 2fdd455 | 2013-09-07 07:02:36 +0000 | [diff] [blame] | 9978 | /* "bgp bestpath as-path multipath-relax" commands */ |
| 9979 | install_element (BGP_NODE, &bgp_bestpath_aspath_multipath_relax_cmd); |
| 9980 | install_element (BGP_NODE, &no_bgp_bestpath_aspath_multipath_relax_cmd); |
| 9981 | |
paul | 848973c | 2003-08-13 00:32:49 +0000 | [diff] [blame] | 9982 | /* "bgp log-neighbor-changes" commands */ |
| 9983 | install_element (BGP_NODE, &bgp_log_neighbor_changes_cmd); |
| 9984 | install_element (BGP_NODE, &no_bgp_log_neighbor_changes_cmd); |
| 9985 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9986 | /* "bgp bestpath med" commands */ |
| 9987 | install_element (BGP_NODE, &bgp_bestpath_med_cmd); |
| 9988 | install_element (BGP_NODE, &bgp_bestpath_med2_cmd); |
| 9989 | install_element (BGP_NODE, &bgp_bestpath_med3_cmd); |
| 9990 | install_element (BGP_NODE, &no_bgp_bestpath_med_cmd); |
| 9991 | install_element (BGP_NODE, &no_bgp_bestpath_med2_cmd); |
| 9992 | install_element (BGP_NODE, &no_bgp_bestpath_med3_cmd); |
| 9993 | |
| 9994 | /* "no bgp default ipv4-unicast" commands. */ |
| 9995 | install_element (BGP_NODE, &no_bgp_default_ipv4_unicast_cmd); |
| 9996 | install_element (BGP_NODE, &bgp_default_ipv4_unicast_cmd); |
| 9997 | |
| 9998 | /* "bgp network import-check" commands. */ |
| 9999 | install_element (BGP_NODE, &bgp_network_import_check_cmd); |
| 10000 | install_element (BGP_NODE, &no_bgp_network_import_check_cmd); |
| 10001 | |
| 10002 | /* "bgp default local-preference" commands. */ |
| 10003 | install_element (BGP_NODE, &bgp_default_local_preference_cmd); |
| 10004 | install_element (BGP_NODE, &no_bgp_default_local_preference_cmd); |
| 10005 | install_element (BGP_NODE, &no_bgp_default_local_preference_val_cmd); |
| 10006 | |
| 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 | } |