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" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 33 | |
| 34 | #include "bgpd/bgpd.h" |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 35 | #include "bgpd/bgp_advertise.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 36 | #include "bgpd/bgp_attr.h" |
| 37 | #include "bgpd/bgp_aspath.h" |
| 38 | #include "bgpd/bgp_community.h" |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 39 | #include "bgpd/bgp_ecommunity.h" |
| 40 | #include "bgpd/bgp_damp.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 41 | #include "bgpd/bgp_debug.h" |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 42 | #include "bgpd/bgp_fsm.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 43 | #include "bgpd/bgp_mplsvpn.h" |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 44 | #include "bgpd/bgp_nexthop.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 45 | #include "bgpd/bgp_open.h" |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 46 | #include "bgpd/bgp_regex.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 47 | #include "bgpd/bgp_route.h" |
| 48 | #include "bgpd/bgp_zebra.h" |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 49 | #include "bgpd/bgp_table.h" |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 50 | #include "bgpd/bgp_vty.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 51 | |
hasso | 18a6dce | 2004-10-03 18:18:34 +0000 | [diff] [blame] | 52 | extern struct in_addr router_id_zebra; |
| 53 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 54 | /* Utility function to get address family from current node. */ |
| 55 | afi_t |
| 56 | bgp_node_afi (struct vty *vty) |
| 57 | { |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 58 | if (vty->node == BGP_IPV6_NODE || vty->node == BGP_IPV6M_NODE) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 59 | return AFI_IP6; |
| 60 | return AFI_IP; |
| 61 | } |
| 62 | |
| 63 | /* Utility function to get subsequent address family from current |
| 64 | node. */ |
| 65 | safi_t |
| 66 | bgp_node_safi (struct vty *vty) |
| 67 | { |
| 68 | if (vty->node == BGP_VPNV4_NODE) |
| 69 | return SAFI_MPLS_VPN; |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 70 | if (vty->node == BGP_IPV4M_NODE || vty->node == BGP_IPV6M_NODE) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 71 | return SAFI_MULTICAST; |
| 72 | return SAFI_UNICAST; |
| 73 | } |
| 74 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 75 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 76 | peer_address_self_check (union sockunion *su) |
| 77 | { |
| 78 | struct interface *ifp = NULL; |
| 79 | |
| 80 | if (su->sa.sa_family == AF_INET) |
| 81 | ifp = if_lookup_by_ipv4_exact (&su->sin.sin_addr); |
| 82 | #ifdef HAVE_IPV6 |
| 83 | else if (su->sa.sa_family == AF_INET6) |
| 84 | ifp = if_lookup_by_ipv6_exact (&su->sin6.sin6_addr); |
| 85 | #endif /* HAVE IPV6 */ |
| 86 | |
| 87 | if (ifp) |
| 88 | return 1; |
| 89 | |
| 90 | return 0; |
| 91 | } |
| 92 | |
| 93 | /* Utility function for looking up peer from VTY. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 94 | static struct peer * |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 95 | peer_lookup_vty (struct vty *vty, const char *ip_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 96 | { |
| 97 | int ret; |
| 98 | struct bgp *bgp; |
| 99 | union sockunion su; |
| 100 | struct peer *peer; |
| 101 | |
| 102 | bgp = vty->index; |
| 103 | |
| 104 | ret = str2sockunion (ip_str, &su); |
| 105 | if (ret < 0) |
| 106 | { |
| 107 | vty_out (vty, "%% Malformed address: %s%s", ip_str, VTY_NEWLINE); |
| 108 | return NULL; |
| 109 | } |
| 110 | |
| 111 | peer = peer_lookup (bgp, &su); |
| 112 | if (! peer) |
| 113 | { |
| 114 | vty_out (vty, "%% Specify remote-as or peer-group commands first%s", VTY_NEWLINE); |
| 115 | return NULL; |
| 116 | } |
| 117 | return peer; |
| 118 | } |
| 119 | |
| 120 | /* Utility function for looking up peer or peer group. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 121 | static struct peer * |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 122 | peer_and_group_lookup_vty (struct vty *vty, const char *peer_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 123 | { |
| 124 | int ret; |
| 125 | struct bgp *bgp; |
| 126 | union sockunion su; |
| 127 | struct peer *peer; |
| 128 | struct peer_group *group; |
| 129 | |
| 130 | bgp = vty->index; |
| 131 | |
| 132 | ret = str2sockunion (peer_str, &su); |
| 133 | if (ret == 0) |
| 134 | { |
| 135 | peer = peer_lookup (bgp, &su); |
| 136 | if (peer) |
| 137 | return peer; |
| 138 | } |
| 139 | else |
| 140 | { |
| 141 | group = peer_group_lookup (bgp, peer_str); |
| 142 | if (group) |
| 143 | return group->conf; |
| 144 | } |
| 145 | |
| 146 | vty_out (vty, "%% Specify remote-as or peer-group commands first%s", |
| 147 | VTY_NEWLINE); |
| 148 | |
| 149 | return NULL; |
| 150 | } |
| 151 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 152 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 153 | bgp_vty_return (struct vty *vty, int ret) |
| 154 | { |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 155 | const char *str = NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 156 | |
| 157 | switch (ret) |
| 158 | { |
| 159 | case BGP_ERR_INVALID_VALUE: |
| 160 | str = "Invalid value"; |
| 161 | break; |
| 162 | case BGP_ERR_INVALID_FLAG: |
| 163 | str = "Invalid flag"; |
| 164 | break; |
| 165 | case BGP_ERR_PEER_INACTIVE: |
| 166 | str = "Activate the neighbor for the address family first"; |
| 167 | break; |
| 168 | case BGP_ERR_INVALID_FOR_PEER_GROUP_MEMBER: |
| 169 | str = "Invalid command for a peer-group member"; |
| 170 | break; |
| 171 | case BGP_ERR_PEER_GROUP_SHUTDOWN: |
| 172 | str = "Peer-group has been shutdown. Activate the peer-group first"; |
| 173 | break; |
| 174 | case BGP_ERR_PEER_GROUP_HAS_THE_FLAG: |
| 175 | str = "This peer is a peer-group member. Please change peer-group configuration"; |
| 176 | break; |
| 177 | case BGP_ERR_PEER_FLAG_CONFLICT: |
| 178 | str = "Can't set override-capability and strict-capability-match at the same time"; |
| 179 | break; |
| 180 | case BGP_ERR_PEER_GROUP_MEMBER_EXISTS: |
| 181 | str = "No activate for peergroup can be given only if peer-group has no members"; |
| 182 | break; |
| 183 | case BGP_ERR_PEER_BELONGS_TO_GROUP: |
| 184 | str = "No activate for an individual peer-group member is invalid"; |
| 185 | break; |
| 186 | case BGP_ERR_PEER_GROUP_AF_UNCONFIGURED: |
| 187 | str = "Activate the peer-group for the address family first"; |
| 188 | break; |
| 189 | case BGP_ERR_PEER_GROUP_NO_REMOTE_AS: |
| 190 | str = "Specify remote-as or peer-group remote AS first"; |
| 191 | break; |
| 192 | case BGP_ERR_PEER_GROUP_CANT_CHANGE: |
| 193 | str = "Cannot change the peer-group. Deconfigure first"; |
| 194 | break; |
| 195 | case BGP_ERR_PEER_GROUP_MISMATCH: |
| 196 | str = "Cannot have different peer-group for the neighbor"; |
| 197 | break; |
| 198 | case BGP_ERR_PEER_FILTER_CONFLICT: |
| 199 | str = "Prefix/distribute list can not co-exist"; |
| 200 | break; |
| 201 | case BGP_ERR_NOT_INTERNAL_PEER: |
| 202 | str = "Invalid command. Not an internal neighbor"; |
| 203 | break; |
| 204 | case BGP_ERR_REMOVE_PRIVATE_AS: |
| 205 | str = "Private AS cannot be removed for IBGP peers"; |
| 206 | break; |
| 207 | case BGP_ERR_LOCAL_AS_ALLOWED_ONLY_FOR_EBGP: |
| 208 | str = "Local-AS allowed only for EBGP peers"; |
| 209 | break; |
| 210 | case BGP_ERR_CANNOT_HAVE_LOCAL_AS_SAME_AS: |
| 211 | str = "Cannot have local-as same as BGP AS number"; |
| 212 | break; |
| 213 | } |
| 214 | if (str) |
| 215 | { |
| 216 | vty_out (vty, "%% %s%s", str, VTY_NEWLINE); |
| 217 | return CMD_WARNING; |
| 218 | } |
| 219 | return CMD_SUCCESS; |
| 220 | } |
| 221 | |
| 222 | /* BGP global configuration. */ |
| 223 | |
| 224 | DEFUN (bgp_multiple_instance_func, |
| 225 | bgp_multiple_instance_cmd, |
| 226 | "bgp multiple-instance", |
| 227 | BGP_STR |
| 228 | "Enable bgp multiple instance\n") |
| 229 | { |
| 230 | bgp_option_set (BGP_OPT_MULTIPLE_INSTANCE); |
| 231 | return CMD_SUCCESS; |
| 232 | } |
| 233 | |
| 234 | DEFUN (no_bgp_multiple_instance, |
| 235 | no_bgp_multiple_instance_cmd, |
| 236 | "no bgp multiple-instance", |
| 237 | NO_STR |
| 238 | BGP_STR |
| 239 | "BGP multiple instance\n") |
| 240 | { |
| 241 | int ret; |
| 242 | |
| 243 | ret = bgp_option_unset (BGP_OPT_MULTIPLE_INSTANCE); |
| 244 | if (ret < 0) |
| 245 | { |
| 246 | vty_out (vty, "%% There are more than two BGP instances%s", VTY_NEWLINE); |
| 247 | return CMD_WARNING; |
| 248 | } |
| 249 | return CMD_SUCCESS; |
| 250 | } |
| 251 | |
| 252 | DEFUN (bgp_config_type, |
| 253 | bgp_config_type_cmd, |
| 254 | "bgp config-type (cisco|zebra)", |
| 255 | BGP_STR |
| 256 | "Configuration type\n" |
| 257 | "cisco\n" |
| 258 | "zebra\n") |
| 259 | { |
| 260 | if (strncmp (argv[0], "c", 1) == 0) |
| 261 | bgp_option_set (BGP_OPT_CONFIG_CISCO); |
| 262 | else |
| 263 | bgp_option_unset (BGP_OPT_CONFIG_CISCO); |
| 264 | |
| 265 | return CMD_SUCCESS; |
| 266 | } |
| 267 | |
| 268 | DEFUN (no_bgp_config_type, |
| 269 | no_bgp_config_type_cmd, |
| 270 | "no bgp config-type", |
| 271 | NO_STR |
| 272 | BGP_STR |
| 273 | "Display configuration type\n") |
| 274 | { |
| 275 | bgp_option_unset (BGP_OPT_CONFIG_CISCO); |
| 276 | return CMD_SUCCESS; |
| 277 | } |
| 278 | |
| 279 | DEFUN (no_synchronization, |
| 280 | no_synchronization_cmd, |
| 281 | "no synchronization", |
| 282 | NO_STR |
| 283 | "Perform IGP synchronization\n") |
| 284 | { |
| 285 | return CMD_SUCCESS; |
| 286 | } |
| 287 | |
| 288 | DEFUN (no_auto_summary, |
| 289 | no_auto_summary_cmd, |
| 290 | "no auto-summary", |
| 291 | NO_STR |
| 292 | "Enable automatic network number summarization\n") |
| 293 | { |
| 294 | return CMD_SUCCESS; |
| 295 | } |
hasso | 3d515fd | 2005-02-01 21:30:04 +0000 | [diff] [blame] | 296 | |
| 297 | DEFUN_DEPRECATED (neighbor_version, |
| 298 | neighbor_version_cmd, |
| 299 | NEIGHBOR_CMD "version (4|4-)", |
| 300 | NEIGHBOR_STR |
| 301 | NEIGHBOR_ADDR_STR |
| 302 | "Set the BGP version to match a neighbor\n" |
| 303 | "Neighbor's BGP version\n") |
| 304 | { |
| 305 | return CMD_SUCCESS; |
| 306 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 307 | |
| 308 | /* "router bgp" commands. */ |
| 309 | DEFUN (router_bgp, |
| 310 | router_bgp_cmd, |
| 311 | "router bgp <1-65535>", |
| 312 | ROUTER_STR |
| 313 | BGP_STR |
| 314 | AS_STR) |
| 315 | { |
| 316 | int ret; |
| 317 | as_t as; |
| 318 | struct bgp *bgp; |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 319 | const char *name = NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 320 | |
| 321 | VTY_GET_INTEGER_RANGE ("AS", as, argv[0], 1, 65535); |
| 322 | |
| 323 | if (argc == 2) |
| 324 | name = argv[1]; |
| 325 | |
| 326 | ret = bgp_get (&bgp, &as, name); |
| 327 | switch (ret) |
| 328 | { |
| 329 | case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET: |
| 330 | vty_out (vty, "Please specify 'bgp multiple-instance' first%s", |
| 331 | VTY_NEWLINE); |
| 332 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 333 | case BGP_ERR_AS_MISMATCH: |
| 334 | vty_out (vty, "BGP is already running; AS is %d%s", as, VTY_NEWLINE); |
| 335 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 336 | case BGP_ERR_INSTANCE_MISMATCH: |
| 337 | vty_out (vty, "BGP view name and AS number mismatch%s", VTY_NEWLINE); |
| 338 | vty_out (vty, "BGP instance is already running; AS is %d%s", |
| 339 | as, VTY_NEWLINE); |
| 340 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 341 | } |
| 342 | |
| 343 | vty->node = BGP_NODE; |
| 344 | vty->index = bgp; |
| 345 | |
| 346 | return CMD_SUCCESS; |
| 347 | } |
| 348 | |
| 349 | ALIAS (router_bgp, |
| 350 | router_bgp_view_cmd, |
| 351 | "router bgp <1-65535> view WORD", |
| 352 | ROUTER_STR |
| 353 | BGP_STR |
| 354 | AS_STR |
| 355 | "BGP view\n" |
| 356 | "view name\n") |
| 357 | |
| 358 | /* "no router bgp" commands. */ |
| 359 | DEFUN (no_router_bgp, |
| 360 | no_router_bgp_cmd, |
| 361 | "no router bgp <1-65535>", |
| 362 | NO_STR |
| 363 | ROUTER_STR |
| 364 | BGP_STR |
| 365 | AS_STR) |
| 366 | { |
| 367 | as_t as; |
| 368 | struct bgp *bgp; |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 369 | const char *name = NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 370 | |
| 371 | VTY_GET_INTEGER_RANGE ("AS", as, argv[0], 1, 65535); |
| 372 | |
| 373 | if (argc == 2) |
| 374 | name = argv[1]; |
| 375 | |
| 376 | /* Lookup bgp structure. */ |
| 377 | bgp = bgp_lookup (as, name); |
| 378 | if (! bgp) |
| 379 | { |
| 380 | vty_out (vty, "%% Can't find BGP instance%s", VTY_NEWLINE); |
| 381 | return CMD_WARNING; |
| 382 | } |
| 383 | |
| 384 | bgp_delete (bgp); |
| 385 | |
| 386 | return CMD_SUCCESS; |
| 387 | } |
| 388 | |
| 389 | ALIAS (no_router_bgp, |
| 390 | no_router_bgp_view_cmd, |
| 391 | "no router bgp <1-65535> view WORD", |
| 392 | NO_STR |
| 393 | ROUTER_STR |
| 394 | BGP_STR |
| 395 | AS_STR |
| 396 | "BGP view\n" |
| 397 | "view name\n") |
| 398 | |
| 399 | /* BGP router-id. */ |
| 400 | |
| 401 | DEFUN (bgp_router_id, |
| 402 | bgp_router_id_cmd, |
| 403 | "bgp router-id A.B.C.D", |
| 404 | BGP_STR |
| 405 | "Override configured router identifier\n" |
| 406 | "Manually configured router identifier\n") |
| 407 | { |
| 408 | int ret; |
| 409 | struct in_addr id; |
| 410 | struct bgp *bgp; |
| 411 | |
| 412 | bgp = vty->index; |
| 413 | |
| 414 | ret = inet_aton (argv[0], &id); |
| 415 | if (! ret) |
| 416 | { |
| 417 | vty_out (vty, "%% Malformed bgp router identifier%s", VTY_NEWLINE); |
| 418 | return CMD_WARNING; |
| 419 | } |
| 420 | |
hasso | 18a6dce | 2004-10-03 18:18:34 +0000 | [diff] [blame] | 421 | bgp->router_id_static = id; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 422 | bgp_router_id_set (bgp, &id); |
| 423 | |
| 424 | return CMD_SUCCESS; |
| 425 | } |
| 426 | |
| 427 | DEFUN (no_bgp_router_id, |
| 428 | no_bgp_router_id_cmd, |
| 429 | "no bgp router-id", |
| 430 | NO_STR |
| 431 | BGP_STR |
| 432 | "Override configured router identifier\n") |
| 433 | { |
| 434 | int ret; |
| 435 | struct in_addr id; |
| 436 | struct bgp *bgp; |
| 437 | |
| 438 | bgp = vty->index; |
| 439 | |
| 440 | if (argc == 1) |
| 441 | { |
| 442 | ret = inet_aton (argv[0], &id); |
| 443 | if (! ret) |
| 444 | { |
| 445 | vty_out (vty, "%% Malformed BGP router identifier%s", VTY_NEWLINE); |
| 446 | return CMD_WARNING; |
| 447 | } |
| 448 | |
hasso | 18a6dce | 2004-10-03 18:18:34 +0000 | [diff] [blame] | 449 | if (! IPV4_ADDR_SAME (&bgp->router_id_static, &id)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 450 | { |
| 451 | vty_out (vty, "%% BGP router-id doesn't match%s", VTY_NEWLINE); |
| 452 | return CMD_WARNING; |
| 453 | } |
| 454 | } |
| 455 | |
hasso | 18a6dce | 2004-10-03 18:18:34 +0000 | [diff] [blame] | 456 | bgp->router_id_static.s_addr = 0; |
| 457 | bgp_router_id_set (bgp, &router_id_zebra); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 458 | |
| 459 | return CMD_SUCCESS; |
| 460 | } |
| 461 | |
| 462 | ALIAS (no_bgp_router_id, |
| 463 | no_bgp_router_id_val_cmd, |
| 464 | "no bgp router-id A.B.C.D", |
| 465 | NO_STR |
| 466 | BGP_STR |
| 467 | "Override configured router identifier\n" |
| 468 | "Manually configured router identifier\n") |
| 469 | |
| 470 | /* BGP Cluster ID. */ |
| 471 | |
| 472 | DEFUN (bgp_cluster_id, |
| 473 | bgp_cluster_id_cmd, |
| 474 | "bgp cluster-id A.B.C.D", |
| 475 | BGP_STR |
| 476 | "Configure Route-Reflector Cluster-id\n" |
| 477 | "Route-Reflector Cluster-id in IP address format\n") |
| 478 | { |
| 479 | int ret; |
| 480 | struct bgp *bgp; |
| 481 | struct in_addr cluster; |
| 482 | |
| 483 | bgp = vty->index; |
| 484 | |
| 485 | ret = inet_aton (argv[0], &cluster); |
| 486 | if (! ret) |
| 487 | { |
| 488 | vty_out (vty, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE); |
| 489 | return CMD_WARNING; |
| 490 | } |
| 491 | |
| 492 | bgp_cluster_id_set (bgp, &cluster); |
| 493 | |
| 494 | return CMD_SUCCESS; |
| 495 | } |
| 496 | |
| 497 | ALIAS (bgp_cluster_id, |
| 498 | bgp_cluster_id32_cmd, |
| 499 | "bgp cluster-id <1-4294967295>", |
| 500 | BGP_STR |
| 501 | "Configure Route-Reflector Cluster-id\n" |
| 502 | "Route-Reflector Cluster-id as 32 bit quantity\n") |
| 503 | |
| 504 | DEFUN (no_bgp_cluster_id, |
| 505 | no_bgp_cluster_id_cmd, |
| 506 | "no bgp cluster-id", |
| 507 | NO_STR |
| 508 | BGP_STR |
| 509 | "Configure Route-Reflector Cluster-id\n") |
| 510 | { |
| 511 | int ret; |
| 512 | struct bgp *bgp; |
| 513 | struct in_addr cluster; |
| 514 | |
| 515 | bgp = vty->index; |
| 516 | |
| 517 | if (argc == 1) |
| 518 | { |
| 519 | ret = inet_aton (argv[0], &cluster); |
| 520 | if (! ret) |
| 521 | { |
| 522 | vty_out (vty, "%% Malformed bgp cluster identifier%s", VTY_NEWLINE); |
| 523 | return CMD_WARNING; |
| 524 | } |
| 525 | } |
| 526 | |
| 527 | bgp_cluster_id_unset (bgp); |
| 528 | |
| 529 | return CMD_SUCCESS; |
| 530 | } |
| 531 | |
| 532 | ALIAS (no_bgp_cluster_id, |
| 533 | no_bgp_cluster_id_arg_cmd, |
| 534 | "no bgp cluster-id A.B.C.D", |
| 535 | NO_STR |
| 536 | BGP_STR |
| 537 | "Configure Route-Reflector Cluster-id\n" |
| 538 | "Route-Reflector Cluster-id in IP address format\n") |
| 539 | |
| 540 | DEFUN (bgp_confederation_identifier, |
| 541 | bgp_confederation_identifier_cmd, |
| 542 | "bgp confederation identifier <1-65535>", |
| 543 | "BGP specific commands\n" |
| 544 | "AS confederation parameters\n" |
| 545 | "AS number\n" |
| 546 | "Set routing domain confederation AS\n") |
| 547 | { |
| 548 | struct bgp *bgp; |
| 549 | as_t as; |
| 550 | |
| 551 | bgp = vty->index; |
| 552 | |
| 553 | VTY_GET_INTEGER ("AS", as, argv[0]); |
| 554 | |
| 555 | bgp_confederation_id_set (bgp, as); |
| 556 | |
| 557 | return CMD_SUCCESS; |
| 558 | } |
| 559 | |
| 560 | DEFUN (no_bgp_confederation_identifier, |
| 561 | no_bgp_confederation_identifier_cmd, |
| 562 | "no bgp confederation identifier", |
| 563 | NO_STR |
| 564 | "BGP specific commands\n" |
| 565 | "AS confederation parameters\n" |
| 566 | "AS number\n") |
| 567 | { |
| 568 | struct bgp *bgp; |
| 569 | as_t as; |
| 570 | |
| 571 | bgp = vty->index; |
| 572 | |
| 573 | if (argc == 1) |
| 574 | VTY_GET_INTEGER ("AS", as, argv[0]); |
| 575 | |
| 576 | bgp_confederation_id_unset (bgp); |
| 577 | |
| 578 | return CMD_SUCCESS; |
| 579 | } |
| 580 | |
| 581 | ALIAS (no_bgp_confederation_identifier, |
| 582 | no_bgp_confederation_identifier_arg_cmd, |
| 583 | "no bgp confederation identifier <1-65535>", |
| 584 | NO_STR |
| 585 | "BGP specific commands\n" |
| 586 | "AS confederation parameters\n" |
| 587 | "AS number\n" |
| 588 | "Set routing domain confederation AS\n") |
| 589 | |
| 590 | DEFUN (bgp_confederation_peers, |
| 591 | bgp_confederation_peers_cmd, |
| 592 | "bgp confederation peers .<1-65535>", |
| 593 | "BGP specific commands\n" |
| 594 | "AS confederation parameters\n" |
| 595 | "Peer ASs in BGP confederation\n" |
| 596 | AS_STR) |
| 597 | { |
| 598 | struct bgp *bgp; |
| 599 | as_t as; |
| 600 | int i; |
| 601 | |
| 602 | bgp = vty->index; |
| 603 | |
| 604 | for (i = 0; i < argc; i++) |
| 605 | { |
| 606 | VTY_GET_INTEGER_RANGE ("AS", as, argv[i], 1, 65535); |
| 607 | |
| 608 | if (bgp->as == as) |
| 609 | { |
| 610 | vty_out (vty, "%% Local member-AS not allowed in confed peer list%s", |
| 611 | VTY_NEWLINE); |
| 612 | continue; |
| 613 | } |
| 614 | |
| 615 | bgp_confederation_peers_add (bgp, as); |
| 616 | } |
| 617 | return CMD_SUCCESS; |
| 618 | } |
| 619 | |
| 620 | DEFUN (no_bgp_confederation_peers, |
| 621 | no_bgp_confederation_peers_cmd, |
| 622 | "no bgp confederation peers .<1-65535>", |
| 623 | NO_STR |
| 624 | "BGP specific commands\n" |
| 625 | "AS confederation parameters\n" |
| 626 | "Peer ASs in BGP confederation\n" |
| 627 | AS_STR) |
| 628 | { |
| 629 | struct bgp *bgp; |
| 630 | as_t as; |
| 631 | int i; |
| 632 | |
| 633 | bgp = vty->index; |
| 634 | |
| 635 | for (i = 0; i < argc; i++) |
| 636 | { |
| 637 | VTY_GET_INTEGER_RANGE ("AS", as, argv[i], 1, 65535); |
| 638 | |
| 639 | bgp_confederation_peers_remove (bgp, as); |
| 640 | } |
| 641 | return CMD_SUCCESS; |
| 642 | } |
| 643 | |
| 644 | /* BGP timers. */ |
| 645 | |
| 646 | DEFUN (bgp_timers, |
| 647 | bgp_timers_cmd, |
| 648 | "timers bgp <0-65535> <0-65535>", |
| 649 | "Adjust routing timers\n" |
| 650 | "BGP timers\n" |
| 651 | "Keepalive interval\n" |
| 652 | "Holdtime\n") |
| 653 | { |
| 654 | struct bgp *bgp; |
| 655 | unsigned long keepalive = 0; |
| 656 | unsigned long holdtime = 0; |
| 657 | |
| 658 | bgp = vty->index; |
| 659 | |
| 660 | VTY_GET_INTEGER ("keepalive", keepalive, argv[0]); |
| 661 | VTY_GET_INTEGER ("holdtime", holdtime, argv[1]); |
| 662 | |
| 663 | /* Holdtime value check. */ |
| 664 | if (holdtime < 3 && holdtime != 0) |
| 665 | { |
| 666 | vty_out (vty, "%% hold time value must be either 0 or greater than 3%s", |
| 667 | VTY_NEWLINE); |
| 668 | return CMD_WARNING; |
| 669 | } |
| 670 | |
| 671 | bgp_timers_set (bgp, keepalive, holdtime); |
| 672 | |
| 673 | return CMD_SUCCESS; |
| 674 | } |
| 675 | |
| 676 | DEFUN (no_bgp_timers, |
| 677 | no_bgp_timers_cmd, |
| 678 | "no timers bgp", |
| 679 | NO_STR |
| 680 | "Adjust routing timers\n" |
| 681 | "BGP timers\n") |
| 682 | { |
| 683 | struct bgp *bgp; |
| 684 | |
| 685 | bgp = vty->index; |
| 686 | bgp_timers_unset (bgp); |
| 687 | |
| 688 | return CMD_SUCCESS; |
| 689 | } |
| 690 | |
| 691 | ALIAS (no_bgp_timers, |
| 692 | no_bgp_timers_arg_cmd, |
| 693 | "no timers bgp <0-65535> <0-65535>", |
| 694 | NO_STR |
| 695 | "Adjust routing timers\n" |
| 696 | "BGP timers\n" |
| 697 | "Keepalive interval\n" |
| 698 | "Holdtime\n") |
| 699 | |
| 700 | DEFUN (bgp_client_to_client_reflection, |
| 701 | bgp_client_to_client_reflection_cmd, |
| 702 | "bgp client-to-client reflection", |
| 703 | "BGP specific commands\n" |
| 704 | "Configure client to client route reflection\n" |
| 705 | "reflection of routes allowed\n") |
| 706 | { |
| 707 | struct bgp *bgp; |
| 708 | |
| 709 | bgp = vty->index; |
| 710 | bgp_flag_unset (bgp, BGP_FLAG_NO_CLIENT_TO_CLIENT); |
| 711 | return CMD_SUCCESS; |
| 712 | } |
| 713 | |
| 714 | DEFUN (no_bgp_client_to_client_reflection, |
| 715 | no_bgp_client_to_client_reflection_cmd, |
| 716 | "no bgp client-to-client reflection", |
| 717 | NO_STR |
| 718 | "BGP specific commands\n" |
| 719 | "Configure client to client route reflection\n" |
| 720 | "reflection of routes allowed\n") |
| 721 | { |
| 722 | struct bgp *bgp; |
| 723 | |
| 724 | bgp = vty->index; |
| 725 | bgp_flag_set (bgp, BGP_FLAG_NO_CLIENT_TO_CLIENT); |
| 726 | return CMD_SUCCESS; |
| 727 | } |
| 728 | |
| 729 | /* "bgp always-compare-med" configuration. */ |
| 730 | DEFUN (bgp_always_compare_med, |
| 731 | bgp_always_compare_med_cmd, |
| 732 | "bgp always-compare-med", |
| 733 | "BGP specific commands\n" |
| 734 | "Allow comparing MED from different neighbors\n") |
| 735 | { |
| 736 | struct bgp *bgp; |
| 737 | |
| 738 | bgp = vty->index; |
| 739 | bgp_flag_set (bgp, BGP_FLAG_ALWAYS_COMPARE_MED); |
| 740 | return CMD_SUCCESS; |
| 741 | } |
| 742 | |
| 743 | DEFUN (no_bgp_always_compare_med, |
| 744 | no_bgp_always_compare_med_cmd, |
| 745 | "no bgp always-compare-med", |
| 746 | NO_STR |
| 747 | "BGP specific commands\n" |
| 748 | "Allow comparing MED from different neighbors\n") |
| 749 | { |
| 750 | struct bgp *bgp; |
| 751 | |
| 752 | bgp = vty->index; |
| 753 | bgp_flag_unset (bgp, BGP_FLAG_ALWAYS_COMPARE_MED); |
| 754 | return CMD_SUCCESS; |
| 755 | } |
| 756 | |
| 757 | /* "bgp deterministic-med" configuration. */ |
| 758 | DEFUN (bgp_deterministic_med, |
| 759 | bgp_deterministic_med_cmd, |
| 760 | "bgp deterministic-med", |
| 761 | "BGP specific commands\n" |
| 762 | "Pick the best-MED path among paths advertised from the neighboring AS\n") |
| 763 | { |
| 764 | struct bgp *bgp; |
| 765 | |
| 766 | bgp = vty->index; |
| 767 | bgp_flag_set (bgp, BGP_FLAG_DETERMINISTIC_MED); |
| 768 | return CMD_SUCCESS; |
| 769 | } |
| 770 | |
| 771 | DEFUN (no_bgp_deterministic_med, |
| 772 | no_bgp_deterministic_med_cmd, |
| 773 | "no bgp deterministic-med", |
| 774 | NO_STR |
| 775 | "BGP specific commands\n" |
| 776 | "Pick the best-MED path among paths advertised from the neighboring AS\n") |
| 777 | { |
| 778 | struct bgp *bgp; |
| 779 | |
| 780 | bgp = vty->index; |
| 781 | bgp_flag_unset (bgp, BGP_FLAG_DETERMINISTIC_MED); |
| 782 | return CMD_SUCCESS; |
| 783 | } |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 784 | |
| 785 | /* "bgp graceful-restart" configuration. */ |
| 786 | DEFUN (bgp_graceful_restart, |
| 787 | bgp_graceful_restart_cmd, |
| 788 | "bgp graceful-restart", |
| 789 | "BGP specific commands\n" |
| 790 | "Graceful restart capability parameters\n") |
| 791 | { |
| 792 | struct bgp *bgp; |
| 793 | |
| 794 | bgp = vty->index; |
| 795 | bgp_flag_set (bgp, BGP_FLAG_GRACEFUL_RESTART); |
| 796 | return CMD_SUCCESS; |
| 797 | } |
| 798 | |
| 799 | DEFUN (no_bgp_graceful_restart, |
| 800 | no_bgp_graceful_restart_cmd, |
| 801 | "no bgp graceful-restart", |
| 802 | NO_STR |
| 803 | "BGP specific commands\n" |
| 804 | "Graceful restart capability parameters\n") |
| 805 | { |
| 806 | struct bgp *bgp; |
| 807 | |
| 808 | bgp = vty->index; |
| 809 | bgp_flag_unset (bgp, BGP_FLAG_GRACEFUL_RESTART); |
| 810 | return CMD_SUCCESS; |
| 811 | } |
| 812 | |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 813 | DEFUN (bgp_graceful_restart_stalepath_time, |
| 814 | bgp_graceful_restart_stalepath_time_cmd, |
| 815 | "bgp graceful-restart stalepath-time <1-3600>", |
| 816 | "BGP specific commands\n" |
| 817 | "Graceful restart capability parameters\n" |
| 818 | "Set the max time to hold onto restarting peer's stale paths\n" |
| 819 | "Delay value (seconds)\n") |
| 820 | { |
| 821 | struct bgp *bgp; |
| 822 | u_int32_t stalepath; |
| 823 | |
| 824 | bgp = vty->index; |
| 825 | if (! bgp) |
| 826 | return CMD_WARNING; |
| 827 | |
| 828 | VTY_GET_INTEGER_RANGE ("stalepath-time", stalepath, argv[0], 1, 3600); |
| 829 | bgp->stalepath_time = stalepath; |
| 830 | return CMD_SUCCESS; |
| 831 | } |
| 832 | |
| 833 | DEFUN (no_bgp_graceful_restart_stalepath_time, |
| 834 | no_bgp_graceful_restart_stalepath_time_cmd, |
| 835 | "no bgp graceful-restart stalepath-time", |
| 836 | NO_STR |
| 837 | "BGP specific commands\n" |
| 838 | "Graceful restart capability parameters\n" |
| 839 | "Set the max time to hold onto restarting peer's stale paths\n") |
| 840 | { |
| 841 | struct bgp *bgp; |
| 842 | |
| 843 | bgp = vty->index; |
| 844 | if (! bgp) |
| 845 | return CMD_WARNING; |
| 846 | |
| 847 | bgp->stalepath_time = BGP_DEFAULT_STALEPATH_TIME; |
| 848 | return CMD_SUCCESS; |
| 849 | } |
| 850 | |
| 851 | ALIAS (no_bgp_graceful_restart_stalepath_time, |
| 852 | no_bgp_graceful_restart_stalepath_time_val_cmd, |
| 853 | "no bgp graceful-restart stalepath-time <1-3600>", |
| 854 | NO_STR |
| 855 | "BGP specific commands\n" |
| 856 | "Graceful restart capability parameters\n" |
| 857 | "Set the max time to hold onto restarting peer's stale paths\n" |
| 858 | "Delay value (seconds)\n") |
| 859 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 860 | /* "bgp fast-external-failover" configuration. */ |
| 861 | DEFUN (bgp_fast_external_failover, |
| 862 | bgp_fast_external_failover_cmd, |
| 863 | "bgp fast-external-failover", |
| 864 | BGP_STR |
| 865 | "Immediately reset session if a link to a directly connected external peer goes down\n") |
| 866 | { |
| 867 | struct bgp *bgp; |
| 868 | |
| 869 | bgp = vty->index; |
| 870 | bgp_flag_unset (bgp, BGP_FLAG_NO_FAST_EXT_FAILOVER); |
| 871 | return CMD_SUCCESS; |
| 872 | } |
| 873 | |
| 874 | DEFUN (no_bgp_fast_external_failover, |
| 875 | no_bgp_fast_external_failover_cmd, |
| 876 | "no bgp fast-external-failover", |
| 877 | NO_STR |
| 878 | BGP_STR |
| 879 | "Immediately reset session if a link to a directly connected external peer goes down\n") |
| 880 | { |
| 881 | struct bgp *bgp; |
| 882 | |
| 883 | bgp = vty->index; |
| 884 | bgp_flag_set (bgp, BGP_FLAG_NO_FAST_EXT_FAILOVER); |
| 885 | return CMD_SUCCESS; |
| 886 | } |
| 887 | |
| 888 | /* "bgp enforce-first-as" configuration. */ |
| 889 | DEFUN (bgp_enforce_first_as, |
| 890 | bgp_enforce_first_as_cmd, |
| 891 | "bgp enforce-first-as", |
| 892 | BGP_STR |
| 893 | "Enforce the first AS for EBGP routes\n") |
| 894 | { |
| 895 | struct bgp *bgp; |
| 896 | |
| 897 | bgp = vty->index; |
| 898 | bgp_flag_set (bgp, BGP_FLAG_ENFORCE_FIRST_AS); |
| 899 | return CMD_SUCCESS; |
| 900 | } |
| 901 | |
| 902 | DEFUN (no_bgp_enforce_first_as, |
| 903 | no_bgp_enforce_first_as_cmd, |
| 904 | "no bgp enforce-first-as", |
| 905 | NO_STR |
| 906 | BGP_STR |
| 907 | "Enforce the first AS for EBGP routes\n") |
| 908 | { |
| 909 | struct bgp *bgp; |
| 910 | |
| 911 | bgp = vty->index; |
| 912 | bgp_flag_unset (bgp, BGP_FLAG_ENFORCE_FIRST_AS); |
| 913 | return CMD_SUCCESS; |
| 914 | } |
| 915 | |
| 916 | /* "bgp bestpath compare-routerid" configuration. */ |
| 917 | DEFUN (bgp_bestpath_compare_router_id, |
| 918 | bgp_bestpath_compare_router_id_cmd, |
| 919 | "bgp bestpath compare-routerid", |
| 920 | "BGP specific commands\n" |
| 921 | "Change the default bestpath selection\n" |
| 922 | "Compare router-id for identical EBGP paths\n") |
| 923 | { |
| 924 | struct bgp *bgp; |
| 925 | |
| 926 | bgp = vty->index; |
| 927 | bgp_flag_set (bgp, BGP_FLAG_COMPARE_ROUTER_ID); |
| 928 | return CMD_SUCCESS; |
| 929 | } |
| 930 | |
| 931 | DEFUN (no_bgp_bestpath_compare_router_id, |
| 932 | no_bgp_bestpath_compare_router_id_cmd, |
| 933 | "no bgp bestpath compare-routerid", |
| 934 | NO_STR |
| 935 | "BGP specific commands\n" |
| 936 | "Change the default bestpath selection\n" |
| 937 | "Compare router-id for identical EBGP paths\n") |
| 938 | { |
| 939 | struct bgp *bgp; |
| 940 | |
| 941 | bgp = vty->index; |
| 942 | bgp_flag_unset (bgp, BGP_FLAG_COMPARE_ROUTER_ID); |
| 943 | return CMD_SUCCESS; |
| 944 | } |
| 945 | |
| 946 | /* "bgp bestpath as-path ignore" configuration. */ |
| 947 | DEFUN (bgp_bestpath_aspath_ignore, |
| 948 | bgp_bestpath_aspath_ignore_cmd, |
| 949 | "bgp bestpath as-path ignore", |
| 950 | "BGP specific commands\n" |
| 951 | "Change the default bestpath selection\n" |
| 952 | "AS-path attribute\n" |
| 953 | "Ignore as-path length in selecting a route\n") |
| 954 | { |
| 955 | struct bgp *bgp; |
| 956 | |
| 957 | bgp = vty->index; |
| 958 | bgp_flag_set (bgp, BGP_FLAG_ASPATH_IGNORE); |
| 959 | return CMD_SUCCESS; |
| 960 | } |
| 961 | |
| 962 | DEFUN (no_bgp_bestpath_aspath_ignore, |
| 963 | no_bgp_bestpath_aspath_ignore_cmd, |
| 964 | "no bgp bestpath as-path ignore", |
| 965 | NO_STR |
| 966 | "BGP specific commands\n" |
| 967 | "Change the default bestpath selection\n" |
| 968 | "AS-path attribute\n" |
| 969 | "Ignore as-path length in selecting a route\n") |
| 970 | { |
| 971 | struct bgp *bgp; |
| 972 | |
| 973 | bgp = vty->index; |
| 974 | bgp_flag_unset (bgp, BGP_FLAG_ASPATH_IGNORE); |
| 975 | return CMD_SUCCESS; |
| 976 | } |
| 977 | |
hasso | 6811845 | 2005-04-08 15:40:36 +0000 | [diff] [blame] | 978 | /* "bgp bestpath as-path confed" configuration. */ |
| 979 | DEFUN (bgp_bestpath_aspath_confed, |
| 980 | bgp_bestpath_aspath_confed_cmd, |
| 981 | "bgp bestpath as-path confed", |
| 982 | "BGP specific commands\n" |
| 983 | "Change the default bestpath selection\n" |
| 984 | "AS-path attribute\n" |
| 985 | "Compare path lengths including confederation sets & sequences in selecting a route\n") |
| 986 | { |
| 987 | struct bgp *bgp; |
| 988 | |
| 989 | bgp = vty->index; |
| 990 | bgp_flag_set (bgp, BGP_FLAG_ASPATH_CONFED); |
| 991 | return CMD_SUCCESS; |
| 992 | } |
| 993 | |
| 994 | DEFUN (no_bgp_bestpath_aspath_confed, |
| 995 | no_bgp_bestpath_aspath_confed_cmd, |
| 996 | "no bgp bestpath as-path confed", |
| 997 | NO_STR |
| 998 | "BGP specific commands\n" |
| 999 | "Change the default bestpath selection\n" |
| 1000 | "AS-path attribute\n" |
| 1001 | "Compare path lengths including confederation sets & sequences in selecting a route\n") |
| 1002 | { |
| 1003 | struct bgp *bgp; |
| 1004 | |
| 1005 | bgp = vty->index; |
| 1006 | bgp_flag_unset (bgp, BGP_FLAG_ASPATH_CONFED); |
| 1007 | return CMD_SUCCESS; |
| 1008 | } |
| 1009 | |
paul | 848973c | 2003-08-13 00:32:49 +0000 | [diff] [blame] | 1010 | /* "bgp log-neighbor-changes" configuration. */ |
| 1011 | DEFUN (bgp_log_neighbor_changes, |
| 1012 | bgp_log_neighbor_changes_cmd, |
| 1013 | "bgp log-neighbor-changes", |
| 1014 | "BGP specific commands\n" |
| 1015 | "Log neighbor up/down and reset reason\n") |
| 1016 | { |
| 1017 | struct bgp *bgp; |
| 1018 | |
| 1019 | bgp = vty->index; |
| 1020 | bgp_flag_set (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES); |
| 1021 | return CMD_SUCCESS; |
| 1022 | } |
| 1023 | |
| 1024 | DEFUN (no_bgp_log_neighbor_changes, |
| 1025 | no_bgp_log_neighbor_changes_cmd, |
| 1026 | "no bgp log-neighbor-changes", |
| 1027 | NO_STR |
| 1028 | "BGP specific commands\n" |
| 1029 | "Log neighbor up/down and reset reason\n") |
| 1030 | { |
| 1031 | struct bgp *bgp; |
| 1032 | |
| 1033 | bgp = vty->index; |
| 1034 | bgp_flag_unset (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES); |
| 1035 | return CMD_SUCCESS; |
| 1036 | } |
| 1037 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1038 | /* "bgp bestpath med" configuration. */ |
| 1039 | DEFUN (bgp_bestpath_med, |
| 1040 | bgp_bestpath_med_cmd, |
| 1041 | "bgp bestpath med (confed|missing-as-worst)", |
| 1042 | "BGP specific commands\n" |
| 1043 | "Change the default bestpath selection\n" |
| 1044 | "MED attribute\n" |
| 1045 | "Compare MED among confederation paths\n" |
| 1046 | "Treat missing MED as the least preferred one\n") |
| 1047 | { |
| 1048 | struct bgp *bgp; |
| 1049 | |
| 1050 | bgp = vty->index; |
| 1051 | |
| 1052 | if (strncmp (argv[0], "confed", 1) == 0) |
| 1053 | bgp_flag_set (bgp, BGP_FLAG_MED_CONFED); |
| 1054 | else |
| 1055 | bgp_flag_set (bgp, BGP_FLAG_MED_MISSING_AS_WORST); |
| 1056 | |
| 1057 | return CMD_SUCCESS; |
| 1058 | } |
| 1059 | |
| 1060 | DEFUN (bgp_bestpath_med2, |
| 1061 | bgp_bestpath_med2_cmd, |
| 1062 | "bgp bestpath med confed missing-as-worst", |
| 1063 | "BGP specific commands\n" |
| 1064 | "Change the default bestpath selection\n" |
| 1065 | "MED attribute\n" |
| 1066 | "Compare MED among confederation paths\n" |
| 1067 | "Treat missing MED as the least preferred one\n") |
| 1068 | { |
| 1069 | struct bgp *bgp; |
| 1070 | |
| 1071 | bgp = vty->index; |
| 1072 | bgp_flag_set (bgp, BGP_FLAG_MED_CONFED); |
| 1073 | bgp_flag_set (bgp, BGP_FLAG_MED_MISSING_AS_WORST); |
| 1074 | return CMD_SUCCESS; |
| 1075 | } |
| 1076 | |
| 1077 | ALIAS (bgp_bestpath_med2, |
| 1078 | bgp_bestpath_med3_cmd, |
| 1079 | "bgp bestpath med missing-as-worst confed", |
| 1080 | "BGP specific commands\n" |
| 1081 | "Change the default bestpath selection\n" |
| 1082 | "MED attribute\n" |
| 1083 | "Treat missing MED as the least preferred one\n" |
| 1084 | "Compare MED among confederation paths\n") |
| 1085 | |
| 1086 | DEFUN (no_bgp_bestpath_med, |
| 1087 | no_bgp_bestpath_med_cmd, |
| 1088 | "no bgp bestpath med (confed|missing-as-worst)", |
| 1089 | NO_STR |
| 1090 | "BGP specific commands\n" |
| 1091 | "Change the default bestpath selection\n" |
| 1092 | "MED attribute\n" |
| 1093 | "Compare MED among confederation paths\n" |
| 1094 | "Treat missing MED as the least preferred one\n") |
| 1095 | { |
| 1096 | struct bgp *bgp; |
| 1097 | |
| 1098 | bgp = vty->index; |
| 1099 | |
| 1100 | if (strncmp (argv[0], "confed", 1) == 0) |
| 1101 | bgp_flag_unset (bgp, BGP_FLAG_MED_CONFED); |
| 1102 | else |
| 1103 | bgp_flag_unset (bgp, BGP_FLAG_MED_MISSING_AS_WORST); |
| 1104 | |
| 1105 | return CMD_SUCCESS; |
| 1106 | } |
| 1107 | |
| 1108 | DEFUN (no_bgp_bestpath_med2, |
| 1109 | no_bgp_bestpath_med2_cmd, |
| 1110 | "no bgp bestpath med confed missing-as-worst", |
| 1111 | NO_STR |
| 1112 | "BGP specific commands\n" |
| 1113 | "Change the default bestpath selection\n" |
| 1114 | "MED attribute\n" |
| 1115 | "Compare MED among confederation paths\n" |
| 1116 | "Treat missing MED as the least preferred one\n") |
| 1117 | { |
| 1118 | struct bgp *bgp; |
| 1119 | |
| 1120 | bgp = vty->index; |
| 1121 | bgp_flag_unset (bgp, BGP_FLAG_MED_CONFED); |
| 1122 | bgp_flag_unset (bgp, BGP_FLAG_MED_MISSING_AS_WORST); |
| 1123 | return CMD_SUCCESS; |
| 1124 | } |
| 1125 | |
| 1126 | ALIAS (no_bgp_bestpath_med2, |
| 1127 | no_bgp_bestpath_med3_cmd, |
| 1128 | "no bgp bestpath med missing-as-worst confed", |
| 1129 | NO_STR |
| 1130 | "BGP specific commands\n" |
| 1131 | "Change the default bestpath selection\n" |
| 1132 | "MED attribute\n" |
| 1133 | "Treat missing MED as the least preferred one\n" |
| 1134 | "Compare MED among confederation paths\n") |
| 1135 | |
| 1136 | /* "no bgp default ipv4-unicast". */ |
| 1137 | DEFUN (no_bgp_default_ipv4_unicast, |
| 1138 | no_bgp_default_ipv4_unicast_cmd, |
| 1139 | "no bgp default ipv4-unicast", |
| 1140 | NO_STR |
| 1141 | "BGP specific commands\n" |
| 1142 | "Configure BGP defaults\n" |
| 1143 | "Activate ipv4-unicast for a peer by default\n") |
| 1144 | { |
| 1145 | struct bgp *bgp; |
| 1146 | |
| 1147 | bgp = vty->index; |
| 1148 | bgp_flag_set (bgp, BGP_FLAG_NO_DEFAULT_IPV4); |
| 1149 | return CMD_SUCCESS; |
| 1150 | } |
| 1151 | |
| 1152 | DEFUN (bgp_default_ipv4_unicast, |
| 1153 | bgp_default_ipv4_unicast_cmd, |
| 1154 | "bgp default ipv4-unicast", |
| 1155 | "BGP specific commands\n" |
| 1156 | "Configure BGP defaults\n" |
| 1157 | "Activate ipv4-unicast for a peer by default\n") |
| 1158 | { |
| 1159 | struct bgp *bgp; |
| 1160 | |
| 1161 | bgp = vty->index; |
| 1162 | bgp_flag_unset (bgp, BGP_FLAG_NO_DEFAULT_IPV4); |
| 1163 | return CMD_SUCCESS; |
| 1164 | } |
| 1165 | |
| 1166 | /* "bgp import-check" configuration. */ |
| 1167 | DEFUN (bgp_network_import_check, |
| 1168 | bgp_network_import_check_cmd, |
| 1169 | "bgp network import-check", |
| 1170 | "BGP specific commands\n" |
| 1171 | "BGP network command\n" |
| 1172 | "Check BGP network route exists in IGP\n") |
| 1173 | { |
| 1174 | struct bgp *bgp; |
| 1175 | |
| 1176 | bgp = vty->index; |
| 1177 | bgp_flag_set (bgp, BGP_FLAG_IMPORT_CHECK); |
| 1178 | return CMD_SUCCESS; |
| 1179 | } |
| 1180 | |
| 1181 | DEFUN (no_bgp_network_import_check, |
| 1182 | no_bgp_network_import_check_cmd, |
| 1183 | "no bgp network import-check", |
| 1184 | NO_STR |
| 1185 | "BGP specific commands\n" |
| 1186 | "BGP network command\n" |
| 1187 | "Check BGP network route exists in IGP\n") |
| 1188 | { |
| 1189 | struct bgp *bgp; |
| 1190 | |
| 1191 | bgp = vty->index; |
| 1192 | bgp_flag_unset (bgp, BGP_FLAG_IMPORT_CHECK); |
| 1193 | return CMD_SUCCESS; |
| 1194 | } |
| 1195 | |
| 1196 | DEFUN (bgp_default_local_preference, |
| 1197 | bgp_default_local_preference_cmd, |
| 1198 | "bgp default local-preference <0-4294967295>", |
| 1199 | "BGP specific commands\n" |
| 1200 | "Configure BGP defaults\n" |
| 1201 | "local preference (higher=more preferred)\n" |
| 1202 | "Configure default local preference value\n") |
| 1203 | { |
| 1204 | struct bgp *bgp; |
| 1205 | u_int32_t local_pref; |
| 1206 | |
| 1207 | bgp = vty->index; |
| 1208 | |
| 1209 | VTY_GET_INTEGER ("local preference", local_pref, argv[0]); |
| 1210 | |
| 1211 | bgp_default_local_preference_set (bgp, local_pref); |
| 1212 | |
| 1213 | return CMD_SUCCESS; |
| 1214 | } |
| 1215 | |
| 1216 | DEFUN (no_bgp_default_local_preference, |
| 1217 | no_bgp_default_local_preference_cmd, |
| 1218 | "no bgp default local-preference", |
| 1219 | NO_STR |
| 1220 | "BGP specific commands\n" |
| 1221 | "Configure BGP defaults\n" |
| 1222 | "local preference (higher=more preferred)\n") |
| 1223 | { |
| 1224 | struct bgp *bgp; |
| 1225 | |
| 1226 | bgp = vty->index; |
| 1227 | bgp_default_local_preference_unset (bgp); |
| 1228 | return CMD_SUCCESS; |
| 1229 | } |
| 1230 | |
| 1231 | ALIAS (no_bgp_default_local_preference, |
| 1232 | no_bgp_default_local_preference_val_cmd, |
| 1233 | "no bgp default local-preference <0-4294967295>", |
| 1234 | NO_STR |
| 1235 | "BGP specific commands\n" |
| 1236 | "Configure BGP defaults\n" |
| 1237 | "local preference (higher=more preferred)\n" |
| 1238 | "Configure default local preference value\n") |
| 1239 | |
| 1240 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 1241 | peer_remote_as_vty (struct vty *vty, const char *peer_str, |
| 1242 | const char *as_str, afi_t afi, safi_t safi) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1243 | { |
| 1244 | int ret; |
| 1245 | struct bgp *bgp; |
| 1246 | as_t as; |
| 1247 | union sockunion su; |
| 1248 | |
| 1249 | bgp = vty->index; |
| 1250 | |
| 1251 | /* Get AS number. */ |
| 1252 | VTY_GET_INTEGER_RANGE ("AS", as, as_str, 1, 65535); |
| 1253 | |
| 1254 | /* If peer is peer group, call proper function. */ |
| 1255 | ret = str2sockunion (peer_str, &su); |
| 1256 | if (ret < 0) |
| 1257 | { |
| 1258 | ret = peer_group_remote_as (bgp, peer_str, &as); |
| 1259 | if (ret < 0) |
| 1260 | { |
| 1261 | vty_out (vty, "%% Create the peer-group first%s", VTY_NEWLINE); |
| 1262 | return CMD_WARNING; |
| 1263 | } |
| 1264 | return CMD_SUCCESS; |
| 1265 | } |
| 1266 | |
| 1267 | if (peer_address_self_check (&su)) |
| 1268 | { |
| 1269 | vty_out (vty, "%% Can not configure the local system as neighbor%s", |
| 1270 | VTY_NEWLINE); |
| 1271 | return CMD_WARNING; |
| 1272 | } |
| 1273 | |
| 1274 | ret = peer_remote_as (bgp, &su, &as, afi, safi); |
| 1275 | |
| 1276 | /* This peer belongs to peer group. */ |
| 1277 | switch (ret) |
| 1278 | { |
| 1279 | case BGP_ERR_PEER_GROUP_MEMBER: |
| 1280 | vty_out (vty, "%% Peer-group AS %d. Cannot configure remote-as for member%s", as, VTY_NEWLINE); |
| 1281 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1282 | case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT: |
| 1283 | vty_out (vty, "%% The AS# can not be changed from %d to %s, peer-group members must be all internal or all external%s", as, as_str, VTY_NEWLINE); |
| 1284 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1285 | } |
| 1286 | return bgp_vty_return (vty, ret); |
| 1287 | } |
| 1288 | |
| 1289 | DEFUN (neighbor_remote_as, |
| 1290 | neighbor_remote_as_cmd, |
| 1291 | NEIGHBOR_CMD2 "remote-as <1-65535>", |
| 1292 | NEIGHBOR_STR |
| 1293 | NEIGHBOR_ADDR_STR2 |
| 1294 | "Specify a BGP neighbor\n" |
| 1295 | AS_STR) |
| 1296 | { |
| 1297 | return peer_remote_as_vty (vty, argv[0], argv[1], AFI_IP, SAFI_UNICAST); |
| 1298 | } |
| 1299 | |
| 1300 | DEFUN (neighbor_peer_group, |
| 1301 | neighbor_peer_group_cmd, |
| 1302 | "neighbor WORD peer-group", |
| 1303 | NEIGHBOR_STR |
| 1304 | "Neighbor tag\n" |
| 1305 | "Configure peer-group\n") |
| 1306 | { |
| 1307 | struct bgp *bgp; |
| 1308 | struct peer_group *group; |
| 1309 | |
| 1310 | bgp = vty->index; |
| 1311 | |
| 1312 | group = peer_group_get (bgp, argv[0]); |
| 1313 | if (! group) |
| 1314 | return CMD_WARNING; |
| 1315 | |
| 1316 | return CMD_SUCCESS; |
| 1317 | } |
| 1318 | |
| 1319 | DEFUN (no_neighbor, |
| 1320 | no_neighbor_cmd, |
| 1321 | NO_NEIGHBOR_CMD2, |
| 1322 | NO_STR |
| 1323 | NEIGHBOR_STR |
| 1324 | NEIGHBOR_ADDR_STR2) |
| 1325 | { |
| 1326 | int ret; |
| 1327 | union sockunion su; |
| 1328 | struct peer_group *group; |
| 1329 | struct peer *peer; |
| 1330 | |
| 1331 | ret = str2sockunion (argv[0], &su); |
| 1332 | if (ret < 0) |
| 1333 | { |
| 1334 | group = peer_group_lookup (vty->index, argv[0]); |
| 1335 | if (group) |
| 1336 | peer_group_delete (group); |
| 1337 | else |
| 1338 | { |
| 1339 | vty_out (vty, "%% Create the peer-group first%s", VTY_NEWLINE); |
| 1340 | return CMD_WARNING; |
| 1341 | } |
| 1342 | } |
| 1343 | else |
| 1344 | { |
| 1345 | peer = peer_lookup (vty->index, &su); |
| 1346 | if (peer) |
paul | 200df11 | 2005-06-01 11:17:05 +0000 | [diff] [blame] | 1347 | peer_delete (peer); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1348 | } |
| 1349 | |
| 1350 | return CMD_SUCCESS; |
| 1351 | } |
| 1352 | |
| 1353 | ALIAS (no_neighbor, |
| 1354 | no_neighbor_remote_as_cmd, |
| 1355 | NO_NEIGHBOR_CMD "remote-as <1-65535>", |
| 1356 | NO_STR |
| 1357 | NEIGHBOR_STR |
| 1358 | NEIGHBOR_ADDR_STR |
| 1359 | "Specify a BGP neighbor\n" |
| 1360 | AS_STR) |
| 1361 | |
| 1362 | DEFUN (no_neighbor_peer_group, |
| 1363 | no_neighbor_peer_group_cmd, |
| 1364 | "no neighbor WORD peer-group", |
| 1365 | NO_STR |
| 1366 | NEIGHBOR_STR |
| 1367 | "Neighbor tag\n" |
| 1368 | "Configure peer-group\n") |
| 1369 | { |
| 1370 | struct peer_group *group; |
| 1371 | |
| 1372 | group = peer_group_lookup (vty->index, argv[0]); |
| 1373 | if (group) |
| 1374 | peer_group_delete (group); |
| 1375 | else |
| 1376 | { |
| 1377 | vty_out (vty, "%% Create the peer-group first%s", VTY_NEWLINE); |
| 1378 | return CMD_WARNING; |
| 1379 | } |
| 1380 | return CMD_SUCCESS; |
| 1381 | } |
| 1382 | |
| 1383 | DEFUN (no_neighbor_peer_group_remote_as, |
| 1384 | no_neighbor_peer_group_remote_as_cmd, |
| 1385 | "no neighbor WORD remote-as <1-65535>", |
| 1386 | NO_STR |
| 1387 | NEIGHBOR_STR |
| 1388 | "Neighbor tag\n" |
| 1389 | "Specify a BGP neighbor\n" |
| 1390 | AS_STR) |
| 1391 | { |
| 1392 | struct peer_group *group; |
| 1393 | |
| 1394 | group = peer_group_lookup (vty->index, argv[0]); |
| 1395 | if (group) |
| 1396 | peer_group_remote_as_delete (group); |
| 1397 | else |
| 1398 | { |
| 1399 | vty_out (vty, "%% Create the peer-group first%s", VTY_NEWLINE); |
| 1400 | return CMD_WARNING; |
| 1401 | } |
| 1402 | return CMD_SUCCESS; |
| 1403 | } |
| 1404 | |
| 1405 | DEFUN (neighbor_local_as, |
| 1406 | neighbor_local_as_cmd, |
| 1407 | NEIGHBOR_CMD2 "local-as <1-65535>", |
| 1408 | NEIGHBOR_STR |
| 1409 | NEIGHBOR_ADDR_STR2 |
| 1410 | "Specify a local-as number\n" |
| 1411 | "AS number used as local AS\n") |
| 1412 | { |
| 1413 | struct peer *peer; |
| 1414 | int ret; |
| 1415 | |
| 1416 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1417 | if (! peer) |
| 1418 | return CMD_WARNING; |
| 1419 | |
| 1420 | ret = peer_local_as_set (peer, atoi (argv[1]), 0); |
| 1421 | return bgp_vty_return (vty, ret); |
| 1422 | } |
| 1423 | |
| 1424 | DEFUN (neighbor_local_as_no_prepend, |
| 1425 | neighbor_local_as_no_prepend_cmd, |
| 1426 | NEIGHBOR_CMD2 "local-as <1-65535> no-prepend", |
| 1427 | NEIGHBOR_STR |
| 1428 | NEIGHBOR_ADDR_STR2 |
| 1429 | "Specify a local-as number\n" |
| 1430 | "AS number used as local AS\n" |
| 1431 | "Do not prepend local-as to updates from ebgp peers\n") |
| 1432 | { |
| 1433 | struct peer *peer; |
| 1434 | int ret; |
| 1435 | |
| 1436 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1437 | if (! peer) |
| 1438 | return CMD_WARNING; |
| 1439 | |
| 1440 | ret = peer_local_as_set (peer, atoi (argv[1]), 1); |
| 1441 | return bgp_vty_return (vty, ret); |
| 1442 | } |
| 1443 | |
| 1444 | DEFUN (no_neighbor_local_as, |
| 1445 | no_neighbor_local_as_cmd, |
| 1446 | NO_NEIGHBOR_CMD2 "local-as", |
| 1447 | NO_STR |
| 1448 | NEIGHBOR_STR |
| 1449 | NEIGHBOR_ADDR_STR2 |
| 1450 | "Specify a local-as number\n") |
| 1451 | { |
| 1452 | struct peer *peer; |
| 1453 | int ret; |
| 1454 | |
| 1455 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1456 | if (! peer) |
| 1457 | return CMD_WARNING; |
| 1458 | |
| 1459 | ret = peer_local_as_unset (peer); |
| 1460 | return bgp_vty_return (vty, ret); |
| 1461 | } |
| 1462 | |
| 1463 | ALIAS (no_neighbor_local_as, |
| 1464 | no_neighbor_local_as_val_cmd, |
| 1465 | NO_NEIGHBOR_CMD2 "local-as <1-65535>", |
| 1466 | NO_STR |
| 1467 | NEIGHBOR_STR |
| 1468 | NEIGHBOR_ADDR_STR2 |
| 1469 | "Specify a local-as number\n" |
| 1470 | "AS number used as local AS\n") |
| 1471 | |
| 1472 | ALIAS (no_neighbor_local_as, |
| 1473 | no_neighbor_local_as_val2_cmd, |
| 1474 | NO_NEIGHBOR_CMD2 "local-as <1-65535> no-prepend", |
| 1475 | NO_STR |
| 1476 | NEIGHBOR_STR |
| 1477 | NEIGHBOR_ADDR_STR2 |
| 1478 | "Specify a local-as number\n" |
| 1479 | "AS number used as local AS\n" |
| 1480 | "Do not prepend local-as to updates from ebgp peers\n") |
| 1481 | |
| 1482 | DEFUN (neighbor_activate, |
| 1483 | neighbor_activate_cmd, |
| 1484 | NEIGHBOR_CMD2 "activate", |
| 1485 | NEIGHBOR_STR |
| 1486 | NEIGHBOR_ADDR_STR2 |
| 1487 | "Enable the Address Family for this Neighbor\n") |
| 1488 | { |
| 1489 | struct peer *peer; |
| 1490 | |
| 1491 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1492 | if (! peer) |
| 1493 | return CMD_WARNING; |
| 1494 | |
| 1495 | peer_activate (peer, bgp_node_afi (vty), bgp_node_safi (vty)); |
| 1496 | |
| 1497 | return CMD_SUCCESS; |
| 1498 | } |
| 1499 | |
| 1500 | DEFUN (no_neighbor_activate, |
| 1501 | no_neighbor_activate_cmd, |
| 1502 | NO_NEIGHBOR_CMD2 "activate", |
| 1503 | NO_STR |
| 1504 | NEIGHBOR_STR |
| 1505 | NEIGHBOR_ADDR_STR2 |
| 1506 | "Enable the Address Family for this Neighbor\n") |
| 1507 | { |
| 1508 | int ret; |
| 1509 | struct peer *peer; |
| 1510 | |
| 1511 | /* Lookup peer. */ |
| 1512 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 1513 | if (! peer) |
| 1514 | return CMD_WARNING; |
| 1515 | |
| 1516 | ret = peer_deactivate (peer, bgp_node_afi (vty), bgp_node_safi (vty)); |
| 1517 | |
| 1518 | return bgp_vty_return (vty, ret); |
| 1519 | } |
| 1520 | |
| 1521 | DEFUN (neighbor_set_peer_group, |
| 1522 | neighbor_set_peer_group_cmd, |
| 1523 | NEIGHBOR_CMD "peer-group WORD", |
| 1524 | NEIGHBOR_STR |
| 1525 | NEIGHBOR_ADDR_STR |
| 1526 | "Member of the peer-group\n" |
| 1527 | "peer-group name\n") |
| 1528 | { |
| 1529 | int ret; |
| 1530 | as_t as; |
| 1531 | union sockunion su; |
| 1532 | struct bgp *bgp; |
| 1533 | struct peer_group *group; |
| 1534 | |
| 1535 | bgp = vty->index; |
| 1536 | |
| 1537 | ret = str2sockunion (argv[0], &su); |
| 1538 | if (ret < 0) |
| 1539 | { |
| 1540 | vty_out (vty, "%% Malformed address: %s%s", argv[0], VTY_NEWLINE); |
| 1541 | return CMD_WARNING; |
| 1542 | } |
| 1543 | |
| 1544 | group = peer_group_lookup (bgp, argv[1]); |
| 1545 | if (! group) |
| 1546 | { |
| 1547 | vty_out (vty, "%% Configure the peer-group first%s", VTY_NEWLINE); |
| 1548 | return CMD_WARNING; |
| 1549 | } |
| 1550 | |
| 1551 | if (peer_address_self_check (&su)) |
| 1552 | { |
| 1553 | vty_out (vty, "%% Can not configure the local system as neighbor%s", |
| 1554 | VTY_NEWLINE); |
| 1555 | return CMD_WARNING; |
| 1556 | } |
| 1557 | |
| 1558 | ret = peer_group_bind (bgp, &su, group, bgp_node_afi (vty), |
| 1559 | bgp_node_safi (vty), &as); |
| 1560 | |
| 1561 | if (ret == BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT) |
| 1562 | { |
| 1563 | vty_out (vty, "%% Peer with AS %d cannot be in this peer-group, members must be all internal or all external%s", as, VTY_NEWLINE); |
| 1564 | return CMD_WARNING; |
| 1565 | } |
| 1566 | |
| 1567 | return bgp_vty_return (vty, ret); |
| 1568 | } |
| 1569 | |
| 1570 | DEFUN (no_neighbor_set_peer_group, |
| 1571 | no_neighbor_set_peer_group_cmd, |
| 1572 | NO_NEIGHBOR_CMD "peer-group WORD", |
| 1573 | NO_STR |
| 1574 | NEIGHBOR_STR |
| 1575 | NEIGHBOR_ADDR_STR |
| 1576 | "Member of the peer-group\n" |
| 1577 | "peer-group name\n") |
| 1578 | { |
| 1579 | int ret; |
| 1580 | struct bgp *bgp; |
| 1581 | struct peer *peer; |
| 1582 | struct peer_group *group; |
| 1583 | |
| 1584 | bgp = vty->index; |
| 1585 | |
| 1586 | peer = peer_lookup_vty (vty, argv[0]); |
| 1587 | if (! peer) |
| 1588 | return CMD_WARNING; |
| 1589 | |
| 1590 | group = peer_group_lookup (bgp, argv[1]); |
| 1591 | if (! group) |
| 1592 | { |
| 1593 | vty_out (vty, "%% Configure the peer-group first%s", VTY_NEWLINE); |
| 1594 | return CMD_WARNING; |
| 1595 | } |
| 1596 | |
| 1597 | ret = peer_group_unbind (bgp, peer, group, bgp_node_afi (vty), |
| 1598 | bgp_node_safi (vty)); |
| 1599 | |
| 1600 | return bgp_vty_return (vty, ret); |
| 1601 | } |
| 1602 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 1603 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 1604 | peer_flag_modify_vty (struct vty *vty, const char *ip_str, |
| 1605 | u_int16_t flag, int set) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1606 | { |
| 1607 | int ret; |
| 1608 | struct peer *peer; |
| 1609 | |
| 1610 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 1611 | if (! peer) |
| 1612 | return CMD_WARNING; |
| 1613 | |
| 1614 | if (set) |
| 1615 | ret = peer_flag_set (peer, flag); |
| 1616 | else |
| 1617 | ret = peer_flag_unset (peer, flag); |
| 1618 | |
| 1619 | return bgp_vty_return (vty, ret); |
| 1620 | } |
| 1621 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 1622 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 1623 | 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] | 1624 | { |
| 1625 | return peer_flag_modify_vty (vty, ip_str, flag, 1); |
| 1626 | } |
| 1627 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 1628 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 1629 | 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] | 1630 | { |
| 1631 | return peer_flag_modify_vty (vty, ip_str, flag, 0); |
| 1632 | } |
| 1633 | |
| 1634 | /* neighbor passive. */ |
| 1635 | DEFUN (neighbor_passive, |
| 1636 | neighbor_passive_cmd, |
| 1637 | NEIGHBOR_CMD2 "passive", |
| 1638 | NEIGHBOR_STR |
| 1639 | NEIGHBOR_ADDR_STR2 |
| 1640 | "Don't send open messages to this neighbor\n") |
| 1641 | { |
| 1642 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_PASSIVE); |
| 1643 | } |
| 1644 | |
| 1645 | DEFUN (no_neighbor_passive, |
| 1646 | no_neighbor_passive_cmd, |
| 1647 | NO_NEIGHBOR_CMD2 "passive", |
| 1648 | NO_STR |
| 1649 | NEIGHBOR_STR |
| 1650 | NEIGHBOR_ADDR_STR2 |
| 1651 | "Don't send open messages to this neighbor\n") |
| 1652 | { |
| 1653 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_PASSIVE); |
| 1654 | } |
| 1655 | |
| 1656 | /* neighbor shutdown. */ |
| 1657 | DEFUN (neighbor_shutdown, |
| 1658 | neighbor_shutdown_cmd, |
| 1659 | NEIGHBOR_CMD2 "shutdown", |
| 1660 | NEIGHBOR_STR |
| 1661 | NEIGHBOR_ADDR_STR2 |
| 1662 | "Administratively shut down this neighbor\n") |
| 1663 | { |
| 1664 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_SHUTDOWN); |
| 1665 | } |
| 1666 | |
| 1667 | DEFUN (no_neighbor_shutdown, |
| 1668 | no_neighbor_shutdown_cmd, |
| 1669 | NO_NEIGHBOR_CMD2 "shutdown", |
| 1670 | NO_STR |
| 1671 | NEIGHBOR_STR |
| 1672 | NEIGHBOR_ADDR_STR2 |
| 1673 | "Administratively shut down this neighbor\n") |
| 1674 | { |
| 1675 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_SHUTDOWN); |
| 1676 | } |
| 1677 | |
hasso | c950243 | 2005-02-01 22:01:48 +0000 | [diff] [blame] | 1678 | /* Deprecated neighbor capability route-refresh. */ |
| 1679 | DEFUN_DEPRECATED (neighbor_capability_route_refresh, |
| 1680 | neighbor_capability_route_refresh_cmd, |
| 1681 | NEIGHBOR_CMD2 "capability route-refresh", |
| 1682 | NEIGHBOR_STR |
| 1683 | NEIGHBOR_ADDR_STR2 |
| 1684 | "Advertise capability to the peer\n" |
| 1685 | "Advertise route-refresh capability to this neighbor\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1686 | { |
hasso | c950243 | 2005-02-01 22:01:48 +0000 | [diff] [blame] | 1687 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1688 | } |
| 1689 | |
hasso | c950243 | 2005-02-01 22:01:48 +0000 | [diff] [blame] | 1690 | DEFUN_DEPRECATED (no_neighbor_capability_route_refresh, |
| 1691 | no_neighbor_capability_route_refresh_cmd, |
| 1692 | NO_NEIGHBOR_CMD2 "capability route-refresh", |
| 1693 | NO_STR |
| 1694 | NEIGHBOR_STR |
| 1695 | NEIGHBOR_ADDR_STR2 |
| 1696 | "Advertise capability to the peer\n" |
| 1697 | "Advertise route-refresh capability to this neighbor\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1698 | { |
hasso | c950243 | 2005-02-01 22:01:48 +0000 | [diff] [blame] | 1699 | return CMD_SUCCESS; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1700 | } |
| 1701 | |
| 1702 | /* neighbor capability dynamic. */ |
| 1703 | DEFUN (neighbor_capability_dynamic, |
| 1704 | neighbor_capability_dynamic_cmd, |
| 1705 | NEIGHBOR_CMD2 "capability dynamic", |
| 1706 | NEIGHBOR_STR |
| 1707 | NEIGHBOR_ADDR_STR2 |
| 1708 | "Advertise capability to the peer\n" |
| 1709 | "Advertise dynamic capability to this neighbor\n") |
| 1710 | { |
| 1711 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_DYNAMIC_CAPABILITY); |
| 1712 | } |
| 1713 | |
| 1714 | DEFUN (no_neighbor_capability_dynamic, |
| 1715 | no_neighbor_capability_dynamic_cmd, |
| 1716 | NO_NEIGHBOR_CMD2 "capability dynamic", |
| 1717 | NO_STR |
| 1718 | NEIGHBOR_STR |
| 1719 | NEIGHBOR_ADDR_STR2 |
| 1720 | "Advertise capability to the peer\n" |
| 1721 | "Advertise dynamic capability to this neighbor\n") |
| 1722 | { |
| 1723 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_DYNAMIC_CAPABILITY); |
| 1724 | } |
| 1725 | |
| 1726 | /* neighbor dont-capability-negotiate */ |
| 1727 | DEFUN (neighbor_dont_capability_negotiate, |
| 1728 | neighbor_dont_capability_negotiate_cmd, |
| 1729 | NEIGHBOR_CMD2 "dont-capability-negotiate", |
| 1730 | NEIGHBOR_STR |
| 1731 | NEIGHBOR_ADDR_STR2 |
| 1732 | "Do not perform capability negotiation\n") |
| 1733 | { |
| 1734 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_DONT_CAPABILITY); |
| 1735 | } |
| 1736 | |
| 1737 | DEFUN (no_neighbor_dont_capability_negotiate, |
| 1738 | no_neighbor_dont_capability_negotiate_cmd, |
| 1739 | NO_NEIGHBOR_CMD2 "dont-capability-negotiate", |
| 1740 | NO_STR |
| 1741 | NEIGHBOR_STR |
| 1742 | NEIGHBOR_ADDR_STR2 |
| 1743 | "Do not perform capability negotiation\n") |
| 1744 | { |
| 1745 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_DONT_CAPABILITY); |
| 1746 | } |
| 1747 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 1748 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 1749 | 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] | 1750 | safi_t safi, u_int32_t flag, int set) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1751 | { |
| 1752 | int ret; |
| 1753 | struct peer *peer; |
| 1754 | |
| 1755 | peer = peer_and_group_lookup_vty (vty, peer_str); |
| 1756 | if (! peer) |
| 1757 | return CMD_WARNING; |
| 1758 | |
| 1759 | if (set) |
| 1760 | ret = peer_af_flag_set (peer, afi, safi, flag); |
| 1761 | else |
| 1762 | ret = peer_af_flag_unset (peer, afi, safi, flag); |
| 1763 | |
| 1764 | return bgp_vty_return (vty, ret); |
| 1765 | } |
| 1766 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 1767 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 1768 | 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] | 1769 | safi_t safi, u_int32_t flag) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1770 | { |
| 1771 | return peer_af_flag_modify_vty (vty, peer_str, afi, safi, flag, 1); |
| 1772 | } |
| 1773 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 1774 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 1775 | 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] | 1776 | safi_t safi, u_int32_t flag) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1777 | { |
| 1778 | return peer_af_flag_modify_vty (vty, peer_str, afi, safi, flag, 0); |
| 1779 | } |
| 1780 | |
| 1781 | /* neighbor capability orf prefix-list. */ |
| 1782 | DEFUN (neighbor_capability_orf_prefix, |
| 1783 | neighbor_capability_orf_prefix_cmd, |
| 1784 | NEIGHBOR_CMD2 "capability orf prefix-list (both|send|receive)", |
| 1785 | NEIGHBOR_STR |
| 1786 | NEIGHBOR_ADDR_STR2 |
| 1787 | "Advertise capability to the peer\n" |
| 1788 | "Advertise ORF capability to the peer\n" |
| 1789 | "Advertise prefixlist ORF capability to this neighbor\n" |
| 1790 | "Capability to SEND and RECEIVE the ORF to/from this neighbor\n" |
| 1791 | "Capability to RECEIVE the ORF from this neighbor\n" |
| 1792 | "Capability to SEND the ORF to this neighbor\n") |
| 1793 | { |
| 1794 | u_int16_t flag = 0; |
| 1795 | |
| 1796 | if (strncmp (argv[1], "s", 1) == 0) |
| 1797 | flag = PEER_FLAG_ORF_PREFIX_SM; |
| 1798 | else if (strncmp (argv[1], "r", 1) == 0) |
| 1799 | flag = PEER_FLAG_ORF_PREFIX_RM; |
| 1800 | else if (strncmp (argv[1], "b", 1) == 0) |
| 1801 | flag = PEER_FLAG_ORF_PREFIX_SM|PEER_FLAG_ORF_PREFIX_RM; |
| 1802 | else |
| 1803 | return CMD_WARNING; |
| 1804 | |
| 1805 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 1806 | bgp_node_safi (vty), flag); |
| 1807 | } |
| 1808 | |
| 1809 | DEFUN (no_neighbor_capability_orf_prefix, |
| 1810 | no_neighbor_capability_orf_prefix_cmd, |
| 1811 | NO_NEIGHBOR_CMD2 "capability orf prefix-list (both|send|receive)", |
| 1812 | NO_STR |
| 1813 | NEIGHBOR_STR |
| 1814 | NEIGHBOR_ADDR_STR2 |
| 1815 | "Advertise capability to the peer\n" |
| 1816 | "Advertise ORF capability to the peer\n" |
| 1817 | "Advertise prefixlist ORF capability to this neighbor\n" |
| 1818 | "Capability to SEND and RECEIVE the ORF to/from this neighbor\n" |
| 1819 | "Capability to RECEIVE the ORF from this neighbor\n" |
| 1820 | "Capability to SEND the ORF to this neighbor\n") |
| 1821 | { |
| 1822 | u_int16_t flag = 0; |
| 1823 | |
| 1824 | if (strncmp (argv[1], "s", 1) == 0) |
| 1825 | flag = PEER_FLAG_ORF_PREFIX_SM; |
| 1826 | else if (strncmp (argv[1], "r", 1) == 0) |
| 1827 | flag = PEER_FLAG_ORF_PREFIX_RM; |
| 1828 | else if (strncmp (argv[1], "b", 1) == 0) |
| 1829 | flag = PEER_FLAG_ORF_PREFIX_SM|PEER_FLAG_ORF_PREFIX_RM; |
| 1830 | else |
| 1831 | return CMD_WARNING; |
| 1832 | |
| 1833 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 1834 | bgp_node_safi (vty), flag); |
| 1835 | } |
| 1836 | |
| 1837 | /* neighbor next-hop-self. */ |
| 1838 | DEFUN (neighbor_nexthop_self, |
| 1839 | neighbor_nexthop_self_cmd, |
| 1840 | NEIGHBOR_CMD2 "next-hop-self", |
| 1841 | NEIGHBOR_STR |
| 1842 | NEIGHBOR_ADDR_STR2 |
| 1843 | "Disable the next hop calculation for this neighbor\n") |
| 1844 | { |
| 1845 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 1846 | bgp_node_safi (vty), PEER_FLAG_NEXTHOP_SELF); |
| 1847 | } |
| 1848 | |
| 1849 | DEFUN (no_neighbor_nexthop_self, |
| 1850 | no_neighbor_nexthop_self_cmd, |
| 1851 | NO_NEIGHBOR_CMD2 "next-hop-self", |
| 1852 | NO_STR |
| 1853 | NEIGHBOR_STR |
| 1854 | NEIGHBOR_ADDR_STR2 |
| 1855 | "Disable the next hop calculation for this neighbor\n") |
| 1856 | { |
| 1857 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 1858 | bgp_node_safi (vty), PEER_FLAG_NEXTHOP_SELF); |
| 1859 | } |
| 1860 | |
| 1861 | /* neighbor remove-private-AS. */ |
| 1862 | DEFUN (neighbor_remove_private_as, |
| 1863 | neighbor_remove_private_as_cmd, |
| 1864 | NEIGHBOR_CMD2 "remove-private-AS", |
| 1865 | NEIGHBOR_STR |
| 1866 | NEIGHBOR_ADDR_STR2 |
| 1867 | "Remove private AS number from outbound updates\n") |
| 1868 | { |
| 1869 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 1870 | bgp_node_safi (vty), |
| 1871 | PEER_FLAG_REMOVE_PRIVATE_AS); |
| 1872 | } |
| 1873 | |
| 1874 | DEFUN (no_neighbor_remove_private_as, |
| 1875 | no_neighbor_remove_private_as_cmd, |
| 1876 | NO_NEIGHBOR_CMD2 "remove-private-AS", |
| 1877 | NO_STR |
| 1878 | NEIGHBOR_STR |
| 1879 | NEIGHBOR_ADDR_STR2 |
| 1880 | "Remove private AS number from outbound updates\n") |
| 1881 | { |
| 1882 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 1883 | bgp_node_safi (vty), |
| 1884 | PEER_FLAG_REMOVE_PRIVATE_AS); |
| 1885 | } |
| 1886 | |
| 1887 | /* neighbor send-community. */ |
| 1888 | DEFUN (neighbor_send_community, |
| 1889 | neighbor_send_community_cmd, |
| 1890 | NEIGHBOR_CMD2 "send-community", |
| 1891 | NEIGHBOR_STR |
| 1892 | NEIGHBOR_ADDR_STR2 |
| 1893 | "Send Community attribute to this neighbor\n") |
| 1894 | { |
| 1895 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 1896 | bgp_node_safi (vty), |
| 1897 | PEER_FLAG_SEND_COMMUNITY); |
| 1898 | } |
| 1899 | |
| 1900 | DEFUN (no_neighbor_send_community, |
| 1901 | no_neighbor_send_community_cmd, |
| 1902 | NO_NEIGHBOR_CMD2 "send-community", |
| 1903 | NO_STR |
| 1904 | NEIGHBOR_STR |
| 1905 | NEIGHBOR_ADDR_STR2 |
| 1906 | "Send Community attribute to this neighbor\n") |
| 1907 | { |
| 1908 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 1909 | bgp_node_safi (vty), |
| 1910 | PEER_FLAG_SEND_COMMUNITY); |
| 1911 | } |
| 1912 | |
| 1913 | /* neighbor send-community extended. */ |
| 1914 | DEFUN (neighbor_send_community_type, |
| 1915 | neighbor_send_community_type_cmd, |
| 1916 | NEIGHBOR_CMD2 "send-community (both|extended|standard)", |
| 1917 | NEIGHBOR_STR |
| 1918 | NEIGHBOR_ADDR_STR2 |
| 1919 | "Send Community attribute to this neighbor\n" |
| 1920 | "Send Standard and Extended Community attributes\n" |
| 1921 | "Send Extended Community attributes\n" |
| 1922 | "Send Standard Community attributes\n") |
| 1923 | { |
| 1924 | if (strncmp (argv[1], "s", 1) == 0) |
| 1925 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 1926 | bgp_node_safi (vty), |
| 1927 | PEER_FLAG_SEND_COMMUNITY); |
| 1928 | if (strncmp (argv[1], "e", 1) == 0) |
| 1929 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 1930 | bgp_node_safi (vty), |
| 1931 | PEER_FLAG_SEND_EXT_COMMUNITY); |
| 1932 | |
| 1933 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 1934 | bgp_node_safi (vty), |
| 1935 | (PEER_FLAG_SEND_COMMUNITY| |
| 1936 | PEER_FLAG_SEND_EXT_COMMUNITY)); |
| 1937 | } |
| 1938 | |
| 1939 | DEFUN (no_neighbor_send_community_type, |
| 1940 | no_neighbor_send_community_type_cmd, |
| 1941 | NO_NEIGHBOR_CMD2 "send-community (both|extended|standard)", |
| 1942 | NO_STR |
| 1943 | NEIGHBOR_STR |
| 1944 | NEIGHBOR_ADDR_STR2 |
| 1945 | "Send Community attribute to this neighbor\n" |
| 1946 | "Send Standard and Extended Community attributes\n" |
| 1947 | "Send Extended Community attributes\n" |
| 1948 | "Send Standard Community attributes\n") |
| 1949 | { |
| 1950 | if (strncmp (argv[1], "s", 1) == 0) |
| 1951 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 1952 | bgp_node_safi (vty), |
| 1953 | PEER_FLAG_SEND_COMMUNITY); |
| 1954 | if (strncmp (argv[1], "e", 1) == 0) |
| 1955 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 1956 | bgp_node_safi (vty), |
| 1957 | PEER_FLAG_SEND_EXT_COMMUNITY); |
| 1958 | |
| 1959 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 1960 | bgp_node_safi (vty), |
| 1961 | (PEER_FLAG_SEND_COMMUNITY | |
| 1962 | PEER_FLAG_SEND_EXT_COMMUNITY)); |
| 1963 | } |
| 1964 | |
| 1965 | /* neighbor soft-reconfig. */ |
| 1966 | DEFUN (neighbor_soft_reconfiguration, |
| 1967 | neighbor_soft_reconfiguration_cmd, |
| 1968 | NEIGHBOR_CMD2 "soft-reconfiguration inbound", |
| 1969 | NEIGHBOR_STR |
| 1970 | NEIGHBOR_ADDR_STR2 |
| 1971 | "Per neighbor soft reconfiguration\n" |
| 1972 | "Allow inbound soft reconfiguration for this neighbor\n") |
| 1973 | { |
| 1974 | return peer_af_flag_set_vty (vty, argv[0], |
| 1975 | bgp_node_afi (vty), bgp_node_safi (vty), |
| 1976 | PEER_FLAG_SOFT_RECONFIG); |
| 1977 | } |
| 1978 | |
| 1979 | DEFUN (no_neighbor_soft_reconfiguration, |
| 1980 | no_neighbor_soft_reconfiguration_cmd, |
| 1981 | NO_NEIGHBOR_CMD2 "soft-reconfiguration inbound", |
| 1982 | NO_STR |
| 1983 | NEIGHBOR_STR |
| 1984 | NEIGHBOR_ADDR_STR2 |
| 1985 | "Per neighbor soft reconfiguration\n" |
| 1986 | "Allow inbound soft reconfiguration for this neighbor\n") |
| 1987 | { |
| 1988 | return peer_af_flag_unset_vty (vty, argv[0], |
| 1989 | bgp_node_afi (vty), bgp_node_safi (vty), |
| 1990 | PEER_FLAG_SOFT_RECONFIG); |
| 1991 | } |
| 1992 | |
| 1993 | DEFUN (neighbor_route_reflector_client, |
| 1994 | neighbor_route_reflector_client_cmd, |
| 1995 | NEIGHBOR_CMD2 "route-reflector-client", |
| 1996 | NEIGHBOR_STR |
| 1997 | NEIGHBOR_ADDR_STR2 |
| 1998 | "Configure a neighbor as Route Reflector client\n") |
| 1999 | { |
| 2000 | struct peer *peer; |
| 2001 | |
| 2002 | |
| 2003 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 2004 | if (! peer) |
| 2005 | return CMD_WARNING; |
| 2006 | |
| 2007 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2008 | bgp_node_safi (vty), |
| 2009 | PEER_FLAG_REFLECTOR_CLIENT); |
| 2010 | } |
| 2011 | |
| 2012 | DEFUN (no_neighbor_route_reflector_client, |
| 2013 | no_neighbor_route_reflector_client_cmd, |
| 2014 | NO_NEIGHBOR_CMD2 "route-reflector-client", |
| 2015 | NO_STR |
| 2016 | NEIGHBOR_STR |
| 2017 | NEIGHBOR_ADDR_STR2 |
| 2018 | "Configure a neighbor as Route Reflector client\n") |
| 2019 | { |
| 2020 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2021 | bgp_node_safi (vty), |
| 2022 | PEER_FLAG_REFLECTOR_CLIENT); |
| 2023 | } |
| 2024 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2025 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2026 | peer_rsclient_set_vty (struct vty *vty, const char *peer_str, |
| 2027 | int afi, int safi) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2028 | { |
| 2029 | int ret; |
| 2030 | struct bgp *bgp; |
| 2031 | struct peer *peer; |
| 2032 | struct peer_group *group; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 2033 | struct listnode *node, *nnode; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2034 | struct bgp_filter *pfilter; |
| 2035 | struct bgp_filter *gfilter; |
| 2036 | |
| 2037 | bgp = vty->index; |
| 2038 | |
| 2039 | peer = peer_and_group_lookup_vty (vty, peer_str); |
| 2040 | if ( ! peer ) |
| 2041 | return CMD_WARNING; |
| 2042 | |
| 2043 | /* If it is already a RS-Client, don't do anything. */ |
| 2044 | if ( CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT) ) |
| 2045 | return CMD_SUCCESS; |
| 2046 | |
| 2047 | if ( ! peer_rsclient_active (peer) ) |
paul | 200df11 | 2005-06-01 11:17:05 +0000 | [diff] [blame] | 2048 | { |
| 2049 | peer = peer_lock (peer); /* rsclient peer list reference */ |
| 2050 | listnode_add_sort (bgp->rsclient, peer); |
| 2051 | } |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2052 | |
| 2053 | ret = peer_af_flag_set (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT); |
| 2054 | if (ret < 0) |
| 2055 | return bgp_vty_return (vty, ret); |
| 2056 | |
Paul Jakma | 64e580a | 2006-02-21 01:09:01 +0000 | [diff] [blame] | 2057 | peer->rib[afi][safi] = bgp_table_init (afi, safi); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2058 | peer->rib[afi][safi]->type = BGP_TABLE_RSCLIENT; |
| 2059 | peer->rib[afi][safi]->owner = peer; |
| 2060 | |
| 2061 | /* Check for existing 'network' and 'redistribute' routes. */ |
| 2062 | bgp_check_local_routes_rsclient (peer, afi, safi); |
| 2063 | |
| 2064 | /* Check for routes for peers configured with 'soft-reconfiguration'. */ |
| 2065 | bgp_soft_reconfig_rsclient (peer, afi, safi); |
| 2066 | |
| 2067 | if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) |
| 2068 | { |
| 2069 | group = peer->group; |
| 2070 | gfilter = &peer->filter[afi][safi]; |
| 2071 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 2072 | for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer)) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2073 | { |
| 2074 | pfilter = &peer->filter[afi][safi]; |
| 2075 | |
| 2076 | /* Members of a non-RS-Client group should not be RS-Clients, as that |
| 2077 | is checked when the become part of the peer-group */ |
| 2078 | ret = peer_af_flag_set (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT); |
| 2079 | if (ret < 0) |
| 2080 | return bgp_vty_return (vty, ret); |
| 2081 | |
| 2082 | /* Make peer's RIB point to group's RIB. */ |
| 2083 | peer->rib[afi][safi] = group->conf->rib[afi][safi]; |
| 2084 | |
| 2085 | /* Import policy. */ |
| 2086 | if (pfilter->map[RMAP_IMPORT].name) |
| 2087 | free (pfilter->map[RMAP_IMPORT].name); |
| 2088 | if (gfilter->map[RMAP_IMPORT].name) |
| 2089 | { |
| 2090 | pfilter->map[RMAP_IMPORT].name = strdup (gfilter->map[RMAP_IMPORT].name); |
| 2091 | pfilter->map[RMAP_IMPORT].map = gfilter->map[RMAP_IMPORT].map; |
| 2092 | } |
| 2093 | else |
| 2094 | { |
| 2095 | pfilter->map[RMAP_IMPORT].name = NULL; |
| 2096 | pfilter->map[RMAP_IMPORT].map =NULL; |
| 2097 | } |
| 2098 | |
| 2099 | /* Export policy. */ |
| 2100 | if (gfilter->map[RMAP_EXPORT].name && ! pfilter->map[RMAP_EXPORT].name) |
| 2101 | { |
| 2102 | pfilter->map[RMAP_EXPORT].name = strdup (gfilter->map[RMAP_EXPORT].name); |
| 2103 | pfilter->map[RMAP_EXPORT].map = gfilter->map[RMAP_EXPORT].map; |
| 2104 | } |
| 2105 | } |
| 2106 | } |
| 2107 | return CMD_SUCCESS; |
| 2108 | } |
| 2109 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2110 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2111 | peer_rsclient_unset_vty (struct vty *vty, const char *peer_str, |
| 2112 | int afi, int safi) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2113 | { |
| 2114 | int ret; |
| 2115 | struct bgp *bgp; |
| 2116 | struct peer *peer; |
| 2117 | struct peer_group *group; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 2118 | struct listnode *node, *nnode; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2119 | |
| 2120 | bgp = vty->index; |
| 2121 | |
| 2122 | peer = peer_and_group_lookup_vty (vty, peer_str); |
| 2123 | if ( ! peer ) |
| 2124 | return CMD_WARNING; |
| 2125 | |
| 2126 | /* If it is not a RS-Client, don't do anything. */ |
| 2127 | if ( ! CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT) ) |
| 2128 | return CMD_SUCCESS; |
| 2129 | |
| 2130 | if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) |
| 2131 | { |
| 2132 | group = peer->group; |
| 2133 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 2134 | for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer)) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2135 | { |
| 2136 | ret = peer_af_flag_unset (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT); |
| 2137 | if (ret < 0) |
| 2138 | return bgp_vty_return (vty, ret); |
| 2139 | |
| 2140 | peer->rib[afi][safi] = NULL; |
| 2141 | } |
| 2142 | |
| 2143 | peer = group->conf; |
| 2144 | } |
| 2145 | |
| 2146 | ret = peer_af_flag_unset (peer, afi, safi, PEER_FLAG_RSERVER_CLIENT); |
| 2147 | if (ret < 0) |
| 2148 | return bgp_vty_return (vty, ret); |
| 2149 | |
| 2150 | if ( ! peer_rsclient_active (peer) ) |
paul | 200df11 | 2005-06-01 11:17:05 +0000 | [diff] [blame] | 2151 | { |
| 2152 | peer_unlock (peer); /* peer bgp rsclient reference */ |
| 2153 | listnode_delete (bgp->rsclient, peer); |
| 2154 | } |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2155 | |
| 2156 | bgp_table_finish (peer->rib[bgp_node_afi(vty)][bgp_node_safi(vty)]); |
| 2157 | |
| 2158 | return CMD_SUCCESS; |
| 2159 | } |
| 2160 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2161 | /* neighbor route-server-client. */ |
| 2162 | DEFUN (neighbor_route_server_client, |
| 2163 | neighbor_route_server_client_cmd, |
| 2164 | NEIGHBOR_CMD2 "route-server-client", |
| 2165 | NEIGHBOR_STR |
| 2166 | NEIGHBOR_ADDR_STR2 |
| 2167 | "Configure a neighbor as Route Server client\n") |
| 2168 | { |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2169 | return peer_rsclient_set_vty (vty, argv[0], bgp_node_afi(vty), |
| 2170 | bgp_node_safi(vty)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2171 | } |
| 2172 | |
| 2173 | DEFUN (no_neighbor_route_server_client, |
| 2174 | no_neighbor_route_server_client_cmd, |
| 2175 | NO_NEIGHBOR_CMD2 "route-server-client", |
| 2176 | NO_STR |
| 2177 | NEIGHBOR_STR |
| 2178 | NEIGHBOR_ADDR_STR2 |
| 2179 | "Configure a neighbor as Route Server client\n") |
| 2180 | { |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2181 | return peer_rsclient_unset_vty (vty, argv[0], bgp_node_afi(vty), |
| 2182 | bgp_node_safi(vty)); |
| 2183 | } |
| 2184 | |
| 2185 | DEFUN (neighbor_nexthop_local_unchanged, |
| 2186 | neighbor_nexthop_local_unchanged_cmd, |
| 2187 | NEIGHBOR_CMD2 "nexthop-local unchanged", |
| 2188 | NEIGHBOR_STR |
| 2189 | NEIGHBOR_ADDR_STR2 |
| 2190 | "Configure treatment of outgoing link-local nexthop attribute\n" |
| 2191 | "Leave link-local nexthop unchanged for this peer\n") |
| 2192 | { |
| 2193 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2194 | bgp_node_safi (vty), |
| 2195 | PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED ); |
| 2196 | } |
| 2197 | |
| 2198 | DEFUN (no_neighbor_nexthop_local_unchanged, |
| 2199 | no_neighbor_nexthop_local_unchanged_cmd, |
| 2200 | NO_NEIGHBOR_CMD2 "nexthop-local unchanged", |
| 2201 | NO_STR |
| 2202 | NEIGHBOR_STR |
| 2203 | NEIGHBOR_ADDR_STR2 |
| 2204 | "Configure treatment of outgoing link-local-nexthop attribute\n" |
| 2205 | "Leave link-local nexthop unchanged for this peer\n") |
| 2206 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2207 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2208 | bgp_node_safi (vty), |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 2209 | PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED ); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2210 | } |
| 2211 | |
| 2212 | DEFUN (neighbor_attr_unchanged, |
| 2213 | neighbor_attr_unchanged_cmd, |
| 2214 | NEIGHBOR_CMD2 "attribute-unchanged", |
| 2215 | NEIGHBOR_STR |
| 2216 | NEIGHBOR_ADDR_STR2 |
| 2217 | "BGP attribute is propagated unchanged to this neighbor\n") |
| 2218 | { |
| 2219 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2220 | bgp_node_safi (vty), |
| 2221 | (PEER_FLAG_AS_PATH_UNCHANGED | |
| 2222 | PEER_FLAG_NEXTHOP_UNCHANGED | |
| 2223 | PEER_FLAG_MED_UNCHANGED)); |
| 2224 | } |
| 2225 | |
| 2226 | DEFUN (neighbor_attr_unchanged1, |
| 2227 | neighbor_attr_unchanged1_cmd, |
| 2228 | NEIGHBOR_CMD2 "attribute-unchanged (as-path|next-hop|med)", |
| 2229 | NEIGHBOR_STR |
| 2230 | NEIGHBOR_ADDR_STR2 |
| 2231 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2232 | "As-path attribute\n" |
| 2233 | "Nexthop attribute\n" |
| 2234 | "Med attribute\n") |
| 2235 | { |
| 2236 | u_int16_t flags = 0; |
| 2237 | |
| 2238 | if (strncmp (argv[1], "as-path", 1) == 0) |
| 2239 | SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED); |
| 2240 | else if (strncmp (argv[1], "next-hop", 1) == 0) |
| 2241 | SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2242 | else if (strncmp (argv[1], "med", 1) == 0) |
| 2243 | SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED); |
| 2244 | |
| 2245 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2246 | bgp_node_safi (vty), flags); |
| 2247 | } |
| 2248 | |
| 2249 | DEFUN (neighbor_attr_unchanged2, |
| 2250 | neighbor_attr_unchanged2_cmd, |
| 2251 | NEIGHBOR_CMD2 "attribute-unchanged as-path (next-hop|med)", |
| 2252 | NEIGHBOR_STR |
| 2253 | NEIGHBOR_ADDR_STR2 |
| 2254 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2255 | "As-path attribute\n" |
| 2256 | "Nexthop attribute\n" |
| 2257 | "Med attribute\n") |
| 2258 | { |
| 2259 | u_int16_t flags = PEER_FLAG_AS_PATH_UNCHANGED; |
| 2260 | |
| 2261 | if (strncmp (argv[1], "next-hop", 1) == 0) |
| 2262 | SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2263 | else if (strncmp (argv[1], "med", 1) == 0) |
| 2264 | SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED); |
| 2265 | |
| 2266 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2267 | bgp_node_safi (vty), flags); |
| 2268 | |
| 2269 | } |
| 2270 | |
| 2271 | DEFUN (neighbor_attr_unchanged3, |
| 2272 | neighbor_attr_unchanged3_cmd, |
| 2273 | NEIGHBOR_CMD2 "attribute-unchanged next-hop (as-path|med)", |
| 2274 | NEIGHBOR_STR |
| 2275 | NEIGHBOR_ADDR_STR2 |
| 2276 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2277 | "Nexthop attribute\n" |
| 2278 | "As-path attribute\n" |
| 2279 | "Med attribute\n") |
| 2280 | { |
| 2281 | u_int16_t flags = PEER_FLAG_NEXTHOP_UNCHANGED; |
| 2282 | |
| 2283 | if (strncmp (argv[1], "as-path", 1) == 0) |
| 2284 | SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED); |
| 2285 | else if (strncmp (argv[1], "med", 1) == 0) |
| 2286 | SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED); |
| 2287 | |
| 2288 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2289 | bgp_node_safi (vty), flags); |
| 2290 | } |
| 2291 | |
| 2292 | DEFUN (neighbor_attr_unchanged4, |
| 2293 | neighbor_attr_unchanged4_cmd, |
| 2294 | NEIGHBOR_CMD2 "attribute-unchanged med (as-path|next-hop)", |
| 2295 | NEIGHBOR_STR |
| 2296 | NEIGHBOR_ADDR_STR2 |
| 2297 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2298 | "Med attribute\n" |
| 2299 | "As-path attribute\n" |
| 2300 | "Nexthop attribute\n") |
| 2301 | { |
| 2302 | u_int16_t flags = PEER_FLAG_MED_UNCHANGED; |
| 2303 | |
| 2304 | if (strncmp (argv[1], "as-path", 1) == 0) |
| 2305 | SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED); |
| 2306 | else if (strncmp (argv[1], "next-hop", 1) == 0) |
| 2307 | SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2308 | |
| 2309 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2310 | bgp_node_safi (vty), flags); |
| 2311 | } |
| 2312 | |
| 2313 | ALIAS (neighbor_attr_unchanged, |
| 2314 | neighbor_attr_unchanged5_cmd, |
| 2315 | NEIGHBOR_CMD2 "attribute-unchanged as-path next-hop med", |
| 2316 | NEIGHBOR_STR |
| 2317 | NEIGHBOR_ADDR_STR2 |
| 2318 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2319 | "As-path attribute\n" |
| 2320 | "Nexthop attribute\n" |
| 2321 | "Med attribute\n") |
| 2322 | |
| 2323 | ALIAS (neighbor_attr_unchanged, |
| 2324 | neighbor_attr_unchanged6_cmd, |
| 2325 | NEIGHBOR_CMD2 "attribute-unchanged as-path med next-hop", |
| 2326 | NEIGHBOR_STR |
| 2327 | NEIGHBOR_ADDR_STR2 |
| 2328 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2329 | "As-path attribute\n" |
| 2330 | "Med attribute\n" |
| 2331 | "Nexthop attribute\n") |
| 2332 | |
| 2333 | ALIAS (neighbor_attr_unchanged, |
| 2334 | neighbor_attr_unchanged7_cmd, |
| 2335 | NEIGHBOR_CMD2 "attribute-unchanged next-hop med as-path", |
| 2336 | NEIGHBOR_STR |
| 2337 | NEIGHBOR_ADDR_STR2 |
| 2338 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2339 | "Nexthop attribute\n" |
| 2340 | "Med attribute\n" |
| 2341 | "As-path attribute\n") |
| 2342 | |
| 2343 | ALIAS (neighbor_attr_unchanged, |
| 2344 | neighbor_attr_unchanged8_cmd, |
| 2345 | NEIGHBOR_CMD2 "attribute-unchanged next-hop as-path med", |
| 2346 | NEIGHBOR_STR |
| 2347 | NEIGHBOR_ADDR_STR2 |
| 2348 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2349 | "Nexthop attribute\n" |
| 2350 | "As-path attribute\n" |
| 2351 | "Med attribute\n") |
| 2352 | |
| 2353 | ALIAS (neighbor_attr_unchanged, |
| 2354 | neighbor_attr_unchanged9_cmd, |
| 2355 | NEIGHBOR_CMD2 "attribute-unchanged med next-hop as-path", |
| 2356 | NEIGHBOR_STR |
| 2357 | NEIGHBOR_ADDR_STR2 |
| 2358 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2359 | "Med attribute\n" |
| 2360 | "Nexthop attribute\n" |
| 2361 | "As-path attribute\n") |
| 2362 | |
| 2363 | ALIAS (neighbor_attr_unchanged, |
| 2364 | neighbor_attr_unchanged10_cmd, |
| 2365 | NEIGHBOR_CMD2 "attribute-unchanged med as-path next-hop", |
| 2366 | NEIGHBOR_STR |
| 2367 | NEIGHBOR_ADDR_STR2 |
| 2368 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2369 | "Med attribute\n" |
| 2370 | "As-path attribute\n" |
| 2371 | "Nexthop attribute\n") |
| 2372 | |
| 2373 | DEFUN (no_neighbor_attr_unchanged, |
| 2374 | no_neighbor_attr_unchanged_cmd, |
| 2375 | NO_NEIGHBOR_CMD2 "attribute-unchanged", |
| 2376 | NO_STR |
| 2377 | NEIGHBOR_STR |
| 2378 | NEIGHBOR_ADDR_STR2 |
| 2379 | "BGP attribute is propagated unchanged to this neighbor\n") |
| 2380 | { |
| 2381 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2382 | bgp_node_safi (vty), |
| 2383 | (PEER_FLAG_AS_PATH_UNCHANGED | |
| 2384 | PEER_FLAG_NEXTHOP_UNCHANGED | |
| 2385 | PEER_FLAG_MED_UNCHANGED)); |
| 2386 | } |
| 2387 | |
| 2388 | DEFUN (no_neighbor_attr_unchanged1, |
| 2389 | no_neighbor_attr_unchanged1_cmd, |
| 2390 | NO_NEIGHBOR_CMD2 "attribute-unchanged (as-path|next-hop|med)", |
| 2391 | NO_STR |
| 2392 | NEIGHBOR_STR |
| 2393 | NEIGHBOR_ADDR_STR2 |
| 2394 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2395 | "As-path attribute\n" |
| 2396 | "Nexthop attribute\n" |
| 2397 | "Med attribute\n") |
| 2398 | { |
| 2399 | u_int16_t flags = 0; |
| 2400 | |
| 2401 | if (strncmp (argv[1], "as-path", 1) == 0) |
| 2402 | SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED); |
| 2403 | else if (strncmp (argv[1], "next-hop", 1) == 0) |
| 2404 | SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2405 | else if (strncmp (argv[1], "med", 1) == 0) |
| 2406 | SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED); |
| 2407 | |
| 2408 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2409 | bgp_node_safi (vty), flags); |
| 2410 | } |
| 2411 | |
| 2412 | DEFUN (no_neighbor_attr_unchanged2, |
| 2413 | no_neighbor_attr_unchanged2_cmd, |
| 2414 | NO_NEIGHBOR_CMD2 "attribute-unchanged as-path (next-hop|med)", |
| 2415 | NO_STR |
| 2416 | NEIGHBOR_STR |
| 2417 | NEIGHBOR_ADDR_STR2 |
| 2418 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2419 | "As-path attribute\n" |
| 2420 | "Nexthop attribute\n" |
| 2421 | "Med attribute\n") |
| 2422 | { |
| 2423 | u_int16_t flags = PEER_FLAG_AS_PATH_UNCHANGED; |
| 2424 | |
| 2425 | if (strncmp (argv[1], "next-hop", 1) == 0) |
| 2426 | SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2427 | else if (strncmp (argv[1], "med", 1) == 0) |
| 2428 | SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED); |
| 2429 | |
| 2430 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2431 | bgp_node_safi (vty), flags); |
| 2432 | } |
| 2433 | |
| 2434 | DEFUN (no_neighbor_attr_unchanged3, |
| 2435 | no_neighbor_attr_unchanged3_cmd, |
| 2436 | NO_NEIGHBOR_CMD2 "attribute-unchanged next-hop (as-path|med)", |
| 2437 | NO_STR |
| 2438 | NEIGHBOR_STR |
| 2439 | NEIGHBOR_ADDR_STR2 |
| 2440 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2441 | "Nexthop attribute\n" |
| 2442 | "As-path attribute\n" |
| 2443 | "Med attribute\n") |
| 2444 | { |
| 2445 | u_int16_t flags = PEER_FLAG_NEXTHOP_UNCHANGED; |
| 2446 | |
| 2447 | if (strncmp (argv[1], "as-path", 1) == 0) |
| 2448 | SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED); |
| 2449 | else if (strncmp (argv[1], "med", 1) == 0) |
| 2450 | SET_FLAG (flags, PEER_FLAG_MED_UNCHANGED); |
| 2451 | |
| 2452 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2453 | bgp_node_safi (vty), flags); |
| 2454 | } |
| 2455 | |
| 2456 | DEFUN (no_neighbor_attr_unchanged4, |
| 2457 | no_neighbor_attr_unchanged4_cmd, |
| 2458 | NO_NEIGHBOR_CMD2 "attribute-unchanged med (as-path|next-hop)", |
| 2459 | NO_STR |
| 2460 | NEIGHBOR_STR |
| 2461 | NEIGHBOR_ADDR_STR2 |
| 2462 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2463 | "Med attribute\n" |
| 2464 | "As-path attribute\n" |
| 2465 | "Nexthop attribute\n") |
| 2466 | { |
| 2467 | u_int16_t flags = PEER_FLAG_MED_UNCHANGED; |
| 2468 | |
| 2469 | if (strncmp (argv[1], "as-path", 1) == 0) |
| 2470 | SET_FLAG (flags, PEER_FLAG_AS_PATH_UNCHANGED); |
| 2471 | else if (strncmp (argv[1], "next-hop", 1) == 0) |
| 2472 | SET_FLAG (flags, PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2473 | |
| 2474 | return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 2475 | bgp_node_safi (vty), flags); |
| 2476 | } |
| 2477 | |
| 2478 | ALIAS (no_neighbor_attr_unchanged, |
| 2479 | no_neighbor_attr_unchanged5_cmd, |
| 2480 | NO_NEIGHBOR_CMD2 "attribute-unchanged as-path next-hop med", |
| 2481 | NO_STR |
| 2482 | NEIGHBOR_STR |
| 2483 | NEIGHBOR_ADDR_STR2 |
| 2484 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2485 | "As-path attribute\n" |
| 2486 | "Nexthop attribute\n" |
| 2487 | "Med attribute\n") |
| 2488 | |
| 2489 | ALIAS (no_neighbor_attr_unchanged, |
| 2490 | no_neighbor_attr_unchanged6_cmd, |
| 2491 | NO_NEIGHBOR_CMD2 "attribute-unchanged as-path med next-hop", |
| 2492 | NO_STR |
| 2493 | NEIGHBOR_STR |
| 2494 | NEIGHBOR_ADDR_STR2 |
| 2495 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2496 | "As-path attribute\n" |
| 2497 | "Med attribute\n" |
| 2498 | "Nexthop attribute\n") |
| 2499 | |
| 2500 | ALIAS (no_neighbor_attr_unchanged, |
| 2501 | no_neighbor_attr_unchanged7_cmd, |
| 2502 | NO_NEIGHBOR_CMD2 "attribute-unchanged next-hop med as-path", |
| 2503 | NO_STR |
| 2504 | NEIGHBOR_STR |
| 2505 | NEIGHBOR_ADDR_STR2 |
| 2506 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2507 | "Nexthop attribute\n" |
| 2508 | "Med attribute\n" |
| 2509 | "As-path attribute\n") |
| 2510 | |
| 2511 | ALIAS (no_neighbor_attr_unchanged, |
| 2512 | no_neighbor_attr_unchanged8_cmd, |
| 2513 | NO_NEIGHBOR_CMD2 "attribute-unchanged next-hop as-path med", |
| 2514 | NO_STR |
| 2515 | NEIGHBOR_STR |
| 2516 | NEIGHBOR_ADDR_STR2 |
| 2517 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2518 | "Nexthop attribute\n" |
| 2519 | "As-path attribute\n" |
| 2520 | "Med attribute\n") |
| 2521 | |
| 2522 | ALIAS (no_neighbor_attr_unchanged, |
| 2523 | no_neighbor_attr_unchanged9_cmd, |
| 2524 | NO_NEIGHBOR_CMD2 "attribute-unchanged med next-hop as-path", |
| 2525 | NO_STR |
| 2526 | NEIGHBOR_STR |
| 2527 | NEIGHBOR_ADDR_STR2 |
| 2528 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2529 | "Med attribute\n" |
| 2530 | "Nexthop attribute\n" |
| 2531 | "As-path attribute\n") |
| 2532 | |
| 2533 | ALIAS (no_neighbor_attr_unchanged, |
| 2534 | no_neighbor_attr_unchanged10_cmd, |
| 2535 | NO_NEIGHBOR_CMD2 "attribute-unchanged med as-path next-hop", |
| 2536 | NO_STR |
| 2537 | NEIGHBOR_STR |
| 2538 | NEIGHBOR_ADDR_STR2 |
| 2539 | "BGP attribute is propagated unchanged to this neighbor\n" |
| 2540 | "Med attribute\n" |
| 2541 | "As-path attribute\n" |
| 2542 | "Nexthop attribute\n") |
| 2543 | |
| 2544 | /* For old version Zebra compatibility. */ |
hasso | dd4c593 | 2005-02-02 17:15:34 +0000 | [diff] [blame] | 2545 | DEFUN_DEPRECATED (neighbor_transparent_as, |
| 2546 | neighbor_transparent_as_cmd, |
| 2547 | NEIGHBOR_CMD "transparent-as", |
| 2548 | NEIGHBOR_STR |
| 2549 | NEIGHBOR_ADDR_STR |
| 2550 | "Do not append my AS number even peer is EBGP peer\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2551 | { |
| 2552 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2553 | bgp_node_safi (vty), |
| 2554 | PEER_FLAG_AS_PATH_UNCHANGED); |
| 2555 | } |
| 2556 | |
hasso | dd4c593 | 2005-02-02 17:15:34 +0000 | [diff] [blame] | 2557 | DEFUN_DEPRECATED (neighbor_transparent_nexthop, |
| 2558 | neighbor_transparent_nexthop_cmd, |
| 2559 | NEIGHBOR_CMD "transparent-nexthop", |
| 2560 | NEIGHBOR_STR |
| 2561 | NEIGHBOR_ADDR_STR |
| 2562 | "Do not change nexthop even peer is EBGP peer\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2563 | { |
| 2564 | return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2565 | bgp_node_safi (vty), |
| 2566 | PEER_FLAG_NEXTHOP_UNCHANGED); |
| 2567 | } |
| 2568 | |
| 2569 | /* EBGP multihop configuration. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2570 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2571 | peer_ebgp_multihop_set_vty (struct vty *vty, const char *ip_str, |
| 2572 | const char *ttl_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2573 | { |
| 2574 | struct peer *peer; |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2575 | unsigned int ttl; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2576 | |
| 2577 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 2578 | if (! peer) |
| 2579 | return CMD_WARNING; |
| 2580 | |
| 2581 | if (! ttl_str) |
| 2582 | ttl = TTL_MAX; |
| 2583 | else |
| 2584 | VTY_GET_INTEGER_RANGE ("TTL", ttl, ttl_str, 1, 255); |
| 2585 | |
| 2586 | peer_ebgp_multihop_set (peer, ttl); |
| 2587 | |
| 2588 | return CMD_SUCCESS; |
| 2589 | } |
| 2590 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2591 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2592 | peer_ebgp_multihop_unset_vty (struct vty *vty, const char *ip_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2593 | { |
| 2594 | struct peer *peer; |
| 2595 | |
| 2596 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 2597 | if (! peer) |
| 2598 | return CMD_WARNING; |
| 2599 | |
| 2600 | peer_ebgp_multihop_unset (peer); |
| 2601 | |
| 2602 | return CMD_SUCCESS; |
| 2603 | } |
| 2604 | |
| 2605 | /* neighbor ebgp-multihop. */ |
| 2606 | DEFUN (neighbor_ebgp_multihop, |
| 2607 | neighbor_ebgp_multihop_cmd, |
| 2608 | NEIGHBOR_CMD2 "ebgp-multihop", |
| 2609 | NEIGHBOR_STR |
| 2610 | NEIGHBOR_ADDR_STR2 |
| 2611 | "Allow EBGP neighbors not on directly connected networks\n") |
| 2612 | { |
| 2613 | return peer_ebgp_multihop_set_vty (vty, argv[0], NULL); |
| 2614 | } |
| 2615 | |
| 2616 | DEFUN (neighbor_ebgp_multihop_ttl, |
| 2617 | neighbor_ebgp_multihop_ttl_cmd, |
| 2618 | NEIGHBOR_CMD2 "ebgp-multihop <1-255>", |
| 2619 | NEIGHBOR_STR |
| 2620 | NEIGHBOR_ADDR_STR2 |
| 2621 | "Allow EBGP neighbors not on directly connected networks\n" |
| 2622 | "maximum hop count\n") |
| 2623 | { |
| 2624 | return peer_ebgp_multihop_set_vty (vty, argv[0], argv[1]); |
| 2625 | } |
| 2626 | |
| 2627 | DEFUN (no_neighbor_ebgp_multihop, |
| 2628 | no_neighbor_ebgp_multihop_cmd, |
| 2629 | NO_NEIGHBOR_CMD2 "ebgp-multihop", |
| 2630 | NO_STR |
| 2631 | NEIGHBOR_STR |
| 2632 | NEIGHBOR_ADDR_STR2 |
| 2633 | "Allow EBGP neighbors not on directly connected networks\n") |
| 2634 | { |
| 2635 | return peer_ebgp_multihop_unset_vty (vty, argv[0]); |
| 2636 | } |
| 2637 | |
| 2638 | ALIAS (no_neighbor_ebgp_multihop, |
| 2639 | no_neighbor_ebgp_multihop_ttl_cmd, |
| 2640 | NO_NEIGHBOR_CMD2 "ebgp-multihop <1-255>", |
| 2641 | NO_STR |
| 2642 | NEIGHBOR_STR |
| 2643 | NEIGHBOR_ADDR_STR2 |
| 2644 | "Allow EBGP neighbors not on directly connected networks\n" |
| 2645 | "maximum hop count\n") |
| 2646 | |
hasso | 6ffd207 | 2005-02-02 14:50:11 +0000 | [diff] [blame] | 2647 | /* disable-connected-check */ |
| 2648 | DEFUN (neighbor_disable_connected_check, |
| 2649 | neighbor_disable_connected_check_cmd, |
| 2650 | NEIGHBOR_CMD2 "disable-connected-check", |
| 2651 | NEIGHBOR_STR |
| 2652 | NEIGHBOR_ADDR_STR2 |
| 2653 | "one-hop away EBGP peer using loopback address\n") |
| 2654 | { |
| 2655 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_DISABLE_CONNECTED_CHECK); |
| 2656 | } |
| 2657 | |
| 2658 | DEFUN (no_neighbor_disable_connected_check, |
| 2659 | no_neighbor_disable_connected_check_cmd, |
| 2660 | NO_NEIGHBOR_CMD2 "disable-connected-check", |
| 2661 | NO_STR |
| 2662 | NEIGHBOR_STR |
| 2663 | NEIGHBOR_ADDR_STR2 |
| 2664 | "one-hop away EBGP peer using loopback address\n") |
| 2665 | { |
| 2666 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_DISABLE_CONNECTED_CHECK); |
| 2667 | } |
| 2668 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2669 | /* Enforce multihop. */ |
hasso | 6ffd207 | 2005-02-02 14:50:11 +0000 | [diff] [blame] | 2670 | ALIAS (neighbor_disable_connected_check, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2671 | neighbor_enforce_multihop_cmd, |
| 2672 | NEIGHBOR_CMD2 "enforce-multihop", |
| 2673 | NEIGHBOR_STR |
| 2674 | NEIGHBOR_ADDR_STR2 |
paul | e8e1946 | 2006-01-19 20:16:55 +0000 | [diff] [blame] | 2675 | "Enforce EBGP neighbors perform multihop\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2676 | |
hasso | 6ffd207 | 2005-02-02 14:50:11 +0000 | [diff] [blame] | 2677 | /* Enforce multihop. */ |
| 2678 | ALIAS (no_neighbor_disable_connected_check, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2679 | no_neighbor_enforce_multihop_cmd, |
| 2680 | NO_NEIGHBOR_CMD2 "enforce-multihop", |
| 2681 | NO_STR |
| 2682 | NEIGHBOR_STR |
| 2683 | NEIGHBOR_ADDR_STR2 |
paul | e8e1946 | 2006-01-19 20:16:55 +0000 | [diff] [blame] | 2684 | "Enforce EBGP neighbors perform multihop\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2685 | |
| 2686 | DEFUN (neighbor_description, |
| 2687 | neighbor_description_cmd, |
| 2688 | NEIGHBOR_CMD2 "description .LINE", |
| 2689 | NEIGHBOR_STR |
| 2690 | NEIGHBOR_ADDR_STR2 |
| 2691 | "Neighbor specific description\n" |
| 2692 | "Up to 80 characters describing this neighbor\n") |
| 2693 | { |
| 2694 | struct peer *peer; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2695 | char *str; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2696 | |
| 2697 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 2698 | if (! peer) |
| 2699 | return CMD_WARNING; |
| 2700 | |
| 2701 | if (argc == 1) |
| 2702 | return CMD_SUCCESS; |
| 2703 | |
ajs | 3b8b185 | 2005-01-29 18:19:13 +0000 | [diff] [blame] | 2704 | str = argv_concat(argv, argc, 1); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2705 | |
| 2706 | peer_description_set (peer, str); |
| 2707 | |
ajs | 3b8b185 | 2005-01-29 18:19:13 +0000 | [diff] [blame] | 2708 | XFREE (MTYPE_TMP, str); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2709 | |
| 2710 | return CMD_SUCCESS; |
| 2711 | } |
| 2712 | |
| 2713 | DEFUN (no_neighbor_description, |
| 2714 | no_neighbor_description_cmd, |
| 2715 | NO_NEIGHBOR_CMD2 "description", |
| 2716 | NO_STR |
| 2717 | NEIGHBOR_STR |
| 2718 | NEIGHBOR_ADDR_STR2 |
| 2719 | "Neighbor specific description\n") |
| 2720 | { |
| 2721 | struct peer *peer; |
| 2722 | |
| 2723 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 2724 | if (! peer) |
| 2725 | return CMD_WARNING; |
| 2726 | |
| 2727 | peer_description_unset (peer); |
| 2728 | |
| 2729 | return CMD_SUCCESS; |
| 2730 | } |
| 2731 | |
| 2732 | ALIAS (no_neighbor_description, |
| 2733 | no_neighbor_description_val_cmd, |
| 2734 | NO_NEIGHBOR_CMD2 "description .LINE", |
| 2735 | NO_STR |
| 2736 | NEIGHBOR_STR |
| 2737 | NEIGHBOR_ADDR_STR2 |
| 2738 | "Neighbor specific description\n" |
| 2739 | "Up to 80 characters describing this neighbor\n") |
| 2740 | |
| 2741 | /* Neighbor update-source. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2742 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2743 | peer_update_source_vty (struct vty *vty, const char *peer_str, |
| 2744 | const char *source_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2745 | { |
| 2746 | struct peer *peer; |
| 2747 | union sockunion *su; |
| 2748 | |
| 2749 | peer = peer_and_group_lookup_vty (vty, peer_str); |
| 2750 | if (! peer) |
| 2751 | return CMD_WARNING; |
| 2752 | |
| 2753 | if (source_str) |
| 2754 | { |
| 2755 | su = sockunion_str2su (source_str); |
| 2756 | if (su) |
| 2757 | { |
| 2758 | peer_update_source_addr_set (peer, su); |
| 2759 | sockunion_free (su); |
| 2760 | } |
| 2761 | else |
| 2762 | peer_update_source_if_set (peer, source_str); |
| 2763 | } |
| 2764 | else |
| 2765 | peer_update_source_unset (peer); |
| 2766 | |
| 2767 | return CMD_SUCCESS; |
| 2768 | } |
| 2769 | |
Paul Jakma | 369688c | 2006-05-23 22:27:55 +0000 | [diff] [blame] | 2770 | #define BGP_UPDATE_SOURCE_STR "(A.B.C.D|WORD)" |
| 2771 | #define BGP_UPDATE_SOURCE_HELP_STR \ |
| 2772 | "IPv4 address\n" \ |
| 2773 | "Interface name\n" |
| 2774 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2775 | DEFUN (neighbor_update_source, |
| 2776 | neighbor_update_source_cmd, |
Paul Jakma | 369688c | 2006-05-23 22:27:55 +0000 | [diff] [blame] | 2777 | NEIGHBOR_CMD2 "update-source " BGP_UPDATE_SOURCE_STR, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2778 | NEIGHBOR_STR |
| 2779 | NEIGHBOR_ADDR_STR2 |
| 2780 | "Source of routing updates\n" |
Paul Jakma | 369688c | 2006-05-23 22:27:55 +0000 | [diff] [blame] | 2781 | BGP_UPDATE_SOURCE_HELP_STR) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2782 | { |
| 2783 | return peer_update_source_vty (vty, argv[0], argv[1]); |
| 2784 | } |
| 2785 | |
| 2786 | DEFUN (no_neighbor_update_source, |
| 2787 | no_neighbor_update_source_cmd, |
| 2788 | NO_NEIGHBOR_CMD2 "update-source", |
| 2789 | NO_STR |
| 2790 | NEIGHBOR_STR |
| 2791 | NEIGHBOR_ADDR_STR2 |
Paul Jakma | 369688c | 2006-05-23 22:27:55 +0000 | [diff] [blame] | 2792 | "Source of routing updates\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2793 | { |
| 2794 | return peer_update_source_vty (vty, argv[0], NULL); |
| 2795 | } |
| 2796 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2797 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2798 | peer_default_originate_set_vty (struct vty *vty, const char *peer_str, |
| 2799 | afi_t afi, safi_t safi, |
| 2800 | const char *rmap, int set) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2801 | { |
| 2802 | int ret; |
| 2803 | struct peer *peer; |
| 2804 | |
| 2805 | peer = peer_and_group_lookup_vty (vty, peer_str); |
| 2806 | if (! peer) |
| 2807 | return CMD_WARNING; |
| 2808 | |
| 2809 | if (set) |
| 2810 | ret = peer_default_originate_set (peer, afi, safi, rmap); |
| 2811 | else |
| 2812 | ret = peer_default_originate_unset (peer, afi, safi); |
| 2813 | |
| 2814 | return bgp_vty_return (vty, ret); |
| 2815 | } |
| 2816 | |
| 2817 | /* neighbor default-originate. */ |
| 2818 | DEFUN (neighbor_default_originate, |
| 2819 | neighbor_default_originate_cmd, |
| 2820 | NEIGHBOR_CMD2 "default-originate", |
| 2821 | NEIGHBOR_STR |
| 2822 | NEIGHBOR_ADDR_STR2 |
| 2823 | "Originate default route to this neighbor\n") |
| 2824 | { |
| 2825 | return peer_default_originate_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2826 | bgp_node_safi (vty), NULL, 1); |
| 2827 | } |
| 2828 | |
| 2829 | DEFUN (neighbor_default_originate_rmap, |
| 2830 | neighbor_default_originate_rmap_cmd, |
| 2831 | NEIGHBOR_CMD2 "default-originate route-map WORD", |
| 2832 | NEIGHBOR_STR |
| 2833 | NEIGHBOR_ADDR_STR2 |
| 2834 | "Originate default route to this neighbor\n" |
| 2835 | "Route-map to specify criteria to originate default\n" |
| 2836 | "route-map name\n") |
| 2837 | { |
| 2838 | return peer_default_originate_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2839 | bgp_node_safi (vty), argv[1], 1); |
| 2840 | } |
| 2841 | |
| 2842 | DEFUN (no_neighbor_default_originate, |
| 2843 | no_neighbor_default_originate_cmd, |
| 2844 | NO_NEIGHBOR_CMD2 "default-originate", |
| 2845 | NO_STR |
| 2846 | NEIGHBOR_STR |
| 2847 | NEIGHBOR_ADDR_STR2 |
| 2848 | "Originate default route to this neighbor\n") |
| 2849 | { |
| 2850 | return peer_default_originate_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 2851 | bgp_node_safi (vty), NULL, 0); |
| 2852 | } |
| 2853 | |
| 2854 | ALIAS (no_neighbor_default_originate, |
| 2855 | no_neighbor_default_originate_rmap_cmd, |
| 2856 | NO_NEIGHBOR_CMD2 "default-originate route-map WORD", |
| 2857 | NO_STR |
| 2858 | NEIGHBOR_STR |
| 2859 | NEIGHBOR_ADDR_STR2 |
| 2860 | "Originate default route to this neighbor\n" |
| 2861 | "Route-map to specify criteria to originate default\n" |
| 2862 | "route-map name\n") |
| 2863 | |
| 2864 | /* Set neighbor's BGP port. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2865 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2866 | peer_port_vty (struct vty *vty, const char *ip_str, int afi, |
| 2867 | const char *port_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2868 | { |
| 2869 | struct peer *peer; |
| 2870 | u_int16_t port; |
| 2871 | struct servent *sp; |
| 2872 | |
| 2873 | peer = peer_lookup_vty (vty, ip_str); |
| 2874 | if (! peer) |
| 2875 | return CMD_WARNING; |
| 2876 | |
| 2877 | if (! port_str) |
| 2878 | { |
| 2879 | sp = getservbyname ("bgp", "tcp"); |
| 2880 | port = (sp == NULL) ? BGP_PORT_DEFAULT : ntohs (sp->s_port); |
| 2881 | } |
| 2882 | else |
| 2883 | { |
| 2884 | VTY_GET_INTEGER("port", port, port_str); |
| 2885 | } |
| 2886 | |
| 2887 | peer_port_set (peer, port); |
| 2888 | |
| 2889 | return CMD_SUCCESS; |
| 2890 | } |
| 2891 | |
hasso | f418446 | 2005-02-01 20:13:16 +0000 | [diff] [blame] | 2892 | /* Set specified peer's BGP port. */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2893 | DEFUN (neighbor_port, |
| 2894 | neighbor_port_cmd, |
| 2895 | NEIGHBOR_CMD "port <0-65535>", |
| 2896 | NEIGHBOR_STR |
| 2897 | NEIGHBOR_ADDR_STR |
| 2898 | "Neighbor's BGP port\n" |
| 2899 | "TCP port number\n") |
| 2900 | { |
| 2901 | return peer_port_vty (vty, argv[0], AFI_IP, argv[1]); |
| 2902 | } |
| 2903 | |
| 2904 | DEFUN (no_neighbor_port, |
| 2905 | no_neighbor_port_cmd, |
| 2906 | NO_NEIGHBOR_CMD "port", |
| 2907 | NO_STR |
| 2908 | NEIGHBOR_STR |
| 2909 | NEIGHBOR_ADDR_STR |
| 2910 | "Neighbor's BGP port\n") |
| 2911 | { |
| 2912 | return peer_port_vty (vty, argv[0], AFI_IP, NULL); |
| 2913 | } |
| 2914 | |
| 2915 | ALIAS (no_neighbor_port, |
| 2916 | no_neighbor_port_val_cmd, |
| 2917 | NO_NEIGHBOR_CMD "port <0-65535>", |
| 2918 | NO_STR |
| 2919 | NEIGHBOR_STR |
| 2920 | NEIGHBOR_ADDR_STR |
| 2921 | "Neighbor's BGP port\n" |
| 2922 | "TCP port number\n") |
| 2923 | |
| 2924 | /* neighbor weight. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2925 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2926 | peer_weight_set_vty (struct vty *vty, const char *ip_str, |
| 2927 | const char *weight_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2928 | { |
| 2929 | int ret; |
| 2930 | struct peer *peer; |
| 2931 | unsigned long weight; |
| 2932 | |
| 2933 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 2934 | if (! peer) |
| 2935 | return CMD_WARNING; |
| 2936 | |
| 2937 | VTY_GET_INTEGER_RANGE("weight", weight, weight_str, 0, 65535); |
| 2938 | |
| 2939 | ret = peer_weight_set (peer, weight); |
| 2940 | |
| 2941 | return CMD_SUCCESS; |
| 2942 | } |
| 2943 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 2944 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 2945 | peer_weight_unset_vty (struct vty *vty, const char *ip_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2946 | { |
| 2947 | struct peer *peer; |
| 2948 | |
| 2949 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 2950 | if (! peer) |
| 2951 | return CMD_WARNING; |
| 2952 | |
| 2953 | peer_weight_unset (peer); |
| 2954 | |
| 2955 | return CMD_SUCCESS; |
| 2956 | } |
| 2957 | |
| 2958 | DEFUN (neighbor_weight, |
| 2959 | neighbor_weight_cmd, |
| 2960 | NEIGHBOR_CMD2 "weight <0-65535>", |
| 2961 | NEIGHBOR_STR |
| 2962 | NEIGHBOR_ADDR_STR2 |
| 2963 | "Set default weight for routes from this neighbor\n" |
| 2964 | "default weight\n") |
| 2965 | { |
| 2966 | return peer_weight_set_vty (vty, argv[0], argv[1]); |
| 2967 | } |
| 2968 | |
| 2969 | DEFUN (no_neighbor_weight, |
| 2970 | no_neighbor_weight_cmd, |
| 2971 | NO_NEIGHBOR_CMD2 "weight", |
| 2972 | NO_STR |
| 2973 | NEIGHBOR_STR |
| 2974 | NEIGHBOR_ADDR_STR2 |
| 2975 | "Set default weight for routes from this neighbor\n") |
| 2976 | { |
| 2977 | return peer_weight_unset_vty (vty, argv[0]); |
| 2978 | } |
| 2979 | |
| 2980 | ALIAS (no_neighbor_weight, |
| 2981 | no_neighbor_weight_val_cmd, |
| 2982 | NO_NEIGHBOR_CMD2 "weight <0-65535>", |
| 2983 | NO_STR |
| 2984 | NEIGHBOR_STR |
| 2985 | NEIGHBOR_ADDR_STR2 |
| 2986 | "Set default weight for routes from this neighbor\n" |
| 2987 | "default weight\n") |
| 2988 | |
| 2989 | /* Override capability negotiation. */ |
| 2990 | DEFUN (neighbor_override_capability, |
| 2991 | neighbor_override_capability_cmd, |
| 2992 | NEIGHBOR_CMD2 "override-capability", |
| 2993 | NEIGHBOR_STR |
| 2994 | NEIGHBOR_ADDR_STR2 |
| 2995 | "Override capability negotiation result\n") |
| 2996 | { |
| 2997 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_OVERRIDE_CAPABILITY); |
| 2998 | } |
| 2999 | |
| 3000 | DEFUN (no_neighbor_override_capability, |
| 3001 | no_neighbor_override_capability_cmd, |
| 3002 | NO_NEIGHBOR_CMD2 "override-capability", |
| 3003 | NO_STR |
| 3004 | NEIGHBOR_STR |
| 3005 | NEIGHBOR_ADDR_STR2 |
| 3006 | "Override capability negotiation result\n") |
| 3007 | { |
| 3008 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_OVERRIDE_CAPABILITY); |
| 3009 | } |
| 3010 | |
| 3011 | DEFUN (neighbor_strict_capability, |
| 3012 | neighbor_strict_capability_cmd, |
| 3013 | NEIGHBOR_CMD "strict-capability-match", |
| 3014 | NEIGHBOR_STR |
| 3015 | NEIGHBOR_ADDR_STR |
| 3016 | "Strict capability negotiation match\n") |
| 3017 | { |
| 3018 | return peer_flag_set_vty (vty, argv[0], PEER_FLAG_STRICT_CAP_MATCH); |
| 3019 | } |
| 3020 | |
| 3021 | DEFUN (no_neighbor_strict_capability, |
| 3022 | no_neighbor_strict_capability_cmd, |
| 3023 | NO_NEIGHBOR_CMD "strict-capability-match", |
| 3024 | NO_STR |
| 3025 | NEIGHBOR_STR |
| 3026 | NEIGHBOR_ADDR_STR |
| 3027 | "Strict capability negotiation match\n") |
| 3028 | { |
| 3029 | return peer_flag_unset_vty (vty, argv[0], PEER_FLAG_STRICT_CAP_MATCH); |
| 3030 | } |
| 3031 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3032 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3033 | peer_timers_set_vty (struct vty *vty, const char *ip_str, |
| 3034 | const char *keep_str, const char *hold_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3035 | { |
| 3036 | int ret; |
| 3037 | struct peer *peer; |
| 3038 | u_int32_t keepalive; |
| 3039 | u_int32_t holdtime; |
| 3040 | |
| 3041 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3042 | if (! peer) |
| 3043 | return CMD_WARNING; |
| 3044 | |
| 3045 | VTY_GET_INTEGER_RANGE ("Keepalive", keepalive, keep_str, 0, 65535); |
| 3046 | VTY_GET_INTEGER_RANGE ("Holdtime", holdtime, hold_str, 0, 65535); |
| 3047 | |
| 3048 | ret = peer_timers_set (peer, keepalive, holdtime); |
| 3049 | |
| 3050 | return bgp_vty_return (vty, ret); |
| 3051 | } |
| 3052 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3053 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3054 | peer_timers_unset_vty (struct vty *vty, const char *ip_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3055 | { |
| 3056 | int ret; |
| 3057 | struct peer *peer; |
| 3058 | |
| 3059 | peer = peer_lookup_vty (vty, ip_str); |
| 3060 | if (! peer) |
| 3061 | return CMD_WARNING; |
| 3062 | |
| 3063 | ret = peer_timers_unset (peer); |
| 3064 | |
| 3065 | return bgp_vty_return (vty, ret); |
| 3066 | } |
| 3067 | |
| 3068 | DEFUN (neighbor_timers, |
| 3069 | neighbor_timers_cmd, |
| 3070 | NEIGHBOR_CMD2 "timers <0-65535> <0-65535>", |
| 3071 | NEIGHBOR_STR |
| 3072 | NEIGHBOR_ADDR_STR2 |
| 3073 | "BGP per neighbor timers\n" |
| 3074 | "Keepalive interval\n" |
| 3075 | "Holdtime\n") |
| 3076 | { |
| 3077 | return peer_timers_set_vty (vty, argv[0], argv[1], argv[2]); |
| 3078 | } |
| 3079 | |
| 3080 | DEFUN (no_neighbor_timers, |
| 3081 | no_neighbor_timers_cmd, |
| 3082 | NO_NEIGHBOR_CMD2 "timers", |
| 3083 | NO_STR |
| 3084 | NEIGHBOR_STR |
| 3085 | NEIGHBOR_ADDR_STR2 |
| 3086 | "BGP per neighbor timers\n") |
| 3087 | { |
| 3088 | return peer_timers_unset_vty (vty, argv[0]); |
| 3089 | } |
| 3090 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3091 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3092 | peer_timers_connect_set_vty (struct vty *vty, const char *ip_str, |
| 3093 | const char *time_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3094 | { |
| 3095 | int ret; |
| 3096 | struct peer *peer; |
| 3097 | u_int32_t connect; |
| 3098 | |
| 3099 | peer = peer_lookup_vty (vty, ip_str); |
| 3100 | if (! peer) |
| 3101 | return CMD_WARNING; |
| 3102 | |
| 3103 | VTY_GET_INTEGER_RANGE ("Connect time", connect, time_str, 0, 65535); |
| 3104 | |
| 3105 | ret = peer_timers_connect_set (peer, connect); |
| 3106 | |
| 3107 | return CMD_SUCCESS; |
| 3108 | } |
| 3109 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3110 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3111 | peer_timers_connect_unset_vty (struct vty *vty, const char *ip_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3112 | { |
| 3113 | int ret; |
| 3114 | struct peer *peer; |
| 3115 | |
| 3116 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3117 | if (! peer) |
| 3118 | return CMD_WARNING; |
| 3119 | |
| 3120 | ret = peer_timers_connect_unset (peer); |
| 3121 | |
| 3122 | return CMD_SUCCESS; |
| 3123 | } |
| 3124 | |
| 3125 | DEFUN (neighbor_timers_connect, |
| 3126 | neighbor_timers_connect_cmd, |
| 3127 | NEIGHBOR_CMD "timers connect <0-65535>", |
| 3128 | NEIGHBOR_STR |
| 3129 | NEIGHBOR_ADDR_STR |
| 3130 | "BGP per neighbor timers\n" |
| 3131 | "BGP connect timer\n" |
| 3132 | "Connect timer\n") |
| 3133 | { |
| 3134 | return peer_timers_connect_set_vty (vty, argv[0], argv[1]); |
| 3135 | } |
| 3136 | |
| 3137 | DEFUN (no_neighbor_timers_connect, |
| 3138 | no_neighbor_timers_connect_cmd, |
| 3139 | NO_NEIGHBOR_CMD "timers connect", |
| 3140 | NO_STR |
| 3141 | NEIGHBOR_STR |
| 3142 | NEIGHBOR_ADDR_STR |
| 3143 | "BGP per neighbor timers\n" |
| 3144 | "BGP connect timer\n") |
| 3145 | { |
| 3146 | return peer_timers_connect_unset_vty (vty, argv[0]); |
| 3147 | } |
| 3148 | |
| 3149 | ALIAS (no_neighbor_timers_connect, |
| 3150 | no_neighbor_timers_connect_val_cmd, |
| 3151 | NO_NEIGHBOR_CMD "timers connect <0-65535>", |
| 3152 | NO_STR |
| 3153 | NEIGHBOR_STR |
| 3154 | NEIGHBOR_ADDR_STR |
| 3155 | "BGP per neighbor timers\n" |
| 3156 | "BGP connect timer\n" |
| 3157 | "Connect timer\n") |
| 3158 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3159 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3160 | peer_advertise_interval_vty (struct vty *vty, const char *ip_str, |
| 3161 | const char *time_str, int set) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3162 | { |
| 3163 | int ret; |
| 3164 | struct peer *peer; |
| 3165 | u_int32_t routeadv = 0; |
| 3166 | |
| 3167 | peer = peer_lookup_vty (vty, ip_str); |
| 3168 | if (! peer) |
| 3169 | return CMD_WARNING; |
| 3170 | |
| 3171 | if (time_str) |
| 3172 | VTY_GET_INTEGER_RANGE ("advertise interval", routeadv, time_str, 0, 600); |
| 3173 | |
| 3174 | if (set) |
| 3175 | ret = peer_advertise_interval_set (peer, routeadv); |
| 3176 | else |
| 3177 | ret = peer_advertise_interval_unset (peer); |
| 3178 | |
| 3179 | return CMD_SUCCESS; |
| 3180 | } |
| 3181 | |
| 3182 | DEFUN (neighbor_advertise_interval, |
| 3183 | neighbor_advertise_interval_cmd, |
| 3184 | NEIGHBOR_CMD "advertisement-interval <0-600>", |
| 3185 | NEIGHBOR_STR |
| 3186 | NEIGHBOR_ADDR_STR |
| 3187 | "Minimum interval between sending BGP routing updates\n" |
| 3188 | "time in seconds\n") |
| 3189 | { |
| 3190 | return peer_advertise_interval_vty (vty, argv[0], argv[1], 1); |
| 3191 | } |
| 3192 | |
| 3193 | DEFUN (no_neighbor_advertise_interval, |
| 3194 | no_neighbor_advertise_interval_cmd, |
| 3195 | NO_NEIGHBOR_CMD "advertisement-interval", |
| 3196 | NO_STR |
| 3197 | NEIGHBOR_STR |
| 3198 | NEIGHBOR_ADDR_STR |
| 3199 | "Minimum interval between sending BGP routing updates\n") |
| 3200 | { |
| 3201 | return peer_advertise_interval_vty (vty, argv[0], NULL, 0); |
| 3202 | } |
| 3203 | |
| 3204 | ALIAS (no_neighbor_advertise_interval, |
| 3205 | no_neighbor_advertise_interval_val_cmd, |
| 3206 | NO_NEIGHBOR_CMD "advertisement-interval <0-600>", |
| 3207 | NO_STR |
| 3208 | NEIGHBOR_STR |
| 3209 | NEIGHBOR_ADDR_STR |
| 3210 | "Minimum interval between sending BGP routing updates\n" |
| 3211 | "time in seconds\n") |
| 3212 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3213 | /* neighbor interface */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3214 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3215 | peer_interface_vty (struct vty *vty, const char *ip_str, const char *str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3216 | { |
| 3217 | int ret; |
| 3218 | struct peer *peer; |
| 3219 | |
| 3220 | peer = peer_lookup_vty (vty, ip_str); |
| 3221 | if (! peer) |
| 3222 | return CMD_WARNING; |
| 3223 | |
| 3224 | if (str) |
| 3225 | ret = peer_interface_set (peer, str); |
| 3226 | else |
| 3227 | ret = peer_interface_unset (peer); |
| 3228 | |
| 3229 | return CMD_SUCCESS; |
| 3230 | } |
| 3231 | |
| 3232 | DEFUN (neighbor_interface, |
| 3233 | neighbor_interface_cmd, |
| 3234 | NEIGHBOR_CMD "interface WORD", |
| 3235 | NEIGHBOR_STR |
| 3236 | NEIGHBOR_ADDR_STR |
| 3237 | "Interface\n" |
| 3238 | "Interface name\n") |
| 3239 | { |
| 3240 | return peer_interface_vty (vty, argv[0], argv[1]); |
| 3241 | } |
| 3242 | |
| 3243 | DEFUN (no_neighbor_interface, |
| 3244 | no_neighbor_interface_cmd, |
| 3245 | NO_NEIGHBOR_CMD "interface WORD", |
| 3246 | NO_STR |
| 3247 | NEIGHBOR_STR |
| 3248 | NEIGHBOR_ADDR_STR |
| 3249 | "Interface\n" |
| 3250 | "Interface name\n") |
| 3251 | { |
| 3252 | return peer_interface_vty (vty, argv[0], NULL); |
| 3253 | } |
| 3254 | |
| 3255 | /* Set distribute list to the peer. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3256 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3257 | peer_distribute_set_vty (struct vty *vty, const char *ip_str, |
| 3258 | afi_t afi, safi_t safi, |
| 3259 | const char *name_str, const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3260 | { |
| 3261 | int ret; |
| 3262 | struct peer *peer; |
| 3263 | int direct = FILTER_IN; |
| 3264 | |
| 3265 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3266 | if (! peer) |
| 3267 | return CMD_WARNING; |
| 3268 | |
| 3269 | /* Check filter direction. */ |
| 3270 | if (strncmp (direct_str, "i", 1) == 0) |
| 3271 | direct = FILTER_IN; |
| 3272 | else if (strncmp (direct_str, "o", 1) == 0) |
| 3273 | direct = FILTER_OUT; |
| 3274 | |
| 3275 | ret = peer_distribute_set (peer, afi, safi, direct, name_str); |
| 3276 | |
| 3277 | return bgp_vty_return (vty, ret); |
| 3278 | } |
| 3279 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3280 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3281 | peer_distribute_unset_vty (struct vty *vty, const char *ip_str, afi_t afi, |
| 3282 | safi_t safi, const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3283 | { |
| 3284 | int ret; |
| 3285 | struct peer *peer; |
| 3286 | int direct = FILTER_IN; |
| 3287 | |
| 3288 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3289 | if (! peer) |
| 3290 | return CMD_WARNING; |
| 3291 | |
| 3292 | /* Check filter direction. */ |
| 3293 | if (strncmp (direct_str, "i", 1) == 0) |
| 3294 | direct = FILTER_IN; |
| 3295 | else if (strncmp (direct_str, "o", 1) == 0) |
| 3296 | direct = FILTER_OUT; |
| 3297 | |
| 3298 | ret = peer_distribute_unset (peer, afi, safi, direct); |
| 3299 | |
| 3300 | return bgp_vty_return (vty, ret); |
| 3301 | } |
| 3302 | |
| 3303 | DEFUN (neighbor_distribute_list, |
| 3304 | neighbor_distribute_list_cmd, |
| 3305 | NEIGHBOR_CMD2 "distribute-list (<1-199>|<1300-2699>|WORD) (in|out)", |
| 3306 | NEIGHBOR_STR |
| 3307 | NEIGHBOR_ADDR_STR2 |
| 3308 | "Filter updates to/from this neighbor\n" |
| 3309 | "IP access-list number\n" |
| 3310 | "IP access-list number (expanded range)\n" |
| 3311 | "IP Access-list name\n" |
| 3312 | "Filter incoming updates\n" |
| 3313 | "Filter outgoing updates\n") |
| 3314 | { |
| 3315 | return peer_distribute_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3316 | bgp_node_safi (vty), argv[1], argv[2]); |
| 3317 | } |
| 3318 | |
| 3319 | DEFUN (no_neighbor_distribute_list, |
| 3320 | no_neighbor_distribute_list_cmd, |
| 3321 | NO_NEIGHBOR_CMD2 "distribute-list (<1-199>|<1300-2699>|WORD) (in|out)", |
| 3322 | NO_STR |
| 3323 | NEIGHBOR_STR |
| 3324 | NEIGHBOR_ADDR_STR2 |
| 3325 | "Filter updates to/from this neighbor\n" |
| 3326 | "IP access-list number\n" |
| 3327 | "IP access-list number (expanded range)\n" |
| 3328 | "IP Access-list name\n" |
| 3329 | "Filter incoming updates\n" |
| 3330 | "Filter outgoing updates\n") |
| 3331 | { |
| 3332 | return peer_distribute_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 3333 | bgp_node_safi (vty), argv[2]); |
| 3334 | } |
| 3335 | |
| 3336 | /* Set prefix list to the peer. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3337 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3338 | peer_prefix_list_set_vty (struct vty *vty, const char *ip_str, afi_t afi, |
| 3339 | safi_t safi, const char *name_str, |
| 3340 | const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3341 | { |
| 3342 | int ret; |
| 3343 | struct peer *peer; |
| 3344 | int direct = FILTER_IN; |
| 3345 | |
| 3346 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3347 | if (! peer) |
| 3348 | return CMD_WARNING; |
| 3349 | |
| 3350 | /* Check filter direction. */ |
| 3351 | if (strncmp (direct_str, "i", 1) == 0) |
| 3352 | direct = FILTER_IN; |
| 3353 | else if (strncmp (direct_str, "o", 1) == 0) |
| 3354 | direct = FILTER_OUT; |
| 3355 | |
| 3356 | ret = peer_prefix_list_set (peer, afi, safi, direct, name_str); |
| 3357 | |
| 3358 | return bgp_vty_return (vty, ret); |
| 3359 | } |
| 3360 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3361 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3362 | peer_prefix_list_unset_vty (struct vty *vty, const char *ip_str, afi_t afi, |
| 3363 | safi_t safi, const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3364 | { |
| 3365 | int ret; |
| 3366 | struct peer *peer; |
| 3367 | int direct = FILTER_IN; |
| 3368 | |
| 3369 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3370 | if (! peer) |
| 3371 | return CMD_WARNING; |
| 3372 | |
| 3373 | /* Check filter direction. */ |
| 3374 | if (strncmp (direct_str, "i", 1) == 0) |
| 3375 | direct = FILTER_IN; |
| 3376 | else if (strncmp (direct_str, "o", 1) == 0) |
| 3377 | direct = FILTER_OUT; |
| 3378 | |
| 3379 | ret = peer_prefix_list_unset (peer, afi, safi, direct); |
| 3380 | |
| 3381 | return bgp_vty_return (vty, ret); |
| 3382 | } |
| 3383 | |
| 3384 | DEFUN (neighbor_prefix_list, |
| 3385 | neighbor_prefix_list_cmd, |
| 3386 | NEIGHBOR_CMD2 "prefix-list WORD (in|out)", |
| 3387 | NEIGHBOR_STR |
| 3388 | NEIGHBOR_ADDR_STR2 |
| 3389 | "Filter updates to/from this neighbor\n" |
| 3390 | "Name of a prefix list\n" |
| 3391 | "Filter incoming updates\n" |
| 3392 | "Filter outgoing updates\n") |
| 3393 | { |
| 3394 | return peer_prefix_list_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3395 | bgp_node_safi (vty), argv[1], argv[2]); |
| 3396 | } |
| 3397 | |
| 3398 | DEFUN (no_neighbor_prefix_list, |
| 3399 | no_neighbor_prefix_list_cmd, |
| 3400 | NO_NEIGHBOR_CMD2 "prefix-list WORD (in|out)", |
| 3401 | NO_STR |
| 3402 | NEIGHBOR_STR |
| 3403 | NEIGHBOR_ADDR_STR2 |
| 3404 | "Filter updates to/from this neighbor\n" |
| 3405 | "Name of a prefix list\n" |
| 3406 | "Filter incoming updates\n" |
| 3407 | "Filter outgoing updates\n") |
| 3408 | { |
| 3409 | return peer_prefix_list_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 3410 | bgp_node_safi (vty), argv[2]); |
| 3411 | } |
| 3412 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3413 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3414 | peer_aslist_set_vty (struct vty *vty, const char *ip_str, |
| 3415 | afi_t afi, safi_t safi, |
| 3416 | const char *name_str, const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3417 | { |
| 3418 | int ret; |
| 3419 | struct peer *peer; |
| 3420 | int direct = FILTER_IN; |
| 3421 | |
| 3422 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3423 | if (! peer) |
| 3424 | return CMD_WARNING; |
| 3425 | |
| 3426 | /* Check filter direction. */ |
| 3427 | if (strncmp (direct_str, "i", 1) == 0) |
| 3428 | direct = FILTER_IN; |
| 3429 | else if (strncmp (direct_str, "o", 1) == 0) |
| 3430 | direct = FILTER_OUT; |
| 3431 | |
| 3432 | ret = peer_aslist_set (peer, afi, safi, direct, name_str); |
| 3433 | |
| 3434 | return bgp_vty_return (vty, ret); |
| 3435 | } |
| 3436 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3437 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3438 | peer_aslist_unset_vty (struct vty *vty, const char *ip_str, |
| 3439 | afi_t afi, safi_t safi, |
| 3440 | const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3441 | { |
| 3442 | int ret; |
| 3443 | struct peer *peer; |
| 3444 | int direct = FILTER_IN; |
| 3445 | |
| 3446 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3447 | if (! peer) |
| 3448 | return CMD_WARNING; |
| 3449 | |
| 3450 | /* Check filter direction. */ |
| 3451 | if (strncmp (direct_str, "i", 1) == 0) |
| 3452 | direct = FILTER_IN; |
| 3453 | else if (strncmp (direct_str, "o", 1) == 0) |
| 3454 | direct = FILTER_OUT; |
| 3455 | |
| 3456 | ret = peer_aslist_unset (peer, afi, safi, direct); |
| 3457 | |
| 3458 | return bgp_vty_return (vty, ret); |
| 3459 | } |
| 3460 | |
| 3461 | DEFUN (neighbor_filter_list, |
| 3462 | neighbor_filter_list_cmd, |
| 3463 | NEIGHBOR_CMD2 "filter-list WORD (in|out)", |
| 3464 | NEIGHBOR_STR |
| 3465 | NEIGHBOR_ADDR_STR2 |
| 3466 | "Establish BGP filters\n" |
| 3467 | "AS path access-list name\n" |
| 3468 | "Filter incoming routes\n" |
| 3469 | "Filter outgoing routes\n") |
| 3470 | { |
| 3471 | return peer_aslist_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3472 | bgp_node_safi (vty), argv[1], argv[2]); |
| 3473 | } |
| 3474 | |
| 3475 | DEFUN (no_neighbor_filter_list, |
| 3476 | no_neighbor_filter_list_cmd, |
| 3477 | NO_NEIGHBOR_CMD2 "filter-list WORD (in|out)", |
| 3478 | NO_STR |
| 3479 | NEIGHBOR_STR |
| 3480 | NEIGHBOR_ADDR_STR2 |
| 3481 | "Establish BGP filters\n" |
| 3482 | "AS path access-list name\n" |
| 3483 | "Filter incoming routes\n" |
| 3484 | "Filter outgoing routes\n") |
| 3485 | { |
| 3486 | return peer_aslist_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 3487 | bgp_node_safi (vty), argv[2]); |
| 3488 | } |
| 3489 | |
| 3490 | /* Set route-map to the peer. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3491 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3492 | peer_route_map_set_vty (struct vty *vty, const char *ip_str, |
| 3493 | afi_t afi, safi_t safi, |
| 3494 | const char *name_str, const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3495 | { |
| 3496 | int ret; |
| 3497 | struct peer *peer; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3498 | int direct = RMAP_IN; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3499 | |
| 3500 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3501 | if (! peer) |
| 3502 | return CMD_WARNING; |
| 3503 | |
| 3504 | /* Check filter direction. */ |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3505 | if (strncmp (direct_str, "in", 2) == 0) |
| 3506 | direct = RMAP_IN; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3507 | else if (strncmp (direct_str, "o", 1) == 0) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3508 | direct = RMAP_OUT; |
| 3509 | else if (strncmp (direct_str, "im", 2) == 0) |
| 3510 | direct = RMAP_IMPORT; |
| 3511 | else if (strncmp (direct_str, "e", 1) == 0) |
| 3512 | direct = RMAP_EXPORT; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3513 | |
| 3514 | ret = peer_route_map_set (peer, afi, safi, direct, name_str); |
| 3515 | |
| 3516 | return bgp_vty_return (vty, ret); |
| 3517 | } |
| 3518 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3519 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3520 | peer_route_map_unset_vty (struct vty *vty, const char *ip_str, afi_t afi, |
| 3521 | safi_t safi, const char *direct_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3522 | { |
| 3523 | int ret; |
| 3524 | struct peer *peer; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3525 | int direct = RMAP_IN; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3526 | |
| 3527 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3528 | if (! peer) |
| 3529 | return CMD_WARNING; |
| 3530 | |
| 3531 | /* Check filter direction. */ |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3532 | if (strncmp (direct_str, "in", 2) == 0) |
| 3533 | direct = RMAP_IN; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3534 | else if (strncmp (direct_str, "o", 1) == 0) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3535 | direct = RMAP_OUT; |
| 3536 | else if (strncmp (direct_str, "im", 2) == 0) |
| 3537 | direct = RMAP_IMPORT; |
| 3538 | else if (strncmp (direct_str, "e", 1) == 0) |
| 3539 | direct = RMAP_EXPORT; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3540 | |
| 3541 | ret = peer_route_map_unset (peer, afi, safi, direct); |
| 3542 | |
| 3543 | return bgp_vty_return (vty, ret); |
| 3544 | } |
| 3545 | |
| 3546 | DEFUN (neighbor_route_map, |
| 3547 | neighbor_route_map_cmd, |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3548 | NEIGHBOR_CMD2 "route-map WORD (in|out|import|export)", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3549 | NEIGHBOR_STR |
| 3550 | NEIGHBOR_ADDR_STR2 |
| 3551 | "Apply route map to neighbor\n" |
| 3552 | "Name of route map\n" |
| 3553 | "Apply map to incoming routes\n" |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3554 | "Apply map to outbound routes\n" |
| 3555 | "Apply map to routes going into a Route-Server client's table\n" |
| 3556 | "Apply map to routes coming from a Route-Server client") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3557 | { |
| 3558 | return peer_route_map_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3559 | bgp_node_safi (vty), argv[1], argv[2]); |
| 3560 | } |
| 3561 | |
| 3562 | DEFUN (no_neighbor_route_map, |
| 3563 | no_neighbor_route_map_cmd, |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3564 | NO_NEIGHBOR_CMD2 "route-map WORD (in|out|import|export)", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3565 | NO_STR |
| 3566 | NEIGHBOR_STR |
| 3567 | NEIGHBOR_ADDR_STR2 |
| 3568 | "Apply route map to neighbor\n" |
| 3569 | "Name of route map\n" |
| 3570 | "Apply map to incoming routes\n" |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 3571 | "Apply map to outbound routes\n" |
| 3572 | "Apply map to routes going into a Route-Server client's table\n" |
| 3573 | "Apply map to routes coming from a Route-Server client") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3574 | { |
| 3575 | return peer_route_map_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 3576 | bgp_node_safi (vty), argv[2]); |
| 3577 | } |
| 3578 | |
| 3579 | /* Set unsuppress-map to the peer. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3580 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3581 | peer_unsuppress_map_set_vty (struct vty *vty, const char *ip_str, afi_t afi, |
| 3582 | safi_t safi, const char *name_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3583 | { |
| 3584 | int ret; |
| 3585 | struct peer *peer; |
| 3586 | |
| 3587 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3588 | if (! peer) |
| 3589 | return CMD_WARNING; |
| 3590 | |
| 3591 | ret = peer_unsuppress_map_set (peer, afi, safi, name_str); |
| 3592 | |
| 3593 | return bgp_vty_return (vty, ret); |
| 3594 | } |
| 3595 | |
| 3596 | /* Unset route-map from the peer. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3597 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3598 | 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] | 3599 | safi_t safi) |
| 3600 | { |
| 3601 | int ret; |
| 3602 | struct peer *peer; |
| 3603 | |
| 3604 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3605 | if (! peer) |
| 3606 | return CMD_WARNING; |
| 3607 | |
| 3608 | ret = peer_unsuppress_map_unset (peer, afi, safi); |
| 3609 | |
| 3610 | return bgp_vty_return (vty, ret); |
| 3611 | } |
| 3612 | |
| 3613 | DEFUN (neighbor_unsuppress_map, |
| 3614 | neighbor_unsuppress_map_cmd, |
| 3615 | NEIGHBOR_CMD2 "unsuppress-map WORD", |
| 3616 | NEIGHBOR_STR |
| 3617 | NEIGHBOR_ADDR_STR2 |
| 3618 | "Route-map to selectively unsuppress suppressed routes\n" |
| 3619 | "Name of route map\n") |
| 3620 | { |
| 3621 | return peer_unsuppress_map_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3622 | bgp_node_safi (vty), argv[1]); |
| 3623 | } |
| 3624 | |
| 3625 | DEFUN (no_neighbor_unsuppress_map, |
| 3626 | no_neighbor_unsuppress_map_cmd, |
| 3627 | NO_NEIGHBOR_CMD2 "unsuppress-map WORD", |
| 3628 | NO_STR |
| 3629 | NEIGHBOR_STR |
| 3630 | NEIGHBOR_ADDR_STR2 |
| 3631 | "Route-map to selectively unsuppress suppressed routes\n" |
| 3632 | "Name of route map\n") |
| 3633 | { |
| 3634 | return peer_unsuppress_map_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 3635 | bgp_node_safi (vty)); |
| 3636 | } |
| 3637 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3638 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3639 | peer_maximum_prefix_set_vty (struct vty *vty, const char *ip_str, afi_t afi, |
| 3640 | safi_t safi, const char *num_str, |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 3641 | const char *threshold_str, int warning, |
| 3642 | const char *restart_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3643 | { |
| 3644 | int ret; |
| 3645 | struct peer *peer; |
| 3646 | u_int32_t max; |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 3647 | u_char threshold; |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 3648 | u_int16_t restart; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3649 | |
| 3650 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3651 | if (! peer) |
| 3652 | return CMD_WARNING; |
| 3653 | |
| 3654 | VTY_GET_INTEGER ("maxmum number", max, num_str); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 3655 | if (threshold_str) |
| 3656 | threshold = atoi (threshold_str); |
| 3657 | else |
| 3658 | threshold = MAXIMUM_PREFIX_THRESHOLD_DEFAULT; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3659 | |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 3660 | if (restart_str) |
| 3661 | restart = atoi (restart_str); |
| 3662 | else |
| 3663 | restart = 0; |
| 3664 | |
| 3665 | ret = peer_maximum_prefix_set (peer, afi, safi, max, threshold, warning, restart); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3666 | |
| 3667 | return bgp_vty_return (vty, ret); |
| 3668 | } |
| 3669 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3670 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3671 | 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] | 3672 | safi_t safi) |
| 3673 | { |
| 3674 | int ret; |
| 3675 | struct peer *peer; |
| 3676 | |
| 3677 | peer = peer_and_group_lookup_vty (vty, ip_str); |
| 3678 | if (! peer) |
| 3679 | return CMD_WARNING; |
| 3680 | |
| 3681 | ret = peer_maximum_prefix_unset (peer, afi, safi); |
| 3682 | |
| 3683 | return bgp_vty_return (vty, ret); |
| 3684 | } |
| 3685 | |
| 3686 | /* Maximum number of prefix configuration. prefix count is different |
| 3687 | for each peer configuration. So this configuration can be set for |
| 3688 | each peer configuration. */ |
| 3689 | DEFUN (neighbor_maximum_prefix, |
| 3690 | neighbor_maximum_prefix_cmd, |
| 3691 | NEIGHBOR_CMD2 "maximum-prefix <1-4294967295>", |
| 3692 | NEIGHBOR_STR |
| 3693 | NEIGHBOR_ADDR_STR2 |
| 3694 | "Maximum number of prefix accept from this peer\n" |
| 3695 | "maximum no. of prefix limit\n") |
| 3696 | { |
| 3697 | return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty), |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 3698 | bgp_node_safi (vty), argv[1], NULL, 0, |
| 3699 | NULL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3700 | } |
| 3701 | |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 3702 | DEFUN (neighbor_maximum_prefix_threshold, |
| 3703 | neighbor_maximum_prefix_threshold_cmd, |
| 3704 | NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100>", |
| 3705 | NEIGHBOR_STR |
| 3706 | NEIGHBOR_ADDR_STR2 |
| 3707 | "Maximum number of prefix accept from this peer\n" |
| 3708 | "maximum no. of prefix limit\n" |
| 3709 | "Threshold value (%) at which to generate a warning msg\n") |
| 3710 | { |
| 3711 | return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty), |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 3712 | bgp_node_safi (vty), argv[1], argv[2], 0, |
| 3713 | NULL); |
| 3714 | } |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 3715 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3716 | DEFUN (neighbor_maximum_prefix_warning, |
| 3717 | neighbor_maximum_prefix_warning_cmd, |
| 3718 | NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> warning-only", |
| 3719 | NEIGHBOR_STR |
| 3720 | NEIGHBOR_ADDR_STR2 |
| 3721 | "Maximum number of prefix accept from this peer\n" |
| 3722 | "maximum no. of prefix limit\n" |
| 3723 | "Only give warning message when limit is exceeded\n") |
| 3724 | { |
| 3725 | return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty), |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 3726 | bgp_node_safi (vty), argv[1], NULL, 1, |
| 3727 | NULL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3728 | } |
| 3729 | |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 3730 | DEFUN (neighbor_maximum_prefix_threshold_warning, |
| 3731 | neighbor_maximum_prefix_threshold_warning_cmd, |
| 3732 | NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100> warning-only", |
| 3733 | NEIGHBOR_STR |
| 3734 | NEIGHBOR_ADDR_STR2 |
| 3735 | "Maximum number of prefix accept from this peer\n" |
| 3736 | "maximum no. of prefix limit\n" |
| 3737 | "Threshold value (%) at which to generate a warning msg\n" |
| 3738 | "Only give warning message when limit is exceeded\n") |
| 3739 | { |
| 3740 | return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty), |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 3741 | bgp_node_safi (vty), argv[1], argv[2], 1, NULL); |
| 3742 | } |
| 3743 | |
| 3744 | DEFUN (neighbor_maximum_prefix_restart, |
| 3745 | neighbor_maximum_prefix_restart_cmd, |
| 3746 | NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> restart <1-65535>", |
| 3747 | NEIGHBOR_STR |
| 3748 | NEIGHBOR_ADDR_STR2 |
| 3749 | "Maximum number of prefix accept from this peer\n" |
| 3750 | "maximum no. of prefix limit\n" |
| 3751 | "Restart bgp connection after limit is exceeded\n" |
| 3752 | "Restart interval in minutes") |
| 3753 | { |
| 3754 | return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3755 | bgp_node_safi (vty), argv[1], NULL, 0, argv[2]); |
| 3756 | } |
| 3757 | |
| 3758 | DEFUN (neighbor_maximum_prefix_threshold_restart, |
| 3759 | neighbor_maximum_prefix_threshold_restart_cmd, |
| 3760 | NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100> restart <1-65535>", |
| 3761 | NEIGHBOR_STR |
| 3762 | NEIGHBOR_ADDR_STR2 |
| 3763 | "Maximum number of prefix accept from this peer\n" |
| 3764 | "maximum no. of prefix limit\n" |
| 3765 | "Threshold value (%) at which to generate a warning msg\n" |
| 3766 | "Restart bgp connection after limit is exceeded\n" |
| 3767 | "Restart interval in minutes") |
| 3768 | { |
| 3769 | return peer_maximum_prefix_set_vty (vty, argv[0], bgp_node_afi (vty), |
| 3770 | bgp_node_safi (vty), argv[1], argv[2], 0, argv[3]); |
| 3771 | } |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 3772 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3773 | DEFUN (no_neighbor_maximum_prefix, |
| 3774 | no_neighbor_maximum_prefix_cmd, |
| 3775 | NO_NEIGHBOR_CMD2 "maximum-prefix", |
| 3776 | NO_STR |
| 3777 | NEIGHBOR_STR |
| 3778 | NEIGHBOR_ADDR_STR2 |
| 3779 | "Maximum number of prefix accept from this peer\n") |
| 3780 | { |
| 3781 | return peer_maximum_prefix_unset_vty (vty, argv[0], bgp_node_afi (vty), |
| 3782 | bgp_node_safi (vty)); |
| 3783 | } |
| 3784 | |
| 3785 | ALIAS (no_neighbor_maximum_prefix, |
| 3786 | no_neighbor_maximum_prefix_val_cmd, |
| 3787 | NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295>", |
| 3788 | NO_STR |
| 3789 | NEIGHBOR_STR |
| 3790 | NEIGHBOR_ADDR_STR2 |
| 3791 | "Maximum number of prefix accept from this peer\n" |
| 3792 | "maximum no. of prefix limit\n") |
| 3793 | |
| 3794 | ALIAS (no_neighbor_maximum_prefix, |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 3795 | no_neighbor_maximum_prefix_threshold_cmd, |
| 3796 | NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> warning-only", |
| 3797 | NO_STR |
| 3798 | NEIGHBOR_STR |
| 3799 | NEIGHBOR_ADDR_STR2 |
| 3800 | "Maximum number of prefix accept from this peer\n" |
| 3801 | "maximum no. of prefix limit\n" |
| 3802 | "Threshold value (%) at which to generate a warning msg\n") |
| 3803 | |
| 3804 | ALIAS (no_neighbor_maximum_prefix, |
| 3805 | no_neighbor_maximum_prefix_warning_cmd, |
| 3806 | NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> warning-only", |
| 3807 | NO_STR |
| 3808 | NEIGHBOR_STR |
| 3809 | NEIGHBOR_ADDR_STR2 |
| 3810 | "Maximum number of prefix accept from this peer\n" |
| 3811 | "maximum no. of prefix limit\n" |
paul | e8e1946 | 2006-01-19 20:16:55 +0000 | [diff] [blame] | 3812 | "Only give warning message when limit is exceeded\n") |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 3813 | |
| 3814 | ALIAS (no_neighbor_maximum_prefix, |
| 3815 | no_neighbor_maximum_prefix_threshold_warning_cmd, |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 3816 | NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100> warning-only", |
| 3817 | NO_STR |
| 3818 | NEIGHBOR_STR |
| 3819 | NEIGHBOR_ADDR_STR2 |
| 3820 | "Maximum number of prefix accept from this peer\n" |
| 3821 | "maximum no. of prefix limit\n" |
| 3822 | "Threshold value (%) at which to generate a warning msg\n" |
paul | e8e1946 | 2006-01-19 20:16:55 +0000 | [diff] [blame] | 3823 | "Only give warning message when limit is exceeded\n") |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 3824 | |
| 3825 | ALIAS (no_neighbor_maximum_prefix, |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 3826 | no_neighbor_maximum_prefix_restart_cmd, |
| 3827 | NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> restart <1-65535>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3828 | NO_STR |
| 3829 | NEIGHBOR_STR |
| 3830 | NEIGHBOR_ADDR_STR2 |
| 3831 | "Maximum number of prefix accept from this peer\n" |
| 3832 | "maximum no. of prefix limit\n" |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 3833 | "Restart bgp connection after limit is exceeded\n" |
| 3834 | "Restart interval in minutes") |
| 3835 | |
| 3836 | ALIAS (no_neighbor_maximum_prefix, |
| 3837 | no_neighbor_maximum_prefix_threshold_restart_cmd, |
| 3838 | NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100> restart <1-65535>", |
| 3839 | NO_STR |
| 3840 | NEIGHBOR_STR |
| 3841 | NEIGHBOR_ADDR_STR2 |
| 3842 | "Maximum number of prefix accept from this peer\n" |
| 3843 | "maximum no. of prefix limit\n" |
| 3844 | "Threshold value (%) at which to generate a warning msg\n" |
| 3845 | "Restart bgp connection after limit is exceeded\n" |
| 3846 | "Restart interval in minutes") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3847 | |
| 3848 | /* "neighbor allowas-in" */ |
| 3849 | DEFUN (neighbor_allowas_in, |
| 3850 | neighbor_allowas_in_cmd, |
| 3851 | NEIGHBOR_CMD2 "allowas-in", |
| 3852 | NEIGHBOR_STR |
| 3853 | NEIGHBOR_ADDR_STR2 |
| 3854 | "Accept as-path with my AS present in it\n") |
| 3855 | { |
| 3856 | int ret; |
| 3857 | struct peer *peer; |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 3858 | unsigned int allow_num; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3859 | |
| 3860 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 3861 | if (! peer) |
| 3862 | return CMD_WARNING; |
| 3863 | |
| 3864 | if (argc == 1) |
| 3865 | allow_num = 3; |
| 3866 | else |
| 3867 | VTY_GET_INTEGER_RANGE ("AS number", allow_num, argv[1], 1, 10); |
| 3868 | |
| 3869 | ret = peer_allowas_in_set (peer, bgp_node_afi (vty), bgp_node_safi (vty), |
| 3870 | allow_num); |
| 3871 | |
| 3872 | return bgp_vty_return (vty, ret); |
| 3873 | } |
| 3874 | |
| 3875 | ALIAS (neighbor_allowas_in, |
| 3876 | neighbor_allowas_in_arg_cmd, |
| 3877 | NEIGHBOR_CMD2 "allowas-in <1-10>", |
| 3878 | NEIGHBOR_STR |
| 3879 | NEIGHBOR_ADDR_STR2 |
| 3880 | "Accept as-path with my AS present in it\n" |
| 3881 | "Number of occurances of AS number\n") |
| 3882 | |
| 3883 | DEFUN (no_neighbor_allowas_in, |
| 3884 | no_neighbor_allowas_in_cmd, |
| 3885 | NO_NEIGHBOR_CMD2 "allowas-in", |
| 3886 | NO_STR |
| 3887 | NEIGHBOR_STR |
| 3888 | NEIGHBOR_ADDR_STR2 |
| 3889 | "allow local ASN appears in aspath attribute\n") |
| 3890 | { |
| 3891 | int ret; |
| 3892 | struct peer *peer; |
| 3893 | |
| 3894 | peer = peer_and_group_lookup_vty (vty, argv[0]); |
| 3895 | if (! peer) |
| 3896 | return CMD_WARNING; |
| 3897 | |
| 3898 | ret = peer_allowas_in_unset (peer, bgp_node_afi (vty), bgp_node_safi (vty)); |
| 3899 | |
| 3900 | return bgp_vty_return (vty, ret); |
| 3901 | } |
| 3902 | |
| 3903 | /* Address family configuration. */ |
| 3904 | DEFUN (address_family_ipv4, |
| 3905 | address_family_ipv4_cmd, |
| 3906 | "address-family ipv4", |
| 3907 | "Enter Address Family command mode\n" |
| 3908 | "Address family\n") |
| 3909 | { |
| 3910 | vty->node = BGP_IPV4_NODE; |
| 3911 | return CMD_SUCCESS; |
| 3912 | } |
| 3913 | |
| 3914 | DEFUN (address_family_ipv4_safi, |
| 3915 | address_family_ipv4_safi_cmd, |
| 3916 | "address-family ipv4 (unicast|multicast)", |
| 3917 | "Enter Address Family command mode\n" |
| 3918 | "Address family\n" |
| 3919 | "Address Family modifier\n" |
| 3920 | "Address Family modifier\n") |
| 3921 | { |
| 3922 | if (strncmp (argv[0], "m", 1) == 0) |
| 3923 | vty->node = BGP_IPV4M_NODE; |
| 3924 | else |
| 3925 | vty->node = BGP_IPV4_NODE; |
| 3926 | |
| 3927 | return CMD_SUCCESS; |
| 3928 | } |
| 3929 | |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 3930 | DEFUN (address_family_ipv6, |
| 3931 | address_family_ipv6_cmd, |
| 3932 | "address-family ipv6", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3933 | "Enter Address Family command mode\n" |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 3934 | "Address family\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3935 | { |
| 3936 | vty->node = BGP_IPV6_NODE; |
| 3937 | return CMD_SUCCESS; |
| 3938 | } |
| 3939 | |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 3940 | DEFUN (address_family_ipv6_safi, |
| 3941 | address_family_ipv6_safi_cmd, |
| 3942 | "address-family ipv6 (unicast|multicast)", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3943 | "Enter Address Family command mode\n" |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 3944 | "Address family\n" |
| 3945 | "Address Family modifier\n" |
| 3946 | "Address Family modifier\n") |
| 3947 | { |
| 3948 | if (strncmp (argv[0], "m", 1) == 0) |
| 3949 | vty->node = BGP_IPV6M_NODE; |
| 3950 | else |
| 3951 | vty->node = BGP_IPV6_NODE; |
| 3952 | |
| 3953 | return CMD_SUCCESS; |
| 3954 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3955 | |
| 3956 | DEFUN (address_family_vpnv4, |
| 3957 | address_family_vpnv4_cmd, |
| 3958 | "address-family vpnv4", |
| 3959 | "Enter Address Family command mode\n" |
| 3960 | "Address family\n") |
| 3961 | { |
| 3962 | vty->node = BGP_VPNV4_NODE; |
| 3963 | return CMD_SUCCESS; |
| 3964 | } |
| 3965 | |
| 3966 | ALIAS (address_family_vpnv4, |
| 3967 | address_family_vpnv4_unicast_cmd, |
| 3968 | "address-family vpnv4 unicast", |
| 3969 | "Enter Address Family command mode\n" |
| 3970 | "Address family\n" |
| 3971 | "Address Family Modifier\n") |
| 3972 | |
| 3973 | DEFUN (exit_address_family, |
| 3974 | exit_address_family_cmd, |
| 3975 | "exit-address-family", |
| 3976 | "Exit from Address Family configuration mode\n") |
| 3977 | { |
hasso | a8a80d5 | 2005-04-09 13:07:47 +0000 | [diff] [blame] | 3978 | if (vty->node == BGP_IPV4_NODE |
| 3979 | || vty->node == BGP_IPV4M_NODE |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3980 | || vty->node == BGP_VPNV4_NODE |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 3981 | || vty->node == BGP_IPV6_NODE |
| 3982 | || vty->node == BGP_IPV6M_NODE) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3983 | vty->node = BGP_NODE; |
| 3984 | return CMD_SUCCESS; |
| 3985 | } |
| 3986 | |
| 3987 | /* BGP clear sort. */ |
| 3988 | enum clear_sort |
| 3989 | { |
| 3990 | clear_all, |
| 3991 | clear_peer, |
| 3992 | clear_group, |
| 3993 | clear_external, |
| 3994 | clear_as |
| 3995 | }; |
| 3996 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 3997 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3998 | bgp_clear_vty_error (struct vty *vty, struct peer *peer, afi_t afi, |
| 3999 | safi_t safi, int error) |
| 4000 | { |
| 4001 | switch (error) |
| 4002 | { |
| 4003 | case BGP_ERR_AF_UNCONFIGURED: |
| 4004 | vty_out (vty, |
| 4005 | "%%BGP: Enable %s %s address family for the neighbor %s%s", |
| 4006 | afi == AFI_IP6 ? "IPv6" : safi == SAFI_MPLS_VPN ? "VPNv4" : "IPv4", |
| 4007 | safi == SAFI_MULTICAST ? "Multicast" : "Unicast", |
| 4008 | peer->host, VTY_NEWLINE); |
| 4009 | break; |
| 4010 | case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED: |
| 4011 | 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); |
| 4012 | break; |
| 4013 | default: |
| 4014 | break; |
| 4015 | } |
| 4016 | } |
| 4017 | |
| 4018 | /* `clear ip bgp' functions. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 4019 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4020 | 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] | 4021 | enum clear_sort sort,enum bgp_clear_type stype, const char *arg) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4022 | { |
| 4023 | int ret; |
| 4024 | struct peer *peer; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 4025 | struct listnode *node, *nnode; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4026 | |
| 4027 | /* Clear all neighbors. */ |
| 4028 | if (sort == clear_all) |
| 4029 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 4030 | for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4031 | { |
| 4032 | if (stype == BGP_CLEAR_SOFT_NONE) |
| 4033 | ret = peer_clear (peer); |
| 4034 | else |
| 4035 | ret = peer_clear_soft (peer, afi, safi, stype); |
| 4036 | |
| 4037 | if (ret < 0) |
| 4038 | bgp_clear_vty_error (vty, peer, afi, safi, ret); |
| 4039 | } |
| 4040 | return 0; |
| 4041 | } |
| 4042 | |
| 4043 | /* Clear specified neighbors. */ |
| 4044 | if (sort == clear_peer) |
| 4045 | { |
| 4046 | union sockunion su; |
| 4047 | int ret; |
| 4048 | |
| 4049 | /* Make sockunion for lookup. */ |
| 4050 | ret = str2sockunion (arg, &su); |
| 4051 | if (ret < 0) |
| 4052 | { |
| 4053 | vty_out (vty, "Malformed address: %s%s", arg, VTY_NEWLINE); |
| 4054 | return -1; |
| 4055 | } |
| 4056 | peer = peer_lookup (bgp, &su); |
| 4057 | if (! peer) |
| 4058 | { |
| 4059 | vty_out (vty, "%%BGP: Unknown neighbor - \"%s\"%s", arg, VTY_NEWLINE); |
| 4060 | return -1; |
| 4061 | } |
| 4062 | |
| 4063 | if (stype == BGP_CLEAR_SOFT_NONE) |
| 4064 | ret = peer_clear (peer); |
| 4065 | else |
| 4066 | ret = peer_clear_soft (peer, afi, safi, stype); |
| 4067 | |
| 4068 | if (ret < 0) |
| 4069 | bgp_clear_vty_error (vty, peer, afi, safi, ret); |
| 4070 | |
| 4071 | return 0; |
| 4072 | } |
| 4073 | |
| 4074 | /* Clear all peer-group members. */ |
| 4075 | if (sort == clear_group) |
| 4076 | { |
| 4077 | struct peer_group *group; |
| 4078 | |
| 4079 | group = peer_group_lookup (bgp, arg); |
| 4080 | if (! group) |
| 4081 | { |
| 4082 | vty_out (vty, "%%BGP: No such peer-group %s%s", arg, VTY_NEWLINE); |
| 4083 | return -1; |
| 4084 | } |
| 4085 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 4086 | for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4087 | { |
| 4088 | if (stype == BGP_CLEAR_SOFT_NONE) |
| 4089 | { |
| 4090 | ret = peer_clear (peer); |
| 4091 | continue; |
| 4092 | } |
| 4093 | |
| 4094 | if (! peer->af_group[afi][safi]) |
| 4095 | continue; |
| 4096 | |
| 4097 | ret = peer_clear_soft (peer, afi, safi, stype); |
| 4098 | |
| 4099 | if (ret < 0) |
| 4100 | bgp_clear_vty_error (vty, peer, afi, safi, ret); |
| 4101 | } |
| 4102 | return 0; |
| 4103 | } |
| 4104 | |
| 4105 | if (sort == clear_external) |
| 4106 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 4107 | for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4108 | { |
| 4109 | if (peer_sort (peer) == BGP_PEER_IBGP) |
| 4110 | continue; |
| 4111 | |
| 4112 | if (stype == BGP_CLEAR_SOFT_NONE) |
| 4113 | ret = peer_clear (peer); |
| 4114 | else |
| 4115 | ret = peer_clear_soft (peer, afi, safi, stype); |
| 4116 | |
| 4117 | if (ret < 0) |
| 4118 | bgp_clear_vty_error (vty, peer, afi, safi, ret); |
| 4119 | } |
| 4120 | return 0; |
| 4121 | } |
| 4122 | |
| 4123 | if (sort == clear_as) |
| 4124 | { |
| 4125 | as_t as; |
| 4126 | unsigned long as_ul; |
| 4127 | char *endptr = NULL; |
| 4128 | int find = 0; |
| 4129 | |
| 4130 | as_ul = strtoul(arg, &endptr, 10); |
| 4131 | |
| 4132 | if ((as_ul == ULONG_MAX) || (*endptr != '\0') || (as_ul > USHRT_MAX)) |
| 4133 | { |
| 4134 | vty_out (vty, "Invalid AS number%s", VTY_NEWLINE); |
| 4135 | return -1; |
| 4136 | } |
| 4137 | as = (as_t) as_ul; |
| 4138 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 4139 | for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4140 | { |
| 4141 | if (peer->as != as) |
| 4142 | continue; |
| 4143 | |
| 4144 | find = 1; |
| 4145 | if (stype == BGP_CLEAR_SOFT_NONE) |
| 4146 | ret = peer_clear (peer); |
| 4147 | else |
| 4148 | ret = peer_clear_soft (peer, afi, safi, stype); |
| 4149 | |
| 4150 | if (ret < 0) |
| 4151 | bgp_clear_vty_error (vty, peer, afi, safi, ret); |
| 4152 | } |
| 4153 | if (! find) |
| 4154 | vty_out (vty, "%%BGP: No peer is configured with AS %s%s", arg, |
| 4155 | VTY_NEWLINE); |
| 4156 | return 0; |
| 4157 | } |
| 4158 | |
| 4159 | return 0; |
| 4160 | } |
| 4161 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 4162 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 4163 | bgp_clear_vty (struct vty *vty, const char *name, afi_t afi, safi_t safi, |
| 4164 | enum clear_sort sort, enum bgp_clear_type stype, |
| 4165 | const char *arg) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 4166 | { |
| 4167 | int ret; |
| 4168 | struct bgp *bgp; |
| 4169 | |
| 4170 | /* BGP structure lookup. */ |
| 4171 | if (name) |
| 4172 | { |
| 4173 | bgp = bgp_lookup_by_name (name); |
| 4174 | if (bgp == NULL) |
| 4175 | { |
| 4176 | vty_out (vty, "Can't find BGP view %s%s", name, VTY_NEWLINE); |
| 4177 | return CMD_WARNING; |
| 4178 | } |
| 4179 | } |
| 4180 | else |
| 4181 | { |
| 4182 | bgp = bgp_get_default (); |
| 4183 | if (bgp == NULL) |
| 4184 | { |
| 4185 | vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE); |
| 4186 | return CMD_WARNING; |
| 4187 | } |
| 4188 | } |
| 4189 | |
| 4190 | ret = bgp_clear (vty, bgp, afi, safi, sort, stype, arg); |
| 4191 | if (ret < 0) |
| 4192 | return CMD_WARNING; |
| 4193 | |
| 4194 | return CMD_SUCCESS; |
| 4195 | } |
| 4196 | |
| 4197 | DEFUN (clear_ip_bgp_all, |
| 4198 | clear_ip_bgp_all_cmd, |
| 4199 | "clear ip bgp *", |
| 4200 | CLEAR_STR |
| 4201 | IP_STR |
| 4202 | BGP_STR |
| 4203 | "Clear all peers\n") |
| 4204 | { |
| 4205 | if (argc == 1) |
| 4206 | return bgp_clear_vty (vty, argv[0], 0, 0, clear_all, BGP_CLEAR_SOFT_NONE, NULL); |
| 4207 | |
| 4208 | return bgp_clear_vty (vty, NULL, 0, 0, clear_all, BGP_CLEAR_SOFT_NONE, NULL); |
| 4209 | } |
| 4210 | |
| 4211 | ALIAS (clear_ip_bgp_all, |
| 4212 | clear_bgp_all_cmd, |
| 4213 | "clear bgp *", |
| 4214 | CLEAR_STR |
| 4215 | BGP_STR |
| 4216 | "Clear all peers\n") |
| 4217 | |
| 4218 | ALIAS (clear_ip_bgp_all, |
| 4219 | clear_bgp_ipv6_all_cmd, |
| 4220 | "clear bgp ipv6 *", |
| 4221 | CLEAR_STR |
| 4222 | BGP_STR |
| 4223 | "Address family\n" |
| 4224 | "Clear all peers\n") |
| 4225 | |
| 4226 | ALIAS (clear_ip_bgp_all, |
| 4227 | clear_ip_bgp_instance_all_cmd, |
| 4228 | "clear ip bgp view WORD *", |
| 4229 | CLEAR_STR |
| 4230 | IP_STR |
| 4231 | BGP_STR |
| 4232 | "BGP view\n" |
| 4233 | "view name\n" |
| 4234 | "Clear all peers\n") |
| 4235 | |
| 4236 | ALIAS (clear_ip_bgp_all, |
| 4237 | clear_bgp_instance_all_cmd, |
| 4238 | "clear bgp view WORD *", |
| 4239 | CLEAR_STR |
| 4240 | BGP_STR |
| 4241 | "BGP view\n" |
| 4242 | "view name\n" |
| 4243 | "Clear all peers\n") |
| 4244 | |
| 4245 | DEFUN (clear_ip_bgp_peer, |
| 4246 | clear_ip_bgp_peer_cmd, |
| 4247 | "clear ip bgp (A.B.C.D|X:X::X:X)", |
| 4248 | CLEAR_STR |
| 4249 | IP_STR |
| 4250 | BGP_STR |
| 4251 | "BGP neighbor IP address to clear\n" |
| 4252 | "BGP IPv6 neighbor to clear\n") |
| 4253 | { |
| 4254 | return bgp_clear_vty (vty, NULL, 0, 0, clear_peer, BGP_CLEAR_SOFT_NONE, argv[0]); |
| 4255 | } |
| 4256 | |
| 4257 | ALIAS (clear_ip_bgp_peer, |
| 4258 | clear_bgp_peer_cmd, |
| 4259 | "clear bgp (A.B.C.D|X:X::X:X)", |
| 4260 | CLEAR_STR |
| 4261 | BGP_STR |
| 4262 | "BGP neighbor address to clear\n" |
| 4263 | "BGP IPv6 neighbor to clear\n") |
| 4264 | |
| 4265 | ALIAS (clear_ip_bgp_peer, |
| 4266 | clear_bgp_ipv6_peer_cmd, |
| 4267 | "clear bgp ipv6 (A.B.C.D|X:X::X:X)", |
| 4268 | CLEAR_STR |
| 4269 | BGP_STR |
| 4270 | "Address family\n" |
| 4271 | "BGP neighbor address to clear\n" |
| 4272 | "BGP IPv6 neighbor to clear\n") |
| 4273 | |
| 4274 | DEFUN (clear_ip_bgp_peer_group, |
| 4275 | clear_ip_bgp_peer_group_cmd, |
| 4276 | "clear ip bgp peer-group WORD", |
| 4277 | CLEAR_STR |
| 4278 | IP_STR |
| 4279 | BGP_STR |
| 4280 | "Clear all members of peer-group\n" |
| 4281 | "BGP peer-group name\n") |
| 4282 | { |
| 4283 | return bgp_clear_vty (vty, NULL, 0, 0, clear_group, BGP_CLEAR_SOFT_NONE, argv[0]); |
| 4284 | } |
| 4285 | |
| 4286 | ALIAS (clear_ip_bgp_peer_group, |
| 4287 | clear_bgp_peer_group_cmd, |
| 4288 | "clear bgp peer-group WORD", |
| 4289 | CLEAR_STR |
| 4290 | BGP_STR |
| 4291 | "Clear all members of peer-group\n" |
| 4292 | "BGP peer-group name\n") |
| 4293 | |
| 4294 | ALIAS (clear_ip_bgp_peer_group, |
| 4295 | clear_bgp_ipv6_peer_group_cmd, |
| 4296 | "clear bgp ipv6 peer-group WORD", |
| 4297 | CLEAR_STR |
| 4298 | BGP_STR |
| 4299 | "Address family\n" |
| 4300 | "Clear all members of peer-group\n" |
| 4301 | "BGP peer-group name\n") |
| 4302 | |
| 4303 | DEFUN (clear_ip_bgp_external, |
| 4304 | clear_ip_bgp_external_cmd, |
| 4305 | "clear ip bgp external", |
| 4306 | CLEAR_STR |
| 4307 | IP_STR |
| 4308 | BGP_STR |
| 4309 | "Clear all external peers\n") |
| 4310 | { |
| 4311 | return bgp_clear_vty (vty, NULL, 0, 0, clear_external, BGP_CLEAR_SOFT_NONE, NULL); |
| 4312 | } |
| 4313 | |
| 4314 | ALIAS (clear_ip_bgp_external, |
| 4315 | clear_bgp_external_cmd, |
| 4316 | "clear bgp external", |
| 4317 | CLEAR_STR |
| 4318 | BGP_STR |
| 4319 | "Clear all external peers\n") |
| 4320 | |
| 4321 | ALIAS (clear_ip_bgp_external, |
| 4322 | clear_bgp_ipv6_external_cmd, |
| 4323 | "clear bgp ipv6 external", |
| 4324 | CLEAR_STR |
| 4325 | BGP_STR |
| 4326 | "Address family\n" |
| 4327 | "Clear all external peers\n") |
| 4328 | |
| 4329 | DEFUN (clear_ip_bgp_as, |
| 4330 | clear_ip_bgp_as_cmd, |
| 4331 | "clear ip bgp <1-65535>", |
| 4332 | CLEAR_STR |
| 4333 | IP_STR |
| 4334 | BGP_STR |
| 4335 | "Clear peers with the AS number\n") |
| 4336 | { |
| 4337 | return bgp_clear_vty (vty, NULL, 0, 0, clear_as, BGP_CLEAR_SOFT_NONE, argv[0]); |
| 4338 | } |
| 4339 | |
| 4340 | ALIAS (clear_ip_bgp_as, |
| 4341 | clear_bgp_as_cmd, |
| 4342 | "clear bgp <1-65535>", |
| 4343 | CLEAR_STR |
| 4344 | BGP_STR |
| 4345 | "Clear peers with the AS number\n") |
| 4346 | |
| 4347 | ALIAS (clear_ip_bgp_as, |
| 4348 | clear_bgp_ipv6_as_cmd, |
| 4349 | "clear bgp ipv6 <1-65535>", |
| 4350 | CLEAR_STR |
| 4351 | BGP_STR |
| 4352 | "Address family\n" |
| 4353 | "Clear peers with the AS number\n") |
| 4354 | |
| 4355 | /* Outbound soft-reconfiguration */ |
| 4356 | DEFUN (clear_ip_bgp_all_soft_out, |
| 4357 | clear_ip_bgp_all_soft_out_cmd, |
| 4358 | "clear ip bgp * soft out", |
| 4359 | CLEAR_STR |
| 4360 | IP_STR |
| 4361 | BGP_STR |
| 4362 | "Clear all peers\n" |
| 4363 | "Soft reconfig\n" |
| 4364 | "Soft reconfig outbound update\n") |
| 4365 | { |
| 4366 | if (argc == 1) |
| 4367 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 4368 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4369 | |
| 4370 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 4371 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4372 | } |
| 4373 | |
| 4374 | ALIAS (clear_ip_bgp_all_soft_out, |
| 4375 | clear_ip_bgp_all_out_cmd, |
| 4376 | "clear ip bgp * out", |
| 4377 | CLEAR_STR |
| 4378 | IP_STR |
| 4379 | BGP_STR |
| 4380 | "Clear all peers\n" |
| 4381 | "Soft reconfig outbound update\n") |
| 4382 | |
| 4383 | ALIAS (clear_ip_bgp_all_soft_out, |
| 4384 | clear_ip_bgp_instance_all_soft_out_cmd, |
| 4385 | "clear ip bgp view WORD * soft out", |
| 4386 | CLEAR_STR |
| 4387 | IP_STR |
| 4388 | BGP_STR |
| 4389 | "BGP view\n" |
| 4390 | "view name\n" |
| 4391 | "Clear all peers\n" |
| 4392 | "Soft reconfig\n" |
| 4393 | "Soft reconfig outbound update\n") |
| 4394 | |
| 4395 | DEFUN (clear_ip_bgp_all_ipv4_soft_out, |
| 4396 | clear_ip_bgp_all_ipv4_soft_out_cmd, |
| 4397 | "clear ip bgp * ipv4 (unicast|multicast) soft out", |
| 4398 | CLEAR_STR |
| 4399 | IP_STR |
| 4400 | BGP_STR |
| 4401 | "Clear all peers\n" |
| 4402 | "Address family\n" |
| 4403 | "Address Family modifier\n" |
| 4404 | "Address Family modifier\n" |
| 4405 | "Soft reconfig\n" |
| 4406 | "Soft reconfig outbound update\n") |
| 4407 | { |
| 4408 | if (strncmp (argv[0], "m", 1) == 0) |
| 4409 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all, |
| 4410 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4411 | |
| 4412 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 4413 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4414 | } |
| 4415 | |
| 4416 | ALIAS (clear_ip_bgp_all_ipv4_soft_out, |
| 4417 | clear_ip_bgp_all_ipv4_out_cmd, |
| 4418 | "clear ip bgp * ipv4 (unicast|multicast) out", |
| 4419 | CLEAR_STR |
| 4420 | IP_STR |
| 4421 | BGP_STR |
| 4422 | "Clear all peers\n" |
| 4423 | "Address family\n" |
| 4424 | "Address Family modifier\n" |
| 4425 | "Address Family modifier\n" |
| 4426 | "Soft reconfig outbound update\n") |
| 4427 | |
| 4428 | DEFUN (clear_ip_bgp_instance_all_ipv4_soft_out, |
| 4429 | clear_ip_bgp_instance_all_ipv4_soft_out_cmd, |
| 4430 | "clear ip bgp view WORD * ipv4 (unicast|multicast) soft out", |
| 4431 | CLEAR_STR |
| 4432 | IP_STR |
| 4433 | BGP_STR |
| 4434 | "BGP view\n" |
| 4435 | "view name\n" |
| 4436 | "Clear all peers\n" |
| 4437 | "Address family\n" |
| 4438 | "Address Family modifier\n" |
| 4439 | "Address Family modifier\n" |
| 4440 | "Soft reconfig outbound update\n") |
| 4441 | { |
| 4442 | if (strncmp (argv[1], "m", 1) == 0) |
| 4443 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST, clear_all, |
| 4444 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4445 | |
| 4446 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 4447 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4448 | } |
| 4449 | |
| 4450 | DEFUN (clear_ip_bgp_all_vpnv4_soft_out, |
| 4451 | clear_ip_bgp_all_vpnv4_soft_out_cmd, |
| 4452 | "clear ip bgp * vpnv4 unicast soft out", |
| 4453 | CLEAR_STR |
| 4454 | IP_STR |
| 4455 | BGP_STR |
| 4456 | "Clear all peers\n" |
| 4457 | "Address family\n" |
| 4458 | "Address Family Modifier\n" |
| 4459 | "Soft reconfig\n" |
| 4460 | "Soft reconfig outbound update\n") |
| 4461 | { |
| 4462 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_all, |
| 4463 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4464 | } |
| 4465 | |
| 4466 | ALIAS (clear_ip_bgp_all_vpnv4_soft_out, |
| 4467 | clear_ip_bgp_all_vpnv4_out_cmd, |
| 4468 | "clear ip bgp * vpnv4 unicast out", |
| 4469 | CLEAR_STR |
| 4470 | IP_STR |
| 4471 | BGP_STR |
| 4472 | "Clear all peers\n" |
| 4473 | "Address family\n" |
| 4474 | "Address Family Modifier\n" |
| 4475 | "Soft reconfig outbound update\n") |
| 4476 | |
| 4477 | DEFUN (clear_bgp_all_soft_out, |
| 4478 | clear_bgp_all_soft_out_cmd, |
| 4479 | "clear bgp * soft out", |
| 4480 | CLEAR_STR |
| 4481 | BGP_STR |
| 4482 | "Clear all peers\n" |
| 4483 | "Soft reconfig\n" |
| 4484 | "Soft reconfig outbound update\n") |
| 4485 | { |
| 4486 | if (argc == 1) |
| 4487 | return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_all, |
| 4488 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4489 | |
| 4490 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all, |
| 4491 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4492 | } |
| 4493 | |
| 4494 | ALIAS (clear_bgp_all_soft_out, |
| 4495 | clear_bgp_instance_all_soft_out_cmd, |
| 4496 | "clear bgp view WORD * soft out", |
| 4497 | CLEAR_STR |
| 4498 | BGP_STR |
| 4499 | "BGP view\n" |
| 4500 | "view name\n" |
| 4501 | "Clear all peers\n" |
| 4502 | "Soft reconfig\n" |
| 4503 | "Soft reconfig outbound update\n") |
| 4504 | |
| 4505 | ALIAS (clear_bgp_all_soft_out, |
| 4506 | clear_bgp_all_out_cmd, |
| 4507 | "clear bgp * out", |
| 4508 | CLEAR_STR |
| 4509 | BGP_STR |
| 4510 | "Clear all peers\n" |
| 4511 | "Soft reconfig outbound update\n") |
| 4512 | |
| 4513 | ALIAS (clear_bgp_all_soft_out, |
| 4514 | clear_bgp_ipv6_all_soft_out_cmd, |
| 4515 | "clear bgp ipv6 * soft out", |
| 4516 | CLEAR_STR |
| 4517 | BGP_STR |
| 4518 | "Address family\n" |
| 4519 | "Clear all peers\n" |
| 4520 | "Soft reconfig\n" |
| 4521 | "Soft reconfig outbound update\n") |
| 4522 | |
| 4523 | ALIAS (clear_bgp_all_soft_out, |
| 4524 | clear_bgp_ipv6_all_out_cmd, |
| 4525 | "clear bgp ipv6 * out", |
| 4526 | CLEAR_STR |
| 4527 | BGP_STR |
| 4528 | "Address family\n" |
| 4529 | "Clear all peers\n" |
| 4530 | "Soft reconfig outbound update\n") |
| 4531 | |
| 4532 | DEFUN (clear_ip_bgp_peer_soft_out, |
| 4533 | clear_ip_bgp_peer_soft_out_cmd, |
| 4534 | "clear ip bgp A.B.C.D soft out", |
| 4535 | CLEAR_STR |
| 4536 | IP_STR |
| 4537 | BGP_STR |
| 4538 | "BGP neighbor address to clear\n" |
| 4539 | "Soft reconfig\n" |
| 4540 | "Soft reconfig outbound update\n") |
| 4541 | { |
| 4542 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 4543 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 4544 | } |
| 4545 | |
| 4546 | ALIAS (clear_ip_bgp_peer_soft_out, |
| 4547 | clear_ip_bgp_peer_out_cmd, |
| 4548 | "clear ip bgp A.B.C.D out", |
| 4549 | CLEAR_STR |
| 4550 | IP_STR |
| 4551 | BGP_STR |
| 4552 | "BGP neighbor address to clear\n" |
| 4553 | "Soft reconfig outbound update\n") |
| 4554 | |
| 4555 | DEFUN (clear_ip_bgp_peer_ipv4_soft_out, |
| 4556 | clear_ip_bgp_peer_ipv4_soft_out_cmd, |
| 4557 | "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft out", |
| 4558 | CLEAR_STR |
| 4559 | IP_STR |
| 4560 | BGP_STR |
| 4561 | "BGP neighbor address to clear\n" |
| 4562 | "Address family\n" |
| 4563 | "Address Family modifier\n" |
| 4564 | "Address Family modifier\n" |
| 4565 | "Soft reconfig\n" |
| 4566 | "Soft reconfig outbound update\n") |
| 4567 | { |
| 4568 | if (strncmp (argv[1], "m", 1) == 0) |
| 4569 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer, |
| 4570 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 4571 | |
| 4572 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 4573 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 4574 | } |
| 4575 | |
| 4576 | ALIAS (clear_ip_bgp_peer_ipv4_soft_out, |
| 4577 | clear_ip_bgp_peer_ipv4_out_cmd, |
| 4578 | "clear ip bgp A.B.C.D ipv4 (unicast|multicast) out", |
| 4579 | CLEAR_STR |
| 4580 | IP_STR |
| 4581 | BGP_STR |
| 4582 | "BGP neighbor address to clear\n" |
| 4583 | "Address family\n" |
| 4584 | "Address Family modifier\n" |
| 4585 | "Address Family modifier\n" |
| 4586 | "Soft reconfig outbound update\n") |
| 4587 | |
| 4588 | DEFUN (clear_ip_bgp_peer_vpnv4_soft_out, |
| 4589 | clear_ip_bgp_peer_vpnv4_soft_out_cmd, |
| 4590 | "clear ip bgp A.B.C.D vpnv4 unicast soft out", |
| 4591 | CLEAR_STR |
| 4592 | IP_STR |
| 4593 | BGP_STR |
| 4594 | "BGP neighbor address to clear\n" |
| 4595 | "Address family\n" |
| 4596 | "Address Family Modifier\n" |
| 4597 | "Soft reconfig\n" |
| 4598 | "Soft reconfig outbound update\n") |
| 4599 | { |
| 4600 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_peer, |
| 4601 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 4602 | } |
| 4603 | |
| 4604 | ALIAS (clear_ip_bgp_peer_vpnv4_soft_out, |
| 4605 | clear_ip_bgp_peer_vpnv4_out_cmd, |
| 4606 | "clear ip bgp A.B.C.D vpnv4 unicast out", |
| 4607 | CLEAR_STR |
| 4608 | IP_STR |
| 4609 | BGP_STR |
| 4610 | "BGP neighbor address to clear\n" |
| 4611 | "Address family\n" |
| 4612 | "Address Family Modifier\n" |
| 4613 | "Soft reconfig outbound update\n") |
| 4614 | |
| 4615 | DEFUN (clear_bgp_peer_soft_out, |
| 4616 | clear_bgp_peer_soft_out_cmd, |
| 4617 | "clear bgp (A.B.C.D|X:X::X:X) soft out", |
| 4618 | CLEAR_STR |
| 4619 | BGP_STR |
| 4620 | "BGP neighbor address to clear\n" |
| 4621 | "BGP IPv6 neighbor to clear\n" |
| 4622 | "Soft reconfig\n" |
| 4623 | "Soft reconfig outbound update\n") |
| 4624 | { |
| 4625 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer, |
| 4626 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 4627 | } |
| 4628 | |
| 4629 | ALIAS (clear_bgp_peer_soft_out, |
| 4630 | clear_bgp_ipv6_peer_soft_out_cmd, |
| 4631 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft out", |
| 4632 | CLEAR_STR |
| 4633 | BGP_STR |
| 4634 | "Address family\n" |
| 4635 | "BGP neighbor address to clear\n" |
| 4636 | "BGP IPv6 neighbor to clear\n" |
| 4637 | "Soft reconfig\n" |
| 4638 | "Soft reconfig outbound update\n") |
| 4639 | |
| 4640 | ALIAS (clear_bgp_peer_soft_out, |
| 4641 | clear_bgp_peer_out_cmd, |
| 4642 | "clear bgp (A.B.C.D|X:X::X:X) out", |
| 4643 | CLEAR_STR |
| 4644 | BGP_STR |
| 4645 | "BGP neighbor address to clear\n" |
| 4646 | "BGP IPv6 neighbor to clear\n" |
| 4647 | "Soft reconfig outbound update\n") |
| 4648 | |
| 4649 | ALIAS (clear_bgp_peer_soft_out, |
| 4650 | clear_bgp_ipv6_peer_out_cmd, |
| 4651 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) out", |
| 4652 | CLEAR_STR |
| 4653 | BGP_STR |
| 4654 | "Address family\n" |
| 4655 | "BGP neighbor address to clear\n" |
| 4656 | "BGP IPv6 neighbor to clear\n" |
| 4657 | "Soft reconfig outbound update\n") |
| 4658 | |
| 4659 | DEFUN (clear_ip_bgp_peer_group_soft_out, |
| 4660 | clear_ip_bgp_peer_group_soft_out_cmd, |
| 4661 | "clear ip bgp peer-group WORD soft out", |
| 4662 | CLEAR_STR |
| 4663 | IP_STR |
| 4664 | BGP_STR |
| 4665 | "Clear all members of peer-group\n" |
| 4666 | "BGP peer-group name\n" |
| 4667 | "Soft reconfig\n" |
| 4668 | "Soft reconfig outbound update\n") |
| 4669 | { |
| 4670 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 4671 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 4672 | } |
| 4673 | |
| 4674 | ALIAS (clear_ip_bgp_peer_group_soft_out, |
| 4675 | clear_ip_bgp_peer_group_out_cmd, |
| 4676 | "clear ip bgp peer-group WORD out", |
| 4677 | CLEAR_STR |
| 4678 | IP_STR |
| 4679 | BGP_STR |
| 4680 | "Clear all members of peer-group\n" |
| 4681 | "BGP peer-group name\n" |
| 4682 | "Soft reconfig outbound update\n") |
| 4683 | |
| 4684 | DEFUN (clear_ip_bgp_peer_group_ipv4_soft_out, |
| 4685 | clear_ip_bgp_peer_group_ipv4_soft_out_cmd, |
| 4686 | "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft out", |
| 4687 | CLEAR_STR |
| 4688 | IP_STR |
| 4689 | BGP_STR |
| 4690 | "Clear all members of peer-group\n" |
| 4691 | "BGP peer-group name\n" |
| 4692 | "Address family\n" |
| 4693 | "Address Family modifier\n" |
| 4694 | "Address Family modifier\n" |
| 4695 | "Soft reconfig\n" |
| 4696 | "Soft reconfig outbound update\n") |
| 4697 | { |
| 4698 | if (strncmp (argv[1], "m", 1) == 0) |
| 4699 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group, |
| 4700 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 4701 | |
| 4702 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 4703 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 4704 | } |
| 4705 | |
| 4706 | ALIAS (clear_ip_bgp_peer_group_ipv4_soft_out, |
| 4707 | clear_ip_bgp_peer_group_ipv4_out_cmd, |
| 4708 | "clear ip bgp peer-group WORD ipv4 (unicast|multicast) out", |
| 4709 | CLEAR_STR |
| 4710 | IP_STR |
| 4711 | BGP_STR |
| 4712 | "Clear all members of peer-group\n" |
| 4713 | "BGP peer-group name\n" |
| 4714 | "Address family\n" |
| 4715 | "Address Family modifier\n" |
| 4716 | "Address Family modifier\n" |
| 4717 | "Soft reconfig outbound update\n") |
| 4718 | |
| 4719 | DEFUN (clear_bgp_peer_group_soft_out, |
| 4720 | clear_bgp_peer_group_soft_out_cmd, |
| 4721 | "clear bgp peer-group WORD soft out", |
| 4722 | CLEAR_STR |
| 4723 | BGP_STR |
| 4724 | "Clear all members of peer-group\n" |
| 4725 | "BGP peer-group name\n" |
| 4726 | "Soft reconfig\n" |
| 4727 | "Soft reconfig outbound update\n") |
| 4728 | { |
| 4729 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_group, |
| 4730 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 4731 | } |
| 4732 | |
| 4733 | ALIAS (clear_bgp_peer_group_soft_out, |
| 4734 | clear_bgp_ipv6_peer_group_soft_out_cmd, |
| 4735 | "clear bgp ipv6 peer-group WORD soft out", |
| 4736 | CLEAR_STR |
| 4737 | BGP_STR |
| 4738 | "Address family\n" |
| 4739 | "Clear all members of peer-group\n" |
| 4740 | "BGP peer-group name\n" |
| 4741 | "Soft reconfig\n" |
| 4742 | "Soft reconfig outbound update\n") |
| 4743 | |
| 4744 | ALIAS (clear_bgp_peer_group_soft_out, |
| 4745 | clear_bgp_peer_group_out_cmd, |
| 4746 | "clear bgp peer-group WORD out", |
| 4747 | CLEAR_STR |
| 4748 | BGP_STR |
| 4749 | "Clear all members of peer-group\n" |
| 4750 | "BGP peer-group name\n" |
| 4751 | "Soft reconfig outbound update\n") |
| 4752 | |
| 4753 | ALIAS (clear_bgp_peer_group_soft_out, |
| 4754 | clear_bgp_ipv6_peer_group_out_cmd, |
| 4755 | "clear bgp ipv6 peer-group WORD out", |
| 4756 | CLEAR_STR |
| 4757 | BGP_STR |
| 4758 | "Address family\n" |
| 4759 | "Clear all members of peer-group\n" |
| 4760 | "BGP peer-group name\n" |
| 4761 | "Soft reconfig outbound update\n") |
| 4762 | |
| 4763 | DEFUN (clear_ip_bgp_external_soft_out, |
| 4764 | clear_ip_bgp_external_soft_out_cmd, |
| 4765 | "clear ip bgp external soft out", |
| 4766 | CLEAR_STR |
| 4767 | IP_STR |
| 4768 | BGP_STR |
| 4769 | "Clear all external peers\n" |
| 4770 | "Soft reconfig\n" |
| 4771 | "Soft reconfig outbound update\n") |
| 4772 | { |
| 4773 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 4774 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4775 | } |
| 4776 | |
| 4777 | ALIAS (clear_ip_bgp_external_soft_out, |
| 4778 | clear_ip_bgp_external_out_cmd, |
| 4779 | "clear ip bgp external out", |
| 4780 | CLEAR_STR |
| 4781 | IP_STR |
| 4782 | BGP_STR |
| 4783 | "Clear all external peers\n" |
| 4784 | "Soft reconfig outbound update\n") |
| 4785 | |
| 4786 | DEFUN (clear_ip_bgp_external_ipv4_soft_out, |
| 4787 | clear_ip_bgp_external_ipv4_soft_out_cmd, |
| 4788 | "clear ip bgp external ipv4 (unicast|multicast) soft out", |
| 4789 | CLEAR_STR |
| 4790 | IP_STR |
| 4791 | BGP_STR |
| 4792 | "Clear all external peers\n" |
| 4793 | "Address family\n" |
| 4794 | "Address Family modifier\n" |
| 4795 | "Address Family modifier\n" |
| 4796 | "Soft reconfig\n" |
| 4797 | "Soft reconfig outbound update\n") |
| 4798 | { |
| 4799 | if (strncmp (argv[0], "m", 1) == 0) |
| 4800 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external, |
| 4801 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4802 | |
| 4803 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 4804 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4805 | } |
| 4806 | |
| 4807 | ALIAS (clear_ip_bgp_external_ipv4_soft_out, |
| 4808 | clear_ip_bgp_external_ipv4_out_cmd, |
| 4809 | "clear ip bgp external ipv4 (unicast|multicast) out", |
| 4810 | CLEAR_STR |
| 4811 | IP_STR |
| 4812 | BGP_STR |
| 4813 | "Clear all external peers\n" |
| 4814 | "Address family\n" |
| 4815 | "Address Family modifier\n" |
| 4816 | "Address Family modifier\n" |
| 4817 | "Soft reconfig outbound update\n") |
| 4818 | |
| 4819 | DEFUN (clear_bgp_external_soft_out, |
| 4820 | clear_bgp_external_soft_out_cmd, |
| 4821 | "clear bgp external soft out", |
| 4822 | CLEAR_STR |
| 4823 | BGP_STR |
| 4824 | "Clear all external peers\n" |
| 4825 | "Soft reconfig\n" |
| 4826 | "Soft reconfig outbound update\n") |
| 4827 | { |
| 4828 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_external, |
| 4829 | BGP_CLEAR_SOFT_OUT, NULL); |
| 4830 | } |
| 4831 | |
| 4832 | ALIAS (clear_bgp_external_soft_out, |
| 4833 | clear_bgp_ipv6_external_soft_out_cmd, |
| 4834 | "clear bgp ipv6 external soft out", |
| 4835 | CLEAR_STR |
| 4836 | BGP_STR |
| 4837 | "Address family\n" |
| 4838 | "Clear all external peers\n" |
| 4839 | "Soft reconfig\n" |
| 4840 | "Soft reconfig outbound update\n") |
| 4841 | |
| 4842 | ALIAS (clear_bgp_external_soft_out, |
| 4843 | clear_bgp_external_out_cmd, |
| 4844 | "clear bgp external out", |
| 4845 | CLEAR_STR |
| 4846 | BGP_STR |
| 4847 | "Clear all external peers\n" |
| 4848 | "Soft reconfig outbound update\n") |
| 4849 | |
| 4850 | ALIAS (clear_bgp_external_soft_out, |
| 4851 | clear_bgp_ipv6_external_out_cmd, |
| 4852 | "clear bgp ipv6 external WORD out", |
| 4853 | CLEAR_STR |
| 4854 | BGP_STR |
| 4855 | "Address family\n" |
| 4856 | "Clear all external peers\n" |
| 4857 | "Soft reconfig outbound update\n") |
| 4858 | |
| 4859 | DEFUN (clear_ip_bgp_as_soft_out, |
| 4860 | clear_ip_bgp_as_soft_out_cmd, |
| 4861 | "clear ip bgp <1-65535> soft out", |
| 4862 | CLEAR_STR |
| 4863 | IP_STR |
| 4864 | BGP_STR |
| 4865 | "Clear peers with the AS number\n" |
| 4866 | "Soft reconfig\n" |
| 4867 | "Soft reconfig outbound update\n") |
| 4868 | { |
| 4869 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 4870 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 4871 | } |
| 4872 | |
| 4873 | ALIAS (clear_ip_bgp_as_soft_out, |
| 4874 | clear_ip_bgp_as_out_cmd, |
| 4875 | "clear ip bgp <1-65535> out", |
| 4876 | CLEAR_STR |
| 4877 | IP_STR |
| 4878 | BGP_STR |
| 4879 | "Clear peers with the AS number\n" |
| 4880 | "Soft reconfig outbound update\n") |
| 4881 | |
| 4882 | DEFUN (clear_ip_bgp_as_ipv4_soft_out, |
| 4883 | clear_ip_bgp_as_ipv4_soft_out_cmd, |
| 4884 | "clear ip bgp <1-65535> ipv4 (unicast|multicast) soft out", |
| 4885 | CLEAR_STR |
| 4886 | IP_STR |
| 4887 | BGP_STR |
| 4888 | "Clear peers with the AS number\n" |
| 4889 | "Address family\n" |
| 4890 | "Address Family modifier\n" |
| 4891 | "Address Family modifier\n" |
| 4892 | "Soft reconfig\n" |
| 4893 | "Soft reconfig outbound update\n") |
| 4894 | { |
| 4895 | if (strncmp (argv[1], "m", 1) == 0) |
| 4896 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as, |
| 4897 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 4898 | |
| 4899 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 4900 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 4901 | } |
| 4902 | |
| 4903 | ALIAS (clear_ip_bgp_as_ipv4_soft_out, |
| 4904 | clear_ip_bgp_as_ipv4_out_cmd, |
| 4905 | "clear ip bgp <1-65535> ipv4 (unicast|multicast) out", |
| 4906 | CLEAR_STR |
| 4907 | IP_STR |
| 4908 | BGP_STR |
| 4909 | "Clear peers with the AS number\n" |
| 4910 | "Address family\n" |
| 4911 | "Address Family modifier\n" |
| 4912 | "Address Family modifier\n" |
| 4913 | "Soft reconfig outbound update\n") |
| 4914 | |
| 4915 | DEFUN (clear_ip_bgp_as_vpnv4_soft_out, |
| 4916 | clear_ip_bgp_as_vpnv4_soft_out_cmd, |
| 4917 | "clear ip bgp <1-65535> vpnv4 unicast soft out", |
| 4918 | CLEAR_STR |
| 4919 | IP_STR |
| 4920 | BGP_STR |
| 4921 | "Clear peers with the AS number\n" |
| 4922 | "Address family\n" |
| 4923 | "Address Family modifier\n" |
| 4924 | "Soft reconfig\n" |
| 4925 | "Soft reconfig outbound update\n") |
| 4926 | { |
| 4927 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_as, |
| 4928 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 4929 | } |
| 4930 | |
| 4931 | ALIAS (clear_ip_bgp_as_vpnv4_soft_out, |
| 4932 | clear_ip_bgp_as_vpnv4_out_cmd, |
| 4933 | "clear ip bgp <1-65535> vpnv4 unicast out", |
| 4934 | CLEAR_STR |
| 4935 | IP_STR |
| 4936 | BGP_STR |
| 4937 | "Clear peers with the AS number\n" |
| 4938 | "Address family\n" |
| 4939 | "Address Family modifier\n" |
| 4940 | "Soft reconfig outbound update\n") |
| 4941 | |
| 4942 | DEFUN (clear_bgp_as_soft_out, |
| 4943 | clear_bgp_as_soft_out_cmd, |
| 4944 | "clear bgp <1-65535> soft out", |
| 4945 | CLEAR_STR |
| 4946 | BGP_STR |
| 4947 | "Clear peers with the AS number\n" |
| 4948 | "Soft reconfig\n" |
| 4949 | "Soft reconfig outbound update\n") |
| 4950 | { |
| 4951 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_as, |
| 4952 | BGP_CLEAR_SOFT_OUT, argv[0]); |
| 4953 | } |
| 4954 | |
| 4955 | ALIAS (clear_bgp_as_soft_out, |
| 4956 | clear_bgp_ipv6_as_soft_out_cmd, |
| 4957 | "clear bgp ipv6 <1-65535> soft out", |
| 4958 | CLEAR_STR |
| 4959 | BGP_STR |
| 4960 | "Address family\n" |
| 4961 | "Clear peers with the AS number\n" |
| 4962 | "Soft reconfig\n" |
| 4963 | "Soft reconfig outbound update\n") |
| 4964 | |
| 4965 | ALIAS (clear_bgp_as_soft_out, |
| 4966 | clear_bgp_as_out_cmd, |
| 4967 | "clear bgp <1-65535> out", |
| 4968 | CLEAR_STR |
| 4969 | BGP_STR |
| 4970 | "Clear peers with the AS number\n" |
| 4971 | "Soft reconfig outbound update\n") |
| 4972 | |
| 4973 | ALIAS (clear_bgp_as_soft_out, |
| 4974 | clear_bgp_ipv6_as_out_cmd, |
| 4975 | "clear bgp ipv6 <1-65535> out", |
| 4976 | CLEAR_STR |
| 4977 | BGP_STR |
| 4978 | "Address family\n" |
| 4979 | "Clear peers with the AS number\n" |
| 4980 | "Soft reconfig outbound update\n") |
| 4981 | |
| 4982 | /* Inbound soft-reconfiguration */ |
| 4983 | DEFUN (clear_ip_bgp_all_soft_in, |
| 4984 | clear_ip_bgp_all_soft_in_cmd, |
| 4985 | "clear ip bgp * soft in", |
| 4986 | CLEAR_STR |
| 4987 | IP_STR |
| 4988 | BGP_STR |
| 4989 | "Clear all peers\n" |
| 4990 | "Soft reconfig\n" |
| 4991 | "Soft reconfig inbound update\n") |
| 4992 | { |
| 4993 | if (argc == 1) |
| 4994 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 4995 | BGP_CLEAR_SOFT_IN, NULL); |
| 4996 | |
| 4997 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 4998 | BGP_CLEAR_SOFT_IN, NULL); |
| 4999 | } |
| 5000 | |
| 5001 | ALIAS (clear_ip_bgp_all_soft_in, |
| 5002 | clear_ip_bgp_instance_all_soft_in_cmd, |
| 5003 | "clear ip bgp view WORD * soft in", |
| 5004 | CLEAR_STR |
| 5005 | IP_STR |
| 5006 | BGP_STR |
| 5007 | "BGP view\n" |
| 5008 | "view name\n" |
| 5009 | "Clear all peers\n" |
| 5010 | "Soft reconfig\n" |
| 5011 | "Soft reconfig inbound update\n") |
| 5012 | |
| 5013 | ALIAS (clear_ip_bgp_all_soft_in, |
| 5014 | clear_ip_bgp_all_in_cmd, |
| 5015 | "clear ip bgp * in", |
| 5016 | CLEAR_STR |
| 5017 | IP_STR |
| 5018 | BGP_STR |
| 5019 | "Clear all peers\n" |
| 5020 | "Soft reconfig inbound update\n") |
| 5021 | |
| 5022 | DEFUN (clear_ip_bgp_all_in_prefix_filter, |
| 5023 | clear_ip_bgp_all_in_prefix_filter_cmd, |
| 5024 | "clear ip bgp * in prefix-filter", |
| 5025 | CLEAR_STR |
| 5026 | IP_STR |
| 5027 | BGP_STR |
| 5028 | "Clear all peers\n" |
| 5029 | "Soft reconfig inbound update\n" |
| 5030 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5031 | { |
| 5032 | if (argc== 1) |
| 5033 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 5034 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5035 | |
| 5036 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 5037 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5038 | } |
| 5039 | |
| 5040 | ALIAS (clear_ip_bgp_all_in_prefix_filter, |
| 5041 | clear_ip_bgp_instance_all_in_prefix_filter_cmd, |
| 5042 | "clear ip bgp view WORD * in prefix-filter", |
| 5043 | CLEAR_STR |
| 5044 | IP_STR |
| 5045 | BGP_STR |
| 5046 | "BGP view\n" |
| 5047 | "view name\n" |
| 5048 | "Clear all peers\n" |
| 5049 | "Soft reconfig inbound update\n" |
| 5050 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5051 | |
| 5052 | |
| 5053 | DEFUN (clear_ip_bgp_all_ipv4_soft_in, |
| 5054 | clear_ip_bgp_all_ipv4_soft_in_cmd, |
| 5055 | "clear ip bgp * ipv4 (unicast|multicast) soft in", |
| 5056 | CLEAR_STR |
| 5057 | IP_STR |
| 5058 | BGP_STR |
| 5059 | "Clear all peers\n" |
| 5060 | "Address family\n" |
| 5061 | "Address Family modifier\n" |
| 5062 | "Address Family modifier\n" |
| 5063 | "Soft reconfig\n" |
| 5064 | "Soft reconfig inbound update\n") |
| 5065 | { |
| 5066 | if (strncmp (argv[0], "m", 1) == 0) |
| 5067 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all, |
| 5068 | BGP_CLEAR_SOFT_IN, NULL); |
| 5069 | |
| 5070 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 5071 | BGP_CLEAR_SOFT_IN, NULL); |
| 5072 | } |
| 5073 | |
| 5074 | ALIAS (clear_ip_bgp_all_ipv4_soft_in, |
| 5075 | clear_ip_bgp_all_ipv4_in_cmd, |
| 5076 | "clear ip bgp * ipv4 (unicast|multicast) in", |
| 5077 | CLEAR_STR |
| 5078 | IP_STR |
| 5079 | BGP_STR |
| 5080 | "Clear all peers\n" |
| 5081 | "Address family\n" |
| 5082 | "Address Family modifier\n" |
| 5083 | "Address Family modifier\n" |
| 5084 | "Soft reconfig inbound update\n") |
| 5085 | |
| 5086 | DEFUN (clear_ip_bgp_instance_all_ipv4_soft_in, |
| 5087 | clear_ip_bgp_instance_all_ipv4_soft_in_cmd, |
| 5088 | "clear ip bgp view WORD * ipv4 (unicast|multicast) soft in", |
| 5089 | CLEAR_STR |
| 5090 | IP_STR |
| 5091 | BGP_STR |
| 5092 | "BGP view\n" |
| 5093 | "view name\n" |
| 5094 | "Clear all peers\n" |
| 5095 | "Address family\n" |
| 5096 | "Address Family modifier\n" |
| 5097 | "Address Family modifier\n" |
| 5098 | "Soft reconfig\n" |
| 5099 | "Soft reconfig inbound update\n") |
| 5100 | { |
| 5101 | if (strncmp (argv[1], "m", 1) == 0) |
| 5102 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST, clear_all, |
| 5103 | BGP_CLEAR_SOFT_IN, NULL); |
| 5104 | |
| 5105 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 5106 | BGP_CLEAR_SOFT_IN, NULL); |
| 5107 | } |
| 5108 | |
| 5109 | DEFUN (clear_ip_bgp_all_ipv4_in_prefix_filter, |
| 5110 | clear_ip_bgp_all_ipv4_in_prefix_filter_cmd, |
| 5111 | "clear ip bgp * ipv4 (unicast|multicast) in prefix-filter", |
| 5112 | CLEAR_STR |
| 5113 | IP_STR |
| 5114 | BGP_STR |
| 5115 | "Clear all peers\n" |
| 5116 | "Address family\n" |
| 5117 | "Address Family modifier\n" |
| 5118 | "Address Family modifier\n" |
| 5119 | "Soft reconfig inbound update\n" |
| 5120 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5121 | { |
| 5122 | if (strncmp (argv[0], "m", 1) == 0) |
| 5123 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all, |
| 5124 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5125 | |
| 5126 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 5127 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5128 | } |
| 5129 | |
| 5130 | DEFUN (clear_ip_bgp_instance_all_ipv4_in_prefix_filter, |
| 5131 | clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd, |
| 5132 | "clear ip bgp view WORD * ipv4 (unicast|multicast) in prefix-filter", |
| 5133 | CLEAR_STR |
| 5134 | IP_STR |
| 5135 | BGP_STR |
| 5136 | "Clear all peers\n" |
| 5137 | "Address family\n" |
| 5138 | "Address Family modifier\n" |
| 5139 | "Address Family modifier\n" |
| 5140 | "Soft reconfig inbound update\n" |
| 5141 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5142 | { |
| 5143 | if (strncmp (argv[1], "m", 1) == 0) |
| 5144 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST, clear_all, |
| 5145 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5146 | |
| 5147 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 5148 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5149 | } |
| 5150 | |
| 5151 | DEFUN (clear_ip_bgp_all_vpnv4_soft_in, |
| 5152 | clear_ip_bgp_all_vpnv4_soft_in_cmd, |
| 5153 | "clear ip bgp * vpnv4 unicast soft in", |
| 5154 | CLEAR_STR |
| 5155 | IP_STR |
| 5156 | BGP_STR |
| 5157 | "Clear all peers\n" |
| 5158 | "Address family\n" |
| 5159 | "Address Family Modifier\n" |
| 5160 | "Soft reconfig\n" |
| 5161 | "Soft reconfig inbound update\n") |
| 5162 | { |
| 5163 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_all, |
| 5164 | BGP_CLEAR_SOFT_IN, NULL); |
| 5165 | } |
| 5166 | |
| 5167 | ALIAS (clear_ip_bgp_all_vpnv4_soft_in, |
| 5168 | clear_ip_bgp_all_vpnv4_in_cmd, |
| 5169 | "clear ip bgp * vpnv4 unicast in", |
| 5170 | CLEAR_STR |
| 5171 | IP_STR |
| 5172 | BGP_STR |
| 5173 | "Clear all peers\n" |
| 5174 | "Address family\n" |
| 5175 | "Address Family Modifier\n" |
| 5176 | "Soft reconfig inbound update\n") |
| 5177 | |
| 5178 | DEFUN (clear_bgp_all_soft_in, |
| 5179 | clear_bgp_all_soft_in_cmd, |
| 5180 | "clear bgp * soft in", |
| 5181 | CLEAR_STR |
| 5182 | BGP_STR |
| 5183 | "Clear all peers\n" |
| 5184 | "Soft reconfig\n" |
| 5185 | "Soft reconfig inbound update\n") |
| 5186 | { |
| 5187 | if (argc == 1) |
| 5188 | return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_all, |
| 5189 | BGP_CLEAR_SOFT_IN, NULL); |
| 5190 | |
| 5191 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all, |
| 5192 | BGP_CLEAR_SOFT_IN, NULL); |
| 5193 | } |
| 5194 | |
| 5195 | ALIAS (clear_bgp_all_soft_in, |
| 5196 | clear_bgp_instance_all_soft_in_cmd, |
| 5197 | "clear bgp view WORD * soft in", |
| 5198 | CLEAR_STR |
| 5199 | BGP_STR |
| 5200 | "BGP view\n" |
| 5201 | "view name\n" |
| 5202 | "Clear all peers\n" |
| 5203 | "Soft reconfig\n" |
| 5204 | "Soft reconfig inbound update\n") |
| 5205 | |
| 5206 | ALIAS (clear_bgp_all_soft_in, |
| 5207 | clear_bgp_ipv6_all_soft_in_cmd, |
| 5208 | "clear bgp ipv6 * soft in", |
| 5209 | CLEAR_STR |
| 5210 | BGP_STR |
| 5211 | "Address family\n" |
| 5212 | "Clear all peers\n" |
| 5213 | "Soft reconfig\n" |
| 5214 | "Soft reconfig inbound update\n") |
| 5215 | |
| 5216 | ALIAS (clear_bgp_all_soft_in, |
| 5217 | clear_bgp_all_in_cmd, |
| 5218 | "clear bgp * in", |
| 5219 | CLEAR_STR |
| 5220 | BGP_STR |
| 5221 | "Clear all peers\n" |
| 5222 | "Soft reconfig inbound update\n") |
| 5223 | |
| 5224 | ALIAS (clear_bgp_all_soft_in, |
| 5225 | clear_bgp_ipv6_all_in_cmd, |
| 5226 | "clear bgp ipv6 * in", |
| 5227 | CLEAR_STR |
| 5228 | BGP_STR |
| 5229 | "Address family\n" |
| 5230 | "Clear all peers\n" |
| 5231 | "Soft reconfig inbound update\n") |
| 5232 | |
| 5233 | DEFUN (clear_bgp_all_in_prefix_filter, |
| 5234 | clear_bgp_all_in_prefix_filter_cmd, |
| 5235 | "clear bgp * in prefix-filter", |
| 5236 | CLEAR_STR |
| 5237 | BGP_STR |
| 5238 | "Clear all peers\n" |
| 5239 | "Soft reconfig inbound update\n" |
| 5240 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5241 | { |
| 5242 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all, |
| 5243 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5244 | } |
| 5245 | |
| 5246 | ALIAS (clear_bgp_all_in_prefix_filter, |
| 5247 | clear_bgp_ipv6_all_in_prefix_filter_cmd, |
| 5248 | "clear bgp ipv6 * in prefix-filter", |
| 5249 | CLEAR_STR |
| 5250 | BGP_STR |
| 5251 | "Address family\n" |
| 5252 | "Clear all peers\n" |
| 5253 | "Soft reconfig inbound update\n" |
| 5254 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5255 | |
| 5256 | DEFUN (clear_ip_bgp_peer_soft_in, |
| 5257 | clear_ip_bgp_peer_soft_in_cmd, |
| 5258 | "clear ip bgp A.B.C.D soft in", |
| 5259 | CLEAR_STR |
| 5260 | IP_STR |
| 5261 | BGP_STR |
| 5262 | "BGP neighbor address to clear\n" |
| 5263 | "Soft reconfig\n" |
| 5264 | "Soft reconfig inbound update\n") |
| 5265 | { |
| 5266 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 5267 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5268 | } |
| 5269 | |
| 5270 | ALIAS (clear_ip_bgp_peer_soft_in, |
| 5271 | clear_ip_bgp_peer_in_cmd, |
| 5272 | "clear ip bgp A.B.C.D in", |
| 5273 | CLEAR_STR |
| 5274 | IP_STR |
| 5275 | BGP_STR |
| 5276 | "BGP neighbor address to clear\n" |
| 5277 | "Soft reconfig inbound update\n") |
| 5278 | |
| 5279 | DEFUN (clear_ip_bgp_peer_in_prefix_filter, |
| 5280 | clear_ip_bgp_peer_in_prefix_filter_cmd, |
| 5281 | "clear ip bgp A.B.C.D in prefix-filter", |
| 5282 | CLEAR_STR |
| 5283 | IP_STR |
| 5284 | BGP_STR |
| 5285 | "BGP neighbor address to clear\n" |
| 5286 | "Soft reconfig inbound update\n" |
| 5287 | "Push out the existing ORF prefix-list\n") |
| 5288 | { |
| 5289 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 5290 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 5291 | } |
| 5292 | |
| 5293 | DEFUN (clear_ip_bgp_peer_ipv4_soft_in, |
| 5294 | clear_ip_bgp_peer_ipv4_soft_in_cmd, |
| 5295 | "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft in", |
| 5296 | CLEAR_STR |
| 5297 | IP_STR |
| 5298 | BGP_STR |
| 5299 | "BGP neighbor address to clear\n" |
| 5300 | "Address family\n" |
| 5301 | "Address Family modifier\n" |
| 5302 | "Address Family modifier\n" |
| 5303 | "Soft reconfig\n" |
| 5304 | "Soft reconfig inbound update\n") |
| 5305 | { |
| 5306 | if (strncmp (argv[1], "m", 1) == 0) |
| 5307 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer, |
| 5308 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5309 | |
| 5310 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 5311 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5312 | } |
| 5313 | |
| 5314 | ALIAS (clear_ip_bgp_peer_ipv4_soft_in, |
| 5315 | clear_ip_bgp_peer_ipv4_in_cmd, |
| 5316 | "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in", |
| 5317 | CLEAR_STR |
| 5318 | IP_STR |
| 5319 | BGP_STR |
| 5320 | "BGP neighbor address to clear\n" |
| 5321 | "Address family\n" |
| 5322 | "Address Family modifier\n" |
| 5323 | "Address Family modifier\n" |
| 5324 | "Soft reconfig inbound update\n") |
| 5325 | |
| 5326 | DEFUN (clear_ip_bgp_peer_ipv4_in_prefix_filter, |
| 5327 | clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd, |
| 5328 | "clear ip bgp A.B.C.D ipv4 (unicast|multicast) in prefix-filter", |
| 5329 | CLEAR_STR |
| 5330 | IP_STR |
| 5331 | BGP_STR |
| 5332 | "BGP neighbor address to clear\n" |
| 5333 | "Address family\n" |
| 5334 | "Address Family modifier\n" |
| 5335 | "Address Family modifier\n" |
| 5336 | "Soft reconfig inbound update\n" |
| 5337 | "Push out the existing ORF prefix-list\n") |
| 5338 | { |
| 5339 | if (strncmp (argv[1], "m", 1) == 0) |
| 5340 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer, |
| 5341 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 5342 | |
| 5343 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 5344 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 5345 | } |
| 5346 | |
| 5347 | DEFUN (clear_ip_bgp_peer_vpnv4_soft_in, |
| 5348 | clear_ip_bgp_peer_vpnv4_soft_in_cmd, |
| 5349 | "clear ip bgp A.B.C.D vpnv4 unicast soft in", |
| 5350 | CLEAR_STR |
| 5351 | IP_STR |
| 5352 | BGP_STR |
| 5353 | "BGP neighbor address to clear\n" |
| 5354 | "Address family\n" |
| 5355 | "Address Family Modifier\n" |
| 5356 | "Soft reconfig\n" |
| 5357 | "Soft reconfig inbound update\n") |
| 5358 | { |
| 5359 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_peer, |
| 5360 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5361 | } |
| 5362 | |
| 5363 | ALIAS (clear_ip_bgp_peer_vpnv4_soft_in, |
| 5364 | clear_ip_bgp_peer_vpnv4_in_cmd, |
| 5365 | "clear ip bgp A.B.C.D vpnv4 unicast in", |
| 5366 | CLEAR_STR |
| 5367 | IP_STR |
| 5368 | BGP_STR |
| 5369 | "BGP neighbor address to clear\n" |
| 5370 | "Address family\n" |
| 5371 | "Address Family Modifier\n" |
| 5372 | "Soft reconfig inbound update\n") |
| 5373 | |
| 5374 | DEFUN (clear_bgp_peer_soft_in, |
| 5375 | clear_bgp_peer_soft_in_cmd, |
| 5376 | "clear bgp (A.B.C.D|X:X::X:X) soft in", |
| 5377 | CLEAR_STR |
| 5378 | BGP_STR |
| 5379 | "BGP neighbor address to clear\n" |
| 5380 | "BGP IPv6 neighbor to clear\n" |
| 5381 | "Soft reconfig\n" |
| 5382 | "Soft reconfig inbound update\n") |
| 5383 | { |
| 5384 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer, |
| 5385 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5386 | } |
| 5387 | |
| 5388 | ALIAS (clear_bgp_peer_soft_in, |
| 5389 | clear_bgp_ipv6_peer_soft_in_cmd, |
| 5390 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft in", |
| 5391 | CLEAR_STR |
| 5392 | BGP_STR |
| 5393 | "Address family\n" |
| 5394 | "BGP neighbor address to clear\n" |
| 5395 | "BGP IPv6 neighbor to clear\n" |
| 5396 | "Soft reconfig\n" |
| 5397 | "Soft reconfig inbound update\n") |
| 5398 | |
| 5399 | ALIAS (clear_bgp_peer_soft_in, |
| 5400 | clear_bgp_peer_in_cmd, |
| 5401 | "clear bgp (A.B.C.D|X:X::X:X) in", |
| 5402 | CLEAR_STR |
| 5403 | BGP_STR |
| 5404 | "BGP neighbor address to clear\n" |
| 5405 | "BGP IPv6 neighbor to clear\n" |
| 5406 | "Soft reconfig inbound update\n") |
| 5407 | |
| 5408 | ALIAS (clear_bgp_peer_soft_in, |
| 5409 | clear_bgp_ipv6_peer_in_cmd, |
| 5410 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) in", |
| 5411 | CLEAR_STR |
| 5412 | BGP_STR |
| 5413 | "Address family\n" |
| 5414 | "BGP neighbor address to clear\n" |
| 5415 | "BGP IPv6 neighbor to clear\n" |
| 5416 | "Soft reconfig inbound update\n") |
| 5417 | |
| 5418 | DEFUN (clear_bgp_peer_in_prefix_filter, |
| 5419 | clear_bgp_peer_in_prefix_filter_cmd, |
| 5420 | "clear bgp (A.B.C.D|X:X::X:X) in prefix-filter", |
| 5421 | CLEAR_STR |
| 5422 | BGP_STR |
| 5423 | "BGP neighbor address to clear\n" |
| 5424 | "BGP IPv6 neighbor to clear\n" |
| 5425 | "Soft reconfig inbound update\n" |
| 5426 | "Push out the existing ORF prefix-list\n") |
| 5427 | { |
| 5428 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer, |
| 5429 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 5430 | } |
| 5431 | |
| 5432 | ALIAS (clear_bgp_peer_in_prefix_filter, |
| 5433 | clear_bgp_ipv6_peer_in_prefix_filter_cmd, |
| 5434 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) in prefix-filter", |
| 5435 | CLEAR_STR |
| 5436 | BGP_STR |
| 5437 | "Address family\n" |
| 5438 | "BGP neighbor address to clear\n" |
| 5439 | "BGP IPv6 neighbor to clear\n" |
| 5440 | "Soft reconfig inbound update\n" |
| 5441 | "Push out the existing ORF prefix-list\n") |
| 5442 | |
| 5443 | DEFUN (clear_ip_bgp_peer_group_soft_in, |
| 5444 | clear_ip_bgp_peer_group_soft_in_cmd, |
| 5445 | "clear ip bgp peer-group WORD soft in", |
| 5446 | CLEAR_STR |
| 5447 | IP_STR |
| 5448 | BGP_STR |
| 5449 | "Clear all members of peer-group\n" |
| 5450 | "BGP peer-group name\n" |
| 5451 | "Soft reconfig\n" |
| 5452 | "Soft reconfig inbound update\n") |
| 5453 | { |
| 5454 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 5455 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5456 | } |
| 5457 | |
| 5458 | ALIAS (clear_ip_bgp_peer_group_soft_in, |
| 5459 | clear_ip_bgp_peer_group_in_cmd, |
| 5460 | "clear ip bgp peer-group WORD in", |
| 5461 | CLEAR_STR |
| 5462 | IP_STR |
| 5463 | BGP_STR |
| 5464 | "Clear all members of peer-group\n" |
| 5465 | "BGP peer-group name\n" |
| 5466 | "Soft reconfig inbound update\n") |
| 5467 | |
| 5468 | DEFUN (clear_ip_bgp_peer_group_in_prefix_filter, |
| 5469 | clear_ip_bgp_peer_group_in_prefix_filter_cmd, |
| 5470 | "clear ip bgp peer-group WORD in prefix-filter", |
| 5471 | CLEAR_STR |
| 5472 | IP_STR |
| 5473 | BGP_STR |
| 5474 | "Clear all members of peer-group\n" |
| 5475 | "BGP peer-group name\n" |
| 5476 | "Soft reconfig inbound update\n" |
| 5477 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5478 | { |
| 5479 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 5480 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 5481 | } |
| 5482 | |
| 5483 | DEFUN (clear_ip_bgp_peer_group_ipv4_soft_in, |
| 5484 | clear_ip_bgp_peer_group_ipv4_soft_in_cmd, |
| 5485 | "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft in", |
| 5486 | CLEAR_STR |
| 5487 | IP_STR |
| 5488 | BGP_STR |
| 5489 | "Clear all members of peer-group\n" |
| 5490 | "BGP peer-group name\n" |
| 5491 | "Address family\n" |
| 5492 | "Address Family modifier\n" |
| 5493 | "Address Family modifier\n" |
| 5494 | "Soft reconfig\n" |
| 5495 | "Soft reconfig inbound update\n") |
| 5496 | { |
| 5497 | if (strncmp (argv[1], "m", 1) == 0) |
| 5498 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group, |
| 5499 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5500 | |
| 5501 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 5502 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5503 | } |
| 5504 | |
| 5505 | ALIAS (clear_ip_bgp_peer_group_ipv4_soft_in, |
| 5506 | clear_ip_bgp_peer_group_ipv4_in_cmd, |
| 5507 | "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in", |
| 5508 | CLEAR_STR |
| 5509 | IP_STR |
| 5510 | BGP_STR |
| 5511 | "Clear all members of peer-group\n" |
| 5512 | "BGP peer-group name\n" |
| 5513 | "Address family\n" |
| 5514 | "Address Family modifier\n" |
| 5515 | "Address Family modifier\n" |
| 5516 | "Soft reconfig inbound update\n") |
| 5517 | |
| 5518 | DEFUN (clear_ip_bgp_peer_group_ipv4_in_prefix_filter, |
| 5519 | clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd, |
| 5520 | "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in prefix-filter", |
| 5521 | CLEAR_STR |
| 5522 | IP_STR |
| 5523 | BGP_STR |
| 5524 | "Clear all members of peer-group\n" |
| 5525 | "BGP peer-group name\n" |
| 5526 | "Address family\n" |
| 5527 | "Address Family modifier\n" |
| 5528 | "Address Family modifier\n" |
| 5529 | "Soft reconfig inbound update\n" |
| 5530 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5531 | { |
| 5532 | if (strncmp (argv[1], "m", 1) == 0) |
| 5533 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group, |
| 5534 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 5535 | |
| 5536 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 5537 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 5538 | } |
| 5539 | |
| 5540 | DEFUN (clear_bgp_peer_group_soft_in, |
| 5541 | clear_bgp_peer_group_soft_in_cmd, |
| 5542 | "clear bgp peer-group WORD soft in", |
| 5543 | CLEAR_STR |
| 5544 | BGP_STR |
| 5545 | "Clear all members of peer-group\n" |
| 5546 | "BGP peer-group name\n" |
| 5547 | "Soft reconfig\n" |
| 5548 | "Soft reconfig inbound update\n") |
| 5549 | { |
| 5550 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_group, |
| 5551 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5552 | } |
| 5553 | |
| 5554 | ALIAS (clear_bgp_peer_group_soft_in, |
| 5555 | clear_bgp_ipv6_peer_group_soft_in_cmd, |
| 5556 | "clear bgp ipv6 peer-group WORD soft in", |
| 5557 | CLEAR_STR |
| 5558 | BGP_STR |
| 5559 | "Address family\n" |
| 5560 | "Clear all members of peer-group\n" |
| 5561 | "BGP peer-group name\n" |
| 5562 | "Soft reconfig\n" |
| 5563 | "Soft reconfig inbound update\n") |
| 5564 | |
| 5565 | ALIAS (clear_bgp_peer_group_soft_in, |
| 5566 | clear_bgp_peer_group_in_cmd, |
| 5567 | "clear bgp peer-group WORD in", |
| 5568 | CLEAR_STR |
| 5569 | BGP_STR |
| 5570 | "Clear all members of peer-group\n" |
| 5571 | "BGP peer-group name\n" |
| 5572 | "Soft reconfig inbound update\n") |
| 5573 | |
| 5574 | ALIAS (clear_bgp_peer_group_soft_in, |
| 5575 | clear_bgp_ipv6_peer_group_in_cmd, |
| 5576 | "clear bgp ipv6 peer-group WORD in", |
| 5577 | CLEAR_STR |
| 5578 | BGP_STR |
| 5579 | "Address family\n" |
| 5580 | "Clear all members of peer-group\n" |
| 5581 | "BGP peer-group name\n" |
| 5582 | "Soft reconfig inbound update\n") |
| 5583 | |
| 5584 | DEFUN (clear_bgp_peer_group_in_prefix_filter, |
| 5585 | clear_bgp_peer_group_in_prefix_filter_cmd, |
| 5586 | "clear bgp peer-group WORD in prefix-filter", |
| 5587 | CLEAR_STR |
| 5588 | BGP_STR |
| 5589 | "Clear all members of peer-group\n" |
| 5590 | "BGP peer-group name\n" |
| 5591 | "Soft reconfig inbound update\n" |
| 5592 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5593 | { |
| 5594 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_group, |
| 5595 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 5596 | } |
| 5597 | |
| 5598 | ALIAS (clear_bgp_peer_group_in_prefix_filter, |
| 5599 | clear_bgp_ipv6_peer_group_in_prefix_filter_cmd, |
| 5600 | "clear bgp ipv6 peer-group WORD in prefix-filter", |
| 5601 | CLEAR_STR |
| 5602 | BGP_STR |
| 5603 | "Address family\n" |
| 5604 | "Clear all members of peer-group\n" |
| 5605 | "BGP peer-group name\n" |
| 5606 | "Soft reconfig inbound update\n" |
| 5607 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5608 | |
| 5609 | DEFUN (clear_ip_bgp_external_soft_in, |
| 5610 | clear_ip_bgp_external_soft_in_cmd, |
| 5611 | "clear ip bgp external soft in", |
| 5612 | CLEAR_STR |
| 5613 | IP_STR |
| 5614 | BGP_STR |
| 5615 | "Clear all external peers\n" |
| 5616 | "Soft reconfig\n" |
| 5617 | "Soft reconfig inbound update\n") |
| 5618 | { |
| 5619 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 5620 | BGP_CLEAR_SOFT_IN, NULL); |
| 5621 | } |
| 5622 | |
| 5623 | ALIAS (clear_ip_bgp_external_soft_in, |
| 5624 | clear_ip_bgp_external_in_cmd, |
| 5625 | "clear ip bgp external in", |
| 5626 | CLEAR_STR |
| 5627 | IP_STR |
| 5628 | BGP_STR |
| 5629 | "Clear all external peers\n" |
| 5630 | "Soft reconfig inbound update\n") |
| 5631 | |
| 5632 | DEFUN (clear_ip_bgp_external_in_prefix_filter, |
| 5633 | clear_ip_bgp_external_in_prefix_filter_cmd, |
| 5634 | "clear ip bgp external in prefix-filter", |
| 5635 | CLEAR_STR |
| 5636 | IP_STR |
| 5637 | BGP_STR |
| 5638 | "Clear all external peers\n" |
| 5639 | "Soft reconfig inbound update\n" |
| 5640 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5641 | { |
| 5642 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 5643 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5644 | } |
| 5645 | |
| 5646 | DEFUN (clear_ip_bgp_external_ipv4_soft_in, |
| 5647 | clear_ip_bgp_external_ipv4_soft_in_cmd, |
| 5648 | "clear ip bgp external ipv4 (unicast|multicast) soft in", |
| 5649 | CLEAR_STR |
| 5650 | IP_STR |
| 5651 | BGP_STR |
| 5652 | "Clear all external peers\n" |
| 5653 | "Address family\n" |
| 5654 | "Address Family modifier\n" |
| 5655 | "Address Family modifier\n" |
| 5656 | "Soft reconfig\n" |
| 5657 | "Soft reconfig inbound update\n") |
| 5658 | { |
| 5659 | if (strncmp (argv[0], "m", 1) == 0) |
| 5660 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external, |
| 5661 | BGP_CLEAR_SOFT_IN, NULL); |
| 5662 | |
| 5663 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 5664 | BGP_CLEAR_SOFT_IN, NULL); |
| 5665 | } |
| 5666 | |
| 5667 | ALIAS (clear_ip_bgp_external_ipv4_soft_in, |
| 5668 | clear_ip_bgp_external_ipv4_in_cmd, |
| 5669 | "clear ip bgp external ipv4 (unicast|multicast) in", |
| 5670 | CLEAR_STR |
| 5671 | IP_STR |
| 5672 | BGP_STR |
| 5673 | "Clear all external peers\n" |
| 5674 | "Address family\n" |
| 5675 | "Address Family modifier\n" |
| 5676 | "Address Family modifier\n" |
| 5677 | "Soft reconfig inbound update\n") |
| 5678 | |
| 5679 | DEFUN (clear_ip_bgp_external_ipv4_in_prefix_filter, |
| 5680 | clear_ip_bgp_external_ipv4_in_prefix_filter_cmd, |
| 5681 | "clear ip bgp external ipv4 (unicast|multicast) in prefix-filter", |
| 5682 | CLEAR_STR |
| 5683 | IP_STR |
| 5684 | BGP_STR |
| 5685 | "Clear all external peers\n" |
| 5686 | "Address family\n" |
| 5687 | "Address Family modifier\n" |
| 5688 | "Address Family modifier\n" |
| 5689 | "Soft reconfig inbound update\n" |
| 5690 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5691 | { |
| 5692 | if (strncmp (argv[0], "m", 1) == 0) |
| 5693 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external, |
| 5694 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5695 | |
| 5696 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 5697 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5698 | } |
| 5699 | |
| 5700 | DEFUN (clear_bgp_external_soft_in, |
| 5701 | clear_bgp_external_soft_in_cmd, |
| 5702 | "clear bgp external soft in", |
| 5703 | CLEAR_STR |
| 5704 | BGP_STR |
| 5705 | "Clear all external peers\n" |
| 5706 | "Soft reconfig\n" |
| 5707 | "Soft reconfig inbound update\n") |
| 5708 | { |
| 5709 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_external, |
| 5710 | BGP_CLEAR_SOFT_IN, NULL); |
| 5711 | } |
| 5712 | |
| 5713 | ALIAS (clear_bgp_external_soft_in, |
| 5714 | clear_bgp_ipv6_external_soft_in_cmd, |
| 5715 | "clear bgp ipv6 external soft in", |
| 5716 | CLEAR_STR |
| 5717 | BGP_STR |
| 5718 | "Address family\n" |
| 5719 | "Clear all external peers\n" |
| 5720 | "Soft reconfig\n" |
| 5721 | "Soft reconfig inbound update\n") |
| 5722 | |
| 5723 | ALIAS (clear_bgp_external_soft_in, |
| 5724 | clear_bgp_external_in_cmd, |
| 5725 | "clear bgp external in", |
| 5726 | CLEAR_STR |
| 5727 | BGP_STR |
| 5728 | "Clear all external peers\n" |
| 5729 | "Soft reconfig inbound update\n") |
| 5730 | |
| 5731 | ALIAS (clear_bgp_external_soft_in, |
| 5732 | clear_bgp_ipv6_external_in_cmd, |
| 5733 | "clear bgp ipv6 external WORD in", |
| 5734 | CLEAR_STR |
| 5735 | BGP_STR |
| 5736 | "Address family\n" |
| 5737 | "Clear all external peers\n" |
| 5738 | "Soft reconfig inbound update\n") |
| 5739 | |
| 5740 | DEFUN (clear_bgp_external_in_prefix_filter, |
| 5741 | clear_bgp_external_in_prefix_filter_cmd, |
| 5742 | "clear bgp external in prefix-filter", |
| 5743 | CLEAR_STR |
| 5744 | BGP_STR |
| 5745 | "Clear all external peers\n" |
| 5746 | "Soft reconfig inbound update\n" |
| 5747 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5748 | { |
| 5749 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_external, |
| 5750 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL); |
| 5751 | } |
| 5752 | |
| 5753 | ALIAS (clear_bgp_external_in_prefix_filter, |
| 5754 | clear_bgp_ipv6_external_in_prefix_filter_cmd, |
| 5755 | "clear bgp ipv6 external in prefix-filter", |
| 5756 | CLEAR_STR |
| 5757 | BGP_STR |
| 5758 | "Address family\n" |
| 5759 | "Clear all external peers\n" |
| 5760 | "Soft reconfig inbound update\n" |
| 5761 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5762 | |
| 5763 | DEFUN (clear_ip_bgp_as_soft_in, |
| 5764 | clear_ip_bgp_as_soft_in_cmd, |
| 5765 | "clear ip bgp <1-65535> soft in", |
| 5766 | CLEAR_STR |
| 5767 | IP_STR |
| 5768 | BGP_STR |
| 5769 | "Clear peers with the AS number\n" |
| 5770 | "Soft reconfig\n" |
| 5771 | "Soft reconfig inbound update\n") |
| 5772 | { |
| 5773 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 5774 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5775 | } |
| 5776 | |
| 5777 | ALIAS (clear_ip_bgp_as_soft_in, |
| 5778 | clear_ip_bgp_as_in_cmd, |
| 5779 | "clear ip bgp <1-65535> in", |
| 5780 | CLEAR_STR |
| 5781 | IP_STR |
| 5782 | BGP_STR |
| 5783 | "Clear peers with the AS number\n" |
| 5784 | "Soft reconfig inbound update\n") |
| 5785 | |
| 5786 | DEFUN (clear_ip_bgp_as_in_prefix_filter, |
| 5787 | clear_ip_bgp_as_in_prefix_filter_cmd, |
| 5788 | "clear ip bgp <1-65535> in prefix-filter", |
| 5789 | CLEAR_STR |
| 5790 | IP_STR |
| 5791 | BGP_STR |
| 5792 | "Clear peers with the AS number\n" |
| 5793 | "Soft reconfig inbound update\n" |
| 5794 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5795 | { |
| 5796 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 5797 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 5798 | } |
| 5799 | |
| 5800 | DEFUN (clear_ip_bgp_as_ipv4_soft_in, |
| 5801 | clear_ip_bgp_as_ipv4_soft_in_cmd, |
| 5802 | "clear ip bgp <1-65535> ipv4 (unicast|multicast) soft in", |
| 5803 | CLEAR_STR |
| 5804 | IP_STR |
| 5805 | BGP_STR |
| 5806 | "Clear peers with the AS number\n" |
| 5807 | "Address family\n" |
| 5808 | "Address Family modifier\n" |
| 5809 | "Address Family modifier\n" |
| 5810 | "Soft reconfig\n" |
| 5811 | "Soft reconfig inbound update\n") |
| 5812 | { |
| 5813 | if (strncmp (argv[1], "m", 1) == 0) |
| 5814 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as, |
| 5815 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5816 | |
| 5817 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 5818 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5819 | } |
| 5820 | |
| 5821 | ALIAS (clear_ip_bgp_as_ipv4_soft_in, |
| 5822 | clear_ip_bgp_as_ipv4_in_cmd, |
| 5823 | "clear ip bgp <1-65535> ipv4 (unicast|multicast) in", |
| 5824 | CLEAR_STR |
| 5825 | IP_STR |
| 5826 | BGP_STR |
| 5827 | "Clear peers with the AS number\n" |
| 5828 | "Address family\n" |
| 5829 | "Address Family modifier\n" |
| 5830 | "Address Family modifier\n" |
| 5831 | "Soft reconfig inbound update\n") |
| 5832 | |
| 5833 | DEFUN (clear_ip_bgp_as_ipv4_in_prefix_filter, |
| 5834 | clear_ip_bgp_as_ipv4_in_prefix_filter_cmd, |
| 5835 | "clear ip bgp <1-65535> ipv4 (unicast|multicast) in prefix-filter", |
| 5836 | CLEAR_STR |
| 5837 | IP_STR |
| 5838 | BGP_STR |
| 5839 | "Clear peers with the AS number\n" |
| 5840 | "Address family\n" |
| 5841 | "Address Family modifier\n" |
| 5842 | "Address Family modifier\n" |
| 5843 | "Soft reconfig inbound update\n" |
| 5844 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5845 | { |
| 5846 | if (strncmp (argv[1], "m", 1) == 0) |
| 5847 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as, |
| 5848 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 5849 | |
| 5850 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 5851 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 5852 | } |
| 5853 | |
| 5854 | DEFUN (clear_ip_bgp_as_vpnv4_soft_in, |
| 5855 | clear_ip_bgp_as_vpnv4_soft_in_cmd, |
| 5856 | "clear ip bgp <1-65535> vpnv4 unicast soft in", |
| 5857 | CLEAR_STR |
| 5858 | IP_STR |
| 5859 | BGP_STR |
| 5860 | "Clear peers with the AS number\n" |
| 5861 | "Address family\n" |
| 5862 | "Address Family modifier\n" |
| 5863 | "Soft reconfig\n" |
| 5864 | "Soft reconfig inbound update\n") |
| 5865 | { |
| 5866 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_as, |
| 5867 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5868 | } |
| 5869 | |
| 5870 | ALIAS (clear_ip_bgp_as_vpnv4_soft_in, |
| 5871 | clear_ip_bgp_as_vpnv4_in_cmd, |
| 5872 | "clear ip bgp <1-65535> vpnv4 unicast in", |
| 5873 | CLEAR_STR |
| 5874 | IP_STR |
| 5875 | BGP_STR |
| 5876 | "Clear peers with the AS number\n" |
| 5877 | "Address family\n" |
| 5878 | "Address Family modifier\n" |
| 5879 | "Soft reconfig inbound update\n") |
| 5880 | |
| 5881 | DEFUN (clear_bgp_as_soft_in, |
| 5882 | clear_bgp_as_soft_in_cmd, |
| 5883 | "clear bgp <1-65535> soft in", |
| 5884 | CLEAR_STR |
| 5885 | BGP_STR |
| 5886 | "Clear peers with the AS number\n" |
| 5887 | "Soft reconfig\n" |
| 5888 | "Soft reconfig inbound update\n") |
| 5889 | { |
| 5890 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_as, |
| 5891 | BGP_CLEAR_SOFT_IN, argv[0]); |
| 5892 | } |
| 5893 | |
| 5894 | ALIAS (clear_bgp_as_soft_in, |
| 5895 | clear_bgp_ipv6_as_soft_in_cmd, |
| 5896 | "clear bgp ipv6 <1-65535> soft in", |
| 5897 | CLEAR_STR |
| 5898 | BGP_STR |
| 5899 | "Address family\n" |
| 5900 | "Clear peers with the AS number\n" |
| 5901 | "Soft reconfig\n" |
| 5902 | "Soft reconfig inbound update\n") |
| 5903 | |
| 5904 | ALIAS (clear_bgp_as_soft_in, |
| 5905 | clear_bgp_as_in_cmd, |
| 5906 | "clear bgp <1-65535> in", |
| 5907 | CLEAR_STR |
| 5908 | BGP_STR |
| 5909 | "Clear peers with the AS number\n" |
| 5910 | "Soft reconfig inbound update\n") |
| 5911 | |
| 5912 | ALIAS (clear_bgp_as_soft_in, |
| 5913 | clear_bgp_ipv6_as_in_cmd, |
| 5914 | "clear bgp ipv6 <1-65535> in", |
| 5915 | CLEAR_STR |
| 5916 | BGP_STR |
| 5917 | "Address family\n" |
| 5918 | "Clear peers with the AS number\n" |
| 5919 | "Soft reconfig inbound update\n") |
| 5920 | |
| 5921 | DEFUN (clear_bgp_as_in_prefix_filter, |
| 5922 | clear_bgp_as_in_prefix_filter_cmd, |
| 5923 | "clear bgp <1-65535> in prefix-filter", |
| 5924 | CLEAR_STR |
| 5925 | BGP_STR |
| 5926 | "Clear peers with the AS number\n" |
| 5927 | "Soft reconfig inbound update\n" |
| 5928 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5929 | { |
| 5930 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_as, |
| 5931 | BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]); |
| 5932 | } |
| 5933 | |
| 5934 | ALIAS (clear_bgp_as_in_prefix_filter, |
| 5935 | clear_bgp_ipv6_as_in_prefix_filter_cmd, |
| 5936 | "clear bgp ipv6 <1-65535> in prefix-filter", |
| 5937 | CLEAR_STR |
| 5938 | BGP_STR |
| 5939 | "Address family\n" |
| 5940 | "Clear peers with the AS number\n" |
| 5941 | "Soft reconfig inbound update\n" |
| 5942 | "Push out prefix-list ORF and do inbound soft reconfig\n") |
| 5943 | |
| 5944 | /* Both soft-reconfiguration */ |
| 5945 | DEFUN (clear_ip_bgp_all_soft, |
| 5946 | clear_ip_bgp_all_soft_cmd, |
| 5947 | "clear ip bgp * soft", |
| 5948 | CLEAR_STR |
| 5949 | IP_STR |
| 5950 | BGP_STR |
| 5951 | "Clear all peers\n" |
| 5952 | "Soft reconfig\n") |
| 5953 | { |
| 5954 | if (argc == 1) |
| 5955 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 5956 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 5957 | |
| 5958 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 5959 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 5960 | } |
| 5961 | |
| 5962 | ALIAS (clear_ip_bgp_all_soft, |
| 5963 | clear_ip_bgp_instance_all_soft_cmd, |
| 5964 | "clear ip bgp view WORD * soft", |
| 5965 | CLEAR_STR |
| 5966 | IP_STR |
| 5967 | BGP_STR |
| 5968 | "BGP view\n" |
| 5969 | "view name\n" |
| 5970 | "Clear all peers\n" |
| 5971 | "Soft reconfig\n") |
| 5972 | |
| 5973 | |
| 5974 | DEFUN (clear_ip_bgp_all_ipv4_soft, |
| 5975 | clear_ip_bgp_all_ipv4_soft_cmd, |
| 5976 | "clear ip bgp * ipv4 (unicast|multicast) soft", |
| 5977 | CLEAR_STR |
| 5978 | IP_STR |
| 5979 | BGP_STR |
| 5980 | "Clear all peers\n" |
| 5981 | "Address family\n" |
| 5982 | "Address Family Modifier\n" |
| 5983 | "Address Family Modifier\n" |
| 5984 | "Soft reconfig\n") |
| 5985 | { |
| 5986 | if (strncmp (argv[0], "m", 1) == 0) |
| 5987 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all, |
| 5988 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 5989 | |
| 5990 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 5991 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 5992 | } |
| 5993 | |
| 5994 | DEFUN (clear_ip_bgp_instance_all_ipv4_soft, |
| 5995 | clear_ip_bgp_instance_all_ipv4_soft_cmd, |
| 5996 | "clear ip bgp view WORD * ipv4 (unicast|multicast) soft", |
| 5997 | CLEAR_STR |
| 5998 | IP_STR |
| 5999 | BGP_STR |
| 6000 | "BGP view\n" |
| 6001 | "view name\n" |
| 6002 | "Clear all peers\n" |
| 6003 | "Address family\n" |
| 6004 | "Address Family Modifier\n" |
| 6005 | "Address Family Modifier\n" |
| 6006 | "Soft reconfig\n") |
| 6007 | { |
| 6008 | if (strncmp (argv[1], "m", 1) == 0) |
| 6009 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all, |
| 6010 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6011 | |
| 6012 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 6013 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6014 | } |
| 6015 | |
| 6016 | DEFUN (clear_ip_bgp_all_vpnv4_soft, |
| 6017 | clear_ip_bgp_all_vpnv4_soft_cmd, |
| 6018 | "clear ip bgp * vpnv4 unicast soft", |
| 6019 | CLEAR_STR |
| 6020 | IP_STR |
| 6021 | BGP_STR |
| 6022 | "Clear all peers\n" |
| 6023 | "Address family\n" |
| 6024 | "Address Family Modifier\n" |
| 6025 | "Soft reconfig\n") |
| 6026 | { |
| 6027 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_all, |
| 6028 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6029 | } |
| 6030 | |
| 6031 | DEFUN (clear_bgp_all_soft, |
| 6032 | clear_bgp_all_soft_cmd, |
| 6033 | "clear bgp * soft", |
| 6034 | CLEAR_STR |
| 6035 | BGP_STR |
| 6036 | "Clear all peers\n" |
| 6037 | "Soft reconfig\n") |
| 6038 | { |
| 6039 | if (argc == 1) |
| 6040 | return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_all, |
| 6041 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6042 | |
| 6043 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all, |
| 6044 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6045 | } |
| 6046 | |
| 6047 | ALIAS (clear_bgp_all_soft, |
| 6048 | clear_bgp_instance_all_soft_cmd, |
| 6049 | "clear bgp view WORD * soft", |
| 6050 | CLEAR_STR |
| 6051 | BGP_STR |
| 6052 | "BGP view\n" |
| 6053 | "view name\n" |
| 6054 | "Clear all peers\n" |
| 6055 | "Soft reconfig\n") |
| 6056 | |
| 6057 | ALIAS (clear_bgp_all_soft, |
| 6058 | clear_bgp_ipv6_all_soft_cmd, |
| 6059 | "clear bgp ipv6 * soft", |
| 6060 | CLEAR_STR |
| 6061 | BGP_STR |
| 6062 | "Address family\n" |
| 6063 | "Clear all peers\n" |
| 6064 | "Soft reconfig\n") |
| 6065 | |
| 6066 | DEFUN (clear_ip_bgp_peer_soft, |
| 6067 | clear_ip_bgp_peer_soft_cmd, |
| 6068 | "clear ip bgp A.B.C.D soft", |
| 6069 | CLEAR_STR |
| 6070 | IP_STR |
| 6071 | BGP_STR |
| 6072 | "BGP neighbor address to clear\n" |
| 6073 | "Soft reconfig\n") |
| 6074 | { |
| 6075 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 6076 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6077 | } |
| 6078 | |
| 6079 | DEFUN (clear_ip_bgp_peer_ipv4_soft, |
| 6080 | clear_ip_bgp_peer_ipv4_soft_cmd, |
| 6081 | "clear ip bgp A.B.C.D ipv4 (unicast|multicast) soft", |
| 6082 | CLEAR_STR |
| 6083 | IP_STR |
| 6084 | BGP_STR |
| 6085 | "BGP neighbor address to clear\n" |
| 6086 | "Address family\n" |
| 6087 | "Address Family Modifier\n" |
| 6088 | "Address Family Modifier\n" |
| 6089 | "Soft reconfig\n") |
| 6090 | { |
| 6091 | if (strncmp (argv[1], "m", 1) == 0) |
| 6092 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer, |
| 6093 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6094 | |
| 6095 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 6096 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6097 | } |
| 6098 | |
| 6099 | DEFUN (clear_ip_bgp_peer_vpnv4_soft, |
| 6100 | clear_ip_bgp_peer_vpnv4_soft_cmd, |
| 6101 | "clear ip bgp A.B.C.D vpnv4 unicast soft", |
| 6102 | CLEAR_STR |
| 6103 | IP_STR |
| 6104 | BGP_STR |
| 6105 | "BGP neighbor address to clear\n" |
| 6106 | "Address family\n" |
| 6107 | "Address Family Modifier\n" |
| 6108 | "Soft reconfig\n") |
| 6109 | { |
| 6110 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_peer, |
| 6111 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6112 | } |
| 6113 | |
| 6114 | DEFUN (clear_bgp_peer_soft, |
| 6115 | clear_bgp_peer_soft_cmd, |
| 6116 | "clear bgp (A.B.C.D|X:X::X:X) soft", |
| 6117 | CLEAR_STR |
| 6118 | BGP_STR |
| 6119 | "BGP neighbor address to clear\n" |
| 6120 | "BGP IPv6 neighbor to clear\n" |
| 6121 | "Soft reconfig\n") |
| 6122 | { |
| 6123 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer, |
| 6124 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6125 | } |
| 6126 | |
| 6127 | ALIAS (clear_bgp_peer_soft, |
| 6128 | clear_bgp_ipv6_peer_soft_cmd, |
| 6129 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) soft", |
| 6130 | CLEAR_STR |
| 6131 | BGP_STR |
| 6132 | "Address family\n" |
| 6133 | "BGP neighbor address to clear\n" |
| 6134 | "BGP IPv6 neighbor to clear\n" |
| 6135 | "Soft reconfig\n") |
| 6136 | |
| 6137 | DEFUN (clear_ip_bgp_peer_group_soft, |
| 6138 | clear_ip_bgp_peer_group_soft_cmd, |
| 6139 | "clear ip bgp peer-group WORD soft", |
| 6140 | CLEAR_STR |
| 6141 | IP_STR |
| 6142 | BGP_STR |
| 6143 | "Clear all members of peer-group\n" |
| 6144 | "BGP peer-group name\n" |
| 6145 | "Soft reconfig\n") |
| 6146 | { |
| 6147 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 6148 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6149 | } |
| 6150 | |
| 6151 | DEFUN (clear_ip_bgp_peer_group_ipv4_soft, |
| 6152 | clear_ip_bgp_peer_group_ipv4_soft_cmd, |
| 6153 | "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft", |
| 6154 | CLEAR_STR |
| 6155 | IP_STR |
| 6156 | BGP_STR |
| 6157 | "Clear all members of peer-group\n" |
| 6158 | "BGP peer-group name\n" |
| 6159 | "Address family\n" |
| 6160 | "Address Family modifier\n" |
| 6161 | "Address Family modifier\n" |
| 6162 | "Soft reconfig\n") |
| 6163 | { |
| 6164 | if (strncmp (argv[1], "m", 1) == 0) |
| 6165 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group, |
| 6166 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6167 | |
| 6168 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group, |
| 6169 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6170 | } |
| 6171 | |
| 6172 | DEFUN (clear_bgp_peer_group_soft, |
| 6173 | clear_bgp_peer_group_soft_cmd, |
| 6174 | "clear bgp peer-group WORD soft", |
| 6175 | CLEAR_STR |
| 6176 | BGP_STR |
| 6177 | "Clear all members of peer-group\n" |
| 6178 | "BGP peer-group name\n" |
| 6179 | "Soft reconfig\n") |
| 6180 | { |
| 6181 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_group, |
| 6182 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6183 | } |
| 6184 | |
| 6185 | ALIAS (clear_bgp_peer_group_soft, |
| 6186 | clear_bgp_ipv6_peer_group_soft_cmd, |
| 6187 | "clear bgp ipv6 peer-group WORD soft", |
| 6188 | CLEAR_STR |
| 6189 | BGP_STR |
| 6190 | "Address family\n" |
| 6191 | "Clear all members of peer-group\n" |
| 6192 | "BGP peer-group name\n" |
| 6193 | "Soft reconfig\n") |
| 6194 | |
| 6195 | DEFUN (clear_ip_bgp_external_soft, |
| 6196 | clear_ip_bgp_external_soft_cmd, |
| 6197 | "clear ip bgp external soft", |
| 6198 | CLEAR_STR |
| 6199 | IP_STR |
| 6200 | BGP_STR |
| 6201 | "Clear all external peers\n" |
| 6202 | "Soft reconfig\n") |
| 6203 | { |
| 6204 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 6205 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6206 | } |
| 6207 | |
| 6208 | DEFUN (clear_ip_bgp_external_ipv4_soft, |
| 6209 | clear_ip_bgp_external_ipv4_soft_cmd, |
| 6210 | "clear ip bgp external ipv4 (unicast|multicast) soft", |
| 6211 | CLEAR_STR |
| 6212 | IP_STR |
| 6213 | BGP_STR |
| 6214 | "Clear all external peers\n" |
| 6215 | "Address family\n" |
| 6216 | "Address Family modifier\n" |
| 6217 | "Address Family modifier\n" |
| 6218 | "Soft reconfig\n") |
| 6219 | { |
| 6220 | if (strncmp (argv[0], "m", 1) == 0) |
| 6221 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external, |
| 6222 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6223 | |
| 6224 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external, |
| 6225 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6226 | } |
| 6227 | |
| 6228 | DEFUN (clear_bgp_external_soft, |
| 6229 | clear_bgp_external_soft_cmd, |
| 6230 | "clear bgp external soft", |
| 6231 | CLEAR_STR |
| 6232 | BGP_STR |
| 6233 | "Clear all external peers\n" |
| 6234 | "Soft reconfig\n") |
| 6235 | { |
| 6236 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_external, |
| 6237 | BGP_CLEAR_SOFT_BOTH, NULL); |
| 6238 | } |
| 6239 | |
| 6240 | ALIAS (clear_bgp_external_soft, |
| 6241 | clear_bgp_ipv6_external_soft_cmd, |
| 6242 | "clear bgp ipv6 external soft", |
| 6243 | CLEAR_STR |
| 6244 | BGP_STR |
| 6245 | "Address family\n" |
| 6246 | "Clear all external peers\n" |
| 6247 | "Soft reconfig\n") |
| 6248 | |
| 6249 | DEFUN (clear_ip_bgp_as_soft, |
| 6250 | clear_ip_bgp_as_soft_cmd, |
| 6251 | "clear ip bgp <1-65535> soft", |
| 6252 | CLEAR_STR |
| 6253 | IP_STR |
| 6254 | BGP_STR |
| 6255 | "Clear peers with the AS number\n" |
| 6256 | "Soft reconfig\n") |
| 6257 | { |
| 6258 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as, |
| 6259 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6260 | } |
| 6261 | |
| 6262 | DEFUN (clear_ip_bgp_as_ipv4_soft, |
| 6263 | clear_ip_bgp_as_ipv4_soft_cmd, |
| 6264 | "clear ip bgp <1-65535> ipv4 (unicast|multicast) soft", |
| 6265 | CLEAR_STR |
| 6266 | IP_STR |
| 6267 | BGP_STR |
| 6268 | "Clear peers with the AS number\n" |
| 6269 | "Address family\n" |
| 6270 | "Address Family Modifier\n" |
| 6271 | "Address Family Modifier\n" |
| 6272 | "Soft reconfig\n") |
| 6273 | { |
| 6274 | if (strncmp (argv[1], "m", 1) == 0) |
| 6275 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as, |
| 6276 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6277 | |
| 6278 | return bgp_clear_vty (vty, NULL,AFI_IP, SAFI_UNICAST, clear_as, |
| 6279 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6280 | } |
| 6281 | |
| 6282 | DEFUN (clear_ip_bgp_as_vpnv4_soft, |
| 6283 | clear_ip_bgp_as_vpnv4_soft_cmd, |
| 6284 | "clear ip bgp <1-65535> vpnv4 unicast soft", |
| 6285 | CLEAR_STR |
| 6286 | IP_STR |
| 6287 | BGP_STR |
| 6288 | "Clear peers with the AS number\n" |
| 6289 | "Address family\n" |
| 6290 | "Address Family Modifier\n" |
| 6291 | "Soft reconfig\n") |
| 6292 | { |
| 6293 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, clear_as, |
| 6294 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6295 | } |
| 6296 | |
| 6297 | DEFUN (clear_bgp_as_soft, |
| 6298 | clear_bgp_as_soft_cmd, |
| 6299 | "clear bgp <1-65535> soft", |
| 6300 | CLEAR_STR |
| 6301 | BGP_STR |
| 6302 | "Clear peers with the AS number\n" |
| 6303 | "Soft reconfig\n") |
| 6304 | { |
| 6305 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_as, |
| 6306 | BGP_CLEAR_SOFT_BOTH, argv[0]); |
| 6307 | } |
| 6308 | |
| 6309 | ALIAS (clear_bgp_as_soft, |
| 6310 | clear_bgp_ipv6_as_soft_cmd, |
| 6311 | "clear bgp ipv6 <1-65535> soft", |
| 6312 | CLEAR_STR |
| 6313 | BGP_STR |
| 6314 | "Address family\n" |
| 6315 | "Clear peers with the AS number\n" |
| 6316 | "Soft reconfig\n") |
| 6317 | |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 6318 | /* RS-client soft reconfiguration. */ |
| 6319 | #ifdef HAVE_IPV6 |
| 6320 | DEFUN (clear_bgp_all_rsclient, |
| 6321 | clear_bgp_all_rsclient_cmd, |
| 6322 | "clear bgp * rsclient", |
| 6323 | CLEAR_STR |
| 6324 | BGP_STR |
| 6325 | "Clear all peers\n" |
| 6326 | "Soft reconfig for rsclient RIB\n") |
| 6327 | { |
| 6328 | if (argc == 1) |
| 6329 | return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_all, |
| 6330 | BGP_CLEAR_SOFT_RSCLIENT, NULL); |
| 6331 | |
| 6332 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_all, |
| 6333 | BGP_CLEAR_SOFT_RSCLIENT, NULL); |
| 6334 | } |
| 6335 | |
| 6336 | ALIAS (clear_bgp_all_rsclient, |
| 6337 | clear_bgp_ipv6_all_rsclient_cmd, |
| 6338 | "clear bgp ipv6 * rsclient", |
| 6339 | CLEAR_STR |
| 6340 | BGP_STR |
| 6341 | "Address family\n" |
| 6342 | "Clear all peers\n" |
| 6343 | "Soft reconfig for rsclient RIB\n") |
| 6344 | |
| 6345 | ALIAS (clear_bgp_all_rsclient, |
| 6346 | clear_bgp_instance_all_rsclient_cmd, |
| 6347 | "clear bgp view WORD * rsclient", |
| 6348 | CLEAR_STR |
| 6349 | BGP_STR |
| 6350 | "BGP view\n" |
| 6351 | "view name\n" |
| 6352 | "Clear all peers\n" |
| 6353 | "Soft reconfig for rsclient RIB\n") |
| 6354 | |
| 6355 | ALIAS (clear_bgp_all_rsclient, |
| 6356 | clear_bgp_ipv6_instance_all_rsclient_cmd, |
| 6357 | "clear bgp ipv6 view WORD * rsclient", |
| 6358 | CLEAR_STR |
| 6359 | BGP_STR |
| 6360 | "Address family\n" |
| 6361 | "BGP view\n" |
| 6362 | "view name\n" |
| 6363 | "Clear all peers\n" |
| 6364 | "Soft reconfig for rsclient RIB\n") |
| 6365 | #endif /* HAVE_IPV6 */ |
| 6366 | |
| 6367 | DEFUN (clear_ip_bgp_all_rsclient, |
| 6368 | clear_ip_bgp_all_rsclient_cmd, |
| 6369 | "clear ip bgp * rsclient", |
| 6370 | CLEAR_STR |
| 6371 | IP_STR |
| 6372 | BGP_STR |
| 6373 | "Clear all peers\n" |
| 6374 | "Soft reconfig for rsclient RIB\n") |
| 6375 | { |
| 6376 | if (argc == 1) |
| 6377 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all, |
| 6378 | BGP_CLEAR_SOFT_RSCLIENT, NULL); |
| 6379 | |
| 6380 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all, |
| 6381 | BGP_CLEAR_SOFT_RSCLIENT, NULL); |
| 6382 | } |
| 6383 | |
| 6384 | ALIAS (clear_ip_bgp_all_rsclient, |
| 6385 | clear_ip_bgp_instance_all_rsclient_cmd, |
| 6386 | "clear ip bgp view WORD * rsclient", |
| 6387 | CLEAR_STR |
| 6388 | IP_STR |
| 6389 | BGP_STR |
| 6390 | "BGP view\n" |
| 6391 | "view name\n" |
| 6392 | "Clear all peers\n" |
| 6393 | "Soft reconfig for rsclient RIB\n") |
| 6394 | |
| 6395 | #ifdef HAVE_IPV6 |
| 6396 | DEFUN (clear_bgp_peer_rsclient, |
| 6397 | clear_bgp_peer_rsclient_cmd, |
| 6398 | "clear bgp (A.B.C.D|X:X::X:X) rsclient", |
| 6399 | CLEAR_STR |
| 6400 | BGP_STR |
| 6401 | "BGP neighbor IP address to clear\n" |
| 6402 | "BGP IPv6 neighbor to clear\n" |
| 6403 | "Soft reconfig for rsclient RIB\n") |
| 6404 | { |
| 6405 | if (argc == 2) |
| 6406 | return bgp_clear_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, clear_peer, |
| 6407 | BGP_CLEAR_SOFT_RSCLIENT, argv[1]); |
| 6408 | |
| 6409 | return bgp_clear_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, clear_peer, |
| 6410 | BGP_CLEAR_SOFT_RSCLIENT, argv[0]); |
| 6411 | } |
| 6412 | |
| 6413 | ALIAS (clear_bgp_peer_rsclient, |
| 6414 | clear_bgp_ipv6_peer_rsclient_cmd, |
| 6415 | "clear bgp ipv6 (A.B.C.D|X:X::X:X) rsclient", |
| 6416 | CLEAR_STR |
| 6417 | BGP_STR |
| 6418 | "Address family\n" |
| 6419 | "BGP neighbor IP address to clear\n" |
| 6420 | "BGP IPv6 neighbor to clear\n" |
| 6421 | "Soft reconfig for rsclient RIB\n") |
| 6422 | |
| 6423 | ALIAS (clear_bgp_peer_rsclient, |
| 6424 | clear_bgp_instance_peer_rsclient_cmd, |
| 6425 | "clear bgp view WORD (A.B.C.D|X:X::X:X) rsclient", |
| 6426 | CLEAR_STR |
| 6427 | BGP_STR |
| 6428 | "BGP view\n" |
| 6429 | "view name\n" |
| 6430 | "BGP neighbor IP address to clear\n" |
| 6431 | "BGP IPv6 neighbor to clear\n" |
| 6432 | "Soft reconfig for rsclient RIB\n") |
| 6433 | |
| 6434 | ALIAS (clear_bgp_peer_rsclient, |
| 6435 | clear_bgp_ipv6_instance_peer_rsclient_cmd, |
| 6436 | "clear bgp ipv6 view WORD (A.B.C.D|X:X::X:X) rsclient", |
| 6437 | CLEAR_STR |
| 6438 | BGP_STR |
| 6439 | "Address family\n" |
| 6440 | "BGP view\n" |
| 6441 | "view name\n" |
| 6442 | "BGP neighbor IP address to clear\n" |
| 6443 | "BGP IPv6 neighbor to clear\n" |
| 6444 | "Soft reconfig for rsclient RIB\n") |
| 6445 | #endif /* HAVE_IPV6 */ |
| 6446 | |
| 6447 | DEFUN (clear_ip_bgp_peer_rsclient, |
| 6448 | clear_ip_bgp_peer_rsclient_cmd, |
| 6449 | "clear ip bgp (A.B.C.D|X:X::X:X) rsclient", |
| 6450 | CLEAR_STR |
| 6451 | IP_STR |
| 6452 | BGP_STR |
| 6453 | "BGP neighbor IP address to clear\n" |
| 6454 | "BGP IPv6 neighbor to clear\n" |
| 6455 | "Soft reconfig for rsclient RIB\n") |
| 6456 | { |
| 6457 | if (argc == 2) |
| 6458 | return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_peer, |
| 6459 | BGP_CLEAR_SOFT_RSCLIENT, argv[1]); |
| 6460 | |
| 6461 | return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer, |
| 6462 | BGP_CLEAR_SOFT_RSCLIENT, argv[0]); |
| 6463 | } |
| 6464 | |
| 6465 | ALIAS (clear_ip_bgp_peer_rsclient, |
| 6466 | clear_ip_bgp_instance_peer_rsclient_cmd, |
| 6467 | "clear ip bgp view WORD (A.B.C.D|X:X::X:X) rsclient", |
| 6468 | CLEAR_STR |
| 6469 | IP_STR |
| 6470 | BGP_STR |
| 6471 | "BGP view\n" |
| 6472 | "view name\n" |
| 6473 | "BGP neighbor IP address to clear\n" |
| 6474 | "BGP IPv6 neighbor to clear\n" |
| 6475 | "Soft reconfig for rsclient RIB\n") |
| 6476 | |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 6477 | DEFUN (show_bgp_memory, |
| 6478 | show_bgp_memory_cmd, |
| 6479 | "show bgp memory", |
| 6480 | SHOW_STR |
| 6481 | BGP_STR |
| 6482 | "Global BGP memory statistics\n") |
| 6483 | { |
| 6484 | char memstrbuf[MTYPE_MEMSTR_LEN]; |
| 6485 | unsigned long count; |
| 6486 | |
| 6487 | /* RIB related usage stats */ |
| 6488 | count = mtype_stats_alloc (MTYPE_BGP_NODE); |
| 6489 | vty_out (vty, "%ld RIB nodes, using %s of memory%s", count, |
| 6490 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6491 | count * sizeof (struct bgp_node)), |
| 6492 | VTY_NEWLINE); |
| 6493 | |
| 6494 | count = mtype_stats_alloc (MTYPE_BGP_ROUTE); |
| 6495 | vty_out (vty, "%ld BGP routes, using %s of memory%s", count, |
| 6496 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6497 | count * sizeof (struct bgp_info)), |
| 6498 | VTY_NEWLINE); |
| 6499 | |
| 6500 | if ((count = mtype_stats_alloc (MTYPE_BGP_STATIC))) |
| 6501 | vty_out (vty, "%ld Static routes, using %s of memory%s", count, |
| 6502 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6503 | count * sizeof (struct bgp_static)), |
| 6504 | VTY_NEWLINE); |
| 6505 | |
| 6506 | /* Adj-In/Out */ |
| 6507 | if ((count = mtype_stats_alloc (MTYPE_BGP_ADJ_IN))) |
| 6508 | vty_out (vty, "%ld Adj-In entries, using %s of memory%s", count, |
| 6509 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6510 | count * sizeof (struct bgp_adj_in)), |
| 6511 | VTY_NEWLINE); |
| 6512 | if ((count = mtype_stats_alloc (MTYPE_BGP_ADJ_OUT))) |
| 6513 | vty_out (vty, "%ld Adj-Out entries, using %s of memory%s", count, |
| 6514 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6515 | count * sizeof (struct bgp_adj_out)), |
| 6516 | VTY_NEWLINE); |
| 6517 | |
| 6518 | if ((count = mtype_stats_alloc (MTYPE_BGP_NEXTHOP_CACHE))) |
| 6519 | vty_out (vty, "%ld Nexthop cache entries, using %s of memory%s", count, |
| 6520 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6521 | count * sizeof (struct bgp_nexthop_cache)), |
| 6522 | VTY_NEWLINE); |
| 6523 | |
| 6524 | if ((count = mtype_stats_alloc (MTYPE_BGP_DAMP_INFO))) |
| 6525 | vty_out (vty, "%ld Dampening entries, using %s of memory%s", count, |
| 6526 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6527 | count * sizeof (struct bgp_damp_info)), |
| 6528 | VTY_NEWLINE); |
| 6529 | |
| 6530 | /* Attributes */ |
| 6531 | count = attr_count(); |
| 6532 | vty_out (vty, "%ld BGP attributes, using %s of memory%s", count, |
| 6533 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6534 | count * sizeof(struct attr)), |
| 6535 | VTY_NEWLINE); |
| 6536 | |
| 6537 | if ((count = attr_unknown_count())) |
| 6538 | vty_out (vty, "%ld unknown attributes%s", count, VTY_NEWLINE); |
| 6539 | |
| 6540 | /* AS_PATH attributes */ |
| 6541 | count = aspath_count (); |
| 6542 | vty_out (vty, "%ld BGP AS-PATH entries, using %s of memory%s", count, |
| 6543 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6544 | count * sizeof (struct aspath)), |
| 6545 | VTY_NEWLINE); |
| 6546 | |
| 6547 | count = mtype_stats_alloc (MTYPE_AS_SEG); |
| 6548 | vty_out (vty, "%ld BGP AS-PATH segments, using %s of memory%s", count, |
| 6549 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6550 | count * sizeof (struct assegment)), |
| 6551 | VTY_NEWLINE); |
| 6552 | |
| 6553 | /* Other attributes */ |
| 6554 | if ((count = community_count ())) |
| 6555 | vty_out (vty, "%ld BGP community entries, using %s of memory%s", count, |
| 6556 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6557 | count * sizeof (struct community)), |
| 6558 | VTY_NEWLINE); |
| 6559 | if ((count = mtype_stats_alloc (MTYPE_ECOMMUNITY))) |
| 6560 | vty_out (vty, "%ld BGP community entries, using %s of memory%s", count, |
| 6561 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6562 | count * sizeof (struct ecommunity)), |
| 6563 | VTY_NEWLINE); |
| 6564 | |
| 6565 | if ((count = mtype_stats_alloc (MTYPE_CLUSTER))) |
| 6566 | vty_out (vty, "%ld Cluster lists, using %s of memory%s", count, |
| 6567 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6568 | count * sizeof (struct cluster_list)), |
| 6569 | VTY_NEWLINE); |
| 6570 | |
| 6571 | /* Peer related usage */ |
| 6572 | count = mtype_stats_alloc (MTYPE_BGP_PEER); |
| 6573 | vty_out (vty, "%ld peers, using %s of memory%s", count, |
| 6574 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6575 | count * sizeof (struct peer)), |
| 6576 | VTY_NEWLINE); |
| 6577 | |
| 6578 | if ((count = mtype_stats_alloc (MTYPE_PEER_GROUP))) |
| 6579 | vty_out (vty, "%ld peer groups, using %s of memory%s", count, |
| 6580 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6581 | count * sizeof (struct peer_group)), |
| 6582 | VTY_NEWLINE); |
| 6583 | |
| 6584 | /* Other */ |
| 6585 | if ((count = mtype_stats_alloc (MTYPE_HASH))) |
| 6586 | vty_out (vty, "%ld hash tables, using %s of memory%s", count, |
| 6587 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6588 | count * sizeof (struct hash)), |
| 6589 | VTY_NEWLINE); |
| 6590 | if ((count = mtype_stats_alloc (MTYPE_HASH_BACKET))) |
| 6591 | vty_out (vty, "%ld hash buckets, using %s of memory%s", count, |
| 6592 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6593 | count * sizeof (struct hash_backet)), |
| 6594 | VTY_NEWLINE); |
| 6595 | if ((count = mtype_stats_alloc (MTYPE_BGP_REGEXP))) |
| 6596 | vty_out (vty, "%ld compiled regexes, using %s of memory%s", count, |
| 6597 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6598 | count * sizeof (regex_t)), |
| 6599 | VTY_NEWLINE); |
| 6600 | return CMD_SUCCESS; |
| 6601 | } |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 6602 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6603 | /* Show BGP peer's summary information. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 6604 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6605 | bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi) |
| 6606 | { |
| 6607 | struct peer *peer; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 6608 | struct listnode *node, *nnode; |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 6609 | unsigned int count = 0; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6610 | char timebuf[BGP_UPTIME_LEN]; |
| 6611 | int len; |
| 6612 | |
| 6613 | /* Header string for each address family. */ |
| 6614 | 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] | 6615 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 6616 | for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6617 | { |
| 6618 | if (peer->afc[afi][safi]) |
| 6619 | { |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 6620 | if (!count) |
| 6621 | { |
| 6622 | unsigned long ents; |
| 6623 | char memstrbuf[MTYPE_MEMSTR_LEN]; |
| 6624 | |
| 6625 | /* Usage summary and header */ |
| 6626 | vty_out (vty, |
| 6627 | "BGP router identifier %s, local AS number %d%s", |
| 6628 | inet_ntoa (bgp->router_id), bgp->as, VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6629 | |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 6630 | ents = bgp_table_count (bgp->rib[afi][safi]); |
| 6631 | vty_out (vty, "RIB entries %ld, using %s of memory%s", ents, |
| 6632 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6633 | ents * sizeof (struct bgp_node)), |
| 6634 | VTY_NEWLINE); |
| 6635 | |
| 6636 | /* Peer related usage */ |
| 6637 | ents = listcount (bgp->peer); |
| 6638 | vty_out (vty, "Peers %ld, using %s of memory%s", |
| 6639 | ents, |
| 6640 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6641 | ents * sizeof (struct peer)), |
| 6642 | VTY_NEWLINE); |
| 6643 | |
| 6644 | if ((ents = listcount (bgp->rsclient))) |
| 6645 | vty_out (vty, "RS-Client peers %ld, using %s of memory%s", |
| 6646 | ents, |
| 6647 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6648 | ents * sizeof (struct peer)), |
| 6649 | VTY_NEWLINE); |
| 6650 | |
| 6651 | if ((ents = listcount (bgp->group))) |
| 6652 | vty_out (vty, "Peer groups %ld, using %s of memory%s", ents, |
| 6653 | mtype_memstr (memstrbuf, sizeof (memstrbuf), |
| 6654 | ents * sizeof (struct peer_group)), |
| 6655 | VTY_NEWLINE); |
| 6656 | |
| 6657 | if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING)) |
| 6658 | vty_out (vty, "Dampening enabled.%s", VTY_NEWLINE); |
| 6659 | vty_out (vty, "%s", VTY_NEWLINE); |
| 6660 | vty_out (vty, "%s%s", header, VTY_NEWLINE); |
| 6661 | } |
| 6662 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6663 | count++; |
| 6664 | |
| 6665 | len = vty_out (vty, "%s", peer->host); |
| 6666 | len = 16 - len; |
| 6667 | if (len < 1) |
| 6668 | vty_out (vty, "%s%*s", VTY_NEWLINE, 16, " "); |
| 6669 | else |
| 6670 | vty_out (vty, "%*s", len, " "); |
| 6671 | |
hasso | 3d515fd | 2005-02-01 21:30:04 +0000 | [diff] [blame] | 6672 | vty_out (vty, "4 "); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6673 | |
| 6674 | vty_out (vty, "%5d %7d %7d %8d %4d %4ld ", |
| 6675 | peer->as, |
| 6676 | peer->open_in + peer->update_in + peer->keepalive_in |
| 6677 | + peer->notify_in + peer->refresh_in + peer->dynamic_cap_in, |
| 6678 | peer->open_out + peer->update_out + peer->keepalive_out |
| 6679 | + peer->notify_out + peer->refresh_out |
| 6680 | + peer->dynamic_cap_out, |
| 6681 | 0, 0, peer->obuf->count); |
| 6682 | |
| 6683 | vty_out (vty, "%8s", |
| 6684 | peer_uptime (peer->uptime, timebuf, BGP_UPTIME_LEN)); |
| 6685 | |
| 6686 | if (peer->status == Established) |
| 6687 | { |
| 6688 | vty_out (vty, " %8ld", peer->pcount[afi][safi]); |
| 6689 | } |
| 6690 | else |
| 6691 | { |
| 6692 | if (CHECK_FLAG (peer->flags, PEER_FLAG_SHUTDOWN)) |
| 6693 | vty_out (vty, " Idle (Admin)"); |
| 6694 | else if (CHECK_FLAG (peer->sflags, PEER_STATUS_PREFIX_OVERFLOW)) |
| 6695 | vty_out (vty, " Idle (PfxCt)"); |
| 6696 | else |
| 6697 | vty_out (vty, " %-11s", LOOKUP(bgp_status_msg, peer->status)); |
| 6698 | } |
| 6699 | |
| 6700 | vty_out (vty, "%s", VTY_NEWLINE); |
| 6701 | } |
| 6702 | } |
| 6703 | |
| 6704 | if (count) |
| 6705 | vty_out (vty, "%sTotal number of neighbors %d%s", VTY_NEWLINE, |
| 6706 | count, VTY_NEWLINE); |
| 6707 | else |
| 6708 | vty_out (vty, "No %s neighbor is configured%s", |
| 6709 | afi == AFI_IP ? "IPv4" : "IPv6", VTY_NEWLINE); |
| 6710 | return CMD_SUCCESS; |
| 6711 | } |
| 6712 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 6713 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 6714 | bgp_show_summary_vty (struct vty *vty, const char *name, |
| 6715 | afi_t afi, safi_t safi) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6716 | { |
| 6717 | struct bgp *bgp; |
| 6718 | |
| 6719 | if (name) |
| 6720 | { |
| 6721 | bgp = bgp_lookup_by_name (name); |
| 6722 | |
| 6723 | if (! bgp) |
| 6724 | { |
| 6725 | vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE); |
| 6726 | return CMD_WARNING; |
| 6727 | } |
| 6728 | |
| 6729 | bgp_show_summary (vty, bgp, afi, safi); |
| 6730 | return CMD_SUCCESS; |
| 6731 | } |
| 6732 | |
| 6733 | bgp = bgp_get_default (); |
| 6734 | |
| 6735 | if (bgp) |
| 6736 | bgp_show_summary (vty, bgp, afi, safi); |
| 6737 | |
| 6738 | return CMD_SUCCESS; |
| 6739 | } |
| 6740 | |
| 6741 | /* `show ip bgp summary' commands. */ |
| 6742 | DEFUN (show_ip_bgp_summary, |
| 6743 | show_ip_bgp_summary_cmd, |
| 6744 | "show ip bgp summary", |
| 6745 | SHOW_STR |
| 6746 | IP_STR |
| 6747 | BGP_STR |
| 6748 | "Summary of BGP neighbor status\n") |
| 6749 | { |
| 6750 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 6751 | } |
| 6752 | |
| 6753 | DEFUN (show_ip_bgp_instance_summary, |
| 6754 | show_ip_bgp_instance_summary_cmd, |
| 6755 | "show ip bgp view WORD summary", |
| 6756 | SHOW_STR |
| 6757 | IP_STR |
| 6758 | BGP_STR |
| 6759 | "BGP view\n" |
| 6760 | "View name\n" |
| 6761 | "Summary of BGP neighbor status\n") |
| 6762 | { |
| 6763 | return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 6764 | } |
| 6765 | |
| 6766 | DEFUN (show_ip_bgp_ipv4_summary, |
| 6767 | show_ip_bgp_ipv4_summary_cmd, |
| 6768 | "show ip bgp ipv4 (unicast|multicast) summary", |
| 6769 | SHOW_STR |
| 6770 | IP_STR |
| 6771 | BGP_STR |
| 6772 | "Address family\n" |
| 6773 | "Address Family modifier\n" |
| 6774 | "Address Family modifier\n" |
| 6775 | "Summary of BGP neighbor status\n") |
| 6776 | { |
| 6777 | if (strncmp (argv[0], "m", 1) == 0) |
| 6778 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); |
| 6779 | |
| 6780 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 6781 | } |
| 6782 | |
| 6783 | DEFUN (show_ip_bgp_instance_ipv4_summary, |
| 6784 | show_ip_bgp_instance_ipv4_summary_cmd, |
| 6785 | "show ip bgp view WORD ipv4 (unicast|multicast) summary", |
| 6786 | SHOW_STR |
| 6787 | IP_STR |
| 6788 | BGP_STR |
| 6789 | "BGP view\n" |
| 6790 | "View name\n" |
| 6791 | "Address family\n" |
| 6792 | "Address Family modifier\n" |
| 6793 | "Address Family modifier\n" |
| 6794 | "Summary of BGP neighbor status\n") |
| 6795 | { |
| 6796 | if (strncmp (argv[1], "m", 1) == 0) |
| 6797 | return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST); |
| 6798 | else |
| 6799 | return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 6800 | } |
| 6801 | |
| 6802 | DEFUN (show_ip_bgp_vpnv4_all_summary, |
| 6803 | show_ip_bgp_vpnv4_all_summary_cmd, |
| 6804 | "show ip bgp vpnv4 all summary", |
| 6805 | SHOW_STR |
| 6806 | IP_STR |
| 6807 | BGP_STR |
| 6808 | "Display VPNv4 NLRI specific information\n" |
| 6809 | "Display information about all VPNv4 NLRIs\n" |
| 6810 | "Summary of BGP neighbor status\n") |
| 6811 | { |
| 6812 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); |
| 6813 | } |
| 6814 | |
| 6815 | DEFUN (show_ip_bgp_vpnv4_rd_summary, |
| 6816 | show_ip_bgp_vpnv4_rd_summary_cmd, |
| 6817 | "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn summary", |
| 6818 | SHOW_STR |
| 6819 | IP_STR |
| 6820 | BGP_STR |
| 6821 | "Display VPNv4 NLRI specific information\n" |
| 6822 | "Display information for a route distinguisher\n" |
| 6823 | "VPN Route Distinguisher\n" |
| 6824 | "Summary of BGP neighbor status\n") |
| 6825 | { |
| 6826 | int ret; |
| 6827 | struct prefix_rd prd; |
| 6828 | |
| 6829 | ret = str2prefix_rd (argv[0], &prd); |
| 6830 | if (! ret) |
| 6831 | { |
| 6832 | vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE); |
| 6833 | return CMD_WARNING; |
| 6834 | } |
| 6835 | |
| 6836 | return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN); |
| 6837 | } |
| 6838 | |
| 6839 | #ifdef HAVE_IPV6 |
| 6840 | DEFUN (show_bgp_summary, |
| 6841 | show_bgp_summary_cmd, |
| 6842 | "show bgp summary", |
| 6843 | SHOW_STR |
| 6844 | BGP_STR |
| 6845 | "Summary of BGP neighbor status\n") |
| 6846 | { |
| 6847 | return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); |
| 6848 | } |
| 6849 | |
| 6850 | DEFUN (show_bgp_instance_summary, |
| 6851 | show_bgp_instance_summary_cmd, |
| 6852 | "show bgp view WORD summary", |
| 6853 | SHOW_STR |
| 6854 | BGP_STR |
| 6855 | "BGP view\n" |
| 6856 | "View name\n" |
| 6857 | "Summary of BGP neighbor status\n") |
| 6858 | { |
| 6859 | return bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST); |
| 6860 | } |
| 6861 | |
| 6862 | ALIAS (show_bgp_summary, |
| 6863 | show_bgp_ipv6_summary_cmd, |
| 6864 | "show bgp ipv6 summary", |
| 6865 | SHOW_STR |
| 6866 | BGP_STR |
| 6867 | "Address family\n" |
| 6868 | "Summary of BGP neighbor status\n") |
| 6869 | |
| 6870 | ALIAS (show_bgp_instance_summary, |
| 6871 | show_bgp_instance_ipv6_summary_cmd, |
| 6872 | "show bgp view WORD ipv6 summary", |
| 6873 | SHOW_STR |
| 6874 | BGP_STR |
| 6875 | "BGP view\n" |
| 6876 | "View name\n" |
| 6877 | "Address family\n" |
| 6878 | "Summary of BGP neighbor status\n") |
| 6879 | |
| 6880 | /* old command */ |
| 6881 | DEFUN (show_ipv6_bgp_summary, |
| 6882 | show_ipv6_bgp_summary_cmd, |
| 6883 | "show ipv6 bgp summary", |
| 6884 | SHOW_STR |
| 6885 | IPV6_STR |
| 6886 | BGP_STR |
| 6887 | "Summary of BGP neighbor status\n") |
| 6888 | { |
| 6889 | return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); |
| 6890 | } |
| 6891 | |
| 6892 | /* old command */ |
| 6893 | DEFUN (show_ipv6_mbgp_summary, |
| 6894 | show_ipv6_mbgp_summary_cmd, |
| 6895 | "show ipv6 mbgp summary", |
| 6896 | SHOW_STR |
| 6897 | IPV6_STR |
| 6898 | MBGP_STR |
| 6899 | "Summary of BGP neighbor status\n") |
| 6900 | { |
| 6901 | return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST); |
| 6902 | } |
| 6903 | #endif /* HAVE_IPV6 */ |
| 6904 | |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 6905 | const char * |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 6906 | afi_safi_print (afi_t afi, safi_t safi) |
| 6907 | { |
| 6908 | if (afi == AFI_IP && safi == SAFI_UNICAST) |
| 6909 | return "IPv4 Unicast"; |
| 6910 | else if (afi == AFI_IP && safi == SAFI_MULTICAST) |
| 6911 | return "IPv4 Multicast"; |
| 6912 | else if (afi == AFI_IP && safi == SAFI_MPLS_VPN) |
| 6913 | return "VPNv4 Unicast"; |
| 6914 | else if (afi == AFI_IP6 && safi == SAFI_UNICAST) |
| 6915 | return "IPv6 Unicast"; |
| 6916 | else if (afi == AFI_IP6 && safi == SAFI_MULTICAST) |
| 6917 | return "IPv6 Multicast"; |
| 6918 | else |
| 6919 | return "Unknown"; |
| 6920 | } |
| 6921 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6922 | /* Show BGP peer's information. */ |
| 6923 | enum show_type |
| 6924 | { |
| 6925 | show_all, |
| 6926 | show_peer |
| 6927 | }; |
| 6928 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 6929 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6930 | bgp_show_peer_afi_orf_cap (struct vty *vty, struct peer *p, |
| 6931 | afi_t afi, safi_t safi, |
| 6932 | u_int16_t adv_smcap, u_int16_t adv_rmcap, |
| 6933 | u_int16_t rcv_smcap, u_int16_t rcv_rmcap) |
| 6934 | { |
| 6935 | /* Send-Mode */ |
| 6936 | if (CHECK_FLAG (p->af_cap[afi][safi], adv_smcap) |
| 6937 | || CHECK_FLAG (p->af_cap[afi][safi], rcv_smcap)) |
| 6938 | { |
| 6939 | vty_out (vty, " Send-mode: "); |
| 6940 | if (CHECK_FLAG (p->af_cap[afi][safi], adv_smcap)) |
| 6941 | vty_out (vty, "advertised"); |
| 6942 | if (CHECK_FLAG (p->af_cap[afi][safi], rcv_smcap)) |
| 6943 | vty_out (vty, "%sreceived", |
| 6944 | CHECK_FLAG (p->af_cap[afi][safi], adv_smcap) ? |
| 6945 | ", " : ""); |
| 6946 | vty_out (vty, "%s", VTY_NEWLINE); |
| 6947 | } |
| 6948 | |
| 6949 | /* Receive-Mode */ |
| 6950 | if (CHECK_FLAG (p->af_cap[afi][safi], adv_rmcap) |
| 6951 | || CHECK_FLAG (p->af_cap[afi][safi], rcv_rmcap)) |
| 6952 | { |
| 6953 | vty_out (vty, " Receive-mode: "); |
| 6954 | if (CHECK_FLAG (p->af_cap[afi][safi], adv_rmcap)) |
| 6955 | vty_out (vty, "advertised"); |
| 6956 | if (CHECK_FLAG (p->af_cap[afi][safi], rcv_rmcap)) |
| 6957 | vty_out (vty, "%sreceived", |
| 6958 | CHECK_FLAG (p->af_cap[afi][safi], adv_rmcap) ? |
| 6959 | ", " : ""); |
| 6960 | vty_out (vty, "%s", VTY_NEWLINE); |
| 6961 | } |
| 6962 | } |
| 6963 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 6964 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6965 | bgp_show_peer_afi (struct vty *vty, struct peer *p, afi_t afi, safi_t safi) |
| 6966 | { |
| 6967 | struct bgp_filter *filter; |
| 6968 | char orf_pfx_name[BUFSIZ]; |
| 6969 | int orf_pfx_count; |
| 6970 | |
| 6971 | filter = &p->filter[afi][safi]; |
| 6972 | |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 6973 | vty_out (vty, " For address family: %s%s", afi_safi_print (afi, safi), |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6974 | VTY_NEWLINE); |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 6975 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 6976 | if (p->af_group[afi][safi]) |
| 6977 | vty_out (vty, " %s peer-group member%s", p->group->name, VTY_NEWLINE); |
| 6978 | |
| 6979 | if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV) |
| 6980 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_RCV) |
| 6981 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_OLD_RCV) |
| 6982 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV) |
| 6983 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_RCV) |
| 6984 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_OLD_RCV)) |
| 6985 | vty_out (vty, " AF-dependant capabilities:%s", VTY_NEWLINE); |
| 6986 | |
| 6987 | if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV) |
| 6988 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_RCV) |
| 6989 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV) |
| 6990 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_RCV)) |
| 6991 | { |
| 6992 | vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s", |
| 6993 | ORF_TYPE_PREFIX, VTY_NEWLINE); |
| 6994 | bgp_show_peer_afi_orf_cap (vty, p, afi, safi, |
| 6995 | PEER_CAP_ORF_PREFIX_SM_ADV, |
| 6996 | PEER_CAP_ORF_PREFIX_RM_ADV, |
| 6997 | PEER_CAP_ORF_PREFIX_SM_RCV, |
| 6998 | PEER_CAP_ORF_PREFIX_RM_RCV); |
| 6999 | } |
| 7000 | if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV) |
| 7001 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_OLD_RCV) |
| 7002 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV) |
| 7003 | || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_OLD_RCV)) |
| 7004 | { |
| 7005 | vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s", |
| 7006 | ORF_TYPE_PREFIX_OLD, VTY_NEWLINE); |
| 7007 | bgp_show_peer_afi_orf_cap (vty, p, afi, safi, |
| 7008 | PEER_CAP_ORF_PREFIX_SM_ADV, |
| 7009 | PEER_CAP_ORF_PREFIX_RM_ADV, |
| 7010 | PEER_CAP_ORF_PREFIX_SM_OLD_RCV, |
| 7011 | PEER_CAP_ORF_PREFIX_RM_OLD_RCV); |
| 7012 | } |
| 7013 | |
| 7014 | sprintf (orf_pfx_name, "%s.%d.%d", p->host, afi, safi); |
| 7015 | orf_pfx_count = prefix_bgp_show_prefix_list (NULL, afi, orf_pfx_name); |
| 7016 | |
| 7017 | if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_ORF_PREFIX_SEND) |
| 7018 | || orf_pfx_count) |
| 7019 | { |
| 7020 | vty_out (vty, " Outbound Route Filter (ORF):"); |
| 7021 | if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_ORF_PREFIX_SEND)) |
| 7022 | vty_out (vty, " sent;"); |
| 7023 | if (orf_pfx_count) |
| 7024 | vty_out (vty, " received (%d entries)", orf_pfx_count); |
| 7025 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7026 | } |
| 7027 | if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_ORF_WAIT_REFRESH)) |
| 7028 | vty_out (vty, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTY_NEWLINE); |
| 7029 | |
| 7030 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REFLECTOR_CLIENT)) |
| 7031 | vty_out (vty, " Route-Reflector Client%s", VTY_NEWLINE); |
| 7032 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT)) |
| 7033 | vty_out (vty, " Route-Server Client%s", VTY_NEWLINE); |
| 7034 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SOFT_RECONFIG)) |
| 7035 | vty_out (vty, " Inbound soft reconfiguration allowed%s", VTY_NEWLINE); |
| 7036 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_REMOVE_PRIVATE_AS)) |
| 7037 | vty_out (vty, " Private AS number removed from updates to this neighbor%s", VTY_NEWLINE); |
| 7038 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_NEXTHOP_SELF)) |
| 7039 | vty_out (vty, " NEXT_HOP is always this router%s", VTY_NEWLINE); |
| 7040 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_AS_PATH_UNCHANGED)) |
| 7041 | vty_out (vty, " AS_PATH is propagated unchanged to this neighbor%s", VTY_NEWLINE); |
| 7042 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_NEXTHOP_UNCHANGED)) |
| 7043 | vty_out (vty, " NEXT_HOP is propagated unchanged to this neighbor%s", VTY_NEWLINE); |
| 7044 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MED_UNCHANGED)) |
| 7045 | vty_out (vty, " MED is propagated unchanged to this neighbor%s", VTY_NEWLINE); |
| 7046 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY) |
| 7047 | || CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY)) |
| 7048 | { |
| 7049 | vty_out (vty, " Community attribute sent to this neighbor"); |
| 7050 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_COMMUNITY) |
| 7051 | && CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY)) |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7052 | vty_out (vty, "(both)%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7053 | 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] | 7054 | vty_out (vty, "(extended)%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7055 | else |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7056 | vty_out (vty, "(standard)%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7057 | } |
| 7058 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_DEFAULT_ORIGINATE)) |
| 7059 | { |
| 7060 | vty_out (vty, " Default information originate,"); |
| 7061 | |
| 7062 | if (p->default_rmap[afi][safi].name) |
| 7063 | vty_out (vty, " default route-map %s%s,", |
| 7064 | p->default_rmap[afi][safi].map ? "*" : "", |
| 7065 | p->default_rmap[afi][safi].name); |
| 7066 | if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_DEFAULT_ORIGINATE)) |
| 7067 | vty_out (vty, " default sent%s", VTY_NEWLINE); |
| 7068 | else |
| 7069 | vty_out (vty, " default not sent%s", VTY_NEWLINE); |
| 7070 | } |
| 7071 | |
| 7072 | if (filter->plist[FILTER_IN].name |
| 7073 | || filter->dlist[FILTER_IN].name |
| 7074 | || filter->aslist[FILTER_IN].name |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7075 | || filter->map[RMAP_IN].name) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7076 | vty_out (vty, " Inbound path policy configured%s", VTY_NEWLINE); |
| 7077 | if (filter->plist[FILTER_OUT].name |
| 7078 | || filter->dlist[FILTER_OUT].name |
| 7079 | || filter->aslist[FILTER_OUT].name |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7080 | || filter->map[RMAP_OUT].name |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7081 | || filter->usmap.name) |
| 7082 | vty_out (vty, " Outbound path policy configured%s", VTY_NEWLINE); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7083 | if (filter->map[RMAP_IMPORT].name) |
| 7084 | vty_out (vty, " Import policy for this RS-client configured%s", VTY_NEWLINE); |
| 7085 | if (filter->map[RMAP_EXPORT].name) |
| 7086 | vty_out (vty, " Export policy for this RS-client configured%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7087 | |
| 7088 | /* prefix-list */ |
| 7089 | if (filter->plist[FILTER_IN].name) |
| 7090 | vty_out (vty, " Incoming update prefix filter list is %s%s%s", |
| 7091 | filter->plist[FILTER_IN].plist ? "*" : "", |
| 7092 | filter->plist[FILTER_IN].name, |
| 7093 | VTY_NEWLINE); |
| 7094 | if (filter->plist[FILTER_OUT].name) |
| 7095 | vty_out (vty, " Outgoing update prefix filter list is %s%s%s", |
| 7096 | filter->plist[FILTER_OUT].plist ? "*" : "", |
| 7097 | filter->plist[FILTER_OUT].name, |
| 7098 | VTY_NEWLINE); |
| 7099 | |
| 7100 | /* distribute-list */ |
| 7101 | if (filter->dlist[FILTER_IN].name) |
| 7102 | vty_out (vty, " Incoming update network filter list is %s%s%s", |
| 7103 | filter->dlist[FILTER_IN].alist ? "*" : "", |
| 7104 | filter->dlist[FILTER_IN].name, |
| 7105 | VTY_NEWLINE); |
| 7106 | if (filter->dlist[FILTER_OUT].name) |
| 7107 | vty_out (vty, " Outgoing update network filter list is %s%s%s", |
| 7108 | filter->dlist[FILTER_OUT].alist ? "*" : "", |
| 7109 | filter->dlist[FILTER_OUT].name, |
| 7110 | VTY_NEWLINE); |
| 7111 | |
| 7112 | /* filter-list. */ |
| 7113 | if (filter->aslist[FILTER_IN].name) |
| 7114 | vty_out (vty, " Incoming update AS path filter list is %s%s%s", |
| 7115 | filter->aslist[FILTER_IN].aslist ? "*" : "", |
| 7116 | filter->aslist[FILTER_IN].name, |
| 7117 | VTY_NEWLINE); |
| 7118 | if (filter->aslist[FILTER_OUT].name) |
| 7119 | vty_out (vty, " Outgoing update AS path filter list is %s%s%s", |
| 7120 | filter->aslist[FILTER_OUT].aslist ? "*" : "", |
| 7121 | filter->aslist[FILTER_OUT].name, |
| 7122 | VTY_NEWLINE); |
| 7123 | |
| 7124 | /* route-map. */ |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7125 | if (filter->map[RMAP_IN].name) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7126 | vty_out (vty, " Route map for incoming advertisements is %s%s%s", |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7127 | filter->map[RMAP_IN].map ? "*" : "", |
| 7128 | filter->map[RMAP_IN].name, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7129 | VTY_NEWLINE); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7130 | if (filter->map[RMAP_OUT].name) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7131 | vty_out (vty, " Route map for outgoing advertisements is %s%s%s", |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7132 | filter->map[RMAP_OUT].map ? "*" : "", |
| 7133 | filter->map[RMAP_OUT].name, |
| 7134 | VTY_NEWLINE); |
| 7135 | if (filter->map[RMAP_IMPORT].name) |
| 7136 | vty_out (vty, " Route map for advertisements going into this RS-client's table is %s%s%s", |
| 7137 | filter->map[RMAP_IMPORT].map ? "*" : "", |
| 7138 | filter->map[RMAP_IMPORT].name, |
| 7139 | VTY_NEWLINE); |
| 7140 | if (filter->map[RMAP_EXPORT].name) |
| 7141 | vty_out (vty, " Route map for advertisements coming from this RS-client is %s%s%s", |
| 7142 | filter->map[RMAP_EXPORT].map ? "*" : "", |
| 7143 | filter->map[RMAP_EXPORT].name, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7144 | VTY_NEWLINE); |
| 7145 | |
| 7146 | /* unsuppress-map */ |
| 7147 | if (filter->usmap.name) |
| 7148 | vty_out (vty, " Route map for selective unsuppress is %s%s%s", |
| 7149 | filter->usmap.map ? "*" : "", |
| 7150 | filter->usmap.name, VTY_NEWLINE); |
| 7151 | |
| 7152 | /* Receive prefix count */ |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 7153 | vty_out (vty, " %ld accepted prefixes%s", p->pcount[afi][safi], VTY_NEWLINE); |
| 7154 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7155 | /* Maximum prefix */ |
| 7156 | if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX)) |
| 7157 | { |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 7158 | vty_out (vty, " Maximum prefixes allowed %ld%s%s", p->pmax[afi][safi], |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7159 | CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX_WARNING) |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 7160 | ? " (warning-only)" : "", VTY_NEWLINE); |
| 7161 | vty_out (vty, " Threshold for warning message %d%%", |
| 7162 | p->pmax_threshold[afi][safi]); |
| 7163 | if (p->pmax_restart[afi][safi]) |
| 7164 | vty_out (vty, ", restart interval %d min", p->pmax_restart[afi][safi]); |
| 7165 | vty_out (vty, "%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7166 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7167 | |
| 7168 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7169 | } |
| 7170 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 7171 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7172 | bgp_show_peer (struct vty *vty, struct peer *p) |
| 7173 | { |
| 7174 | struct bgp *bgp; |
| 7175 | char buf1[BUFSIZ]; |
| 7176 | char timebuf[BGP_UPTIME_LEN]; |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7177 | afi_t afi; |
| 7178 | safi_t safi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7179 | |
| 7180 | bgp = p->bgp; |
| 7181 | |
| 7182 | /* Configured IP address. */ |
| 7183 | vty_out (vty, "BGP neighbor is %s, ", p->host); |
| 7184 | vty_out (vty, "remote AS %d, ", p->as); |
| 7185 | vty_out (vty, "local AS %d%s, ", |
| 7186 | p->change_local_as ? p->change_local_as : p->local_as, |
| 7187 | CHECK_FLAG (p->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND) ? |
| 7188 | " no-prepend" : ""); |
| 7189 | vty_out (vty, "%s link%s", |
| 7190 | p->as == p->local_as ? "internal" : "external", |
| 7191 | VTY_NEWLINE); |
| 7192 | |
| 7193 | /* Description. */ |
| 7194 | if (p->desc) |
| 7195 | vty_out (vty, " Description: %s%s", p->desc, VTY_NEWLINE); |
| 7196 | |
| 7197 | /* Peer-group */ |
| 7198 | if (p->group) |
| 7199 | vty_out (vty, " Member of peer-group %s for session parameters%s", |
| 7200 | p->group->name, VTY_NEWLINE); |
| 7201 | |
| 7202 | /* Administrative shutdown. */ |
| 7203 | if (CHECK_FLAG (p->flags, PEER_FLAG_SHUTDOWN)) |
| 7204 | vty_out (vty, " Administratively shut down%s", VTY_NEWLINE); |
| 7205 | |
| 7206 | /* BGP Version. */ |
| 7207 | vty_out (vty, " BGP version 4"); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7208 | vty_out (vty, ", remote router ID %s%s", |
| 7209 | inet_ntop (AF_INET, &p->remote_id, buf1, BUFSIZ), |
| 7210 | VTY_NEWLINE); |
| 7211 | |
| 7212 | /* Confederation */ |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 7213 | if (CHECK_FLAG (bgp->config, BGP_CONFIG_CONFEDERATION) |
| 7214 | && bgp_confederation_peers_check (bgp, p->as)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7215 | vty_out (vty, " Neighbor under common administration%s", VTY_NEWLINE); |
| 7216 | |
| 7217 | /* Status. */ |
| 7218 | vty_out (vty, " BGP state = %s", |
| 7219 | LOOKUP (bgp_status_msg, p->status)); |
| 7220 | if (p->status == Established) |
| 7221 | vty_out (vty, ", up for %8s", |
| 7222 | peer_uptime (p->uptime, timebuf, BGP_UPTIME_LEN)); |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 7223 | else if (p->status == Active) |
| 7224 | { |
| 7225 | if (CHECK_FLAG (p->flags, PEER_FLAG_PASSIVE)) |
| 7226 | vty_out (vty, " (passive)"); |
| 7227 | else if (CHECK_FLAG (p->sflags, PEER_STATUS_NSF_WAIT)) |
| 7228 | vty_out (vty, " (NSF passive)"); |
| 7229 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7230 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7231 | |
| 7232 | /* read timer */ |
| 7233 | vty_out (vty, " Last read %s", peer_uptime (p->readtime, timebuf, BGP_UPTIME_LEN)); |
| 7234 | |
| 7235 | /* Configured timer values. */ |
| 7236 | vty_out (vty, ", hold time is %d, keepalive interval is %d seconds%s", |
| 7237 | p->v_holdtime, p->v_keepalive, VTY_NEWLINE); |
| 7238 | if (CHECK_FLAG (p->config, PEER_CONFIG_TIMER)) |
| 7239 | { |
| 7240 | vty_out (vty, " Configured hold time is %d", p->holdtime); |
| 7241 | vty_out (vty, ", keepalive interval is %d seconds%s", |
| 7242 | p->keepalive, VTY_NEWLINE); |
| 7243 | } |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 7244 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7245 | /* Capability. */ |
| 7246 | if (p->status == Established) |
| 7247 | { |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7248 | if (p->cap |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7249 | || p->afc_adv[AFI_IP][SAFI_UNICAST] |
| 7250 | || p->afc_recv[AFI_IP][SAFI_UNICAST] |
| 7251 | || p->afc_adv[AFI_IP][SAFI_MULTICAST] |
| 7252 | || p->afc_recv[AFI_IP][SAFI_MULTICAST] |
| 7253 | #ifdef HAVE_IPV6 |
| 7254 | || p->afc_adv[AFI_IP6][SAFI_UNICAST] |
| 7255 | || p->afc_recv[AFI_IP6][SAFI_UNICAST] |
| 7256 | || p->afc_adv[AFI_IP6][SAFI_MULTICAST] |
| 7257 | || p->afc_recv[AFI_IP6][SAFI_MULTICAST] |
| 7258 | #endif /* HAVE_IPV6 */ |
| 7259 | || p->afc_adv[AFI_IP][SAFI_MPLS_VPN] |
| 7260 | || p->afc_recv[AFI_IP][SAFI_MPLS_VPN]) |
| 7261 | { |
| 7262 | vty_out (vty, " Neighbor capabilities:%s", VTY_NEWLINE); |
| 7263 | |
| 7264 | /* Dynamic */ |
| 7265 | if (CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_RCV) |
| 7266 | || CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_ADV)) |
| 7267 | { |
| 7268 | vty_out (vty, " Dynamic:"); |
| 7269 | if (CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_ADV)) |
| 7270 | vty_out (vty, " advertised"); |
| 7271 | if (CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_RCV)) |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7272 | vty_out (vty, " %sreceived", |
| 7273 | CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_ADV) ? "and " : ""); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7274 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7275 | } |
| 7276 | |
| 7277 | /* Route Refresh */ |
| 7278 | if (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_ADV) |
| 7279 | || CHECK_FLAG (p->cap, PEER_CAP_REFRESH_NEW_RCV) |
| 7280 | || CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV)) |
| 7281 | { |
| 7282 | vty_out (vty, " Route refresh:"); |
| 7283 | if (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_ADV)) |
| 7284 | vty_out (vty, " advertised"); |
| 7285 | if (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_NEW_RCV) |
| 7286 | || CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV)) |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7287 | vty_out (vty, " %sreceived(%s)", |
| 7288 | CHECK_FLAG (p->cap, PEER_CAP_REFRESH_ADV) ? "and " : "", |
| 7289 | (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV) |
| 7290 | && CHECK_FLAG (p->cap, PEER_CAP_REFRESH_NEW_RCV)) ? |
| 7291 | "old & new" : CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV) ? "old" : "new"); |
| 7292 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7293 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7294 | } |
| 7295 | |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7296 | /* Multiprotocol Extensions */ |
| 7297 | for (afi = AFI_IP ; afi < AFI_MAX ; afi++) |
| 7298 | for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) |
| 7299 | if (p->afc_adv[afi][safi] || p->afc_recv[afi][safi]) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7300 | { |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7301 | vty_out (vty, " Address family %s:", afi_safi_print (afi, safi)); |
| 7302 | if (p->afc_adv[afi][safi]) |
| 7303 | vty_out (vty, " advertised"); |
| 7304 | if (p->afc_recv[afi][safi]) |
| 7305 | vty_out (vty, " %sreceived", p->afc_adv[afi][safi] ? "and " : ""); |
| 7306 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7307 | } |
| 7308 | |
| 7309 | /* Gracefull Restart */ |
| 7310 | if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV) |
| 7311 | || CHECK_FLAG (p->cap, PEER_CAP_RESTART_ADV)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7312 | { |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7313 | vty_out (vty, " Graceful Restart Capabilty:"); |
| 7314 | if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_ADV)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7315 | vty_out (vty, " advertised"); |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7316 | if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV)) |
| 7317 | vty_out (vty, " %sreceived", |
| 7318 | CHECK_FLAG (p->cap, PEER_CAP_RESTART_ADV) ? "and " : ""); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7319 | vty_out (vty, "%s", VTY_NEWLINE); |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7320 | |
| 7321 | if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7322 | { |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7323 | int restart_af_count = 0; |
| 7324 | |
| 7325 | vty_out (vty, " Remote Restart timer is %d seconds%s", |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 7326 | p->v_gr_restart, VTY_NEWLINE); |
| 7327 | vty_out (vty, " Address families by peer:%s ", VTY_NEWLINE); |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7328 | |
| 7329 | for (afi = AFI_IP ; afi < AFI_MAX ; afi++) |
| 7330 | for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) |
| 7331 | if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_RESTART_AF_RCV)) |
| 7332 | { |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 7333 | vty_out (vty, "%s%s(%s)", restart_af_count ? ", " : "", |
| 7334 | afi_safi_print (afi, safi), |
| 7335 | CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_RESTART_AF_PRESERVE_RCV) ? |
| 7336 | "preserved" : "not preserved"); |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7337 | restart_af_count++; |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 7338 | } |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7339 | if (! restart_af_count) |
| 7340 | vty_out (vty, "none"); |
| 7341 | vty_out (vty, "%s", VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7342 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7343 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7344 | } |
| 7345 | } |
| 7346 | |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 7347 | /* graceful restart information */ |
| 7348 | if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV) |
| 7349 | || p->t_gr_restart |
| 7350 | || p->t_gr_stale) |
| 7351 | { |
| 7352 | int eor_send_af_count = 0; |
| 7353 | int eor_receive_af_count = 0; |
| 7354 | |
| 7355 | vty_out (vty, " Graceful restart informations:%s", VTY_NEWLINE); |
| 7356 | if (p->status == Established) |
| 7357 | { |
| 7358 | vty_out (vty, " End-of-RIB send: "); |
| 7359 | for (afi = AFI_IP ; afi < AFI_MAX ; afi++) |
| 7360 | for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) |
| 7361 | if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_EOR_SEND)) |
| 7362 | { |
| 7363 | vty_out (vty, "%s%s", eor_send_af_count ? ", " : "", |
| 7364 | afi_safi_print (afi, safi)); |
| 7365 | eor_send_af_count++; |
| 7366 | } |
| 7367 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7368 | |
| 7369 | vty_out (vty, " End-of-RIB received: "); |
| 7370 | for (afi = AFI_IP ; afi < AFI_MAX ; afi++) |
| 7371 | for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) |
| 7372 | if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_EOR_RECEIVED)) |
| 7373 | { |
| 7374 | vty_out (vty, "%s%s", eor_receive_af_count ? ", " : "", |
| 7375 | afi_safi_print (afi, safi)); |
| 7376 | eor_receive_af_count++; |
| 7377 | } |
| 7378 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7379 | } |
| 7380 | |
| 7381 | if (p->t_gr_restart) |
| 7382 | { |
| 7383 | vty_out (vty, " The remaining time of restart timer is %ld%s", |
| 7384 | thread_timer_remain_second (p->t_gr_restart), VTY_NEWLINE); |
| 7385 | } |
| 7386 | if (p->t_gr_stale) |
| 7387 | { |
| 7388 | vty_out (vty, " The remaining time of stalepath timer is %ld%s", |
| 7389 | thread_timer_remain_second (p->t_gr_stale), VTY_NEWLINE); |
| 7390 | } |
| 7391 | } |
| 7392 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7393 | /* Packet counts. */ |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 7394 | vty_out (vty, " Message statistics:%s", VTY_NEWLINE); |
| 7395 | vty_out (vty, " Inq depth is 0%s", VTY_NEWLINE); |
| 7396 | vty_out (vty, " Outq depth is %ld%s", p->obuf->count, VTY_NEWLINE); |
| 7397 | vty_out (vty, " Sent Rcvd%s", VTY_NEWLINE); |
| 7398 | vty_out (vty, " Opens: %10d %10d%s", p->open_out, p->open_in, VTY_NEWLINE); |
| 7399 | vty_out (vty, " Notifications: %10d %10d%s", p->notify_out, p->notify_in, VTY_NEWLINE); |
| 7400 | vty_out (vty, " Updates: %10d %10d%s", p->update_out, p->update_in, VTY_NEWLINE); |
| 7401 | vty_out (vty, " Keepalives: %10d %10d%s", p->keepalive_out, p->keepalive_in, VTY_NEWLINE); |
| 7402 | vty_out (vty, " Route Refresh: %10d %10d%s", p->refresh_out, p->refresh_in, VTY_NEWLINE); |
| 7403 | vty_out (vty, " Capability: %10d %10d%s", p->dynamic_cap_out, p->dynamic_cap_in, VTY_NEWLINE); |
| 7404 | vty_out (vty, " Total: %10d %10d%s", p->open_out + p->notify_out + |
| 7405 | p->update_out + p->keepalive_out + p->refresh_out + p->dynamic_cap_out, |
| 7406 | p->open_in + p->notify_in + p->update_in + p->keepalive_in + p->refresh_in + |
| 7407 | p->dynamic_cap_in, VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7408 | |
| 7409 | /* advertisement-interval */ |
| 7410 | vty_out (vty, " Minimum time between advertisement runs is %d seconds%s", |
| 7411 | p->v_routeadv, VTY_NEWLINE); |
| 7412 | |
| 7413 | /* Update-source. */ |
| 7414 | if (p->update_if || p->update_source) |
| 7415 | { |
| 7416 | vty_out (vty, " Update source is "); |
| 7417 | if (p->update_if) |
| 7418 | vty_out (vty, "%s", p->update_if); |
| 7419 | else if (p->update_source) |
| 7420 | vty_out (vty, "%s", |
| 7421 | sockunion2str (p->update_source, buf1, SU_ADDRSTRLEN)); |
| 7422 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7423 | } |
| 7424 | |
| 7425 | /* Default weight */ |
| 7426 | if (CHECK_FLAG (p->config, PEER_CONFIG_WEIGHT)) |
| 7427 | vty_out (vty, " Default weight %d%s", p->weight, |
| 7428 | VTY_NEWLINE); |
| 7429 | |
| 7430 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7431 | |
| 7432 | /* Address Family Information */ |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 7433 | for (afi = AFI_IP ; afi < AFI_MAX ; afi++) |
| 7434 | for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++) |
| 7435 | if (p->afc[afi][safi]) |
| 7436 | bgp_show_peer_afi (vty, p, afi, safi); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7437 | |
| 7438 | vty_out (vty, " Connections established %d; dropped %d%s", |
| 7439 | p->established, p->dropped, |
| 7440 | VTY_NEWLINE); |
| 7441 | |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 7442 | if (! p->dropped) |
| 7443 | vty_out (vty, " Last reset never%s", VTY_NEWLINE); |
| 7444 | else |
| 7445 | vty_out (vty, " Last reset %s, due to %s%s", |
| 7446 | peer_uptime (p->resettime, timebuf, BGP_UPTIME_LEN), |
| 7447 | peer_down_str[(int) p->last_reset], VTY_NEWLINE); |
paul | 848973c | 2003-08-13 00:32:49 +0000 | [diff] [blame] | 7448 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7449 | if (CHECK_FLAG (p->sflags, PEER_STATUS_PREFIX_OVERFLOW)) |
| 7450 | { |
| 7451 | 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] | 7452 | |
| 7453 | if (p->t_pmax_restart) |
| 7454 | vty_out (vty, " Reduce the no. of prefix from %s, will restart in %ld seconds%s", |
| 7455 | p->host, thread_timer_remain_second (p->t_pmax_restart), |
| 7456 | VTY_NEWLINE); |
| 7457 | else |
| 7458 | vty_out (vty, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s", |
| 7459 | p->host, VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7460 | } |
| 7461 | |
| 7462 | /* EBGP Multihop */ |
| 7463 | if (peer_sort (p) != BGP_PEER_IBGP && p->ttl > 1) |
| 7464 | vty_out (vty, " External BGP neighbor may be up to %d hops away.%s", |
| 7465 | p->ttl, VTY_NEWLINE); |
| 7466 | |
| 7467 | /* Local address. */ |
| 7468 | if (p->su_local) |
| 7469 | { |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 7470 | vty_out (vty, "Local host: %s, Local port: %d%s", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7471 | sockunion2str (p->su_local, buf1, SU_ADDRSTRLEN), |
| 7472 | ntohs (p->su_local->sin.sin_port), |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7473 | VTY_NEWLINE); |
| 7474 | } |
| 7475 | |
| 7476 | /* Remote address. */ |
| 7477 | if (p->su_remote) |
| 7478 | { |
| 7479 | vty_out (vty, "Foreign host: %s, Foreign port: %d%s", |
| 7480 | sockunion2str (p->su_remote, buf1, SU_ADDRSTRLEN), |
| 7481 | ntohs (p->su_remote->sin.sin_port), |
| 7482 | VTY_NEWLINE); |
| 7483 | } |
| 7484 | |
| 7485 | /* Nexthop display. */ |
| 7486 | if (p->su_local) |
| 7487 | { |
| 7488 | vty_out (vty, "Nexthop: %s%s", |
| 7489 | inet_ntop (AF_INET, &p->nexthop.v4, buf1, BUFSIZ), |
| 7490 | VTY_NEWLINE); |
| 7491 | #ifdef HAVE_IPV6 |
| 7492 | vty_out (vty, "Nexthop global: %s%s", |
| 7493 | inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, BUFSIZ), |
| 7494 | VTY_NEWLINE); |
| 7495 | vty_out (vty, "Nexthop local: %s%s", |
| 7496 | inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, BUFSIZ), |
| 7497 | VTY_NEWLINE); |
| 7498 | vty_out (vty, "BGP connection: %s%s", |
| 7499 | p->shared_network ? "shared network" : "non shared network", |
| 7500 | VTY_NEWLINE); |
| 7501 | #endif /* HAVE_IPV6 */ |
| 7502 | } |
| 7503 | |
| 7504 | /* Timer information. */ |
| 7505 | if (p->t_start) |
| 7506 | vty_out (vty, "Next start timer due in %ld seconds%s", |
| 7507 | thread_timer_remain_second (p->t_start), VTY_NEWLINE); |
| 7508 | if (p->t_connect) |
| 7509 | vty_out (vty, "Next connect timer due in %ld seconds%s", |
| 7510 | thread_timer_remain_second (p->t_connect), VTY_NEWLINE); |
| 7511 | |
| 7512 | vty_out (vty, "Read thread: %s Write thread: %s%s", |
| 7513 | p->t_read ? "on" : "off", |
| 7514 | p->t_write ? "on" : "off", |
| 7515 | VTY_NEWLINE); |
| 7516 | |
| 7517 | if (p->notify.code == BGP_NOTIFY_OPEN_ERR |
| 7518 | && p->notify.subcode == BGP_NOTIFY_OPEN_UNSUP_CAPBL) |
| 7519 | bgp_capability_vty_out (vty, p); |
| 7520 | |
| 7521 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7522 | } |
| 7523 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 7524 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7525 | bgp_show_neighbor (struct vty *vty, struct bgp *bgp, |
| 7526 | enum show_type type, union sockunion *su) |
| 7527 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 7528 | struct listnode *node, *nnode; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7529 | struct peer *peer; |
| 7530 | int find = 0; |
| 7531 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 7532 | for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7533 | { |
| 7534 | switch (type) |
| 7535 | { |
| 7536 | case show_all: |
| 7537 | bgp_show_peer (vty, peer); |
| 7538 | break; |
| 7539 | case show_peer: |
| 7540 | if (sockunion_same (&peer->su, su)) |
| 7541 | { |
| 7542 | find = 1; |
| 7543 | bgp_show_peer (vty, peer); |
| 7544 | } |
| 7545 | break; |
| 7546 | } |
| 7547 | } |
| 7548 | |
| 7549 | if (type == show_peer && ! find) |
| 7550 | vty_out (vty, "%% No such neighbor%s", VTY_NEWLINE); |
| 7551 | |
| 7552 | return CMD_SUCCESS; |
| 7553 | } |
| 7554 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 7555 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 7556 | bgp_show_neighbor_vty (struct vty *vty, const char *name, |
| 7557 | enum show_type type, const char *ip_str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7558 | { |
| 7559 | int ret; |
| 7560 | struct bgp *bgp; |
| 7561 | union sockunion su; |
| 7562 | |
| 7563 | if (ip_str) |
| 7564 | { |
| 7565 | ret = str2sockunion (ip_str, &su); |
| 7566 | if (ret < 0) |
| 7567 | { |
| 7568 | vty_out (vty, "%% Malformed address: %s%s", ip_str, VTY_NEWLINE); |
| 7569 | return CMD_WARNING; |
| 7570 | } |
| 7571 | } |
| 7572 | |
| 7573 | if (name) |
| 7574 | { |
| 7575 | bgp = bgp_lookup_by_name (name); |
| 7576 | |
| 7577 | if (! bgp) |
| 7578 | { |
| 7579 | vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE); |
| 7580 | return CMD_WARNING; |
| 7581 | } |
| 7582 | |
| 7583 | bgp_show_neighbor (vty, bgp, type, &su); |
| 7584 | |
| 7585 | return CMD_SUCCESS; |
| 7586 | } |
| 7587 | |
| 7588 | bgp = bgp_get_default (); |
| 7589 | |
| 7590 | if (bgp) |
| 7591 | bgp_show_neighbor (vty, bgp, type, &su); |
| 7592 | |
| 7593 | return CMD_SUCCESS; |
| 7594 | } |
| 7595 | |
| 7596 | /* "show ip bgp neighbors" commands. */ |
| 7597 | DEFUN (show_ip_bgp_neighbors, |
| 7598 | show_ip_bgp_neighbors_cmd, |
| 7599 | "show ip bgp neighbors", |
| 7600 | SHOW_STR |
| 7601 | IP_STR |
| 7602 | BGP_STR |
| 7603 | "Detailed information on TCP and BGP neighbor connections\n") |
| 7604 | { |
| 7605 | return bgp_show_neighbor_vty (vty, NULL, show_all, NULL); |
| 7606 | } |
| 7607 | |
| 7608 | ALIAS (show_ip_bgp_neighbors, |
| 7609 | show_ip_bgp_ipv4_neighbors_cmd, |
| 7610 | "show ip bgp ipv4 (unicast|multicast) neighbors", |
| 7611 | SHOW_STR |
| 7612 | IP_STR |
| 7613 | BGP_STR |
| 7614 | "Address family\n" |
| 7615 | "Address Family modifier\n" |
| 7616 | "Address Family modifier\n" |
| 7617 | "Detailed information on TCP and BGP neighbor connections\n") |
| 7618 | |
| 7619 | ALIAS (show_ip_bgp_neighbors, |
| 7620 | show_ip_bgp_vpnv4_all_neighbors_cmd, |
| 7621 | "show ip bgp vpnv4 all neighbors", |
| 7622 | SHOW_STR |
| 7623 | IP_STR |
| 7624 | BGP_STR |
| 7625 | "Display VPNv4 NLRI specific information\n" |
| 7626 | "Display information about all VPNv4 NLRIs\n" |
| 7627 | "Detailed information on TCP and BGP neighbor connections\n") |
| 7628 | |
| 7629 | ALIAS (show_ip_bgp_neighbors, |
| 7630 | show_ip_bgp_vpnv4_rd_neighbors_cmd, |
| 7631 | "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors", |
| 7632 | SHOW_STR |
| 7633 | IP_STR |
| 7634 | BGP_STR |
| 7635 | "Display VPNv4 NLRI specific information\n" |
| 7636 | "Display information for a route distinguisher\n" |
| 7637 | "VPN Route Distinguisher\n" |
| 7638 | "Detailed information on TCP and BGP neighbor connections\n") |
| 7639 | |
| 7640 | ALIAS (show_ip_bgp_neighbors, |
| 7641 | show_bgp_neighbors_cmd, |
| 7642 | "show bgp neighbors", |
| 7643 | SHOW_STR |
| 7644 | BGP_STR |
| 7645 | "Detailed information on TCP and BGP neighbor connections\n") |
| 7646 | |
| 7647 | ALIAS (show_ip_bgp_neighbors, |
| 7648 | show_bgp_ipv6_neighbors_cmd, |
| 7649 | "show bgp ipv6 neighbors", |
| 7650 | SHOW_STR |
| 7651 | BGP_STR |
| 7652 | "Address family\n" |
| 7653 | "Detailed information on TCP and BGP neighbor connections\n") |
| 7654 | |
| 7655 | DEFUN (show_ip_bgp_neighbors_peer, |
| 7656 | show_ip_bgp_neighbors_peer_cmd, |
| 7657 | "show ip bgp neighbors (A.B.C.D|X:X::X:X)", |
| 7658 | SHOW_STR |
| 7659 | IP_STR |
| 7660 | BGP_STR |
| 7661 | "Detailed information on TCP and BGP neighbor connections\n" |
| 7662 | "Neighbor to display information about\n" |
| 7663 | "Neighbor to display information about\n") |
| 7664 | { |
| 7665 | return bgp_show_neighbor_vty (vty, NULL, show_peer, argv[argc - 1]); |
| 7666 | } |
| 7667 | |
| 7668 | ALIAS (show_ip_bgp_neighbors_peer, |
| 7669 | show_ip_bgp_ipv4_neighbors_peer_cmd, |
| 7670 | "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X)", |
| 7671 | SHOW_STR |
| 7672 | IP_STR |
| 7673 | BGP_STR |
| 7674 | "Address family\n" |
| 7675 | "Address Family modifier\n" |
| 7676 | "Address Family modifier\n" |
| 7677 | "Detailed information on TCP and BGP neighbor connections\n" |
| 7678 | "Neighbor to display information about\n" |
| 7679 | "Neighbor to display information about\n") |
| 7680 | |
| 7681 | ALIAS (show_ip_bgp_neighbors_peer, |
| 7682 | show_ip_bgp_vpnv4_all_neighbors_peer_cmd, |
| 7683 | "show ip bgp vpnv4 all neighbors A.B.C.D", |
| 7684 | SHOW_STR |
| 7685 | IP_STR |
| 7686 | BGP_STR |
| 7687 | "Display VPNv4 NLRI specific information\n" |
| 7688 | "Display information about all VPNv4 NLRIs\n" |
| 7689 | "Detailed information on TCP and BGP neighbor connections\n" |
| 7690 | "Neighbor to display information about\n") |
| 7691 | |
| 7692 | ALIAS (show_ip_bgp_neighbors_peer, |
| 7693 | show_ip_bgp_vpnv4_rd_neighbors_peer_cmd, |
| 7694 | "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D", |
| 7695 | SHOW_STR |
| 7696 | IP_STR |
| 7697 | BGP_STR |
| 7698 | "Display VPNv4 NLRI specific information\n" |
| 7699 | "Display information about all VPNv4 NLRIs\n" |
| 7700 | "Detailed information on TCP and BGP neighbor connections\n" |
| 7701 | "Neighbor to display information about\n") |
| 7702 | |
| 7703 | ALIAS (show_ip_bgp_neighbors_peer, |
| 7704 | show_bgp_neighbors_peer_cmd, |
| 7705 | "show bgp neighbors (A.B.C.D|X:X::X:X)", |
| 7706 | SHOW_STR |
| 7707 | BGP_STR |
| 7708 | "Detailed information on TCP and BGP neighbor connections\n" |
| 7709 | "Neighbor to display information about\n" |
| 7710 | "Neighbor to display information about\n") |
| 7711 | |
| 7712 | ALIAS (show_ip_bgp_neighbors_peer, |
| 7713 | show_bgp_ipv6_neighbors_peer_cmd, |
| 7714 | "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X)", |
| 7715 | SHOW_STR |
| 7716 | BGP_STR |
| 7717 | "Address family\n" |
| 7718 | "Detailed information on TCP and BGP neighbor connections\n" |
| 7719 | "Neighbor to display information about\n" |
| 7720 | "Neighbor to display information about\n") |
| 7721 | |
| 7722 | DEFUN (show_ip_bgp_instance_neighbors, |
| 7723 | show_ip_bgp_instance_neighbors_cmd, |
| 7724 | "show ip bgp view WORD neighbors", |
| 7725 | SHOW_STR |
| 7726 | IP_STR |
| 7727 | BGP_STR |
| 7728 | "BGP view\n" |
| 7729 | "View name\n" |
| 7730 | "Detailed information on TCP and BGP neighbor connections\n") |
| 7731 | { |
| 7732 | return bgp_show_neighbor_vty (vty, argv[0], show_all, NULL); |
| 7733 | } |
| 7734 | |
paul | bb46e94 | 2003-10-24 19:02:03 +0000 | [diff] [blame] | 7735 | ALIAS (show_ip_bgp_instance_neighbors, |
| 7736 | show_bgp_instance_neighbors_cmd, |
| 7737 | "show bgp view WORD neighbors", |
| 7738 | SHOW_STR |
| 7739 | BGP_STR |
| 7740 | "BGP view\n" |
| 7741 | "View name\n" |
| 7742 | "Detailed information on TCP and BGP neighbor connections\n") |
| 7743 | |
| 7744 | ALIAS (show_ip_bgp_instance_neighbors, |
| 7745 | show_bgp_instance_ipv6_neighbors_cmd, |
| 7746 | "show bgp view WORD ipv6 neighbors", |
| 7747 | SHOW_STR |
| 7748 | BGP_STR |
| 7749 | "BGP view\n" |
| 7750 | "View name\n" |
| 7751 | "Address family\n" |
| 7752 | "Detailed information on TCP and BGP neighbor connections\n") |
| 7753 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7754 | DEFUN (show_ip_bgp_instance_neighbors_peer, |
| 7755 | show_ip_bgp_instance_neighbors_peer_cmd, |
| 7756 | "show ip bgp view WORD neighbors (A.B.C.D|X:X::X:X)", |
| 7757 | SHOW_STR |
| 7758 | IP_STR |
| 7759 | BGP_STR |
| 7760 | "BGP view\n" |
| 7761 | "View name\n" |
| 7762 | "Detailed information on TCP and BGP neighbor connections\n" |
| 7763 | "Neighbor to display information about\n" |
| 7764 | "Neighbor to display information about\n") |
| 7765 | { |
| 7766 | return bgp_show_neighbor_vty (vty, argv[0], show_peer, argv[1]); |
| 7767 | } |
paul | bb46e94 | 2003-10-24 19:02:03 +0000 | [diff] [blame] | 7768 | |
| 7769 | ALIAS (show_ip_bgp_instance_neighbors_peer, |
| 7770 | show_bgp_instance_neighbors_peer_cmd, |
| 7771 | "show bgp view WORD neighbors (A.B.C.D|X:X::X:X)", |
| 7772 | SHOW_STR |
| 7773 | BGP_STR |
| 7774 | "BGP view\n" |
| 7775 | "View name\n" |
| 7776 | "Detailed information on TCP and BGP neighbor connections\n" |
| 7777 | "Neighbor to display information about\n" |
| 7778 | "Neighbor to display information about\n") |
| 7779 | |
| 7780 | ALIAS (show_ip_bgp_instance_neighbors_peer, |
| 7781 | show_bgp_instance_ipv6_neighbors_peer_cmd, |
| 7782 | "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X)", |
| 7783 | SHOW_STR |
| 7784 | BGP_STR |
| 7785 | "BGP view\n" |
| 7786 | "View name\n" |
| 7787 | "Address family\n" |
| 7788 | "Detailed information on TCP and BGP neighbor connections\n" |
| 7789 | "Neighbor to display information about\n" |
| 7790 | "Neighbor to display information about\n") |
| 7791 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7792 | /* Show BGP's AS paths internal data. There are both `show ip bgp |
| 7793 | paths' and `show ip mbgp paths'. Those functions results are the |
| 7794 | same.*/ |
| 7795 | DEFUN (show_ip_bgp_paths, |
| 7796 | show_ip_bgp_paths_cmd, |
| 7797 | "show ip bgp paths", |
| 7798 | SHOW_STR |
| 7799 | IP_STR |
| 7800 | BGP_STR |
| 7801 | "Path information\n") |
| 7802 | { |
| 7803 | vty_out (vty, "Address Refcnt Path%s", VTY_NEWLINE); |
| 7804 | aspath_print_all_vty (vty); |
| 7805 | return CMD_SUCCESS; |
| 7806 | } |
| 7807 | |
| 7808 | DEFUN (show_ip_bgp_ipv4_paths, |
| 7809 | show_ip_bgp_ipv4_paths_cmd, |
| 7810 | "show ip bgp ipv4 (unicast|multicast) paths", |
| 7811 | SHOW_STR |
| 7812 | IP_STR |
| 7813 | BGP_STR |
| 7814 | "Address family\n" |
| 7815 | "Address Family modifier\n" |
| 7816 | "Address Family modifier\n" |
| 7817 | "Path information\n") |
| 7818 | { |
| 7819 | vty_out (vty, "Address Refcnt Path\r\n"); |
| 7820 | aspath_print_all_vty (vty); |
| 7821 | |
| 7822 | return CMD_SUCCESS; |
| 7823 | } |
| 7824 | |
| 7825 | #include "hash.h" |
| 7826 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 7827 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 7828 | community_show_all_iterator (struct hash_backet *backet, struct vty *vty) |
| 7829 | { |
| 7830 | struct community *com; |
| 7831 | |
| 7832 | com = (struct community *) backet->data; |
| 7833 | vty_out (vty, "[%p] (%ld) %s%s", backet, com->refcnt, |
| 7834 | community_str (com), VTY_NEWLINE); |
| 7835 | } |
| 7836 | |
| 7837 | /* Show BGP's community internal data. */ |
| 7838 | DEFUN (show_ip_bgp_community_info, |
| 7839 | show_ip_bgp_community_info_cmd, |
| 7840 | "show ip bgp community-info", |
| 7841 | SHOW_STR |
| 7842 | IP_STR |
| 7843 | BGP_STR |
| 7844 | "List all bgp community information\n") |
| 7845 | { |
| 7846 | vty_out (vty, "Address Refcnt Community%s", VTY_NEWLINE); |
| 7847 | |
| 7848 | hash_iterate (community_hash (), |
| 7849 | (void (*) (struct hash_backet *, void *)) |
| 7850 | community_show_all_iterator, |
| 7851 | vty); |
| 7852 | |
| 7853 | return CMD_SUCCESS; |
| 7854 | } |
| 7855 | |
| 7856 | DEFUN (show_ip_bgp_attr_info, |
| 7857 | show_ip_bgp_attr_info_cmd, |
| 7858 | "show ip bgp attribute-info", |
| 7859 | SHOW_STR |
| 7860 | IP_STR |
| 7861 | BGP_STR |
| 7862 | "List all bgp attribute information\n") |
| 7863 | { |
| 7864 | attr_show_all (vty); |
| 7865 | return CMD_SUCCESS; |
| 7866 | } |
| 7867 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 7868 | static int |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7869 | bgp_write_rsclient_summary (struct vty *vty, struct peer *rsclient, |
| 7870 | afi_t afi, safi_t safi) |
| 7871 | { |
| 7872 | char timebuf[BGP_UPTIME_LEN]; |
| 7873 | char rmbuf[14]; |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 7874 | const char *rmname; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7875 | struct peer *peer; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 7876 | struct listnode *node, *nnode; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7877 | int len; |
| 7878 | int count = 0; |
| 7879 | |
| 7880 | if (CHECK_FLAG (rsclient->sflags, PEER_STATUS_GROUP)) |
| 7881 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 7882 | for (ALL_LIST_ELEMENTS (rsclient->group->peer, node, nnode, peer)) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7883 | { |
| 7884 | count++; |
| 7885 | bgp_write_rsclient_summary (vty, peer, afi, safi); |
| 7886 | } |
| 7887 | return count; |
| 7888 | } |
| 7889 | |
| 7890 | len = vty_out (vty, "%s", rsclient->host); |
| 7891 | len = 16 - len; |
| 7892 | |
| 7893 | if (len < 1) |
| 7894 | vty_out (vty, "%s%*s", VTY_NEWLINE, 16, " "); |
| 7895 | else |
| 7896 | vty_out (vty, "%*s", len, " "); |
| 7897 | |
hasso | 3d515fd | 2005-02-01 21:30:04 +0000 | [diff] [blame] | 7898 | vty_out (vty, "4 "); |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7899 | |
| 7900 | vty_out (vty, "%5d ", rsclient->as); |
| 7901 | |
| 7902 | rmname = ROUTE_MAP_EXPORT_NAME(&rsclient->filter[afi][safi]); |
| 7903 | if ( rmname && strlen (rmname) > 13 ) |
| 7904 | { |
| 7905 | sprintf (rmbuf, "%13s", "..."); |
| 7906 | rmname = strncpy (rmbuf, rmname, 10); |
| 7907 | } |
| 7908 | else if (! rmname) |
| 7909 | rmname = "<none>"; |
| 7910 | vty_out (vty, " %13s ", rmname); |
| 7911 | |
| 7912 | rmname = ROUTE_MAP_IMPORT_NAME(&rsclient->filter[afi][safi]); |
| 7913 | if ( rmname && strlen (rmname) > 13 ) |
| 7914 | { |
| 7915 | sprintf (rmbuf, "%13s", "..."); |
| 7916 | rmname = strncpy (rmbuf, rmname, 10); |
| 7917 | } |
| 7918 | else if (! rmname) |
| 7919 | rmname = "<none>"; |
| 7920 | vty_out (vty, " %13s ", rmname); |
| 7921 | |
| 7922 | vty_out (vty, "%8s", peer_uptime (rsclient->uptime, timebuf, BGP_UPTIME_LEN)); |
| 7923 | |
| 7924 | if (CHECK_FLAG (rsclient->flags, PEER_FLAG_SHUTDOWN)) |
| 7925 | vty_out (vty, " Idle (Admin)"); |
| 7926 | else if (CHECK_FLAG (rsclient->sflags, PEER_STATUS_PREFIX_OVERFLOW)) |
| 7927 | vty_out (vty, " Idle (PfxCt)"); |
| 7928 | else |
| 7929 | vty_out (vty, " %-11s", LOOKUP(bgp_status_msg, rsclient->status)); |
| 7930 | |
| 7931 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7932 | |
| 7933 | return 1; |
| 7934 | } |
| 7935 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 7936 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 7937 | bgp_show_rsclient_summary (struct vty *vty, struct bgp *bgp, |
| 7938 | afi_t afi, safi_t safi) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7939 | { |
| 7940 | struct peer *peer; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 7941 | struct listnode *node, *nnode; |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7942 | int count = 0; |
| 7943 | |
| 7944 | /* Header string for each address family. */ |
| 7945 | static char header[] = "Neighbor V AS Export-Policy Import-Policy Up/Down State"; |
| 7946 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 7947 | for (ALL_LIST_ELEMENTS (bgp->rsclient, node, nnode, peer)) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7948 | { |
| 7949 | if (peer->afc[afi][safi] && |
| 7950 | CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT)) |
| 7951 | { |
| 7952 | if (! count) |
| 7953 | { |
| 7954 | vty_out (vty, |
| 7955 | "Route Server's BGP router identifier %s%s", |
| 7956 | inet_ntoa (bgp->router_id), VTY_NEWLINE); |
| 7957 | vty_out (vty, |
| 7958 | "Route Server's local AS number %d%s", bgp->as, |
| 7959 | VTY_NEWLINE); |
| 7960 | |
| 7961 | vty_out (vty, "%s", VTY_NEWLINE); |
| 7962 | vty_out (vty, "%s%s", header, VTY_NEWLINE); |
| 7963 | } |
| 7964 | |
| 7965 | count += bgp_write_rsclient_summary (vty, peer, afi, safi); |
| 7966 | } |
| 7967 | } |
| 7968 | |
| 7969 | if (count) |
| 7970 | vty_out (vty, "%sTotal number of Route Server Clients %d%s", VTY_NEWLINE, |
| 7971 | count, VTY_NEWLINE); |
| 7972 | else |
| 7973 | vty_out (vty, "No %s Route Server Client is configured%s", |
| 7974 | afi == AFI_IP ? "IPv4" : "IPv6", VTY_NEWLINE); |
| 7975 | |
| 7976 | return CMD_SUCCESS; |
| 7977 | } |
| 7978 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 7979 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 7980 | bgp_show_rsclient_summary_vty (struct vty *vty, const char *name, |
| 7981 | afi_t afi, safi_t safi) |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 7982 | { |
| 7983 | struct bgp *bgp; |
| 7984 | |
| 7985 | if (name) |
| 7986 | { |
| 7987 | bgp = bgp_lookup_by_name (name); |
| 7988 | |
| 7989 | if (! bgp) |
| 7990 | { |
| 7991 | vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE); |
| 7992 | return CMD_WARNING; |
| 7993 | } |
| 7994 | |
| 7995 | bgp_show_rsclient_summary (vty, bgp, afi, safi); |
| 7996 | return CMD_SUCCESS; |
| 7997 | } |
| 7998 | |
| 7999 | bgp = bgp_get_default (); |
| 8000 | |
| 8001 | if (bgp) |
| 8002 | bgp_show_rsclient_summary (vty, bgp, afi, safi); |
| 8003 | |
| 8004 | return CMD_SUCCESS; |
| 8005 | } |
| 8006 | |
| 8007 | /* 'show bgp rsclient' commands. */ |
| 8008 | DEFUN (show_ip_bgp_rsclient_summary, |
| 8009 | show_ip_bgp_rsclient_summary_cmd, |
| 8010 | "show ip bgp rsclient summary", |
| 8011 | SHOW_STR |
| 8012 | IP_STR |
| 8013 | BGP_STR |
| 8014 | "Information about Route Server Clients\n" |
| 8015 | "Summary of all Route Server Clients\n") |
| 8016 | { |
| 8017 | return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 8018 | } |
| 8019 | |
| 8020 | DEFUN (show_ip_bgp_instance_rsclient_summary, |
| 8021 | show_ip_bgp_instance_rsclient_summary_cmd, |
| 8022 | "show ip bgp view WORD rsclient summary", |
| 8023 | SHOW_STR |
| 8024 | IP_STR |
| 8025 | BGP_STR |
| 8026 | "BGP view\n" |
| 8027 | "View name\n" |
| 8028 | "Information about Route Server Clients\n" |
| 8029 | "Summary of all Route Server Clients\n") |
| 8030 | { |
| 8031 | return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 8032 | } |
| 8033 | |
| 8034 | DEFUN (show_ip_bgp_ipv4_rsclient_summary, |
| 8035 | show_ip_bgp_ipv4_rsclient_summary_cmd, |
| 8036 | "show ip bgp ipv4 (unicast|multicast) rsclient summary", |
| 8037 | SHOW_STR |
| 8038 | IP_STR |
| 8039 | BGP_STR |
| 8040 | "Address family\n" |
| 8041 | "Address Family modifier\n" |
| 8042 | "Address Family modifier\n" |
| 8043 | "Information about Route Server Clients\n" |
| 8044 | "Summary of all Route Server Clients\n") |
| 8045 | { |
| 8046 | if (strncmp (argv[0], "m", 1) == 0) |
| 8047 | return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST); |
| 8048 | |
| 8049 | return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST); |
| 8050 | } |
| 8051 | |
| 8052 | DEFUN (show_ip_bgp_instance_ipv4_rsclient_summary, |
| 8053 | show_ip_bgp_instance_ipv4_rsclient_summary_cmd, |
| 8054 | "show ip bgp view WORD ipv4 (unicast|multicast) rsclient summary", |
| 8055 | SHOW_STR |
| 8056 | IP_STR |
| 8057 | BGP_STR |
| 8058 | "BGP view\n" |
| 8059 | "View name\n" |
| 8060 | "Address family\n" |
| 8061 | "Address Family modifier\n" |
| 8062 | "Address Family modifier\n" |
| 8063 | "Information about Route Server Clients\n" |
| 8064 | "Summary of all Route Server Clients\n") |
| 8065 | { |
| 8066 | if (strncmp (argv[1], "m", 1) == 0) |
| 8067 | return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST); |
| 8068 | |
| 8069 | return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST); |
| 8070 | } |
| 8071 | |
| 8072 | #ifdef HAVE_IPV6 |
| 8073 | DEFUN (show_bgp_rsclient_summary, |
| 8074 | show_bgp_rsclient_summary_cmd, |
| 8075 | "show bgp rsclient summary", |
| 8076 | SHOW_STR |
| 8077 | BGP_STR |
| 8078 | "Information about Route Server Clients\n" |
| 8079 | "Summary of all Route Server Clients\n") |
| 8080 | { |
| 8081 | return bgp_show_rsclient_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST); |
| 8082 | } |
| 8083 | |
| 8084 | DEFUN (show_bgp_instance_rsclient_summary, |
| 8085 | show_bgp_instance_rsclient_summary_cmd, |
| 8086 | "show bgp view WORD rsclient summary", |
| 8087 | SHOW_STR |
| 8088 | BGP_STR |
| 8089 | "BGP view\n" |
| 8090 | "View name\n" |
| 8091 | "Information about Route Server Clients\n" |
| 8092 | "Summary of all Route Server Clients\n") |
| 8093 | { |
| 8094 | return bgp_show_rsclient_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST); |
| 8095 | } |
| 8096 | |
| 8097 | ALIAS (show_bgp_rsclient_summary, |
| 8098 | show_bgp_ipv6_rsclient_summary_cmd, |
| 8099 | "show bgp ipv6 rsclient summary", |
| 8100 | SHOW_STR |
| 8101 | BGP_STR |
| 8102 | "Address family\n" |
| 8103 | "Information about Route Server Clients\n" |
| 8104 | "Summary of all Route Server Clients\n") |
| 8105 | |
| 8106 | ALIAS (show_bgp_instance_rsclient_summary, |
| 8107 | show_bgp_instance_ipv6_rsclient_summary_cmd, |
| 8108 | "show bgp view WORD ipv6 rsclient summary", |
| 8109 | SHOW_STR |
| 8110 | BGP_STR |
| 8111 | "BGP view\n" |
| 8112 | "View name\n" |
| 8113 | "Address family\n" |
| 8114 | "Information about Route Server Clients\n" |
| 8115 | "Summary of all Route Server Clients\n") |
| 8116 | #endif /* HAVE IPV6 */ |
| 8117 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8118 | /* Redistribute VTY commands. */ |
| 8119 | |
| 8120 | /* Utility function to convert user input route type string to route |
| 8121 | type. */ |
| 8122 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 8123 | bgp_str2route_type (int afi, const char *str) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8124 | { |
| 8125 | if (! str) |
| 8126 | return 0; |
| 8127 | |
| 8128 | if (afi == AFI_IP) |
| 8129 | { |
| 8130 | if (strncmp (str, "k", 1) == 0) |
| 8131 | return ZEBRA_ROUTE_KERNEL; |
| 8132 | else if (strncmp (str, "c", 1) == 0) |
| 8133 | return ZEBRA_ROUTE_CONNECT; |
| 8134 | else if (strncmp (str, "s", 1) == 0) |
| 8135 | return ZEBRA_ROUTE_STATIC; |
| 8136 | else if (strncmp (str, "r", 1) == 0) |
| 8137 | return ZEBRA_ROUTE_RIP; |
| 8138 | else if (strncmp (str, "o", 1) == 0) |
| 8139 | return ZEBRA_ROUTE_OSPF; |
| 8140 | } |
| 8141 | if (afi == AFI_IP6) |
| 8142 | { |
| 8143 | if (strncmp (str, "k", 1) == 0) |
| 8144 | return ZEBRA_ROUTE_KERNEL; |
| 8145 | else if (strncmp (str, "c", 1) == 0) |
| 8146 | return ZEBRA_ROUTE_CONNECT; |
| 8147 | else if (strncmp (str, "s", 1) == 0) |
| 8148 | return ZEBRA_ROUTE_STATIC; |
| 8149 | else if (strncmp (str, "r", 1) == 0) |
| 8150 | return ZEBRA_ROUTE_RIPNG; |
| 8151 | else if (strncmp (str, "o", 1) == 0) |
| 8152 | return ZEBRA_ROUTE_OSPF6; |
| 8153 | } |
| 8154 | return 0; |
| 8155 | } |
| 8156 | |
| 8157 | DEFUN (bgp_redistribute_ipv4, |
| 8158 | bgp_redistribute_ipv4_cmd, |
| 8159 | "redistribute (connected|kernel|ospf|rip|static)", |
| 8160 | "Redistribute information from another routing protocol\n" |
| 8161 | "Connected\n" |
| 8162 | "Kernel routes\n" |
| 8163 | "Open Shurtest Path First (OSPF)\n" |
| 8164 | "Routing Information Protocol (RIP)\n" |
| 8165 | "Static routes\n") |
| 8166 | { |
| 8167 | int type; |
| 8168 | |
| 8169 | type = bgp_str2route_type (AFI_IP, argv[0]); |
| 8170 | if (! type) |
| 8171 | { |
| 8172 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 8173 | return CMD_WARNING; |
| 8174 | } |
| 8175 | return bgp_redistribute_set (vty->index, AFI_IP, type); |
| 8176 | } |
| 8177 | |
| 8178 | DEFUN (bgp_redistribute_ipv4_rmap, |
| 8179 | bgp_redistribute_ipv4_rmap_cmd, |
| 8180 | "redistribute (connected|kernel|ospf|rip|static) route-map WORD", |
| 8181 | "Redistribute information from another routing protocol\n" |
| 8182 | "Connected\n" |
| 8183 | "Kernel routes\n" |
| 8184 | "Open Shurtest Path First (OSPF)\n" |
| 8185 | "Routing Information Protocol (RIP)\n" |
| 8186 | "Static routes\n" |
| 8187 | "Route map reference\n" |
| 8188 | "Pointer to route-map entries\n") |
| 8189 | { |
| 8190 | int type; |
| 8191 | |
| 8192 | type = bgp_str2route_type (AFI_IP, argv[0]); |
| 8193 | if (! type) |
| 8194 | { |
| 8195 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 8196 | return CMD_WARNING; |
| 8197 | } |
| 8198 | |
| 8199 | bgp_redistribute_rmap_set (vty->index, AFI_IP, type, argv[1]); |
| 8200 | return bgp_redistribute_set (vty->index, AFI_IP, type); |
| 8201 | } |
| 8202 | |
| 8203 | DEFUN (bgp_redistribute_ipv4_metric, |
| 8204 | bgp_redistribute_ipv4_metric_cmd, |
| 8205 | "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>", |
| 8206 | "Redistribute information from another routing protocol\n" |
| 8207 | "Connected\n" |
| 8208 | "Kernel routes\n" |
| 8209 | "Open Shurtest Path First (OSPF)\n" |
| 8210 | "Routing Information Protocol (RIP)\n" |
| 8211 | "Static routes\n" |
| 8212 | "Metric for redistributed routes\n" |
| 8213 | "Default metric\n") |
| 8214 | { |
| 8215 | int type; |
| 8216 | u_int32_t metric; |
| 8217 | |
| 8218 | type = bgp_str2route_type (AFI_IP, argv[0]); |
| 8219 | if (! type) |
| 8220 | { |
| 8221 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 8222 | return CMD_WARNING; |
| 8223 | } |
| 8224 | VTY_GET_INTEGER ("metric", metric, argv[1]); |
| 8225 | |
| 8226 | bgp_redistribute_metric_set (vty->index, AFI_IP, type, metric); |
| 8227 | return bgp_redistribute_set (vty->index, AFI_IP, type); |
| 8228 | } |
| 8229 | |
| 8230 | DEFUN (bgp_redistribute_ipv4_rmap_metric, |
| 8231 | bgp_redistribute_ipv4_rmap_metric_cmd, |
| 8232 | "redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>", |
| 8233 | "Redistribute information from another routing protocol\n" |
| 8234 | "Connected\n" |
| 8235 | "Kernel routes\n" |
| 8236 | "Open Shurtest Path First (OSPF)\n" |
| 8237 | "Routing Information Protocol (RIP)\n" |
| 8238 | "Static routes\n" |
| 8239 | "Route map reference\n" |
| 8240 | "Pointer to route-map entries\n" |
| 8241 | "Metric for redistributed routes\n" |
| 8242 | "Default metric\n") |
| 8243 | { |
| 8244 | int type; |
| 8245 | u_int32_t metric; |
| 8246 | |
| 8247 | type = bgp_str2route_type (AFI_IP, argv[0]); |
| 8248 | if (! type) |
| 8249 | { |
| 8250 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 8251 | return CMD_WARNING; |
| 8252 | } |
| 8253 | VTY_GET_INTEGER ("metric", metric, argv[2]); |
| 8254 | |
| 8255 | bgp_redistribute_rmap_set (vty->index, AFI_IP, type, argv[1]); |
| 8256 | bgp_redistribute_metric_set (vty->index, AFI_IP, type, metric); |
| 8257 | return bgp_redistribute_set (vty->index, AFI_IP, type); |
| 8258 | } |
| 8259 | |
| 8260 | DEFUN (bgp_redistribute_ipv4_metric_rmap, |
| 8261 | bgp_redistribute_ipv4_metric_rmap_cmd, |
| 8262 | "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD", |
| 8263 | "Redistribute information from another routing protocol\n" |
| 8264 | "Connected\n" |
| 8265 | "Kernel routes\n" |
| 8266 | "Open Shurtest Path First (OSPF)\n" |
| 8267 | "Routing Information Protocol (RIP)\n" |
| 8268 | "Static routes\n" |
| 8269 | "Metric for redistributed routes\n" |
| 8270 | "Default metric\n" |
| 8271 | "Route map reference\n" |
| 8272 | "Pointer to route-map entries\n") |
| 8273 | { |
| 8274 | int type; |
| 8275 | u_int32_t metric; |
| 8276 | |
| 8277 | type = bgp_str2route_type (AFI_IP, argv[0]); |
| 8278 | if (! type) |
| 8279 | { |
| 8280 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 8281 | return CMD_WARNING; |
| 8282 | } |
| 8283 | VTY_GET_INTEGER ("metric", metric, argv[1]); |
| 8284 | |
| 8285 | bgp_redistribute_metric_set (vty->index, AFI_IP, type, metric); |
| 8286 | bgp_redistribute_rmap_set (vty->index, AFI_IP, type, argv[2]); |
| 8287 | return bgp_redistribute_set (vty->index, AFI_IP, type); |
| 8288 | } |
| 8289 | |
| 8290 | DEFUN (no_bgp_redistribute_ipv4, |
| 8291 | no_bgp_redistribute_ipv4_cmd, |
| 8292 | "no redistribute (connected|kernel|ospf|rip|static)", |
| 8293 | NO_STR |
| 8294 | "Redistribute information from another routing protocol\n" |
| 8295 | "Connected\n" |
| 8296 | "Kernel routes\n" |
| 8297 | "Open Shurtest Path First (OSPF)\n" |
| 8298 | "Routing Information Protocol (RIP)\n" |
| 8299 | "Static routes\n") |
| 8300 | { |
| 8301 | int type; |
| 8302 | |
| 8303 | type = bgp_str2route_type (AFI_IP, argv[0]); |
| 8304 | if (! type) |
| 8305 | { |
| 8306 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 8307 | return CMD_WARNING; |
| 8308 | } |
| 8309 | |
| 8310 | return bgp_redistribute_unset (vty->index, AFI_IP, type); |
| 8311 | } |
| 8312 | |
| 8313 | DEFUN (no_bgp_redistribute_ipv4_rmap, |
| 8314 | no_bgp_redistribute_ipv4_rmap_cmd, |
| 8315 | "no redistribute (connected|kernel|ospf|rip|static) route-map WORD", |
| 8316 | NO_STR |
| 8317 | "Redistribute information from another routing protocol\n" |
| 8318 | "Connected\n" |
| 8319 | "Kernel routes\n" |
| 8320 | "Open Shurtest Path First (OSPF)\n" |
| 8321 | "Routing Information Protocol (RIP)\n" |
| 8322 | "Static routes\n" |
| 8323 | "Route map reference\n" |
| 8324 | "Pointer to route-map entries\n") |
| 8325 | { |
| 8326 | int type; |
| 8327 | |
| 8328 | type = bgp_str2route_type (AFI_IP, argv[0]); |
| 8329 | if (! type) |
| 8330 | { |
| 8331 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 8332 | return CMD_WARNING; |
| 8333 | } |
| 8334 | |
| 8335 | bgp_redistribute_routemap_unset (vty->index, AFI_IP, type); |
| 8336 | return CMD_SUCCESS; |
| 8337 | } |
| 8338 | |
| 8339 | DEFUN (no_bgp_redistribute_ipv4_metric, |
| 8340 | no_bgp_redistribute_ipv4_metric_cmd, |
| 8341 | "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>", |
| 8342 | NO_STR |
| 8343 | "Redistribute information from another routing protocol\n" |
| 8344 | "Connected\n" |
| 8345 | "Kernel routes\n" |
| 8346 | "Open Shurtest Path First (OSPF)\n" |
| 8347 | "Routing Information Protocol (RIP)\n" |
| 8348 | "Static routes\n" |
| 8349 | "Metric for redistributed routes\n" |
| 8350 | "Default metric\n") |
| 8351 | { |
| 8352 | int type; |
| 8353 | |
| 8354 | type = bgp_str2route_type (AFI_IP, argv[0]); |
| 8355 | if (! type) |
| 8356 | { |
| 8357 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 8358 | return CMD_WARNING; |
| 8359 | } |
| 8360 | |
| 8361 | bgp_redistribute_metric_unset (vty->index, AFI_IP, type); |
| 8362 | return CMD_SUCCESS; |
| 8363 | } |
| 8364 | |
| 8365 | DEFUN (no_bgp_redistribute_ipv4_rmap_metric, |
| 8366 | no_bgp_redistribute_ipv4_rmap_metric_cmd, |
| 8367 | "no redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>", |
| 8368 | NO_STR |
| 8369 | "Redistribute information from another routing protocol\n" |
| 8370 | "Connected\n" |
| 8371 | "Kernel routes\n" |
| 8372 | "Open Shurtest Path First (OSPF)\n" |
| 8373 | "Routing Information Protocol (RIP)\n" |
| 8374 | "Static routes\n" |
| 8375 | "Route map reference\n" |
| 8376 | "Pointer to route-map entries\n" |
| 8377 | "Metric for redistributed routes\n" |
| 8378 | "Default metric\n") |
| 8379 | { |
| 8380 | int type; |
| 8381 | |
| 8382 | type = bgp_str2route_type (AFI_IP, argv[0]); |
| 8383 | if (! type) |
| 8384 | { |
| 8385 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 8386 | return CMD_WARNING; |
| 8387 | } |
| 8388 | |
| 8389 | bgp_redistribute_metric_unset (vty->index, AFI_IP, type); |
| 8390 | bgp_redistribute_routemap_unset (vty->index, AFI_IP, type); |
| 8391 | return CMD_SUCCESS; |
| 8392 | } |
| 8393 | |
| 8394 | ALIAS (no_bgp_redistribute_ipv4_rmap_metric, |
| 8395 | no_bgp_redistribute_ipv4_metric_rmap_cmd, |
| 8396 | "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD", |
| 8397 | NO_STR |
| 8398 | "Redistribute information from another routing protocol\n" |
| 8399 | "Connected\n" |
| 8400 | "Kernel routes\n" |
| 8401 | "Open Shurtest Path First (OSPF)\n" |
| 8402 | "Routing Information Protocol (RIP)\n" |
| 8403 | "Static routes\n" |
| 8404 | "Metric for redistributed routes\n" |
| 8405 | "Default metric\n" |
| 8406 | "Route map reference\n" |
| 8407 | "Pointer to route-map entries\n") |
| 8408 | |
| 8409 | #ifdef HAVE_IPV6 |
| 8410 | DEFUN (bgp_redistribute_ipv6, |
| 8411 | bgp_redistribute_ipv6_cmd, |
| 8412 | "redistribute (connected|kernel|ospf6|ripng|static)", |
| 8413 | "Redistribute information from another routing protocol\n" |
| 8414 | "Connected\n" |
| 8415 | "Kernel routes\n" |
| 8416 | "Open Shurtest Path First (OSPFv3)\n" |
| 8417 | "Routing Information Protocol (RIPng)\n" |
| 8418 | "Static routes\n") |
| 8419 | { |
| 8420 | int type; |
| 8421 | |
| 8422 | type = bgp_str2route_type (AFI_IP6, argv[0]); |
| 8423 | if (! type) |
| 8424 | { |
| 8425 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 8426 | return CMD_WARNING; |
| 8427 | } |
| 8428 | |
| 8429 | return bgp_redistribute_set (vty->index, AFI_IP6, type); |
| 8430 | } |
| 8431 | |
| 8432 | DEFUN (bgp_redistribute_ipv6_rmap, |
| 8433 | bgp_redistribute_ipv6_rmap_cmd, |
| 8434 | "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD", |
| 8435 | "Redistribute information from another routing protocol\n" |
| 8436 | "Connected\n" |
| 8437 | "Kernel routes\n" |
| 8438 | "Open Shurtest Path First (OSPFv3)\n" |
| 8439 | "Routing Information Protocol (RIPng)\n" |
| 8440 | "Static routes\n" |
| 8441 | "Route map reference\n" |
| 8442 | "Pointer to route-map entries\n") |
| 8443 | { |
| 8444 | int type; |
| 8445 | |
| 8446 | type = bgp_str2route_type (AFI_IP6, argv[0]); |
| 8447 | if (! type) |
| 8448 | { |
| 8449 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 8450 | return CMD_WARNING; |
| 8451 | } |
| 8452 | |
| 8453 | bgp_redistribute_rmap_set (vty->index, AFI_IP6, type, argv[1]); |
| 8454 | return bgp_redistribute_set (vty->index, AFI_IP6, type); |
| 8455 | } |
| 8456 | |
| 8457 | DEFUN (bgp_redistribute_ipv6_metric, |
| 8458 | bgp_redistribute_ipv6_metric_cmd, |
| 8459 | "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>", |
| 8460 | "Redistribute information from another routing protocol\n" |
| 8461 | "Connected\n" |
| 8462 | "Kernel routes\n" |
| 8463 | "Open Shurtest Path First (OSPFv3)\n" |
| 8464 | "Routing Information Protocol (RIPng)\n" |
| 8465 | "Static routes\n" |
| 8466 | "Metric for redistributed routes\n" |
| 8467 | "Default metric\n") |
| 8468 | { |
| 8469 | int type; |
| 8470 | u_int32_t metric; |
| 8471 | |
| 8472 | type = bgp_str2route_type (AFI_IP6, argv[0]); |
| 8473 | if (! type) |
| 8474 | { |
| 8475 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 8476 | return CMD_WARNING; |
| 8477 | } |
| 8478 | VTY_GET_INTEGER ("metric", metric, argv[1]); |
| 8479 | |
| 8480 | bgp_redistribute_metric_set (vty->index, AFI_IP6, type, metric); |
| 8481 | return bgp_redistribute_set (vty->index, AFI_IP6, type); |
| 8482 | } |
| 8483 | |
| 8484 | DEFUN (bgp_redistribute_ipv6_rmap_metric, |
| 8485 | bgp_redistribute_ipv6_rmap_metric_cmd, |
| 8486 | "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>", |
| 8487 | "Redistribute information from another routing protocol\n" |
| 8488 | "Connected\n" |
| 8489 | "Kernel routes\n" |
| 8490 | "Open Shurtest Path First (OSPFv3)\n" |
| 8491 | "Routing Information Protocol (RIPng)\n" |
| 8492 | "Static routes\n" |
| 8493 | "Route map reference\n" |
| 8494 | "Pointer to route-map entries\n" |
| 8495 | "Metric for redistributed routes\n" |
| 8496 | "Default metric\n") |
| 8497 | { |
| 8498 | int type; |
| 8499 | u_int32_t metric; |
| 8500 | |
| 8501 | type = bgp_str2route_type (AFI_IP6, argv[0]); |
| 8502 | if (! type) |
| 8503 | { |
| 8504 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 8505 | return CMD_WARNING; |
| 8506 | } |
| 8507 | VTY_GET_INTEGER ("metric", metric, argv[2]); |
| 8508 | |
| 8509 | bgp_redistribute_rmap_set (vty->index, AFI_IP6, type, argv[1]); |
| 8510 | bgp_redistribute_metric_set (vty->index, AFI_IP6, type, metric); |
| 8511 | return bgp_redistribute_set (vty->index, AFI_IP6, type); |
| 8512 | } |
| 8513 | |
| 8514 | DEFUN (bgp_redistribute_ipv6_metric_rmap, |
| 8515 | bgp_redistribute_ipv6_metric_rmap_cmd, |
| 8516 | "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD", |
| 8517 | "Redistribute information from another routing protocol\n" |
| 8518 | "Connected\n" |
| 8519 | "Kernel routes\n" |
| 8520 | "Open Shurtest Path First (OSPFv3)\n" |
| 8521 | "Routing Information Protocol (RIPng)\n" |
| 8522 | "Static routes\n" |
| 8523 | "Metric for redistributed routes\n" |
| 8524 | "Default metric\n" |
| 8525 | "Route map reference\n" |
| 8526 | "Pointer to route-map entries\n") |
| 8527 | { |
| 8528 | int type; |
| 8529 | u_int32_t metric; |
| 8530 | |
| 8531 | type = bgp_str2route_type (AFI_IP6, argv[0]); |
| 8532 | if (! type) |
| 8533 | { |
| 8534 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 8535 | return CMD_WARNING; |
| 8536 | } |
| 8537 | VTY_GET_INTEGER ("metric", metric, argv[1]); |
| 8538 | |
| 8539 | bgp_redistribute_metric_set (vty->index, AFI_IP6, type, metric); |
| 8540 | bgp_redistribute_rmap_set (vty->index, AFI_IP6, type, argv[2]); |
| 8541 | return bgp_redistribute_set (vty->index, AFI_IP6, type); |
| 8542 | } |
| 8543 | |
| 8544 | DEFUN (no_bgp_redistribute_ipv6, |
| 8545 | no_bgp_redistribute_ipv6_cmd, |
| 8546 | "no redistribute (connected|kernel|ospf6|ripng|static)", |
| 8547 | NO_STR |
| 8548 | "Redistribute information from another routing protocol\n" |
| 8549 | "Connected\n" |
| 8550 | "Kernel routes\n" |
| 8551 | "Open Shurtest Path First (OSPFv3)\n" |
| 8552 | "Routing Information Protocol (RIPng)\n" |
| 8553 | "Static routes\n") |
| 8554 | { |
| 8555 | int type; |
| 8556 | |
| 8557 | type = bgp_str2route_type (AFI_IP6, argv[0]); |
| 8558 | if (! type) |
| 8559 | { |
| 8560 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 8561 | return CMD_WARNING; |
| 8562 | } |
| 8563 | |
| 8564 | return bgp_redistribute_unset (vty->index, AFI_IP6, type); |
| 8565 | } |
| 8566 | |
| 8567 | DEFUN (no_bgp_redistribute_ipv6_rmap, |
| 8568 | no_bgp_redistribute_ipv6_rmap_cmd, |
| 8569 | "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD", |
| 8570 | NO_STR |
| 8571 | "Redistribute information from another routing protocol\n" |
| 8572 | "Connected\n" |
| 8573 | "Kernel routes\n" |
| 8574 | "Open Shurtest Path First (OSPFv3)\n" |
| 8575 | "Routing Information Protocol (RIPng)\n" |
| 8576 | "Static routes\n" |
| 8577 | "Route map reference\n" |
| 8578 | "Pointer to route-map entries\n") |
| 8579 | { |
| 8580 | int type; |
| 8581 | |
| 8582 | type = bgp_str2route_type (AFI_IP6, argv[0]); |
| 8583 | if (! type) |
| 8584 | { |
| 8585 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 8586 | return CMD_WARNING; |
| 8587 | } |
| 8588 | |
| 8589 | bgp_redistribute_routemap_unset (vty->index, AFI_IP6, type); |
| 8590 | return CMD_SUCCESS; |
| 8591 | } |
| 8592 | |
| 8593 | DEFUN (no_bgp_redistribute_ipv6_metric, |
| 8594 | no_bgp_redistribute_ipv6_metric_cmd, |
| 8595 | "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>", |
| 8596 | NO_STR |
| 8597 | "Redistribute information from another routing protocol\n" |
| 8598 | "Connected\n" |
| 8599 | "Kernel routes\n" |
| 8600 | "Open Shurtest Path First (OSPFv3)\n" |
| 8601 | "Routing Information Protocol (RIPng)\n" |
| 8602 | "Static routes\n" |
| 8603 | "Metric for redistributed routes\n" |
| 8604 | "Default metric\n") |
| 8605 | { |
| 8606 | int type; |
| 8607 | |
| 8608 | type = bgp_str2route_type (AFI_IP6, argv[0]); |
| 8609 | if (! type) |
| 8610 | { |
| 8611 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 8612 | return CMD_WARNING; |
| 8613 | } |
| 8614 | |
| 8615 | bgp_redistribute_metric_unset (vty->index, AFI_IP6, type); |
| 8616 | return CMD_SUCCESS; |
| 8617 | } |
| 8618 | |
| 8619 | DEFUN (no_bgp_redistribute_ipv6_rmap_metric, |
| 8620 | no_bgp_redistribute_ipv6_rmap_metric_cmd, |
| 8621 | "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>", |
| 8622 | NO_STR |
| 8623 | "Redistribute information from another routing protocol\n" |
| 8624 | "Connected\n" |
| 8625 | "Kernel routes\n" |
| 8626 | "Open Shurtest Path First (OSPFv3)\n" |
| 8627 | "Routing Information Protocol (RIPng)\n" |
| 8628 | "Static routes\n" |
| 8629 | "Route map reference\n" |
| 8630 | "Pointer to route-map entries\n" |
| 8631 | "Metric for redistributed routes\n" |
| 8632 | "Default metric\n") |
| 8633 | { |
| 8634 | int type; |
| 8635 | |
| 8636 | type = bgp_str2route_type (AFI_IP6, argv[0]); |
| 8637 | if (! type) |
| 8638 | { |
| 8639 | vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE); |
| 8640 | return CMD_WARNING; |
| 8641 | } |
| 8642 | |
| 8643 | bgp_redistribute_metric_unset (vty->index, AFI_IP6, type); |
| 8644 | bgp_redistribute_routemap_unset (vty->index, AFI_IP6, type); |
| 8645 | return CMD_SUCCESS; |
| 8646 | } |
| 8647 | |
| 8648 | ALIAS (no_bgp_redistribute_ipv6_rmap_metric, |
| 8649 | no_bgp_redistribute_ipv6_metric_rmap_cmd, |
| 8650 | "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD", |
| 8651 | NO_STR |
| 8652 | "Redistribute information from another routing protocol\n" |
| 8653 | "Connected\n" |
| 8654 | "Kernel routes\n" |
| 8655 | "Open Shurtest Path First (OSPFv3)\n" |
| 8656 | "Routing Information Protocol (RIPng)\n" |
| 8657 | "Static routes\n" |
| 8658 | "Metric for redistributed routes\n" |
| 8659 | "Default metric\n" |
| 8660 | "Route map reference\n" |
| 8661 | "Pointer to route-map entries\n") |
| 8662 | #endif /* HAVE_IPV6 */ |
| 8663 | |
| 8664 | int |
| 8665 | bgp_config_write_redistribute (struct vty *vty, struct bgp *bgp, afi_t afi, |
| 8666 | safi_t safi, int *write) |
| 8667 | { |
| 8668 | int i; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8669 | |
| 8670 | /* Unicast redistribution only. */ |
| 8671 | if (safi != SAFI_UNICAST) |
| 8672 | return 0; |
| 8673 | |
| 8674 | for (i = 0; i < ZEBRA_ROUTE_MAX; i++) |
| 8675 | { |
| 8676 | /* Redistribute BGP does not make sense. */ |
| 8677 | if (bgp->redist[afi][i] && i != ZEBRA_ROUTE_BGP) |
| 8678 | { |
| 8679 | /* Display "address-family" when it is not yet diplayed. */ |
| 8680 | bgp_config_write_family_header (vty, afi, safi, write); |
| 8681 | |
| 8682 | /* "redistribute" configuration. */ |
ajs | f52d13c | 2005-10-01 17:38:06 +0000 | [diff] [blame] | 8683 | vty_out (vty, " redistribute %s", zebra_route_string(i)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8684 | |
| 8685 | if (bgp->redist_metric_flag[afi][i]) |
| 8686 | vty_out (vty, " metric %d", bgp->redist_metric[afi][i]); |
| 8687 | |
| 8688 | if (bgp->rmap[afi][i].name) |
| 8689 | vty_out (vty, " route-map %s", bgp->rmap[afi][i].name); |
| 8690 | |
| 8691 | vty_out (vty, "%s", VTY_NEWLINE); |
| 8692 | } |
| 8693 | } |
| 8694 | return *write; |
| 8695 | } |
| 8696 | |
| 8697 | /* BGP node structure. */ |
| 8698 | struct cmd_node bgp_node = |
| 8699 | { |
| 8700 | BGP_NODE, |
| 8701 | "%s(config-router)# ", |
| 8702 | 1, |
| 8703 | }; |
| 8704 | |
| 8705 | struct cmd_node bgp_ipv4_unicast_node = |
| 8706 | { |
| 8707 | BGP_IPV4_NODE, |
| 8708 | "%s(config-router-af)# ", |
| 8709 | 1, |
| 8710 | }; |
| 8711 | |
| 8712 | struct cmd_node bgp_ipv4_multicast_node = |
| 8713 | { |
| 8714 | BGP_IPV4M_NODE, |
| 8715 | "%s(config-router-af)# ", |
| 8716 | 1, |
| 8717 | }; |
| 8718 | |
| 8719 | struct cmd_node bgp_ipv6_unicast_node = |
| 8720 | { |
| 8721 | BGP_IPV6_NODE, |
| 8722 | "%s(config-router-af)# ", |
| 8723 | 1, |
| 8724 | }; |
| 8725 | |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 8726 | struct cmd_node bgp_ipv6_multicast_node = |
| 8727 | { |
| 8728 | BGP_IPV6M_NODE, |
| 8729 | "%s(config-router-af)# ", |
| 8730 | 1, |
| 8731 | }; |
| 8732 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8733 | struct cmd_node bgp_vpnv4_node = |
| 8734 | { |
| 8735 | BGP_VPNV4_NODE, |
| 8736 | "%s(config-router-af)# ", |
| 8737 | 1 |
| 8738 | }; |
| 8739 | |
paul | 1f8ae70 | 2005-09-09 23:49:49 +0000 | [diff] [blame] | 8740 | static void community_list_vty (void); |
| 8741 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8742 | void |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 8743 | bgp_vty_init (void) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8744 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8745 | /* Install bgp top node. */ |
| 8746 | install_node (&bgp_node, bgp_config_write); |
| 8747 | install_node (&bgp_ipv4_unicast_node, NULL); |
| 8748 | install_node (&bgp_ipv4_multicast_node, NULL); |
| 8749 | install_node (&bgp_ipv6_unicast_node, NULL); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 8750 | install_node (&bgp_ipv6_multicast_node, NULL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8751 | install_node (&bgp_vpnv4_node, NULL); |
| 8752 | |
| 8753 | /* Install default VTY commands to new nodes. */ |
| 8754 | install_default (BGP_NODE); |
| 8755 | install_default (BGP_IPV4_NODE); |
| 8756 | install_default (BGP_IPV4M_NODE); |
| 8757 | install_default (BGP_IPV6_NODE); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 8758 | install_default (BGP_IPV6M_NODE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8759 | install_default (BGP_VPNV4_NODE); |
| 8760 | |
| 8761 | /* "bgp multiple-instance" commands. */ |
| 8762 | install_element (CONFIG_NODE, &bgp_multiple_instance_cmd); |
| 8763 | install_element (CONFIG_NODE, &no_bgp_multiple_instance_cmd); |
| 8764 | |
| 8765 | /* "bgp config-type" commands. */ |
| 8766 | install_element (CONFIG_NODE, &bgp_config_type_cmd); |
| 8767 | install_element (CONFIG_NODE, &no_bgp_config_type_cmd); |
| 8768 | |
| 8769 | /* Dummy commands (Currently not supported) */ |
| 8770 | install_element (BGP_NODE, &no_synchronization_cmd); |
| 8771 | install_element (BGP_NODE, &no_auto_summary_cmd); |
| 8772 | |
| 8773 | /* "router bgp" commands. */ |
| 8774 | install_element (CONFIG_NODE, &router_bgp_cmd); |
| 8775 | install_element (CONFIG_NODE, &router_bgp_view_cmd); |
| 8776 | |
| 8777 | /* "no router bgp" commands. */ |
| 8778 | install_element (CONFIG_NODE, &no_router_bgp_cmd); |
| 8779 | install_element (CONFIG_NODE, &no_router_bgp_view_cmd); |
| 8780 | |
| 8781 | /* "bgp router-id" commands. */ |
| 8782 | install_element (BGP_NODE, &bgp_router_id_cmd); |
| 8783 | install_element (BGP_NODE, &no_bgp_router_id_cmd); |
| 8784 | install_element (BGP_NODE, &no_bgp_router_id_val_cmd); |
| 8785 | |
| 8786 | /* "bgp cluster-id" commands. */ |
| 8787 | install_element (BGP_NODE, &bgp_cluster_id_cmd); |
| 8788 | install_element (BGP_NODE, &bgp_cluster_id32_cmd); |
| 8789 | install_element (BGP_NODE, &no_bgp_cluster_id_cmd); |
| 8790 | install_element (BGP_NODE, &no_bgp_cluster_id_arg_cmd); |
| 8791 | |
| 8792 | /* "bgp confederation" commands. */ |
| 8793 | install_element (BGP_NODE, &bgp_confederation_identifier_cmd); |
| 8794 | install_element (BGP_NODE, &no_bgp_confederation_identifier_cmd); |
| 8795 | install_element (BGP_NODE, &no_bgp_confederation_identifier_arg_cmd); |
| 8796 | |
| 8797 | /* "bgp confederation peers" commands. */ |
| 8798 | install_element (BGP_NODE, &bgp_confederation_peers_cmd); |
| 8799 | install_element (BGP_NODE, &no_bgp_confederation_peers_cmd); |
| 8800 | |
| 8801 | /* "timers bgp" commands. */ |
| 8802 | install_element (BGP_NODE, &bgp_timers_cmd); |
| 8803 | install_element (BGP_NODE, &no_bgp_timers_cmd); |
| 8804 | install_element (BGP_NODE, &no_bgp_timers_arg_cmd); |
| 8805 | |
| 8806 | /* "bgp client-to-client reflection" commands */ |
| 8807 | install_element (BGP_NODE, &no_bgp_client_to_client_reflection_cmd); |
| 8808 | install_element (BGP_NODE, &bgp_client_to_client_reflection_cmd); |
| 8809 | |
| 8810 | /* "bgp always-compare-med" commands */ |
| 8811 | install_element (BGP_NODE, &bgp_always_compare_med_cmd); |
| 8812 | install_element (BGP_NODE, &no_bgp_always_compare_med_cmd); |
| 8813 | |
| 8814 | /* "bgp deterministic-med" commands */ |
| 8815 | install_element (BGP_NODE, &bgp_deterministic_med_cmd); |
| 8816 | install_element (BGP_NODE, &no_bgp_deterministic_med_cmd); |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8817 | |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 8818 | /* "bgp graceful-restart" commands */ |
| 8819 | install_element (BGP_NODE, &bgp_graceful_restart_cmd); |
| 8820 | install_element (BGP_NODE, &no_bgp_graceful_restart_cmd); |
hasso | 93406d8 | 2005-02-02 14:40:33 +0000 | [diff] [blame] | 8821 | install_element (BGP_NODE, &bgp_graceful_restart_stalepath_time_cmd); |
| 8822 | install_element (BGP_NODE, &no_bgp_graceful_restart_stalepath_time_cmd); |
| 8823 | install_element (BGP_NODE, &no_bgp_graceful_restart_stalepath_time_val_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8824 | |
| 8825 | /* "bgp fast-external-failover" commands */ |
| 8826 | install_element (BGP_NODE, &bgp_fast_external_failover_cmd); |
| 8827 | install_element (BGP_NODE, &no_bgp_fast_external_failover_cmd); |
| 8828 | |
| 8829 | /* "bgp enforce-first-as" commands */ |
| 8830 | install_element (BGP_NODE, &bgp_enforce_first_as_cmd); |
| 8831 | install_element (BGP_NODE, &no_bgp_enforce_first_as_cmd); |
| 8832 | |
| 8833 | /* "bgp bestpath compare-routerid" commands */ |
| 8834 | install_element (BGP_NODE, &bgp_bestpath_compare_router_id_cmd); |
| 8835 | install_element (BGP_NODE, &no_bgp_bestpath_compare_router_id_cmd); |
| 8836 | |
| 8837 | /* "bgp bestpath as-path ignore" commands */ |
| 8838 | install_element (BGP_NODE, &bgp_bestpath_aspath_ignore_cmd); |
| 8839 | install_element (BGP_NODE, &no_bgp_bestpath_aspath_ignore_cmd); |
| 8840 | |
hasso | 6811845 | 2005-04-08 15:40:36 +0000 | [diff] [blame] | 8841 | /* "bgp bestpath as-path confed" commands */ |
| 8842 | install_element (BGP_NODE, &bgp_bestpath_aspath_confed_cmd); |
| 8843 | install_element (BGP_NODE, &no_bgp_bestpath_aspath_confed_cmd); |
| 8844 | |
paul | 848973c | 2003-08-13 00:32:49 +0000 | [diff] [blame] | 8845 | /* "bgp log-neighbor-changes" commands */ |
| 8846 | install_element (BGP_NODE, &bgp_log_neighbor_changes_cmd); |
| 8847 | install_element (BGP_NODE, &no_bgp_log_neighbor_changes_cmd); |
| 8848 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8849 | /* "bgp bestpath med" commands */ |
| 8850 | install_element (BGP_NODE, &bgp_bestpath_med_cmd); |
| 8851 | install_element (BGP_NODE, &bgp_bestpath_med2_cmd); |
| 8852 | install_element (BGP_NODE, &bgp_bestpath_med3_cmd); |
| 8853 | install_element (BGP_NODE, &no_bgp_bestpath_med_cmd); |
| 8854 | install_element (BGP_NODE, &no_bgp_bestpath_med2_cmd); |
| 8855 | install_element (BGP_NODE, &no_bgp_bestpath_med3_cmd); |
| 8856 | |
| 8857 | /* "no bgp default ipv4-unicast" commands. */ |
| 8858 | install_element (BGP_NODE, &no_bgp_default_ipv4_unicast_cmd); |
| 8859 | install_element (BGP_NODE, &bgp_default_ipv4_unicast_cmd); |
| 8860 | |
| 8861 | /* "bgp network import-check" commands. */ |
| 8862 | install_element (BGP_NODE, &bgp_network_import_check_cmd); |
| 8863 | install_element (BGP_NODE, &no_bgp_network_import_check_cmd); |
| 8864 | |
| 8865 | /* "bgp default local-preference" commands. */ |
| 8866 | install_element (BGP_NODE, &bgp_default_local_preference_cmd); |
| 8867 | install_element (BGP_NODE, &no_bgp_default_local_preference_cmd); |
| 8868 | install_element (BGP_NODE, &no_bgp_default_local_preference_val_cmd); |
| 8869 | |
| 8870 | /* "neighbor remote-as" commands. */ |
| 8871 | install_element (BGP_NODE, &neighbor_remote_as_cmd); |
| 8872 | install_element (BGP_NODE, &no_neighbor_cmd); |
| 8873 | install_element (BGP_NODE, &no_neighbor_remote_as_cmd); |
| 8874 | |
| 8875 | /* "neighbor peer-group" commands. */ |
| 8876 | install_element (BGP_NODE, &neighbor_peer_group_cmd); |
| 8877 | install_element (BGP_NODE, &no_neighbor_peer_group_cmd); |
| 8878 | install_element (BGP_NODE, &no_neighbor_peer_group_remote_as_cmd); |
| 8879 | |
| 8880 | /* "neighbor local-as" commands. */ |
| 8881 | install_element (BGP_NODE, &neighbor_local_as_cmd); |
| 8882 | install_element (BGP_NODE, &neighbor_local_as_no_prepend_cmd); |
| 8883 | install_element (BGP_NODE, &no_neighbor_local_as_cmd); |
| 8884 | install_element (BGP_NODE, &no_neighbor_local_as_val_cmd); |
| 8885 | install_element (BGP_NODE, &no_neighbor_local_as_val2_cmd); |
| 8886 | |
| 8887 | /* "neighbor activate" commands. */ |
| 8888 | install_element (BGP_NODE, &neighbor_activate_cmd); |
| 8889 | install_element (BGP_IPV4_NODE, &neighbor_activate_cmd); |
| 8890 | install_element (BGP_IPV4M_NODE, &neighbor_activate_cmd); |
| 8891 | install_element (BGP_IPV6_NODE, &neighbor_activate_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 8892 | install_element (BGP_IPV6M_NODE, &neighbor_activate_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8893 | install_element (BGP_VPNV4_NODE, &neighbor_activate_cmd); |
| 8894 | |
| 8895 | /* "no neighbor activate" commands. */ |
| 8896 | install_element (BGP_NODE, &no_neighbor_activate_cmd); |
| 8897 | install_element (BGP_IPV4_NODE, &no_neighbor_activate_cmd); |
| 8898 | install_element (BGP_IPV4M_NODE, &no_neighbor_activate_cmd); |
| 8899 | install_element (BGP_IPV6_NODE, &no_neighbor_activate_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 8900 | install_element (BGP_IPV6M_NODE, &no_neighbor_activate_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8901 | install_element (BGP_VPNV4_NODE, &no_neighbor_activate_cmd); |
| 8902 | |
| 8903 | /* "neighbor peer-group set" commands. */ |
| 8904 | install_element (BGP_NODE, &neighbor_set_peer_group_cmd); |
| 8905 | install_element (BGP_IPV4_NODE, &neighbor_set_peer_group_cmd); |
| 8906 | install_element (BGP_IPV4M_NODE, &neighbor_set_peer_group_cmd); |
| 8907 | install_element (BGP_IPV6_NODE, &neighbor_set_peer_group_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 8908 | install_element (BGP_IPV6M_NODE, &neighbor_set_peer_group_cmd); |
paul | a58545b | 2003-07-12 21:43:01 +0000 | [diff] [blame] | 8909 | install_element (BGP_VPNV4_NODE, &neighbor_set_peer_group_cmd); |
| 8910 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8911 | /* "no neighbor peer-group unset" commands. */ |
| 8912 | install_element (BGP_NODE, &no_neighbor_set_peer_group_cmd); |
| 8913 | install_element (BGP_IPV4_NODE, &no_neighbor_set_peer_group_cmd); |
| 8914 | install_element (BGP_IPV4M_NODE, &no_neighbor_set_peer_group_cmd); |
| 8915 | install_element (BGP_IPV6_NODE, &no_neighbor_set_peer_group_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 8916 | install_element (BGP_IPV6M_NODE, &no_neighbor_set_peer_group_cmd); |
paul | a58545b | 2003-07-12 21:43:01 +0000 | [diff] [blame] | 8917 | install_element (BGP_VPNV4_NODE, &no_neighbor_set_peer_group_cmd); |
| 8918 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8919 | /* "neighbor softreconfiguration inbound" commands.*/ |
| 8920 | install_element (BGP_NODE, &neighbor_soft_reconfiguration_cmd); |
| 8921 | install_element (BGP_NODE, &no_neighbor_soft_reconfiguration_cmd); |
| 8922 | install_element (BGP_IPV4_NODE, &neighbor_soft_reconfiguration_cmd); |
| 8923 | install_element (BGP_IPV4_NODE, &no_neighbor_soft_reconfiguration_cmd); |
| 8924 | install_element (BGP_IPV4M_NODE, &neighbor_soft_reconfiguration_cmd); |
| 8925 | install_element (BGP_IPV4M_NODE, &no_neighbor_soft_reconfiguration_cmd); |
| 8926 | install_element (BGP_IPV6_NODE, &neighbor_soft_reconfiguration_cmd); |
| 8927 | install_element (BGP_IPV6_NODE, &no_neighbor_soft_reconfiguration_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 8928 | install_element (BGP_IPV6M_NODE, &neighbor_soft_reconfiguration_cmd); |
| 8929 | install_element (BGP_IPV6M_NODE, &no_neighbor_soft_reconfiguration_cmd); |
paul | a58545b | 2003-07-12 21:43:01 +0000 | [diff] [blame] | 8930 | install_element (BGP_VPNV4_NODE, &neighbor_soft_reconfiguration_cmd); |
| 8931 | install_element (BGP_VPNV4_NODE, &no_neighbor_soft_reconfiguration_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 8932 | |
| 8933 | /* "neighbor attribute-unchanged" commands. */ |
| 8934 | install_element (BGP_NODE, &neighbor_attr_unchanged_cmd); |
| 8935 | install_element (BGP_NODE, &neighbor_attr_unchanged1_cmd); |
| 8936 | install_element (BGP_NODE, &neighbor_attr_unchanged2_cmd); |
| 8937 | install_element (BGP_NODE, &neighbor_attr_unchanged3_cmd); |
| 8938 | install_element (BGP_NODE, &neighbor_attr_unchanged4_cmd); |
| 8939 | install_element (BGP_NODE, &neighbor_attr_unchanged5_cmd); |
| 8940 | install_element (BGP_NODE, &neighbor_attr_unchanged6_cmd); |
| 8941 | install_element (BGP_NODE, &neighbor_attr_unchanged7_cmd); |
| 8942 | install_element (BGP_NODE, &neighbor_attr_unchanged8_cmd); |
| 8943 | install_element (BGP_NODE, &neighbor_attr_unchanged9_cmd); |
| 8944 | install_element (BGP_NODE, &neighbor_attr_unchanged10_cmd); |
| 8945 | install_element (BGP_NODE, &no_neighbor_attr_unchanged_cmd); |
| 8946 | install_element (BGP_NODE, &no_neighbor_attr_unchanged1_cmd); |
| 8947 | install_element (BGP_NODE, &no_neighbor_attr_unchanged2_cmd); |
| 8948 | install_element (BGP_NODE, &no_neighbor_attr_unchanged3_cmd); |
| 8949 | install_element (BGP_NODE, &no_neighbor_attr_unchanged4_cmd); |
| 8950 | install_element (BGP_NODE, &no_neighbor_attr_unchanged5_cmd); |
| 8951 | install_element (BGP_NODE, &no_neighbor_attr_unchanged6_cmd); |
| 8952 | install_element (BGP_NODE, &no_neighbor_attr_unchanged7_cmd); |
| 8953 | install_element (BGP_NODE, &no_neighbor_attr_unchanged8_cmd); |
| 8954 | install_element (BGP_NODE, &no_neighbor_attr_unchanged9_cmd); |
| 8955 | install_element (BGP_NODE, &no_neighbor_attr_unchanged10_cmd); |
| 8956 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged_cmd); |
| 8957 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged1_cmd); |
| 8958 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged2_cmd); |
| 8959 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged3_cmd); |
| 8960 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged4_cmd); |
| 8961 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged5_cmd); |
| 8962 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged6_cmd); |
| 8963 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged7_cmd); |
| 8964 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged8_cmd); |
| 8965 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged9_cmd); |
| 8966 | install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged10_cmd); |
| 8967 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged_cmd); |
| 8968 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged1_cmd); |
| 8969 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged2_cmd); |
| 8970 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged3_cmd); |
| 8971 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged4_cmd); |
| 8972 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged5_cmd); |
| 8973 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged6_cmd); |
| 8974 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged7_cmd); |
| 8975 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged8_cmd); |
| 8976 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged9_cmd); |
| 8977 | install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged10_cmd); |
| 8978 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged_cmd); |
| 8979 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged1_cmd); |
| 8980 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged2_cmd); |
| 8981 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged3_cmd); |
| 8982 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged4_cmd); |
| 8983 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged5_cmd); |
| 8984 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged6_cmd); |
| 8985 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged7_cmd); |
| 8986 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged8_cmd); |
| 8987 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged9_cmd); |
| 8988 | install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged10_cmd); |
| 8989 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged_cmd); |
| 8990 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged1_cmd); |
| 8991 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged2_cmd); |
| 8992 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged3_cmd); |
| 8993 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged4_cmd); |
| 8994 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged5_cmd); |
| 8995 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged6_cmd); |
| 8996 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged7_cmd); |
| 8997 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged8_cmd); |
| 8998 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged9_cmd); |
| 8999 | install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged10_cmd); |
| 9000 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged_cmd); |
| 9001 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged1_cmd); |
| 9002 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged2_cmd); |
| 9003 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged3_cmd); |
| 9004 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged4_cmd); |
| 9005 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged5_cmd); |
| 9006 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged6_cmd); |
| 9007 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged7_cmd); |
| 9008 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged8_cmd); |
| 9009 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged9_cmd); |
| 9010 | install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged10_cmd); |
| 9011 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged_cmd); |
| 9012 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged1_cmd); |
| 9013 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged2_cmd); |
| 9014 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged3_cmd); |
| 9015 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged4_cmd); |
| 9016 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged5_cmd); |
| 9017 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged6_cmd); |
| 9018 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged7_cmd); |
| 9019 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged8_cmd); |
| 9020 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged9_cmd); |
| 9021 | install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged10_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9022 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged_cmd); |
| 9023 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged1_cmd); |
| 9024 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged2_cmd); |
| 9025 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged3_cmd); |
| 9026 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged4_cmd); |
| 9027 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged5_cmd); |
| 9028 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged6_cmd); |
| 9029 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged7_cmd); |
| 9030 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged8_cmd); |
| 9031 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged9_cmd); |
| 9032 | install_element (BGP_IPV6M_NODE, &neighbor_attr_unchanged10_cmd); |
| 9033 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged_cmd); |
| 9034 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged1_cmd); |
| 9035 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged2_cmd); |
| 9036 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged3_cmd); |
| 9037 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged4_cmd); |
| 9038 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged5_cmd); |
| 9039 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged6_cmd); |
| 9040 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged7_cmd); |
| 9041 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged8_cmd); |
| 9042 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged9_cmd); |
| 9043 | install_element (BGP_IPV6M_NODE, &no_neighbor_attr_unchanged10_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9044 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged_cmd); |
| 9045 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged1_cmd); |
| 9046 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged2_cmd); |
| 9047 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged3_cmd); |
| 9048 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged4_cmd); |
| 9049 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged5_cmd); |
| 9050 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged6_cmd); |
| 9051 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged7_cmd); |
| 9052 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged8_cmd); |
| 9053 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged9_cmd); |
| 9054 | install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged10_cmd); |
| 9055 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged_cmd); |
| 9056 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged1_cmd); |
| 9057 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged2_cmd); |
| 9058 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged3_cmd); |
| 9059 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged4_cmd); |
| 9060 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged5_cmd); |
| 9061 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged6_cmd); |
| 9062 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged7_cmd); |
| 9063 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged8_cmd); |
| 9064 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged9_cmd); |
| 9065 | install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged10_cmd); |
| 9066 | |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9067 | /* "nexthop-local unchanged" commands */ |
| 9068 | install_element (BGP_IPV6_NODE, &neighbor_nexthop_local_unchanged_cmd); |
| 9069 | install_element (BGP_IPV6_NODE, &no_neighbor_nexthop_local_unchanged_cmd); |
| 9070 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9071 | /* "transparent-as" and "transparent-nexthop" for old version |
| 9072 | compatibility. */ |
| 9073 | install_element (BGP_NODE, &neighbor_transparent_as_cmd); |
| 9074 | install_element (BGP_NODE, &neighbor_transparent_nexthop_cmd); |
| 9075 | |
| 9076 | /* "neighbor next-hop-self" commands. */ |
| 9077 | install_element (BGP_NODE, &neighbor_nexthop_self_cmd); |
| 9078 | install_element (BGP_NODE, &no_neighbor_nexthop_self_cmd); |
| 9079 | install_element (BGP_IPV4_NODE, &neighbor_nexthop_self_cmd); |
| 9080 | install_element (BGP_IPV4_NODE, &no_neighbor_nexthop_self_cmd); |
| 9081 | install_element (BGP_IPV4M_NODE, &neighbor_nexthop_self_cmd); |
| 9082 | install_element (BGP_IPV4M_NODE, &no_neighbor_nexthop_self_cmd); |
| 9083 | install_element (BGP_IPV6_NODE, &neighbor_nexthop_self_cmd); |
| 9084 | install_element (BGP_IPV6_NODE, &no_neighbor_nexthop_self_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9085 | install_element (BGP_IPV6M_NODE, &neighbor_nexthop_self_cmd); |
| 9086 | install_element (BGP_IPV6M_NODE, &no_neighbor_nexthop_self_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9087 | install_element (BGP_VPNV4_NODE, &neighbor_nexthop_self_cmd); |
| 9088 | install_element (BGP_VPNV4_NODE, &no_neighbor_nexthop_self_cmd); |
| 9089 | |
| 9090 | /* "neighbor remove-private-AS" commands. */ |
| 9091 | install_element (BGP_NODE, &neighbor_remove_private_as_cmd); |
| 9092 | install_element (BGP_NODE, &no_neighbor_remove_private_as_cmd); |
| 9093 | install_element (BGP_IPV4_NODE, &neighbor_remove_private_as_cmd); |
| 9094 | install_element (BGP_IPV4_NODE, &no_neighbor_remove_private_as_cmd); |
| 9095 | install_element (BGP_IPV4M_NODE, &neighbor_remove_private_as_cmd); |
| 9096 | install_element (BGP_IPV4M_NODE, &no_neighbor_remove_private_as_cmd); |
| 9097 | install_element (BGP_IPV6_NODE, &neighbor_remove_private_as_cmd); |
| 9098 | install_element (BGP_IPV6_NODE, &no_neighbor_remove_private_as_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9099 | install_element (BGP_IPV6M_NODE, &neighbor_remove_private_as_cmd); |
| 9100 | install_element (BGP_IPV6M_NODE, &no_neighbor_remove_private_as_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9101 | install_element (BGP_VPNV4_NODE, &neighbor_remove_private_as_cmd); |
| 9102 | install_element (BGP_VPNV4_NODE, &no_neighbor_remove_private_as_cmd); |
| 9103 | |
| 9104 | /* "neighbor send-community" commands.*/ |
| 9105 | install_element (BGP_NODE, &neighbor_send_community_cmd); |
| 9106 | install_element (BGP_NODE, &neighbor_send_community_type_cmd); |
| 9107 | install_element (BGP_NODE, &no_neighbor_send_community_cmd); |
| 9108 | install_element (BGP_NODE, &no_neighbor_send_community_type_cmd); |
| 9109 | install_element (BGP_IPV4_NODE, &neighbor_send_community_cmd); |
| 9110 | install_element (BGP_IPV4_NODE, &neighbor_send_community_type_cmd); |
| 9111 | install_element (BGP_IPV4_NODE, &no_neighbor_send_community_cmd); |
| 9112 | install_element (BGP_IPV4_NODE, &no_neighbor_send_community_type_cmd); |
| 9113 | install_element (BGP_IPV4M_NODE, &neighbor_send_community_cmd); |
| 9114 | install_element (BGP_IPV4M_NODE, &neighbor_send_community_type_cmd); |
| 9115 | install_element (BGP_IPV4M_NODE, &no_neighbor_send_community_cmd); |
| 9116 | install_element (BGP_IPV4M_NODE, &no_neighbor_send_community_type_cmd); |
| 9117 | install_element (BGP_IPV6_NODE, &neighbor_send_community_cmd); |
| 9118 | install_element (BGP_IPV6_NODE, &neighbor_send_community_type_cmd); |
| 9119 | install_element (BGP_IPV6_NODE, &no_neighbor_send_community_cmd); |
| 9120 | install_element (BGP_IPV6_NODE, &no_neighbor_send_community_type_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9121 | install_element (BGP_IPV6M_NODE, &neighbor_send_community_cmd); |
| 9122 | install_element (BGP_IPV6M_NODE, &neighbor_send_community_type_cmd); |
| 9123 | install_element (BGP_IPV6M_NODE, &no_neighbor_send_community_cmd); |
| 9124 | install_element (BGP_IPV6M_NODE, &no_neighbor_send_community_type_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9125 | install_element (BGP_VPNV4_NODE, &neighbor_send_community_cmd); |
| 9126 | install_element (BGP_VPNV4_NODE, &neighbor_send_community_type_cmd); |
| 9127 | install_element (BGP_VPNV4_NODE, &no_neighbor_send_community_cmd); |
| 9128 | install_element (BGP_VPNV4_NODE, &no_neighbor_send_community_type_cmd); |
| 9129 | |
| 9130 | /* "neighbor route-reflector" commands.*/ |
| 9131 | install_element (BGP_NODE, &neighbor_route_reflector_client_cmd); |
| 9132 | install_element (BGP_NODE, &no_neighbor_route_reflector_client_cmd); |
| 9133 | install_element (BGP_IPV4_NODE, &neighbor_route_reflector_client_cmd); |
| 9134 | install_element (BGP_IPV4_NODE, &no_neighbor_route_reflector_client_cmd); |
| 9135 | install_element (BGP_IPV4M_NODE, &neighbor_route_reflector_client_cmd); |
| 9136 | install_element (BGP_IPV4M_NODE, &no_neighbor_route_reflector_client_cmd); |
| 9137 | install_element (BGP_IPV6_NODE, &neighbor_route_reflector_client_cmd); |
| 9138 | install_element (BGP_IPV6_NODE, &no_neighbor_route_reflector_client_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9139 | install_element (BGP_IPV6M_NODE, &neighbor_route_reflector_client_cmd); |
| 9140 | install_element (BGP_IPV6M_NODE, &no_neighbor_route_reflector_client_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9141 | install_element (BGP_VPNV4_NODE, &neighbor_route_reflector_client_cmd); |
| 9142 | install_element (BGP_VPNV4_NODE, &no_neighbor_route_reflector_client_cmd); |
| 9143 | |
| 9144 | /* "neighbor route-server" commands.*/ |
| 9145 | install_element (BGP_NODE, &neighbor_route_server_client_cmd); |
| 9146 | install_element (BGP_NODE, &no_neighbor_route_server_client_cmd); |
| 9147 | install_element (BGP_IPV4_NODE, &neighbor_route_server_client_cmd); |
| 9148 | install_element (BGP_IPV4_NODE, &no_neighbor_route_server_client_cmd); |
| 9149 | install_element (BGP_IPV4M_NODE, &neighbor_route_server_client_cmd); |
| 9150 | install_element (BGP_IPV4M_NODE, &no_neighbor_route_server_client_cmd); |
| 9151 | install_element (BGP_IPV6_NODE, &neighbor_route_server_client_cmd); |
| 9152 | install_element (BGP_IPV6_NODE, &no_neighbor_route_server_client_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9153 | install_element (BGP_IPV6M_NODE, &neighbor_route_server_client_cmd); |
| 9154 | install_element (BGP_IPV6M_NODE, &no_neighbor_route_server_client_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9155 | install_element (BGP_VPNV4_NODE, &neighbor_route_server_client_cmd); |
| 9156 | install_element (BGP_VPNV4_NODE, &no_neighbor_route_server_client_cmd); |
| 9157 | |
| 9158 | /* "neighbor passive" commands. */ |
| 9159 | install_element (BGP_NODE, &neighbor_passive_cmd); |
| 9160 | install_element (BGP_NODE, &no_neighbor_passive_cmd); |
| 9161 | |
| 9162 | /* "neighbor shutdown" commands. */ |
| 9163 | install_element (BGP_NODE, &neighbor_shutdown_cmd); |
| 9164 | install_element (BGP_NODE, &no_neighbor_shutdown_cmd); |
| 9165 | |
hasso | c950243 | 2005-02-01 22:01:48 +0000 | [diff] [blame] | 9166 | /* Deprecated "neighbor capability route-refresh" commands.*/ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9167 | install_element (BGP_NODE, &neighbor_capability_route_refresh_cmd); |
| 9168 | install_element (BGP_NODE, &no_neighbor_capability_route_refresh_cmd); |
| 9169 | |
| 9170 | /* "neighbor capability orf prefix-list" commands.*/ |
| 9171 | install_element (BGP_NODE, &neighbor_capability_orf_prefix_cmd); |
| 9172 | install_element (BGP_NODE, &no_neighbor_capability_orf_prefix_cmd); |
| 9173 | install_element (BGP_IPV4_NODE, &neighbor_capability_orf_prefix_cmd); |
| 9174 | install_element (BGP_IPV4_NODE, &no_neighbor_capability_orf_prefix_cmd); |
| 9175 | install_element (BGP_IPV4M_NODE, &neighbor_capability_orf_prefix_cmd); |
| 9176 | install_element (BGP_IPV4M_NODE, &no_neighbor_capability_orf_prefix_cmd); |
| 9177 | install_element (BGP_IPV6_NODE, &neighbor_capability_orf_prefix_cmd); |
| 9178 | install_element (BGP_IPV6_NODE, &no_neighbor_capability_orf_prefix_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9179 | install_element (BGP_IPV6M_NODE, &neighbor_capability_orf_prefix_cmd); |
| 9180 | install_element (BGP_IPV6M_NODE, &no_neighbor_capability_orf_prefix_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9181 | |
| 9182 | /* "neighbor capability dynamic" commands.*/ |
| 9183 | install_element (BGP_NODE, &neighbor_capability_dynamic_cmd); |
| 9184 | install_element (BGP_NODE, &no_neighbor_capability_dynamic_cmd); |
| 9185 | |
| 9186 | /* "neighbor dont-capability-negotiate" commands. */ |
| 9187 | install_element (BGP_NODE, &neighbor_dont_capability_negotiate_cmd); |
| 9188 | install_element (BGP_NODE, &no_neighbor_dont_capability_negotiate_cmd); |
| 9189 | |
| 9190 | /* "neighbor ebgp-multihop" commands. */ |
| 9191 | install_element (BGP_NODE, &neighbor_ebgp_multihop_cmd); |
| 9192 | install_element (BGP_NODE, &neighbor_ebgp_multihop_ttl_cmd); |
| 9193 | install_element (BGP_NODE, &no_neighbor_ebgp_multihop_cmd); |
| 9194 | install_element (BGP_NODE, &no_neighbor_ebgp_multihop_ttl_cmd); |
| 9195 | |
hasso | 6ffd207 | 2005-02-02 14:50:11 +0000 | [diff] [blame] | 9196 | /* "neighbor disable-connected-check" commands. */ |
| 9197 | install_element (BGP_NODE, &neighbor_disable_connected_check_cmd); |
| 9198 | install_element (BGP_NODE, &no_neighbor_disable_connected_check_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9199 | install_element (BGP_NODE, &neighbor_enforce_multihop_cmd); |
| 9200 | install_element (BGP_NODE, &no_neighbor_enforce_multihop_cmd); |
| 9201 | |
| 9202 | /* "neighbor description" commands. */ |
| 9203 | install_element (BGP_NODE, &neighbor_description_cmd); |
| 9204 | install_element (BGP_NODE, &no_neighbor_description_cmd); |
| 9205 | install_element (BGP_NODE, &no_neighbor_description_val_cmd); |
| 9206 | |
| 9207 | /* "neighbor update-source" commands. "*/ |
| 9208 | install_element (BGP_NODE, &neighbor_update_source_cmd); |
| 9209 | install_element (BGP_NODE, &no_neighbor_update_source_cmd); |
| 9210 | |
| 9211 | /* "neighbor default-originate" commands. */ |
| 9212 | install_element (BGP_NODE, &neighbor_default_originate_cmd); |
| 9213 | install_element (BGP_NODE, &neighbor_default_originate_rmap_cmd); |
| 9214 | install_element (BGP_NODE, &no_neighbor_default_originate_cmd); |
| 9215 | install_element (BGP_NODE, &no_neighbor_default_originate_rmap_cmd); |
| 9216 | install_element (BGP_IPV4_NODE, &neighbor_default_originate_cmd); |
| 9217 | install_element (BGP_IPV4_NODE, &neighbor_default_originate_rmap_cmd); |
| 9218 | install_element (BGP_IPV4_NODE, &no_neighbor_default_originate_cmd); |
| 9219 | install_element (BGP_IPV4_NODE, &no_neighbor_default_originate_rmap_cmd); |
| 9220 | install_element (BGP_IPV4M_NODE, &neighbor_default_originate_cmd); |
| 9221 | install_element (BGP_IPV4M_NODE, &neighbor_default_originate_rmap_cmd); |
| 9222 | install_element (BGP_IPV4M_NODE, &no_neighbor_default_originate_cmd); |
| 9223 | install_element (BGP_IPV4M_NODE, &no_neighbor_default_originate_rmap_cmd); |
| 9224 | install_element (BGP_IPV6_NODE, &neighbor_default_originate_cmd); |
| 9225 | install_element (BGP_IPV6_NODE, &neighbor_default_originate_rmap_cmd); |
| 9226 | install_element (BGP_IPV6_NODE, &no_neighbor_default_originate_cmd); |
| 9227 | install_element (BGP_IPV6_NODE, &no_neighbor_default_originate_rmap_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9228 | install_element (BGP_IPV6M_NODE, &neighbor_default_originate_cmd); |
| 9229 | install_element (BGP_IPV6M_NODE, &neighbor_default_originate_rmap_cmd); |
| 9230 | install_element (BGP_IPV6M_NODE, &no_neighbor_default_originate_cmd); |
| 9231 | install_element (BGP_IPV6M_NODE, &no_neighbor_default_originate_rmap_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9232 | |
| 9233 | /* "neighbor port" commands. */ |
| 9234 | install_element (BGP_NODE, &neighbor_port_cmd); |
| 9235 | install_element (BGP_NODE, &no_neighbor_port_cmd); |
| 9236 | install_element (BGP_NODE, &no_neighbor_port_val_cmd); |
| 9237 | |
| 9238 | /* "neighbor weight" commands. */ |
| 9239 | install_element (BGP_NODE, &neighbor_weight_cmd); |
| 9240 | install_element (BGP_NODE, &no_neighbor_weight_cmd); |
| 9241 | install_element (BGP_NODE, &no_neighbor_weight_val_cmd); |
| 9242 | |
| 9243 | /* "neighbor override-capability" commands. */ |
| 9244 | install_element (BGP_NODE, &neighbor_override_capability_cmd); |
| 9245 | install_element (BGP_NODE, &no_neighbor_override_capability_cmd); |
| 9246 | |
| 9247 | /* "neighbor strict-capability-match" commands. */ |
| 9248 | install_element (BGP_NODE, &neighbor_strict_capability_cmd); |
| 9249 | install_element (BGP_NODE, &no_neighbor_strict_capability_cmd); |
| 9250 | |
| 9251 | /* "neighbor timers" commands. */ |
| 9252 | install_element (BGP_NODE, &neighbor_timers_cmd); |
| 9253 | install_element (BGP_NODE, &no_neighbor_timers_cmd); |
| 9254 | |
| 9255 | /* "neighbor timers connect" commands. */ |
| 9256 | install_element (BGP_NODE, &neighbor_timers_connect_cmd); |
| 9257 | install_element (BGP_NODE, &no_neighbor_timers_connect_cmd); |
| 9258 | install_element (BGP_NODE, &no_neighbor_timers_connect_val_cmd); |
| 9259 | |
| 9260 | /* "neighbor advertisement-interval" commands. */ |
| 9261 | install_element (BGP_NODE, &neighbor_advertise_interval_cmd); |
| 9262 | install_element (BGP_NODE, &no_neighbor_advertise_interval_cmd); |
| 9263 | install_element (BGP_NODE, &no_neighbor_advertise_interval_val_cmd); |
| 9264 | |
| 9265 | /* "neighbor version" commands. */ |
| 9266 | install_element (BGP_NODE, &neighbor_version_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9267 | |
| 9268 | /* "neighbor interface" commands. */ |
| 9269 | install_element (BGP_NODE, &neighbor_interface_cmd); |
| 9270 | install_element (BGP_NODE, &no_neighbor_interface_cmd); |
| 9271 | |
| 9272 | /* "neighbor distribute" commands. */ |
| 9273 | install_element (BGP_NODE, &neighbor_distribute_list_cmd); |
| 9274 | install_element (BGP_NODE, &no_neighbor_distribute_list_cmd); |
| 9275 | install_element (BGP_IPV4_NODE, &neighbor_distribute_list_cmd); |
| 9276 | install_element (BGP_IPV4_NODE, &no_neighbor_distribute_list_cmd); |
| 9277 | install_element (BGP_IPV4M_NODE, &neighbor_distribute_list_cmd); |
| 9278 | install_element (BGP_IPV4M_NODE, &no_neighbor_distribute_list_cmd); |
| 9279 | install_element (BGP_IPV6_NODE, &neighbor_distribute_list_cmd); |
| 9280 | install_element (BGP_IPV6_NODE, &no_neighbor_distribute_list_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9281 | install_element (BGP_IPV6M_NODE, &neighbor_distribute_list_cmd); |
| 9282 | install_element (BGP_IPV6M_NODE, &no_neighbor_distribute_list_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9283 | install_element (BGP_VPNV4_NODE, &neighbor_distribute_list_cmd); |
| 9284 | install_element (BGP_VPNV4_NODE, &no_neighbor_distribute_list_cmd); |
| 9285 | |
| 9286 | /* "neighbor prefix-list" commands. */ |
| 9287 | install_element (BGP_NODE, &neighbor_prefix_list_cmd); |
| 9288 | install_element (BGP_NODE, &no_neighbor_prefix_list_cmd); |
| 9289 | install_element (BGP_IPV4_NODE, &neighbor_prefix_list_cmd); |
| 9290 | install_element (BGP_IPV4_NODE, &no_neighbor_prefix_list_cmd); |
| 9291 | install_element (BGP_IPV4M_NODE, &neighbor_prefix_list_cmd); |
| 9292 | install_element (BGP_IPV4M_NODE, &no_neighbor_prefix_list_cmd); |
| 9293 | install_element (BGP_IPV6_NODE, &neighbor_prefix_list_cmd); |
| 9294 | install_element (BGP_IPV6_NODE, &no_neighbor_prefix_list_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9295 | install_element (BGP_IPV6M_NODE, &neighbor_prefix_list_cmd); |
| 9296 | install_element (BGP_IPV6M_NODE, &no_neighbor_prefix_list_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9297 | install_element (BGP_VPNV4_NODE, &neighbor_prefix_list_cmd); |
| 9298 | install_element (BGP_VPNV4_NODE, &no_neighbor_prefix_list_cmd); |
| 9299 | |
| 9300 | /* "neighbor filter-list" commands. */ |
| 9301 | install_element (BGP_NODE, &neighbor_filter_list_cmd); |
| 9302 | install_element (BGP_NODE, &no_neighbor_filter_list_cmd); |
| 9303 | install_element (BGP_IPV4_NODE, &neighbor_filter_list_cmd); |
| 9304 | install_element (BGP_IPV4_NODE, &no_neighbor_filter_list_cmd); |
| 9305 | install_element (BGP_IPV4M_NODE, &neighbor_filter_list_cmd); |
| 9306 | install_element (BGP_IPV4M_NODE, &no_neighbor_filter_list_cmd); |
| 9307 | install_element (BGP_IPV6_NODE, &neighbor_filter_list_cmd); |
| 9308 | install_element (BGP_IPV6_NODE, &no_neighbor_filter_list_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9309 | install_element (BGP_IPV6M_NODE, &neighbor_filter_list_cmd); |
| 9310 | install_element (BGP_IPV6M_NODE, &no_neighbor_filter_list_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9311 | install_element (BGP_VPNV4_NODE, &neighbor_filter_list_cmd); |
| 9312 | install_element (BGP_VPNV4_NODE, &no_neighbor_filter_list_cmd); |
| 9313 | |
| 9314 | /* "neighbor route-map" commands. */ |
| 9315 | install_element (BGP_NODE, &neighbor_route_map_cmd); |
| 9316 | install_element (BGP_NODE, &no_neighbor_route_map_cmd); |
| 9317 | install_element (BGP_IPV4_NODE, &neighbor_route_map_cmd); |
| 9318 | install_element (BGP_IPV4_NODE, &no_neighbor_route_map_cmd); |
| 9319 | install_element (BGP_IPV4M_NODE, &neighbor_route_map_cmd); |
| 9320 | install_element (BGP_IPV4M_NODE, &no_neighbor_route_map_cmd); |
| 9321 | install_element (BGP_IPV6_NODE, &neighbor_route_map_cmd); |
| 9322 | install_element (BGP_IPV6_NODE, &no_neighbor_route_map_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9323 | install_element (BGP_IPV6M_NODE, &neighbor_route_map_cmd); |
| 9324 | install_element (BGP_IPV6M_NODE, &no_neighbor_route_map_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9325 | install_element (BGP_VPNV4_NODE, &neighbor_route_map_cmd); |
| 9326 | install_element (BGP_VPNV4_NODE, &no_neighbor_route_map_cmd); |
| 9327 | |
| 9328 | /* "neighbor unsuppress-map" commands. */ |
| 9329 | install_element (BGP_NODE, &neighbor_unsuppress_map_cmd); |
| 9330 | install_element (BGP_NODE, &no_neighbor_unsuppress_map_cmd); |
| 9331 | install_element (BGP_IPV4_NODE, &neighbor_unsuppress_map_cmd); |
| 9332 | install_element (BGP_IPV4_NODE, &no_neighbor_unsuppress_map_cmd); |
| 9333 | install_element (BGP_IPV4M_NODE, &neighbor_unsuppress_map_cmd); |
| 9334 | install_element (BGP_IPV4M_NODE, &no_neighbor_unsuppress_map_cmd); |
| 9335 | install_element (BGP_IPV6_NODE, &neighbor_unsuppress_map_cmd); |
| 9336 | install_element (BGP_IPV6_NODE, &no_neighbor_unsuppress_map_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9337 | install_element (BGP_IPV6M_NODE, &neighbor_unsuppress_map_cmd); |
| 9338 | install_element (BGP_IPV6M_NODE, &no_neighbor_unsuppress_map_cmd); |
paul | a58545b | 2003-07-12 21:43:01 +0000 | [diff] [blame] | 9339 | install_element (BGP_VPNV4_NODE, &neighbor_unsuppress_map_cmd); |
| 9340 | install_element (BGP_VPNV4_NODE, &no_neighbor_unsuppress_map_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9341 | |
| 9342 | /* "neighbor maximum-prefix" commands. */ |
| 9343 | install_element (BGP_NODE, &neighbor_maximum_prefix_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 9344 | install_element (BGP_NODE, &neighbor_maximum_prefix_threshold_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9345 | install_element (BGP_NODE, &neighbor_maximum_prefix_warning_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 9346 | install_element (BGP_NODE, &neighbor_maximum_prefix_threshold_warning_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 9347 | install_element (BGP_NODE, &neighbor_maximum_prefix_restart_cmd); |
| 9348 | install_element (BGP_NODE, &neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9349 | install_element (BGP_NODE, &no_neighbor_maximum_prefix_cmd); |
| 9350 | install_element (BGP_NODE, &no_neighbor_maximum_prefix_val_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 9351 | install_element (BGP_NODE, &no_neighbor_maximum_prefix_threshold_cmd); |
| 9352 | install_element (BGP_NODE, &no_neighbor_maximum_prefix_warning_cmd); |
| 9353 | install_element (BGP_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd); |
| 9354 | install_element (BGP_NODE, &no_neighbor_maximum_prefix_restart_cmd); |
| 9355 | install_element (BGP_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9356 | install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 9357 | install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_threshold_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9358 | install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_warning_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 9359 | install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_threshold_warning_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 9360 | install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_restart_cmd); |
| 9361 | install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9362 | install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_cmd); |
| 9363 | install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_val_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 9364 | install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_threshold_cmd); |
| 9365 | install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_warning_cmd); |
| 9366 | install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd); |
| 9367 | install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_restart_cmd); |
| 9368 | install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9369 | install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 9370 | install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_threshold_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9371 | install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_warning_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 9372 | install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_threshold_warning_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 9373 | install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_restart_cmd); |
| 9374 | install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9375 | install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_cmd); |
| 9376 | install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_val_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 9377 | install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_threshold_cmd); |
| 9378 | install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_warning_cmd); |
| 9379 | install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd); |
| 9380 | install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_restart_cmd); |
| 9381 | install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9382 | install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 9383 | install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_threshold_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9384 | install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_warning_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 9385 | install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_threshold_warning_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 9386 | install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_restart_cmd); |
| 9387 | install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9388 | install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_cmd); |
| 9389 | install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_val_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 9390 | install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_threshold_cmd); |
| 9391 | install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_warning_cmd); |
| 9392 | install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd); |
| 9393 | install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_restart_cmd); |
| 9394 | install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9395 | install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_cmd); |
| 9396 | install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_threshold_cmd); |
| 9397 | install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_warning_cmd); |
| 9398 | install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_threshold_warning_cmd); |
| 9399 | install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_restart_cmd); |
| 9400 | install_element (BGP_IPV6M_NODE, &neighbor_maximum_prefix_threshold_restart_cmd); |
| 9401 | install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_cmd); |
| 9402 | install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_val_cmd); |
| 9403 | install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_threshold_cmd); |
| 9404 | install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_warning_cmd); |
| 9405 | install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd); |
| 9406 | install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_restart_cmd); |
| 9407 | install_element (BGP_IPV6M_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9408 | install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 9409 | install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_threshold_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9410 | install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_warning_cmd); |
hasso | e0701b7 | 2004-05-20 09:19:34 +0000 | [diff] [blame] | 9411 | install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_threshold_warning_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 9412 | install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_restart_cmd); |
| 9413 | install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9414 | install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_cmd); |
| 9415 | install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_val_cmd); |
hasso | 0a486e5 | 2005-02-01 20:57:17 +0000 | [diff] [blame] | 9416 | install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_threshold_cmd); |
| 9417 | install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_warning_cmd); |
| 9418 | install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd); |
| 9419 | install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_restart_cmd); |
| 9420 | install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9421 | |
| 9422 | /* "neighbor allowas-in" */ |
| 9423 | install_element (BGP_NODE, &neighbor_allowas_in_cmd); |
| 9424 | install_element (BGP_NODE, &neighbor_allowas_in_arg_cmd); |
| 9425 | install_element (BGP_NODE, &no_neighbor_allowas_in_cmd); |
| 9426 | install_element (BGP_IPV4_NODE, &neighbor_allowas_in_cmd); |
| 9427 | install_element (BGP_IPV4_NODE, &neighbor_allowas_in_arg_cmd); |
| 9428 | install_element (BGP_IPV4_NODE, &no_neighbor_allowas_in_cmd); |
| 9429 | install_element (BGP_IPV4M_NODE, &neighbor_allowas_in_cmd); |
| 9430 | install_element (BGP_IPV4M_NODE, &neighbor_allowas_in_arg_cmd); |
| 9431 | install_element (BGP_IPV4M_NODE, &no_neighbor_allowas_in_cmd); |
| 9432 | install_element (BGP_IPV6_NODE, &neighbor_allowas_in_cmd); |
| 9433 | install_element (BGP_IPV6_NODE, &neighbor_allowas_in_arg_cmd); |
| 9434 | install_element (BGP_IPV6_NODE, &no_neighbor_allowas_in_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9435 | install_element (BGP_IPV6M_NODE, &neighbor_allowas_in_cmd); |
| 9436 | install_element (BGP_IPV6M_NODE, &neighbor_allowas_in_arg_cmd); |
| 9437 | install_element (BGP_IPV6M_NODE, &no_neighbor_allowas_in_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9438 | install_element (BGP_VPNV4_NODE, &neighbor_allowas_in_cmd); |
| 9439 | install_element (BGP_VPNV4_NODE, &neighbor_allowas_in_arg_cmd); |
| 9440 | install_element (BGP_VPNV4_NODE, &no_neighbor_allowas_in_cmd); |
| 9441 | |
| 9442 | /* address-family commands. */ |
| 9443 | install_element (BGP_NODE, &address_family_ipv4_cmd); |
| 9444 | install_element (BGP_NODE, &address_family_ipv4_safi_cmd); |
| 9445 | #ifdef HAVE_IPV6 |
| 9446 | install_element (BGP_NODE, &address_family_ipv6_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9447 | install_element (BGP_NODE, &address_family_ipv6_safi_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9448 | #endif /* HAVE_IPV6 */ |
| 9449 | install_element (BGP_NODE, &address_family_vpnv4_cmd); |
| 9450 | install_element (BGP_NODE, &address_family_vpnv4_unicast_cmd); |
| 9451 | |
| 9452 | /* "exit-address-family" command. */ |
| 9453 | install_element (BGP_IPV4_NODE, &exit_address_family_cmd); |
| 9454 | install_element (BGP_IPV4M_NODE, &exit_address_family_cmd); |
| 9455 | install_element (BGP_IPV6_NODE, &exit_address_family_cmd); |
paul | 25ffbdc | 2005-08-22 22:42:08 +0000 | [diff] [blame] | 9456 | install_element (BGP_IPV6M_NODE, &exit_address_family_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9457 | install_element (BGP_VPNV4_NODE, &exit_address_family_cmd); |
| 9458 | |
| 9459 | /* "clear ip bgp commands" */ |
| 9460 | install_element (ENABLE_NODE, &clear_ip_bgp_all_cmd); |
| 9461 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_cmd); |
| 9462 | install_element (ENABLE_NODE, &clear_ip_bgp_as_cmd); |
| 9463 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_cmd); |
| 9464 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_cmd); |
| 9465 | install_element (ENABLE_NODE, &clear_ip_bgp_external_cmd); |
| 9466 | #ifdef HAVE_IPV6 |
| 9467 | install_element (ENABLE_NODE, &clear_bgp_all_cmd); |
| 9468 | install_element (ENABLE_NODE, &clear_bgp_instance_all_cmd); |
| 9469 | install_element (ENABLE_NODE, &clear_bgp_ipv6_all_cmd); |
| 9470 | install_element (ENABLE_NODE, &clear_bgp_peer_cmd); |
| 9471 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_cmd); |
| 9472 | install_element (ENABLE_NODE, &clear_bgp_peer_group_cmd); |
| 9473 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_cmd); |
| 9474 | install_element (ENABLE_NODE, &clear_bgp_external_cmd); |
| 9475 | install_element (ENABLE_NODE, &clear_bgp_ipv6_external_cmd); |
| 9476 | install_element (ENABLE_NODE, &clear_bgp_as_cmd); |
| 9477 | install_element (ENABLE_NODE, &clear_bgp_ipv6_as_cmd); |
| 9478 | #endif /* HAVE_IPV6 */ |
| 9479 | |
| 9480 | /* "clear ip bgp neighbor soft in" */ |
| 9481 | install_element (ENABLE_NODE, &clear_ip_bgp_all_soft_in_cmd); |
| 9482 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_soft_in_cmd); |
| 9483 | install_element (ENABLE_NODE, &clear_ip_bgp_all_in_cmd); |
| 9484 | install_element (ENABLE_NODE, &clear_ip_bgp_all_in_prefix_filter_cmd); |
| 9485 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_in_prefix_filter_cmd); |
| 9486 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_soft_in_cmd); |
| 9487 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_in_cmd); |
| 9488 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_in_prefix_filter_cmd); |
| 9489 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_soft_in_cmd); |
| 9490 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_in_cmd); |
| 9491 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_in_prefix_filter_cmd); |
| 9492 | install_element (ENABLE_NODE, &clear_ip_bgp_external_soft_in_cmd); |
| 9493 | install_element (ENABLE_NODE, &clear_ip_bgp_external_in_cmd); |
| 9494 | install_element (ENABLE_NODE, &clear_ip_bgp_external_in_prefix_filter_cmd); |
| 9495 | install_element (ENABLE_NODE, &clear_ip_bgp_as_soft_in_cmd); |
| 9496 | install_element (ENABLE_NODE, &clear_ip_bgp_as_in_cmd); |
| 9497 | install_element (ENABLE_NODE, &clear_ip_bgp_as_in_prefix_filter_cmd); |
| 9498 | install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_soft_in_cmd); |
| 9499 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_ipv4_soft_in_cmd); |
| 9500 | install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_in_cmd); |
| 9501 | install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_in_prefix_filter_cmd); |
| 9502 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd); |
| 9503 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_soft_in_cmd); |
| 9504 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_in_cmd); |
| 9505 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd); |
| 9506 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_soft_in_cmd); |
| 9507 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_in_cmd); |
| 9508 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd); |
| 9509 | install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_soft_in_cmd); |
| 9510 | install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_in_cmd); |
| 9511 | install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_in_prefix_filter_cmd); |
| 9512 | install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_soft_in_cmd); |
| 9513 | install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_in_cmd); |
| 9514 | install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_in_prefix_filter_cmd); |
| 9515 | install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_soft_in_cmd); |
| 9516 | install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_in_cmd); |
| 9517 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_soft_in_cmd); |
| 9518 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_in_cmd); |
| 9519 | install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_soft_in_cmd); |
| 9520 | install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_in_cmd); |
| 9521 | #ifdef HAVE_IPV6 |
| 9522 | install_element (ENABLE_NODE, &clear_bgp_all_soft_in_cmd); |
| 9523 | install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_in_cmd); |
| 9524 | install_element (ENABLE_NODE, &clear_bgp_all_in_cmd); |
| 9525 | install_element (ENABLE_NODE, &clear_bgp_all_in_prefix_filter_cmd); |
| 9526 | install_element (ENABLE_NODE, &clear_bgp_peer_soft_in_cmd); |
| 9527 | install_element (ENABLE_NODE, &clear_bgp_peer_in_cmd); |
| 9528 | install_element (ENABLE_NODE, &clear_bgp_peer_in_prefix_filter_cmd); |
| 9529 | install_element (ENABLE_NODE, &clear_bgp_peer_group_soft_in_cmd); |
| 9530 | install_element (ENABLE_NODE, &clear_bgp_peer_group_in_cmd); |
| 9531 | install_element (ENABLE_NODE, &clear_bgp_peer_group_in_prefix_filter_cmd); |
| 9532 | install_element (ENABLE_NODE, &clear_bgp_external_soft_in_cmd); |
| 9533 | install_element (ENABLE_NODE, &clear_bgp_external_in_cmd); |
| 9534 | install_element (ENABLE_NODE, &clear_bgp_external_in_prefix_filter_cmd); |
| 9535 | install_element (ENABLE_NODE, &clear_bgp_as_soft_in_cmd); |
| 9536 | install_element (ENABLE_NODE, &clear_bgp_as_in_cmd); |
| 9537 | install_element (ENABLE_NODE, &clear_bgp_as_in_prefix_filter_cmd); |
| 9538 | install_element (ENABLE_NODE, &clear_bgp_ipv6_all_soft_in_cmd); |
| 9539 | install_element (ENABLE_NODE, &clear_bgp_ipv6_all_in_cmd); |
| 9540 | install_element (ENABLE_NODE, &clear_bgp_ipv6_all_in_prefix_filter_cmd); |
| 9541 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_soft_in_cmd); |
| 9542 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_in_cmd); |
| 9543 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_in_prefix_filter_cmd); |
| 9544 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_soft_in_cmd); |
| 9545 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_in_cmd); |
| 9546 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_in_prefix_filter_cmd); |
| 9547 | install_element (ENABLE_NODE, &clear_bgp_ipv6_external_soft_in_cmd); |
| 9548 | install_element (ENABLE_NODE, &clear_bgp_ipv6_external_in_cmd); |
| 9549 | install_element (ENABLE_NODE, &clear_bgp_ipv6_external_in_prefix_filter_cmd); |
| 9550 | install_element (ENABLE_NODE, &clear_bgp_ipv6_as_soft_in_cmd); |
| 9551 | install_element (ENABLE_NODE, &clear_bgp_ipv6_as_in_cmd); |
| 9552 | install_element (ENABLE_NODE, &clear_bgp_ipv6_as_in_prefix_filter_cmd); |
| 9553 | #endif /* HAVE_IPV6 */ |
| 9554 | |
| 9555 | /* "clear ip bgp neighbor soft out" */ |
| 9556 | install_element (ENABLE_NODE, &clear_ip_bgp_all_soft_out_cmd); |
| 9557 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_soft_out_cmd); |
| 9558 | install_element (ENABLE_NODE, &clear_ip_bgp_all_out_cmd); |
| 9559 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_soft_out_cmd); |
| 9560 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_out_cmd); |
| 9561 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_soft_out_cmd); |
| 9562 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_out_cmd); |
| 9563 | install_element (ENABLE_NODE, &clear_ip_bgp_external_soft_out_cmd); |
| 9564 | install_element (ENABLE_NODE, &clear_ip_bgp_external_out_cmd); |
| 9565 | install_element (ENABLE_NODE, &clear_ip_bgp_as_soft_out_cmd); |
| 9566 | install_element (ENABLE_NODE, &clear_ip_bgp_as_out_cmd); |
| 9567 | install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_soft_out_cmd); |
| 9568 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_ipv4_soft_out_cmd); |
| 9569 | install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_out_cmd); |
| 9570 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_soft_out_cmd); |
| 9571 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_out_cmd); |
| 9572 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_soft_out_cmd); |
| 9573 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_out_cmd); |
| 9574 | install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_soft_out_cmd); |
| 9575 | install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_out_cmd); |
| 9576 | install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_soft_out_cmd); |
| 9577 | install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_out_cmd); |
| 9578 | install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_soft_out_cmd); |
| 9579 | install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_out_cmd); |
| 9580 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_soft_out_cmd); |
| 9581 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_out_cmd); |
| 9582 | install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_soft_out_cmd); |
| 9583 | install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_out_cmd); |
| 9584 | #ifdef HAVE_IPV6 |
| 9585 | install_element (ENABLE_NODE, &clear_bgp_all_soft_out_cmd); |
| 9586 | install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_out_cmd); |
| 9587 | install_element (ENABLE_NODE, &clear_bgp_all_out_cmd); |
| 9588 | install_element (ENABLE_NODE, &clear_bgp_peer_soft_out_cmd); |
| 9589 | install_element (ENABLE_NODE, &clear_bgp_peer_out_cmd); |
| 9590 | install_element (ENABLE_NODE, &clear_bgp_peer_group_soft_out_cmd); |
| 9591 | install_element (ENABLE_NODE, &clear_bgp_peer_group_out_cmd); |
| 9592 | install_element (ENABLE_NODE, &clear_bgp_external_soft_out_cmd); |
| 9593 | install_element (ENABLE_NODE, &clear_bgp_external_out_cmd); |
| 9594 | install_element (ENABLE_NODE, &clear_bgp_as_soft_out_cmd); |
| 9595 | install_element (ENABLE_NODE, &clear_bgp_as_out_cmd); |
| 9596 | install_element (ENABLE_NODE, &clear_bgp_ipv6_all_soft_out_cmd); |
| 9597 | install_element (ENABLE_NODE, &clear_bgp_ipv6_all_out_cmd); |
| 9598 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_soft_out_cmd); |
| 9599 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_out_cmd); |
| 9600 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_soft_out_cmd); |
| 9601 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_out_cmd); |
| 9602 | install_element (ENABLE_NODE, &clear_bgp_ipv6_external_soft_out_cmd); |
| 9603 | install_element (ENABLE_NODE, &clear_bgp_ipv6_external_out_cmd); |
| 9604 | install_element (ENABLE_NODE, &clear_bgp_ipv6_as_soft_out_cmd); |
| 9605 | install_element (ENABLE_NODE, &clear_bgp_ipv6_as_out_cmd); |
| 9606 | #endif /* HAVE_IPV6 */ |
| 9607 | |
| 9608 | /* "clear ip bgp neighbor soft" */ |
| 9609 | install_element (ENABLE_NODE, &clear_ip_bgp_all_soft_cmd); |
| 9610 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_soft_cmd); |
| 9611 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_soft_cmd); |
| 9612 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_soft_cmd); |
| 9613 | install_element (ENABLE_NODE, &clear_ip_bgp_external_soft_cmd); |
| 9614 | install_element (ENABLE_NODE, &clear_ip_bgp_as_soft_cmd); |
| 9615 | install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_soft_cmd); |
| 9616 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_ipv4_soft_cmd); |
| 9617 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_soft_cmd); |
| 9618 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_soft_cmd); |
| 9619 | install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_soft_cmd); |
| 9620 | install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_soft_cmd); |
| 9621 | install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_soft_cmd); |
| 9622 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_soft_cmd); |
| 9623 | install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_soft_cmd); |
| 9624 | #ifdef HAVE_IPV6 |
| 9625 | install_element (ENABLE_NODE, &clear_bgp_all_soft_cmd); |
| 9626 | install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_cmd); |
| 9627 | install_element (ENABLE_NODE, &clear_bgp_peer_soft_cmd); |
| 9628 | install_element (ENABLE_NODE, &clear_bgp_peer_group_soft_cmd); |
| 9629 | install_element (ENABLE_NODE, &clear_bgp_external_soft_cmd); |
| 9630 | install_element (ENABLE_NODE, &clear_bgp_as_soft_cmd); |
| 9631 | install_element (ENABLE_NODE, &clear_bgp_ipv6_all_soft_cmd); |
| 9632 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_soft_cmd); |
| 9633 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_soft_cmd); |
| 9634 | install_element (ENABLE_NODE, &clear_bgp_ipv6_external_soft_cmd); |
| 9635 | install_element (ENABLE_NODE, &clear_bgp_ipv6_as_soft_cmd); |
| 9636 | #endif /* HAVE_IPV6 */ |
| 9637 | |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9638 | /* "clear ip bgp neighbor rsclient" */ |
| 9639 | install_element (ENABLE_NODE, &clear_ip_bgp_all_rsclient_cmd); |
| 9640 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_rsclient_cmd); |
| 9641 | install_element (ENABLE_NODE, &clear_ip_bgp_peer_rsclient_cmd); |
| 9642 | install_element (ENABLE_NODE, &clear_ip_bgp_instance_peer_rsclient_cmd); |
| 9643 | #ifdef HAVE_IPV6 |
| 9644 | install_element (ENABLE_NODE, &clear_bgp_all_rsclient_cmd); |
| 9645 | install_element (ENABLE_NODE, &clear_bgp_instance_all_rsclient_cmd); |
| 9646 | install_element (ENABLE_NODE, &clear_bgp_ipv6_all_rsclient_cmd); |
| 9647 | install_element (ENABLE_NODE, &clear_bgp_ipv6_instance_all_rsclient_cmd); |
| 9648 | install_element (ENABLE_NODE, &clear_bgp_peer_rsclient_cmd); |
| 9649 | install_element (ENABLE_NODE, &clear_bgp_instance_peer_rsclient_cmd); |
| 9650 | install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_rsclient_cmd); |
| 9651 | install_element (ENABLE_NODE, &clear_bgp_ipv6_instance_peer_rsclient_cmd); |
| 9652 | #endif /* HAVE_IPV6 */ |
| 9653 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9654 | /* "show ip bgp summary" commands. */ |
| 9655 | install_element (VIEW_NODE, &show_ip_bgp_summary_cmd); |
| 9656 | install_element (VIEW_NODE, &show_ip_bgp_instance_summary_cmd); |
| 9657 | install_element (VIEW_NODE, &show_ip_bgp_ipv4_summary_cmd); |
| 9658 | install_element (VIEW_NODE, &show_ip_bgp_instance_ipv4_summary_cmd); |
| 9659 | install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_summary_cmd); |
| 9660 | install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd); |
| 9661 | #ifdef HAVE_IPV6 |
| 9662 | install_element (VIEW_NODE, &show_bgp_summary_cmd); |
| 9663 | install_element (VIEW_NODE, &show_bgp_instance_summary_cmd); |
| 9664 | install_element (VIEW_NODE, &show_bgp_ipv6_summary_cmd); |
| 9665 | install_element (VIEW_NODE, &show_bgp_instance_ipv6_summary_cmd); |
| 9666 | #endif /* HAVE_IPV6 */ |
| 9667 | install_element (ENABLE_NODE, &show_ip_bgp_summary_cmd); |
| 9668 | install_element (ENABLE_NODE, &show_ip_bgp_instance_summary_cmd); |
| 9669 | install_element (ENABLE_NODE, &show_ip_bgp_ipv4_summary_cmd); |
| 9670 | install_element (ENABLE_NODE, &show_ip_bgp_instance_ipv4_summary_cmd); |
| 9671 | install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_all_summary_cmd); |
| 9672 | install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd); |
| 9673 | #ifdef HAVE_IPV6 |
| 9674 | install_element (ENABLE_NODE, &show_bgp_summary_cmd); |
| 9675 | install_element (ENABLE_NODE, &show_bgp_instance_summary_cmd); |
| 9676 | install_element (ENABLE_NODE, &show_bgp_ipv6_summary_cmd); |
| 9677 | install_element (ENABLE_NODE, &show_bgp_instance_ipv6_summary_cmd); |
| 9678 | #endif /* HAVE_IPV6 */ |
| 9679 | |
| 9680 | /* "show ip bgp neighbors" commands. */ |
| 9681 | install_element (VIEW_NODE, &show_ip_bgp_neighbors_cmd); |
| 9682 | install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbors_cmd); |
| 9683 | install_element (VIEW_NODE, &show_ip_bgp_neighbors_peer_cmd); |
| 9684 | install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbors_peer_cmd); |
| 9685 | install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_neighbors_cmd); |
| 9686 | install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_neighbors_cmd); |
| 9687 | install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd); |
| 9688 | install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd); |
| 9689 | install_element (VIEW_NODE, &show_ip_bgp_instance_neighbors_cmd); |
| 9690 | install_element (VIEW_NODE, &show_ip_bgp_instance_neighbors_peer_cmd); |
| 9691 | install_element (ENABLE_NODE, &show_ip_bgp_neighbors_cmd); |
| 9692 | install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbors_cmd); |
| 9693 | install_element (ENABLE_NODE, &show_ip_bgp_neighbors_peer_cmd); |
| 9694 | install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbors_peer_cmd); |
| 9695 | install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_all_neighbors_cmd); |
| 9696 | install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_neighbors_cmd); |
| 9697 | install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd); |
| 9698 | install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd); |
| 9699 | install_element (ENABLE_NODE, &show_ip_bgp_instance_neighbors_cmd); |
| 9700 | install_element (ENABLE_NODE, &show_ip_bgp_instance_neighbors_peer_cmd); |
| 9701 | |
| 9702 | #ifdef HAVE_IPV6 |
| 9703 | install_element (VIEW_NODE, &show_bgp_neighbors_cmd); |
| 9704 | install_element (VIEW_NODE, &show_bgp_ipv6_neighbors_cmd); |
| 9705 | install_element (VIEW_NODE, &show_bgp_neighbors_peer_cmd); |
| 9706 | install_element (VIEW_NODE, &show_bgp_ipv6_neighbors_peer_cmd); |
paul | bb46e94 | 2003-10-24 19:02:03 +0000 | [diff] [blame] | 9707 | install_element (VIEW_NODE, &show_bgp_instance_neighbors_cmd); |
| 9708 | install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbors_cmd); |
| 9709 | install_element (VIEW_NODE, &show_bgp_instance_neighbors_peer_cmd); |
| 9710 | install_element (VIEW_NODE, &show_bgp_instance_ipv6_neighbors_peer_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9711 | install_element (ENABLE_NODE, &show_bgp_neighbors_cmd); |
| 9712 | install_element (ENABLE_NODE, &show_bgp_ipv6_neighbors_cmd); |
| 9713 | install_element (ENABLE_NODE, &show_bgp_neighbors_peer_cmd); |
| 9714 | install_element (ENABLE_NODE, &show_bgp_ipv6_neighbors_peer_cmd); |
paul | bb46e94 | 2003-10-24 19:02:03 +0000 | [diff] [blame] | 9715 | install_element (ENABLE_NODE, &show_bgp_instance_neighbors_cmd); |
| 9716 | install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbors_cmd); |
| 9717 | install_element (ENABLE_NODE, &show_bgp_instance_neighbors_peer_cmd); |
| 9718 | install_element (ENABLE_NODE, &show_bgp_instance_ipv6_neighbors_peer_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9719 | |
| 9720 | /* Old commands. */ |
| 9721 | install_element (VIEW_NODE, &show_ipv6_bgp_summary_cmd); |
| 9722 | install_element (VIEW_NODE, &show_ipv6_mbgp_summary_cmd); |
| 9723 | install_element (ENABLE_NODE, &show_ipv6_bgp_summary_cmd); |
| 9724 | install_element (ENABLE_NODE, &show_ipv6_mbgp_summary_cmd); |
| 9725 | #endif /* HAVE_IPV6 */ |
| 9726 | |
paul | fee0f4c | 2004-09-13 05:12:46 +0000 | [diff] [blame] | 9727 | /* "show ip bgp rsclient" commands. */ |
| 9728 | install_element (VIEW_NODE, &show_ip_bgp_rsclient_summary_cmd); |
| 9729 | install_element (VIEW_NODE, &show_ip_bgp_instance_rsclient_summary_cmd); |
| 9730 | install_element (VIEW_NODE, &show_ip_bgp_ipv4_rsclient_summary_cmd); |
| 9731 | install_element (VIEW_NODE, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd); |
| 9732 | install_element (ENABLE_NODE, &show_ip_bgp_rsclient_summary_cmd); |
| 9733 | install_element (ENABLE_NODE, &show_ip_bgp_instance_rsclient_summary_cmd); |
| 9734 | install_element (ENABLE_NODE, &show_ip_bgp_ipv4_rsclient_summary_cmd); |
| 9735 | install_element (ENABLE_NODE, &show_ip_bgp_instance_ipv4_rsclient_summary_cmd); |
| 9736 | |
| 9737 | #ifdef HAVE_IPV6 |
| 9738 | install_element (VIEW_NODE, &show_bgp_rsclient_summary_cmd); |
| 9739 | install_element (VIEW_NODE, &show_bgp_ipv6_rsclient_summary_cmd); |
| 9740 | install_element (VIEW_NODE, &show_bgp_instance_rsclient_summary_cmd); |
| 9741 | install_element (VIEW_NODE, &show_bgp_instance_ipv6_rsclient_summary_cmd); |
| 9742 | install_element (ENABLE_NODE, &show_bgp_rsclient_summary_cmd); |
| 9743 | install_element (ENABLE_NODE, &show_bgp_ipv6_rsclient_summary_cmd); |
| 9744 | install_element (ENABLE_NODE, &show_bgp_instance_rsclient_summary_cmd); |
| 9745 | install_element (ENABLE_NODE, &show_bgp_instance_ipv6_rsclient_summary_cmd); |
| 9746 | #endif /* HAVE_IPV6 */ |
| 9747 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9748 | /* "show ip bgp paths" commands. */ |
| 9749 | install_element (VIEW_NODE, &show_ip_bgp_paths_cmd); |
| 9750 | install_element (VIEW_NODE, &show_ip_bgp_ipv4_paths_cmd); |
| 9751 | install_element (ENABLE_NODE, &show_ip_bgp_paths_cmd); |
| 9752 | install_element (ENABLE_NODE, &show_ip_bgp_ipv4_paths_cmd); |
| 9753 | |
| 9754 | /* "show ip bgp community" commands. */ |
| 9755 | install_element (VIEW_NODE, &show_ip_bgp_community_info_cmd); |
| 9756 | install_element (ENABLE_NODE, &show_ip_bgp_community_info_cmd); |
| 9757 | |
| 9758 | /* "show ip bgp attribute-info" commands. */ |
| 9759 | install_element (VIEW_NODE, &show_ip_bgp_attr_info_cmd); |
| 9760 | install_element (ENABLE_NODE, &show_ip_bgp_attr_info_cmd); |
| 9761 | |
| 9762 | /* "redistribute" commands. */ |
| 9763 | install_element (BGP_NODE, &bgp_redistribute_ipv4_cmd); |
| 9764 | install_element (BGP_NODE, &no_bgp_redistribute_ipv4_cmd); |
| 9765 | install_element (BGP_NODE, &bgp_redistribute_ipv4_rmap_cmd); |
| 9766 | install_element (BGP_NODE, &no_bgp_redistribute_ipv4_rmap_cmd); |
| 9767 | install_element (BGP_NODE, &bgp_redistribute_ipv4_metric_cmd); |
| 9768 | install_element (BGP_NODE, &no_bgp_redistribute_ipv4_metric_cmd); |
| 9769 | install_element (BGP_NODE, &bgp_redistribute_ipv4_rmap_metric_cmd); |
| 9770 | install_element (BGP_NODE, &bgp_redistribute_ipv4_metric_rmap_cmd); |
| 9771 | install_element (BGP_NODE, &no_bgp_redistribute_ipv4_rmap_metric_cmd); |
| 9772 | install_element (BGP_NODE, &no_bgp_redistribute_ipv4_metric_rmap_cmd); |
| 9773 | #ifdef HAVE_IPV6 |
| 9774 | install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_cmd); |
| 9775 | install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_cmd); |
| 9776 | install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_rmap_cmd); |
| 9777 | install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_rmap_cmd); |
| 9778 | install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_metric_cmd); |
| 9779 | install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_metric_cmd); |
| 9780 | install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_rmap_metric_cmd); |
| 9781 | install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_metric_rmap_cmd); |
| 9782 | install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_rmap_metric_cmd); |
| 9783 | install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_metric_rmap_cmd); |
| 9784 | #endif /* HAVE_IPV6 */ |
| 9785 | |
Paul Jakma | 4bf6a36 | 2006-03-30 14:05:23 +0000 | [diff] [blame] | 9786 | /* "show bgp memory" commands. */ |
| 9787 | install_element (VIEW_NODE, &show_bgp_memory_cmd); |
| 9788 | install_element (ENABLE_NODE, &show_bgp_memory_cmd); |
| 9789 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9790 | /* Community-list. */ |
| 9791 | community_list_vty (); |
| 9792 | } |
| 9793 | |
| 9794 | #include "memory.h" |
| 9795 | #include "bgp_regex.h" |
| 9796 | #include "bgp_clist.h" |
| 9797 | #include "bgp_ecommunity.h" |
| 9798 | |
| 9799 | /* VTY functions. */ |
| 9800 | |
| 9801 | /* Direction value to string conversion. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 9802 | static const char * |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9803 | community_direct_str (int direct) |
| 9804 | { |
| 9805 | switch (direct) |
| 9806 | { |
| 9807 | case COMMUNITY_DENY: |
| 9808 | return "deny"; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9809 | case COMMUNITY_PERMIT: |
| 9810 | return "permit"; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9811 | default: |
| 9812 | return "unknown"; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9813 | } |
| 9814 | } |
| 9815 | |
| 9816 | /* Display error string. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 9817 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9818 | community_list_perror (struct vty *vty, int ret) |
| 9819 | { |
| 9820 | switch (ret) |
| 9821 | { |
| 9822 | case COMMUNITY_LIST_ERR_CANT_FIND_LIST: |
| 9823 | vty_out (vty, "%% Can't find communit-list%s", VTY_NEWLINE); |
| 9824 | break; |
| 9825 | case COMMUNITY_LIST_ERR_MALFORMED_VAL: |
| 9826 | vty_out (vty, "%% Malformed community-list value%s", VTY_NEWLINE); |
| 9827 | break; |
| 9828 | case COMMUNITY_LIST_ERR_STANDARD_CONFLICT: |
| 9829 | vty_out (vty, "%% Community name conflict, previously defined as standard community%s", VTY_NEWLINE); |
| 9830 | break; |
| 9831 | case COMMUNITY_LIST_ERR_EXPANDED_CONFLICT: |
| 9832 | vty_out (vty, "%% Community name conflict, previously defined as expanded community%s", VTY_NEWLINE); |
| 9833 | break; |
| 9834 | } |
| 9835 | } |
| 9836 | |
| 9837 | /* VTY interface for community_set() function. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 9838 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 9839 | community_list_set_vty (struct vty *vty, int argc, const char **argv, |
| 9840 | int style, int reject_all_digit_name) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9841 | { |
| 9842 | int ret; |
| 9843 | int direct; |
| 9844 | char *str; |
| 9845 | |
| 9846 | /* Check the list type. */ |
| 9847 | if (strncmp (argv[1], "p", 1) == 0) |
| 9848 | direct = COMMUNITY_PERMIT; |
| 9849 | else if (strncmp (argv[1], "d", 1) == 0) |
| 9850 | direct = COMMUNITY_DENY; |
| 9851 | else |
| 9852 | { |
| 9853 | vty_out (vty, "%% Matching condition must be permit or deny%s", |
| 9854 | VTY_NEWLINE); |
| 9855 | return CMD_WARNING; |
| 9856 | } |
| 9857 | |
| 9858 | /* All digit name check. */ |
| 9859 | if (reject_all_digit_name && all_digit (argv[0])) |
| 9860 | { |
| 9861 | vty_out (vty, "%% Community name cannot have all digits%s", VTY_NEWLINE); |
| 9862 | return CMD_WARNING; |
| 9863 | } |
| 9864 | |
| 9865 | /* Concat community string argument. */ |
| 9866 | if (argc > 1) |
| 9867 | str = argv_concat (argv, argc, 2); |
| 9868 | else |
| 9869 | str = NULL; |
| 9870 | |
| 9871 | /* When community_list_set() return nevetive value, it means |
| 9872 | malformed community string. */ |
| 9873 | ret = community_list_set (bgp_clist, argv[0], str, direct, style); |
| 9874 | |
| 9875 | /* Free temporary community list string allocated by |
| 9876 | argv_concat(). */ |
| 9877 | if (str) |
| 9878 | XFREE (MTYPE_TMP, str); |
| 9879 | |
| 9880 | if (ret < 0) |
| 9881 | { |
| 9882 | /* Display error string. */ |
| 9883 | community_list_perror (vty, ret); |
| 9884 | return CMD_WARNING; |
| 9885 | } |
| 9886 | |
| 9887 | return CMD_SUCCESS; |
| 9888 | } |
| 9889 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9890 | /* Communiyt-list entry delete. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 9891 | static int |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 9892 | community_list_unset_vty (struct vty *vty, int argc, const char **argv, |
| 9893 | int style) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9894 | { |
| 9895 | int ret; |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 9896 | int direct = 0; |
| 9897 | char *str = NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9898 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 9899 | if (argc > 1) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9900 | { |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 9901 | /* Check the list direct. */ |
| 9902 | if (strncmp (argv[1], "p", 1) == 0) |
| 9903 | direct = COMMUNITY_PERMIT; |
| 9904 | else if (strncmp (argv[1], "d", 1) == 0) |
| 9905 | direct = COMMUNITY_DENY; |
| 9906 | else |
| 9907 | { |
| 9908 | vty_out (vty, "%% Matching condition must be permit or deny%s", |
| 9909 | VTY_NEWLINE); |
| 9910 | return CMD_WARNING; |
| 9911 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9912 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 9913 | /* Concat community string argument. */ |
| 9914 | str = argv_concat (argv, argc, 2); |
| 9915 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9916 | |
| 9917 | /* Unset community list. */ |
| 9918 | ret = community_list_unset (bgp_clist, argv[0], str, direct, style); |
| 9919 | |
| 9920 | /* Free temporary community list string allocated by |
| 9921 | argv_concat(). */ |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 9922 | if (str) |
| 9923 | XFREE (MTYPE_TMP, str); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9924 | |
| 9925 | if (ret < 0) |
| 9926 | { |
| 9927 | community_list_perror (vty, ret); |
| 9928 | return CMD_WARNING; |
| 9929 | } |
| 9930 | |
| 9931 | return CMD_SUCCESS; |
| 9932 | } |
| 9933 | |
| 9934 | /* "community-list" keyword help string. */ |
| 9935 | #define COMMUNITY_LIST_STR "Add a community list entry\n" |
| 9936 | #define COMMUNITY_VAL_STR "Community number in aa:nn format or internet|local-AS|no-advertise|no-export\n" |
| 9937 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9938 | DEFUN (ip_community_list_standard, |
| 9939 | ip_community_list_standard_cmd, |
| 9940 | "ip community-list <1-99> (deny|permit) .AA:NN", |
| 9941 | IP_STR |
| 9942 | COMMUNITY_LIST_STR |
| 9943 | "Community list number (standard)\n" |
| 9944 | "Specify community to reject\n" |
| 9945 | "Specify community to accept\n" |
| 9946 | COMMUNITY_VAL_STR) |
| 9947 | { |
| 9948 | return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD, 0); |
| 9949 | } |
| 9950 | |
| 9951 | ALIAS (ip_community_list_standard, |
| 9952 | ip_community_list_standard2_cmd, |
| 9953 | "ip community-list <1-99> (deny|permit)", |
| 9954 | IP_STR |
| 9955 | COMMUNITY_LIST_STR |
| 9956 | "Community list number (standard)\n" |
| 9957 | "Specify community to reject\n" |
| 9958 | "Specify community to accept\n") |
| 9959 | |
| 9960 | DEFUN (ip_community_list_expanded, |
| 9961 | ip_community_list_expanded_cmd, |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 9962 | "ip community-list <100-500> (deny|permit) .LINE", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 9963 | IP_STR |
| 9964 | COMMUNITY_LIST_STR |
| 9965 | "Community list number (expanded)\n" |
| 9966 | "Specify community to reject\n" |
| 9967 | "Specify community to accept\n" |
| 9968 | "An ordered list as a regular-expression\n") |
| 9969 | { |
| 9970 | return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED, 0); |
| 9971 | } |
| 9972 | |
| 9973 | DEFUN (ip_community_list_name_standard, |
| 9974 | ip_community_list_name_standard_cmd, |
| 9975 | "ip community-list standard WORD (deny|permit) .AA:NN", |
| 9976 | IP_STR |
| 9977 | COMMUNITY_LIST_STR |
| 9978 | "Add a standard community-list entry\n" |
| 9979 | "Community list name\n" |
| 9980 | "Specify community to reject\n" |
| 9981 | "Specify community to accept\n" |
| 9982 | COMMUNITY_VAL_STR) |
| 9983 | { |
| 9984 | return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD, 1); |
| 9985 | } |
| 9986 | |
| 9987 | ALIAS (ip_community_list_name_standard, |
| 9988 | ip_community_list_name_standard2_cmd, |
| 9989 | "ip community-list standard WORD (deny|permit)", |
| 9990 | IP_STR |
| 9991 | COMMUNITY_LIST_STR |
| 9992 | "Add a standard community-list entry\n" |
| 9993 | "Community list name\n" |
| 9994 | "Specify community to reject\n" |
| 9995 | "Specify community to accept\n") |
| 9996 | |
| 9997 | DEFUN (ip_community_list_name_expanded, |
| 9998 | ip_community_list_name_expanded_cmd, |
| 9999 | "ip community-list expanded WORD (deny|permit) .LINE", |
| 10000 | IP_STR |
| 10001 | COMMUNITY_LIST_STR |
| 10002 | "Add an expanded community-list entry\n" |
| 10003 | "Community list name\n" |
| 10004 | "Specify community to reject\n" |
| 10005 | "Specify community to accept\n" |
| 10006 | "An ordered list as a regular-expression\n") |
| 10007 | { |
| 10008 | return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED, 1); |
| 10009 | } |
| 10010 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10011 | DEFUN (no_ip_community_list_standard_all, |
| 10012 | no_ip_community_list_standard_all_cmd, |
| 10013 | "no ip community-list <1-99>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10014 | NO_STR |
| 10015 | IP_STR |
| 10016 | COMMUNITY_LIST_STR |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10017 | "Community list number (standard)\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10018 | { |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10019 | return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10020 | } |
| 10021 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10022 | DEFUN (no_ip_community_list_expanded_all, |
| 10023 | no_ip_community_list_expanded_all_cmd, |
| 10024 | "no ip community-list <100-500>", |
| 10025 | NO_STR |
| 10026 | IP_STR |
| 10027 | COMMUNITY_LIST_STR |
| 10028 | "Community list number (expanded)\n") |
| 10029 | { |
| 10030 | return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED); |
| 10031 | } |
| 10032 | |
| 10033 | DEFUN (no_ip_community_list_name_standard_all, |
| 10034 | no_ip_community_list_name_standard_all_cmd, |
| 10035 | "no ip community-list standard WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10036 | NO_STR |
| 10037 | IP_STR |
| 10038 | COMMUNITY_LIST_STR |
| 10039 | "Add a standard community-list entry\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10040 | "Community list name\n") |
| 10041 | { |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10042 | return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10043 | } |
| 10044 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10045 | DEFUN (no_ip_community_list_name_expanded_all, |
| 10046 | no_ip_community_list_name_expanded_all_cmd, |
| 10047 | "no ip community-list expanded WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10048 | NO_STR |
| 10049 | IP_STR |
| 10050 | COMMUNITY_LIST_STR |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10051 | "Add an expanded community-list entry\n" |
| 10052 | "Community list name\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10053 | { |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10054 | return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10055 | } |
| 10056 | |
| 10057 | DEFUN (no_ip_community_list_standard, |
| 10058 | no_ip_community_list_standard_cmd, |
| 10059 | "no ip community-list <1-99> (deny|permit) .AA:NN", |
| 10060 | NO_STR |
| 10061 | IP_STR |
| 10062 | COMMUNITY_LIST_STR |
| 10063 | "Community list number (standard)\n" |
| 10064 | "Specify community to reject\n" |
| 10065 | "Specify community to accept\n" |
| 10066 | COMMUNITY_VAL_STR) |
| 10067 | { |
| 10068 | return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD); |
| 10069 | } |
| 10070 | |
| 10071 | DEFUN (no_ip_community_list_expanded, |
| 10072 | no_ip_community_list_expanded_cmd, |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10073 | "no ip community-list <100-500> (deny|permit) .LINE", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10074 | NO_STR |
| 10075 | IP_STR |
| 10076 | COMMUNITY_LIST_STR |
| 10077 | "Community list number (expanded)\n" |
| 10078 | "Specify community to reject\n" |
| 10079 | "Specify community to accept\n" |
| 10080 | "An ordered list as a regular-expression\n") |
| 10081 | { |
| 10082 | return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED); |
| 10083 | } |
| 10084 | |
| 10085 | DEFUN (no_ip_community_list_name_standard, |
| 10086 | no_ip_community_list_name_standard_cmd, |
| 10087 | "no ip community-list standard WORD (deny|permit) .AA:NN", |
| 10088 | NO_STR |
| 10089 | IP_STR |
| 10090 | COMMUNITY_LIST_STR |
| 10091 | "Specify a standard community-list\n" |
| 10092 | "Community list name\n" |
| 10093 | "Specify community to reject\n" |
| 10094 | "Specify community to accept\n" |
| 10095 | COMMUNITY_VAL_STR) |
| 10096 | { |
| 10097 | return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD); |
| 10098 | } |
| 10099 | |
| 10100 | DEFUN (no_ip_community_list_name_expanded, |
| 10101 | no_ip_community_list_name_expanded_cmd, |
| 10102 | "no ip community-list expanded WORD (deny|permit) .LINE", |
| 10103 | NO_STR |
| 10104 | IP_STR |
| 10105 | COMMUNITY_LIST_STR |
| 10106 | "Specify an expanded community-list\n" |
| 10107 | "Community list name\n" |
| 10108 | "Specify community to reject\n" |
| 10109 | "Specify community to accept\n" |
| 10110 | "An ordered list as a regular-expression\n") |
| 10111 | { |
| 10112 | return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED); |
| 10113 | } |
| 10114 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 10115 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10116 | community_list_show (struct vty *vty, struct community_list *list) |
| 10117 | { |
| 10118 | struct community_entry *entry; |
| 10119 | |
| 10120 | for (entry = list->head; entry; entry = entry->next) |
| 10121 | { |
| 10122 | if (entry == list->head) |
| 10123 | { |
| 10124 | if (all_digit (list->name)) |
| 10125 | vty_out (vty, "Community %s list %s%s", |
| 10126 | entry->style == COMMUNITY_LIST_STANDARD ? |
| 10127 | "standard" : "(expanded) access", |
| 10128 | list->name, VTY_NEWLINE); |
| 10129 | else |
| 10130 | vty_out (vty, "Named Community %s list %s%s", |
| 10131 | entry->style == COMMUNITY_LIST_STANDARD ? |
| 10132 | "standard" : "expanded", |
| 10133 | list->name, VTY_NEWLINE); |
| 10134 | } |
| 10135 | if (entry->any) |
| 10136 | vty_out (vty, " %s%s", |
| 10137 | community_direct_str (entry->direct), VTY_NEWLINE); |
| 10138 | else |
| 10139 | vty_out (vty, " %s %s%s", |
| 10140 | community_direct_str (entry->direct), |
| 10141 | entry->style == COMMUNITY_LIST_STANDARD |
| 10142 | ? community_str (entry->u.com) : entry->config, |
| 10143 | VTY_NEWLINE); |
| 10144 | } |
| 10145 | } |
| 10146 | |
| 10147 | DEFUN (show_ip_community_list, |
| 10148 | show_ip_community_list_cmd, |
| 10149 | "show ip community-list", |
| 10150 | SHOW_STR |
| 10151 | IP_STR |
| 10152 | "List community-list\n") |
| 10153 | { |
| 10154 | struct community_list *list; |
| 10155 | struct community_list_master *cm; |
| 10156 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10157 | cm = community_list_master_lookup (bgp_clist, COMMUNITY_LIST_MASTER); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10158 | if (! cm) |
| 10159 | return CMD_SUCCESS; |
| 10160 | |
| 10161 | for (list = cm->num.head; list; list = list->next) |
| 10162 | community_list_show (vty, list); |
| 10163 | |
| 10164 | for (list = cm->str.head; list; list = list->next) |
| 10165 | community_list_show (vty, list); |
| 10166 | |
| 10167 | return CMD_SUCCESS; |
| 10168 | } |
| 10169 | |
| 10170 | DEFUN (show_ip_community_list_arg, |
| 10171 | show_ip_community_list_arg_cmd, |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10172 | "show ip community-list (<1-500>|WORD)", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10173 | SHOW_STR |
| 10174 | IP_STR |
| 10175 | "List community-list\n" |
| 10176 | "Community-list number\n" |
| 10177 | "Community-list name\n") |
| 10178 | { |
| 10179 | struct community_list *list; |
| 10180 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10181 | list = community_list_lookup (bgp_clist, argv[0], COMMUNITY_LIST_MASTER); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10182 | if (! list) |
| 10183 | { |
| 10184 | vty_out (vty, "%% Can't find communit-list%s", VTY_NEWLINE); |
| 10185 | return CMD_WARNING; |
| 10186 | } |
| 10187 | |
| 10188 | community_list_show (vty, list); |
| 10189 | |
| 10190 | return CMD_SUCCESS; |
| 10191 | } |
| 10192 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 10193 | static int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 10194 | extcommunity_list_set_vty (struct vty *vty, int argc, const char **argv, |
| 10195 | int style, int reject_all_digit_name) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10196 | { |
| 10197 | int ret; |
| 10198 | int direct; |
| 10199 | char *str; |
| 10200 | |
| 10201 | /* Check the list type. */ |
| 10202 | if (strncmp (argv[1], "p", 1) == 0) |
| 10203 | direct = COMMUNITY_PERMIT; |
| 10204 | else if (strncmp (argv[1], "d", 1) == 0) |
| 10205 | direct = COMMUNITY_DENY; |
| 10206 | else |
| 10207 | { |
| 10208 | vty_out (vty, "%% Matching condition must be permit or deny%s", |
| 10209 | VTY_NEWLINE); |
| 10210 | return CMD_WARNING; |
| 10211 | } |
| 10212 | |
| 10213 | /* All digit name check. */ |
| 10214 | if (reject_all_digit_name && all_digit (argv[0])) |
| 10215 | { |
| 10216 | vty_out (vty, "%% Community name cannot have all digits%s", VTY_NEWLINE); |
| 10217 | return CMD_WARNING; |
| 10218 | } |
| 10219 | |
| 10220 | /* Concat community string argument. */ |
| 10221 | if (argc > 1) |
| 10222 | str = argv_concat (argv, argc, 2); |
| 10223 | else |
| 10224 | str = NULL; |
| 10225 | |
| 10226 | ret = extcommunity_list_set (bgp_clist, argv[0], str, direct, style); |
| 10227 | |
| 10228 | /* Free temporary community list string allocated by |
| 10229 | argv_concat(). */ |
| 10230 | if (str) |
| 10231 | XFREE (MTYPE_TMP, str); |
| 10232 | |
| 10233 | if (ret < 0) |
| 10234 | { |
| 10235 | community_list_perror (vty, ret); |
| 10236 | return CMD_WARNING; |
| 10237 | } |
| 10238 | return CMD_SUCCESS; |
| 10239 | } |
| 10240 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 10241 | static int |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10242 | extcommunity_list_unset_vty (struct vty *vty, int argc, const char **argv, |
| 10243 | int style) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10244 | { |
| 10245 | int ret; |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10246 | int direct = 0; |
| 10247 | char *str = NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10248 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10249 | if (argc > 1) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10250 | { |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10251 | /* Check the list direct. */ |
| 10252 | if (strncmp (argv[1], "p", 1) == 0) |
| 10253 | direct = COMMUNITY_PERMIT; |
| 10254 | else if (strncmp (argv[1], "d", 1) == 0) |
| 10255 | direct = COMMUNITY_DENY; |
| 10256 | else |
| 10257 | { |
| 10258 | vty_out (vty, "%% Matching condition must be permit or deny%s", |
| 10259 | VTY_NEWLINE); |
| 10260 | return CMD_WARNING; |
| 10261 | } |
| 10262 | |
| 10263 | /* Concat community string argument. */ |
| 10264 | str = argv_concat (argv, argc, 2); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10265 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10266 | |
| 10267 | /* Unset community list. */ |
| 10268 | ret = extcommunity_list_unset (bgp_clist, argv[0], str, direct, style); |
| 10269 | |
| 10270 | /* Free temporary community list string allocated by |
| 10271 | argv_concat(). */ |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10272 | if (str) |
| 10273 | XFREE (MTYPE_TMP, str); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10274 | |
| 10275 | if (ret < 0) |
| 10276 | { |
| 10277 | community_list_perror (vty, ret); |
| 10278 | return CMD_WARNING; |
| 10279 | } |
| 10280 | |
| 10281 | return CMD_SUCCESS; |
| 10282 | } |
| 10283 | |
| 10284 | /* "extcommunity-list" keyword help string. */ |
| 10285 | #define EXTCOMMUNITY_LIST_STR "Add a extended community list entry\n" |
| 10286 | #define EXTCOMMUNITY_VAL_STR "Extended community attribute in 'rt aa:nn_or_IPaddr:nn' OR 'soo aa:nn_or_IPaddr:nn' format\n" |
| 10287 | |
| 10288 | DEFUN (ip_extcommunity_list_standard, |
| 10289 | ip_extcommunity_list_standard_cmd, |
| 10290 | "ip extcommunity-list <1-99> (deny|permit) .AA:NN", |
| 10291 | IP_STR |
| 10292 | EXTCOMMUNITY_LIST_STR |
| 10293 | "Extended Community list number (standard)\n" |
| 10294 | "Specify community to reject\n" |
| 10295 | "Specify community to accept\n" |
| 10296 | EXTCOMMUNITY_VAL_STR) |
| 10297 | { |
| 10298 | return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD, 0); |
| 10299 | } |
| 10300 | |
| 10301 | ALIAS (ip_extcommunity_list_standard, |
| 10302 | ip_extcommunity_list_standard2_cmd, |
| 10303 | "ip extcommunity-list <1-99> (deny|permit)", |
| 10304 | IP_STR |
| 10305 | EXTCOMMUNITY_LIST_STR |
| 10306 | "Extended Community list number (standard)\n" |
| 10307 | "Specify community to reject\n" |
| 10308 | "Specify community to accept\n") |
| 10309 | |
| 10310 | DEFUN (ip_extcommunity_list_expanded, |
| 10311 | ip_extcommunity_list_expanded_cmd, |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10312 | "ip extcommunity-list <100-500> (deny|permit) .LINE", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10313 | IP_STR |
| 10314 | EXTCOMMUNITY_LIST_STR |
| 10315 | "Extended Community list number (expanded)\n" |
| 10316 | "Specify community to reject\n" |
| 10317 | "Specify community to accept\n" |
| 10318 | "An ordered list as a regular-expression\n") |
| 10319 | { |
| 10320 | return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED, 0); |
| 10321 | } |
| 10322 | |
| 10323 | DEFUN (ip_extcommunity_list_name_standard, |
| 10324 | ip_extcommunity_list_name_standard_cmd, |
| 10325 | "ip extcommunity-list standard WORD (deny|permit) .AA:NN", |
| 10326 | IP_STR |
| 10327 | EXTCOMMUNITY_LIST_STR |
| 10328 | "Specify standard extcommunity-list\n" |
| 10329 | "Extended Community list name\n" |
| 10330 | "Specify community to reject\n" |
| 10331 | "Specify community to accept\n" |
| 10332 | EXTCOMMUNITY_VAL_STR) |
| 10333 | { |
| 10334 | return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD, 1); |
| 10335 | } |
| 10336 | |
| 10337 | ALIAS (ip_extcommunity_list_name_standard, |
| 10338 | ip_extcommunity_list_name_standard2_cmd, |
| 10339 | "ip extcommunity-list standard WORD (deny|permit)", |
| 10340 | IP_STR |
| 10341 | EXTCOMMUNITY_LIST_STR |
| 10342 | "Specify standard extcommunity-list\n" |
| 10343 | "Extended Community list name\n" |
| 10344 | "Specify community to reject\n" |
| 10345 | "Specify community to accept\n") |
| 10346 | |
| 10347 | DEFUN (ip_extcommunity_list_name_expanded, |
| 10348 | ip_extcommunity_list_name_expanded_cmd, |
| 10349 | "ip extcommunity-list expanded WORD (deny|permit) .LINE", |
| 10350 | IP_STR |
| 10351 | EXTCOMMUNITY_LIST_STR |
| 10352 | "Specify expanded extcommunity-list\n" |
| 10353 | "Extended Community list name\n" |
| 10354 | "Specify community to reject\n" |
| 10355 | "Specify community to accept\n" |
| 10356 | "An ordered list as a regular-expression\n") |
| 10357 | { |
| 10358 | return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED, 1); |
| 10359 | } |
| 10360 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10361 | DEFUN (no_ip_extcommunity_list_standard_all, |
| 10362 | no_ip_extcommunity_list_standard_all_cmd, |
| 10363 | "no ip extcommunity-list <1-99>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10364 | NO_STR |
| 10365 | IP_STR |
| 10366 | EXTCOMMUNITY_LIST_STR |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10367 | "Extended Community list number (standard)\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10368 | { |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10369 | return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10370 | } |
| 10371 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10372 | DEFUN (no_ip_extcommunity_list_expanded_all, |
| 10373 | no_ip_extcommunity_list_expanded_all_cmd, |
| 10374 | "no ip extcommunity-list <100-500>", |
| 10375 | NO_STR |
| 10376 | IP_STR |
| 10377 | EXTCOMMUNITY_LIST_STR |
| 10378 | "Extended Community list number (expanded)\n") |
| 10379 | { |
| 10380 | return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED); |
| 10381 | } |
| 10382 | |
| 10383 | DEFUN (no_ip_extcommunity_list_name_standard_all, |
| 10384 | no_ip_extcommunity_list_name_standard_all_cmd, |
| 10385 | "no ip extcommunity-list standard WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10386 | NO_STR |
| 10387 | IP_STR |
| 10388 | EXTCOMMUNITY_LIST_STR |
| 10389 | "Specify standard extcommunity-list\n" |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10390 | "Extended Community list name\n") |
| 10391 | { |
| 10392 | return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD); |
| 10393 | } |
| 10394 | |
| 10395 | DEFUN (no_ip_extcommunity_list_name_expanded_all, |
| 10396 | no_ip_extcommunity_list_name_expanded_all_cmd, |
| 10397 | "no ip extcommunity-list expanded WORD", |
| 10398 | NO_STR |
| 10399 | IP_STR |
| 10400 | EXTCOMMUNITY_LIST_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10401 | "Specify expanded extcommunity-list\n" |
| 10402 | "Extended Community list name\n") |
| 10403 | { |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10404 | return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10405 | } |
| 10406 | |
| 10407 | DEFUN (no_ip_extcommunity_list_standard, |
| 10408 | no_ip_extcommunity_list_standard_cmd, |
| 10409 | "no ip extcommunity-list <1-99> (deny|permit) .AA:NN", |
| 10410 | NO_STR |
| 10411 | IP_STR |
| 10412 | EXTCOMMUNITY_LIST_STR |
| 10413 | "Extended Community list number (standard)\n" |
| 10414 | "Specify community to reject\n" |
| 10415 | "Specify community to accept\n" |
| 10416 | EXTCOMMUNITY_VAL_STR) |
| 10417 | { |
| 10418 | return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD); |
| 10419 | } |
| 10420 | |
| 10421 | DEFUN (no_ip_extcommunity_list_expanded, |
| 10422 | no_ip_extcommunity_list_expanded_cmd, |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10423 | "no ip extcommunity-list <100-500> (deny|permit) .LINE", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10424 | NO_STR |
| 10425 | IP_STR |
| 10426 | EXTCOMMUNITY_LIST_STR |
| 10427 | "Extended Community list number (expanded)\n" |
| 10428 | "Specify community to reject\n" |
| 10429 | "Specify community to accept\n" |
| 10430 | "An ordered list as a regular-expression\n") |
| 10431 | { |
| 10432 | return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED); |
| 10433 | } |
| 10434 | |
| 10435 | DEFUN (no_ip_extcommunity_list_name_standard, |
| 10436 | no_ip_extcommunity_list_name_standard_cmd, |
| 10437 | "no ip extcommunity-list standard WORD (deny|permit) .AA:NN", |
| 10438 | NO_STR |
| 10439 | IP_STR |
| 10440 | EXTCOMMUNITY_LIST_STR |
| 10441 | "Specify standard extcommunity-list\n" |
| 10442 | "Extended Community list name\n" |
| 10443 | "Specify community to reject\n" |
| 10444 | "Specify community to accept\n" |
| 10445 | EXTCOMMUNITY_VAL_STR) |
| 10446 | { |
| 10447 | return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD); |
| 10448 | } |
| 10449 | |
| 10450 | DEFUN (no_ip_extcommunity_list_name_expanded, |
| 10451 | no_ip_extcommunity_list_name_expanded_cmd, |
| 10452 | "no ip extcommunity-list expanded WORD (deny|permit) .LINE", |
| 10453 | NO_STR |
| 10454 | IP_STR |
| 10455 | EXTCOMMUNITY_LIST_STR |
| 10456 | "Specify expanded extcommunity-list\n" |
| 10457 | "Community list name\n" |
| 10458 | "Specify community to reject\n" |
| 10459 | "Specify community to accept\n" |
| 10460 | "An ordered list as a regular-expression\n") |
| 10461 | { |
| 10462 | return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED); |
| 10463 | } |
| 10464 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 10465 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10466 | extcommunity_list_show (struct vty *vty, struct community_list *list) |
| 10467 | { |
| 10468 | struct community_entry *entry; |
| 10469 | |
| 10470 | for (entry = list->head; entry; entry = entry->next) |
| 10471 | { |
| 10472 | if (entry == list->head) |
| 10473 | { |
| 10474 | if (all_digit (list->name)) |
| 10475 | vty_out (vty, "Extended community %s list %s%s", |
| 10476 | entry->style == EXTCOMMUNITY_LIST_STANDARD ? |
| 10477 | "standard" : "(expanded) access", |
| 10478 | list->name, VTY_NEWLINE); |
| 10479 | else |
| 10480 | vty_out (vty, "Named extended community %s list %s%s", |
| 10481 | entry->style == EXTCOMMUNITY_LIST_STANDARD ? |
| 10482 | "standard" : "expanded", |
| 10483 | list->name, VTY_NEWLINE); |
| 10484 | } |
| 10485 | if (entry->any) |
| 10486 | vty_out (vty, " %s%s", |
| 10487 | community_direct_str (entry->direct), VTY_NEWLINE); |
| 10488 | else |
| 10489 | vty_out (vty, " %s %s%s", |
| 10490 | community_direct_str (entry->direct), |
| 10491 | entry->style == EXTCOMMUNITY_LIST_STANDARD ? |
| 10492 | entry->u.ecom->str : entry->config, |
| 10493 | VTY_NEWLINE); |
| 10494 | } |
| 10495 | } |
| 10496 | |
| 10497 | DEFUN (show_ip_extcommunity_list, |
| 10498 | show_ip_extcommunity_list_cmd, |
| 10499 | "show ip extcommunity-list", |
| 10500 | SHOW_STR |
| 10501 | IP_STR |
| 10502 | "List extended-community list\n") |
| 10503 | { |
| 10504 | struct community_list *list; |
| 10505 | struct community_list_master *cm; |
| 10506 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10507 | cm = community_list_master_lookup (bgp_clist, EXTCOMMUNITY_LIST_MASTER); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10508 | if (! cm) |
| 10509 | return CMD_SUCCESS; |
| 10510 | |
| 10511 | for (list = cm->num.head; list; list = list->next) |
| 10512 | extcommunity_list_show (vty, list); |
| 10513 | |
| 10514 | for (list = cm->str.head; list; list = list->next) |
| 10515 | extcommunity_list_show (vty, list); |
| 10516 | |
| 10517 | return CMD_SUCCESS; |
| 10518 | } |
| 10519 | |
| 10520 | DEFUN (show_ip_extcommunity_list_arg, |
| 10521 | show_ip_extcommunity_list_arg_cmd, |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10522 | "show ip extcommunity-list (<1-500>|WORD)", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10523 | SHOW_STR |
| 10524 | IP_STR |
| 10525 | "List extended-community list\n" |
| 10526 | "Extcommunity-list number\n" |
| 10527 | "Extcommunity-list name\n") |
| 10528 | { |
| 10529 | struct community_list *list; |
| 10530 | |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10531 | list = community_list_lookup (bgp_clist, argv[0], EXTCOMMUNITY_LIST_MASTER); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10532 | if (! list) |
| 10533 | { |
| 10534 | vty_out (vty, "%% Can't find extcommunit-list%s", VTY_NEWLINE); |
| 10535 | return CMD_WARNING; |
| 10536 | } |
| 10537 | |
| 10538 | extcommunity_list_show (vty, list); |
| 10539 | |
| 10540 | return CMD_SUCCESS; |
| 10541 | } |
| 10542 | |
| 10543 | /* Return configuration string of community-list entry. */ |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 10544 | static const char * |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10545 | community_list_config_str (struct community_entry *entry) |
| 10546 | { |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 10547 | const char *str; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10548 | |
| 10549 | if (entry->any) |
| 10550 | str = ""; |
| 10551 | else |
| 10552 | { |
| 10553 | if (entry->style == COMMUNITY_LIST_STANDARD) |
| 10554 | str = community_str (entry->u.com); |
| 10555 | else |
| 10556 | str = entry->config; |
| 10557 | } |
| 10558 | return str; |
| 10559 | } |
| 10560 | |
| 10561 | /* Display community-list and extcommunity-list configuration. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 10562 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10563 | community_list_config_write (struct vty *vty) |
| 10564 | { |
| 10565 | struct community_list *list; |
| 10566 | struct community_entry *entry; |
| 10567 | struct community_list_master *cm; |
| 10568 | int write = 0; |
| 10569 | |
| 10570 | /* Community-list. */ |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10571 | cm = community_list_master_lookup (bgp_clist, COMMUNITY_LIST_MASTER); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10572 | |
| 10573 | for (list = cm->num.head; list; list = list->next) |
| 10574 | for (entry = list->head; entry; entry = entry->next) |
| 10575 | { |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10576 | vty_out (vty, "ip community-list %s %s %s%s", |
| 10577 | list->name, community_direct_str (entry->direct), |
| 10578 | community_list_config_str (entry), |
| 10579 | VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10580 | write++; |
| 10581 | } |
| 10582 | for (list = cm->str.head; list; list = list->next) |
| 10583 | for (entry = list->head; entry; entry = entry->next) |
| 10584 | { |
| 10585 | vty_out (vty, "ip community-list %s %s %s %s%s", |
| 10586 | entry->style == COMMUNITY_LIST_STANDARD |
| 10587 | ? "standard" : "expanded", |
| 10588 | list->name, community_direct_str (entry->direct), |
| 10589 | community_list_config_str (entry), |
| 10590 | VTY_NEWLINE); |
| 10591 | write++; |
| 10592 | } |
| 10593 | |
| 10594 | /* Extcommunity-list. */ |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10595 | cm = community_list_master_lookup (bgp_clist, EXTCOMMUNITY_LIST_MASTER); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10596 | |
| 10597 | for (list = cm->num.head; list; list = list->next) |
| 10598 | for (entry = list->head; entry; entry = entry->next) |
| 10599 | { |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10600 | vty_out (vty, "ip extcommunity-list %s %s %s%s", |
| 10601 | list->name, community_direct_str (entry->direct), |
| 10602 | community_list_config_str (entry), VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10603 | write++; |
| 10604 | } |
| 10605 | for (list = cm->str.head; list; list = list->next) |
| 10606 | for (entry = list->head; entry; entry = entry->next) |
| 10607 | { |
| 10608 | vty_out (vty, "ip extcommunity-list %s %s %s %s%s", |
| 10609 | entry->style == EXTCOMMUNITY_LIST_STANDARD |
| 10610 | ? "standard" : "expanded", |
| 10611 | list->name, community_direct_str (entry->direct), |
| 10612 | community_list_config_str (entry), VTY_NEWLINE); |
| 10613 | write++; |
| 10614 | } |
| 10615 | return write; |
| 10616 | } |
| 10617 | |
| 10618 | struct cmd_node community_list_node = |
| 10619 | { |
| 10620 | COMMUNITY_LIST_NODE, |
| 10621 | "", |
| 10622 | 1 /* Export to vtysh. */ |
| 10623 | }; |
| 10624 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 10625 | static void |
| 10626 | community_list_vty (void) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10627 | { |
| 10628 | install_node (&community_list_node, community_list_config_write); |
| 10629 | |
| 10630 | /* Community-list. */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10631 | install_element (CONFIG_NODE, &ip_community_list_standard_cmd); |
| 10632 | install_element (CONFIG_NODE, &ip_community_list_standard2_cmd); |
| 10633 | install_element (CONFIG_NODE, &ip_community_list_expanded_cmd); |
| 10634 | install_element (CONFIG_NODE, &ip_community_list_name_standard_cmd); |
| 10635 | install_element (CONFIG_NODE, &ip_community_list_name_standard2_cmd); |
| 10636 | install_element (CONFIG_NODE, &ip_community_list_name_expanded_cmd); |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10637 | install_element (CONFIG_NODE, &no_ip_community_list_standard_all_cmd); |
| 10638 | install_element (CONFIG_NODE, &no_ip_community_list_expanded_all_cmd); |
| 10639 | install_element (CONFIG_NODE, &no_ip_community_list_name_standard_all_cmd); |
| 10640 | install_element (CONFIG_NODE, &no_ip_community_list_name_expanded_all_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10641 | install_element (CONFIG_NODE, &no_ip_community_list_standard_cmd); |
| 10642 | install_element (CONFIG_NODE, &no_ip_community_list_expanded_cmd); |
| 10643 | install_element (CONFIG_NODE, &no_ip_community_list_name_standard_cmd); |
| 10644 | install_element (CONFIG_NODE, &no_ip_community_list_name_expanded_cmd); |
| 10645 | install_element (VIEW_NODE, &show_ip_community_list_cmd); |
| 10646 | install_element (VIEW_NODE, &show_ip_community_list_arg_cmd); |
| 10647 | install_element (ENABLE_NODE, &show_ip_community_list_cmd); |
| 10648 | install_element (ENABLE_NODE, &show_ip_community_list_arg_cmd); |
| 10649 | |
| 10650 | /* Extcommunity-list. */ |
| 10651 | install_element (CONFIG_NODE, &ip_extcommunity_list_standard_cmd); |
| 10652 | install_element (CONFIG_NODE, &ip_extcommunity_list_standard2_cmd); |
| 10653 | install_element (CONFIG_NODE, &ip_extcommunity_list_expanded_cmd); |
| 10654 | install_element (CONFIG_NODE, &ip_extcommunity_list_name_standard_cmd); |
| 10655 | install_element (CONFIG_NODE, &ip_extcommunity_list_name_standard2_cmd); |
| 10656 | install_element (CONFIG_NODE, &ip_extcommunity_list_name_expanded_cmd); |
hasso | fee6e4e | 2005-02-02 16:29:31 +0000 | [diff] [blame] | 10657 | install_element (CONFIG_NODE, &no_ip_extcommunity_list_standard_all_cmd); |
| 10658 | install_element (CONFIG_NODE, &no_ip_extcommunity_list_expanded_all_cmd); |
| 10659 | install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_standard_all_cmd); |
| 10660 | install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_expanded_all_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 10661 | install_element (CONFIG_NODE, &no_ip_extcommunity_list_standard_cmd); |
| 10662 | install_element (CONFIG_NODE, &no_ip_extcommunity_list_expanded_cmd); |
| 10663 | install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_standard_cmd); |
| 10664 | install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_expanded_cmd); |
| 10665 | install_element (VIEW_NODE, &show_ip_extcommunity_list_cmd); |
| 10666 | install_element (VIEW_NODE, &show_ip_extcommunity_list_arg_cmd); |
| 10667 | install_element (ENABLE_NODE, &show_ip_extcommunity_list_cmd); |
| 10668 | install_element (ENABLE_NODE, &show_ip_extcommunity_list_arg_cmd); |
| 10669 | } |