paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | /* MPLS-VPN |
| 2 | Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org> |
| 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 "log.h" |
| 26 | #include "memory.h" |
| 27 | #include "stream.h" |
Donald Sharp | 0490729 | 2016-01-07 10:03:01 -0500 | [diff] [blame] | 28 | #include "filter.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 29 | |
| 30 | #include "bgpd/bgpd.h" |
| 31 | #include "bgpd/bgp_table.h" |
| 32 | #include "bgpd/bgp_route.h" |
| 33 | #include "bgpd/bgp_attr.h" |
| 34 | #include "bgpd/bgp_mplsvpn.h" |
Paul Jakma | 18ab08b | 2016-01-27 16:37:33 +0000 | [diff] [blame^] | 35 | #include "bgpd/bgp_packet.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 36 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 37 | static u_int16_t |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 38 | decode_rd_type (u_char *pnt) |
| 39 | { |
| 40 | u_int16_t v; |
| 41 | |
| 42 | v = ((u_int16_t) *pnt++ << 8); |
| 43 | v |= (u_int16_t) *pnt; |
| 44 | return v; |
| 45 | } |
| 46 | |
| 47 | u_int32_t |
| 48 | decode_label (u_char *pnt) |
| 49 | { |
| 50 | u_int32_t l; |
| 51 | |
| 52 | l = ((u_int32_t) *pnt++ << 12); |
| 53 | l |= (u_int32_t) *pnt++ << 4; |
| 54 | l |= (u_int32_t) ((*pnt & 0xf0) >> 4); |
| 55 | return l; |
| 56 | } |
| 57 | |
Lou Berger | a03bd16 | 2016-01-12 13:41:54 -0500 | [diff] [blame] | 58 | /* type == RD_TYPE_AS */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 59 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 60 | decode_rd_as (u_char *pnt, struct rd_as *rd_as) |
| 61 | { |
| 62 | rd_as->as = (u_int16_t) *pnt++ << 8; |
| 63 | rd_as->as |= (u_int16_t) *pnt++; |
| 64 | |
| 65 | rd_as->val = ((u_int32_t) *pnt++ << 24); |
| 66 | rd_as->val |= ((u_int32_t) *pnt++ << 16); |
| 67 | rd_as->val |= ((u_int32_t) *pnt++ << 8); |
| 68 | rd_as->val |= (u_int32_t) *pnt; |
| 69 | } |
| 70 | |
Lou Berger | a03bd16 | 2016-01-12 13:41:54 -0500 | [diff] [blame] | 71 | /* type == RD_TYPE_AS4 */ |
| 72 | static void |
| 73 | decode_rd_as4 (u_char *pnt, struct rd_as *rd_as) |
| 74 | { |
| 75 | rd_as->as = (u_int32_t) *pnt++ << 24; |
| 76 | rd_as->as |= (u_int32_t) *pnt++ << 16; |
| 77 | rd_as->as |= (u_int32_t) *pnt++ << 8; |
| 78 | rd_as->as |= (u_int32_t) *pnt++; |
| 79 | |
| 80 | rd_as->val = ((u_int16_t) *pnt++ << 8); |
| 81 | rd_as->val |= (u_int16_t) *pnt; |
| 82 | } |
| 83 | |
| 84 | /* type == RD_TYPE_IP */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 85 | static void |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 86 | decode_rd_ip (u_char *pnt, struct rd_ip *rd_ip) |
| 87 | { |
| 88 | memcpy (&rd_ip->ip, pnt, 4); |
| 89 | pnt += 4; |
| 90 | |
| 91 | rd_ip->val = ((u_int16_t) *pnt++ << 8); |
| 92 | rd_ip->val |= (u_int16_t) *pnt; |
| 93 | } |
| 94 | |
Paul Jakma | 18ab08b | 2016-01-27 16:37:33 +0000 | [diff] [blame^] | 95 | static int |
| 96 | bgp_nlri_parse_vpn_body (struct peer *peer, struct attr *attr, |
| 97 | struct bgp_nlri *packet, bool update) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 98 | { |
| 99 | u_char *pnt; |
| 100 | u_char *lim; |
| 101 | struct prefix p; |
Lou Berger | 9da04bc | 2016-01-12 13:41:55 -0500 | [diff] [blame] | 102 | int psize = 0; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 103 | int prefixlen; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 104 | u_int16_t type; |
| 105 | struct rd_as rd_as; |
| 106 | struct rd_ip rd_ip; |
| 107 | struct prefix_rd prd; |
| 108 | u_char *tagpnt; |
| 109 | |
| 110 | /* Check peer status. */ |
| 111 | if (peer->status != Established) |
| 112 | return 0; |
| 113 | |
| 114 | /* Make prefix_rd */ |
| 115 | prd.family = AF_UNSPEC; |
| 116 | prd.prefixlen = 64; |
| 117 | |
| 118 | pnt = packet->nlri; |
| 119 | lim = pnt + packet->length; |
| 120 | |
Donald Sharp | a3bc7e9 | 2016-01-27 16:54:45 +0000 | [diff] [blame] | 121 | #define VPN_PREFIXLEN_MIN_BYTES (3 + 8) /* label + RD */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 122 | for (; pnt < lim; pnt += psize) |
| 123 | { |
| 124 | /* Clear prefix structure. */ |
| 125 | memset (&p, 0, sizeof (struct prefix)); |
| 126 | |
| 127 | /* Fetch prefix length. */ |
| 128 | prefixlen = *pnt++; |
Donald Sharp | a3bc7e9 | 2016-01-27 16:54:45 +0000 | [diff] [blame] | 129 | p.family = afi2family (packet->afi); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 130 | psize = PSIZE (prefixlen); |
Donald Sharp | a3bc7e9 | 2016-01-27 16:54:45 +0000 | [diff] [blame] | 131 | |
| 132 | /* sanity check against packet data */ |
Paul Jakma | 18ab08b | 2016-01-27 16:37:33 +0000 | [diff] [blame^] | 133 | if (prefixlen < VPN_PREFIXLEN_MIN_BYTES*8) |
Donald Sharp | a3bc7e9 | 2016-01-27 16:54:45 +0000 | [diff] [blame] | 134 | { |
Paul Jakma | 18ab08b | 2016-01-27 16:37:33 +0000 | [diff] [blame^] | 135 | plog_err (peer->log, |
| 136 | "%s [Error] Update packet error / VPNv4" |
| 137 | " (prefix length %d less than VPNv4 min length)", |
| 138 | peer->host, prefixlen); |
| 139 | bgp_notify_send (peer, BGP_NOTIFY_UPDATE_ERR, |
| 140 | BGP_NOTIFY_UPDATE_OPT_ATTR_ERR); |
| 141 | return -1; |
| 142 | } |
| 143 | if ((pnt + psize) > lim) |
| 144 | { |
| 145 | plog_err (peer->log, |
| 146 | "%s [Error] Update packet error / VPNv4" |
| 147 | " (psize %u exceeds packet size (%u)", |
| 148 | peer->host, |
Donald Sharp | a3bc7e9 | 2016-01-27 16:54:45 +0000 | [diff] [blame] | 149 | prefixlen, (uint)(lim-pnt)); |
Paul Jakma | 18ab08b | 2016-01-27 16:37:33 +0000 | [diff] [blame^] | 150 | bgp_notify_send (peer, BGP_NOTIFY_UPDATE_ERR, |
| 151 | BGP_NOTIFY_UPDATE_OPT_ATTR_ERR); |
Donald Sharp | a3bc7e9 | 2016-01-27 16:54:45 +0000 | [diff] [blame] | 152 | return -1; |
| 153 | } |
| 154 | |
| 155 | /* sanity check against storage for the IP address portion */ |
| 156 | if ((psize - VPN_PREFIXLEN_MIN_BYTES) > (ssize_t) sizeof(p.u)) |
| 157 | { |
Paul Jakma | 18ab08b | 2016-01-27 16:37:33 +0000 | [diff] [blame^] | 158 | plog_err (peer->log, |
| 159 | "%s [Error] Update packet error / VPNv4" |
| 160 | " (psize %u exceeds storage size (%zu)", |
| 161 | peer->host, |
Donald Sharp | a3bc7e9 | 2016-01-27 16:54:45 +0000 | [diff] [blame] | 162 | prefixlen - VPN_PREFIXLEN_MIN_BYTES*8, sizeof(p.u)); |
Paul Jakma | 18ab08b | 2016-01-27 16:37:33 +0000 | [diff] [blame^] | 163 | bgp_notify_send (peer, BGP_NOTIFY_UPDATE_ERR, |
| 164 | BGP_NOTIFY_UPDATE_OPT_ATTR_ERR); |
Donald Sharp | a3bc7e9 | 2016-01-27 16:54:45 +0000 | [diff] [blame] | 165 | return -1; |
| 166 | } |
| 167 | |
| 168 | /* Sanity check against max bitlen of the address family */ |
| 169 | if ((psize - VPN_PREFIXLEN_MIN_BYTES) > prefix_blen (&p)) |
| 170 | { |
Paul Jakma | 18ab08b | 2016-01-27 16:37:33 +0000 | [diff] [blame^] | 171 | plog_err (peer->log, |
| 172 | "%s [Error] Update packet error / VPNv4" |
| 173 | " (psize %u exceeds family (%u) max byte len %u)", |
| 174 | peer->host, |
Donald Sharp | a3bc7e9 | 2016-01-27 16:54:45 +0000 | [diff] [blame] | 175 | prefixlen - VPN_PREFIXLEN_MIN_BYTES*8, |
| 176 | p.family, prefix_blen (&p)); |
Paul Jakma | 18ab08b | 2016-01-27 16:37:33 +0000 | [diff] [blame^] | 177 | bgp_notify_send (peer, BGP_NOTIFY_UPDATE_ERR, |
| 178 | BGP_NOTIFY_UPDATE_OPT_ATTR_ERR); |
Donald Sharp | a3bc7e9 | 2016-01-27 16:54:45 +0000 | [diff] [blame] | 179 | return -1; |
Donald Sharp | a3bc7e9 | 2016-01-27 16:54:45 +0000 | [diff] [blame] | 180 | } |
| 181 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 182 | /* Copyr label to prefix. */ |
Donald Sharp | a3bc7e9 | 2016-01-27 16:54:45 +0000 | [diff] [blame] | 183 | tagpnt = pnt; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 184 | |
| 185 | /* Copy routing distinguisher to rd. */ |
| 186 | memcpy (&prd.val, pnt + 3, 8); |
| 187 | |
| 188 | /* Decode RD type. */ |
| 189 | type = decode_rd_type (pnt + 3); |
| 190 | |
Lou Berger | a03bd16 | 2016-01-12 13:41:54 -0500 | [diff] [blame] | 191 | switch (type) |
| 192 | { |
| 193 | case RD_TYPE_AS: |
| 194 | decode_rd_as (pnt + 5, &rd_as); |
| 195 | break; |
| 196 | |
| 197 | case RD_TYPE_AS4: |
| 198 | decode_rd_as4 (pnt + 5, &rd_as); |
| 199 | break; |
| 200 | |
| 201 | case RD_TYPE_IP: |
| 202 | decode_rd_ip (pnt + 5, &rd_ip); |
| 203 | break; |
| 204 | |
Lou Berger | 050defe | 2016-01-12 13:41:59 -0500 | [diff] [blame] | 205 | default: |
| 206 | zlog_err ("Unknown RD type %d", type); |
| 207 | break; /* just report */ |
| 208 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 209 | |
Donald Sharp | a3bc7e9 | 2016-01-27 16:54:45 +0000 | [diff] [blame] | 210 | p.prefixlen = prefixlen - VPN_PREFIXLEN_MIN_BYTES*8; |
| 211 | memcpy (&p.u.prefix, pnt + VPN_PREFIXLEN_MIN_BYTES, |
| 212 | psize - VPN_PREFIXLEN_MIN_BYTES); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 213 | |
Paul Jakma | 18ab08b | 2016-01-27 16:37:33 +0000 | [diff] [blame^] | 214 | if (update) |
| 215 | { |
| 216 | if (attr) |
| 217 | bgp_update (peer, &p, attr, packet->afi, SAFI_MPLS_VPN, |
| 218 | ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, tagpnt, 0); |
| 219 | else |
| 220 | bgp_withdraw (peer, &p, attr, packet->afi, SAFI_MPLS_VPN, |
| 221 | ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, tagpnt); |
| 222 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 223 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 224 | /* Packet length consistency check. */ |
| 225 | if (pnt != lim) |
Paul Jakma | 18ab08b | 2016-01-27 16:37:33 +0000 | [diff] [blame^] | 226 | { |
| 227 | plog_err (peer->log, |
| 228 | "%s [Error] Update packet error / VPNv4" |
| 229 | " (%zu data remaining after parsing)", |
| 230 | peer->host, lim - pnt); |
| 231 | bgp_notify_send (peer, BGP_NOTIFY_UPDATE_ERR, |
| 232 | BGP_NOTIFY_UPDATE_OPT_ATTR_ERR); |
| 233 | return -1; |
| 234 | } |
Donald Sharp | a3bc7e9 | 2016-01-27 16:54:45 +0000 | [diff] [blame] | 235 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 236 | return 0; |
Donald Sharp | a3bc7e9 | 2016-01-27 16:54:45 +0000 | [diff] [blame] | 237 | #undef VPN_PREFIXLEN_MIN_BYTES |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 238 | } |
| 239 | |
| 240 | int |
Paul Jakma | 18ab08b | 2016-01-27 16:37:33 +0000 | [diff] [blame^] | 241 | bgp_nlri_sanity_check_vpn (struct peer *peer, struct bgp_nlri *nlri) |
| 242 | { |
| 243 | return bgp_nlri_parse_vpn_body (peer, NULL, nlri, false); |
| 244 | } |
| 245 | |
| 246 | int |
| 247 | bgp_nlri_parse_vpn (struct peer *peer, struct attr *attr, |
| 248 | struct bgp_nlri *packet) |
| 249 | { |
| 250 | return bgp_nlri_parse_vpn_body (peer, attr, packet, true); |
| 251 | } |
| 252 | |
| 253 | int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 254 | str2prefix_rd (const char *str, struct prefix_rd *prd) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 255 | { |
Lou Berger | 056f376 | 2013-04-10 12:30:04 -0700 | [diff] [blame] | 256 | int ret; /* ret of called functions */ |
| 257 | int lret; /* local ret, of this func */ |
paul | 5228ad2 | 2004-06-04 17:58:18 +0000 | [diff] [blame] | 258 | char *p; |
| 259 | char *p2; |
Lou Berger | 056f376 | 2013-04-10 12:30:04 -0700 | [diff] [blame] | 260 | struct stream *s = NULL; |
| 261 | char *half = NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 262 | struct in_addr addr; |
| 263 | |
| 264 | s = stream_new (8); |
| 265 | |
| 266 | prd->family = AF_UNSPEC; |
| 267 | prd->prefixlen = 64; |
| 268 | |
Lou Berger | 056f376 | 2013-04-10 12:30:04 -0700 | [diff] [blame] | 269 | lret = 0; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 270 | p = strchr (str, ':'); |
| 271 | if (! p) |
Lou Berger | 056f376 | 2013-04-10 12:30:04 -0700 | [diff] [blame] | 272 | goto out; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 273 | |
| 274 | if (! all_digit (p + 1)) |
Lou Berger | 056f376 | 2013-04-10 12:30:04 -0700 | [diff] [blame] | 275 | goto out; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 276 | |
| 277 | half = XMALLOC (MTYPE_TMP, (p - str) + 1); |
| 278 | memcpy (half, str, (p - str)); |
| 279 | half[p - str] = '\0'; |
| 280 | |
| 281 | p2 = strchr (str, '.'); |
| 282 | |
| 283 | if (! p2) |
| 284 | { |
| 285 | if (! all_digit (half)) |
Lou Berger | 056f376 | 2013-04-10 12:30:04 -0700 | [diff] [blame] | 286 | goto out; |
| 287 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 288 | stream_putw (s, RD_TYPE_AS); |
| 289 | stream_putw (s, atoi (half)); |
| 290 | stream_putl (s, atol (p + 1)); |
| 291 | } |
| 292 | else |
| 293 | { |
| 294 | ret = inet_aton (half, &addr); |
| 295 | if (! ret) |
Lou Berger | 056f376 | 2013-04-10 12:30:04 -0700 | [diff] [blame] | 296 | goto out; |
| 297 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 298 | stream_putw (s, RD_TYPE_IP); |
| 299 | stream_put_in_addr (s, &addr); |
| 300 | stream_putw (s, atol (p + 1)); |
| 301 | } |
| 302 | memcpy (prd->val, s->data, 8); |
Lou Berger | 056f376 | 2013-04-10 12:30:04 -0700 | [diff] [blame] | 303 | lret = 1; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 304 | |
Lou Berger | 056f376 | 2013-04-10 12:30:04 -0700 | [diff] [blame] | 305 | out: |
| 306 | if (s) |
| 307 | stream_free (s); |
| 308 | if (half) |
| 309 | XFREE(MTYPE_TMP, half); |
| 310 | return lret; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 311 | } |
| 312 | |
| 313 | int |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 314 | str2tag (const char *str, u_char *tag) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 315 | { |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 316 | unsigned long l; |
| 317 | char *endptr; |
| 318 | u_int32_t t; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 319 | |
Ulrich Weber | 664711c | 2011-12-21 02:24:11 +0400 | [diff] [blame] | 320 | if (*str == '-') |
| 321 | return 0; |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 322 | |
Ulrich Weber | 664711c | 2011-12-21 02:24:11 +0400 | [diff] [blame] | 323 | errno = 0; |
| 324 | l = strtoul (str, &endptr, 10); |
| 325 | |
| 326 | if (*endptr != '\0' || errno || l > UINT32_MAX) |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 327 | return 0; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 328 | |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 329 | t = (u_int32_t) l; |
| 330 | |
| 331 | tag[0] = (u_char)(t >> 12); |
| 332 | tag[1] = (u_char)(t >> 4); |
| 333 | tag[2] = (u_char)(t << 4); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 334 | |
| 335 | return 1; |
| 336 | } |
| 337 | |
| 338 | char * |
| 339 | prefix_rd2str (struct prefix_rd *prd, char *buf, size_t size) |
| 340 | { |
| 341 | u_char *pnt; |
| 342 | u_int16_t type; |
| 343 | struct rd_as rd_as; |
| 344 | struct rd_ip rd_ip; |
| 345 | |
| 346 | if (size < RD_ADDRSTRLEN) |
| 347 | return NULL; |
| 348 | |
| 349 | pnt = prd->val; |
| 350 | |
| 351 | type = decode_rd_type (pnt); |
| 352 | |
| 353 | if (type == RD_TYPE_AS) |
| 354 | { |
| 355 | decode_rd_as (pnt + 2, &rd_as); |
Denis Ovsienko | aea339f | 2009-04-30 17:16:22 +0400 | [diff] [blame] | 356 | snprintf (buf, size, "%u:%d", rd_as.as, rd_as.val); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 357 | return buf; |
| 358 | } |
Lou Berger | a03bd16 | 2016-01-12 13:41:54 -0500 | [diff] [blame] | 359 | else if (type == RD_TYPE_AS4) |
| 360 | { |
| 361 | decode_rd_as4 (pnt + 2, &rd_as); |
| 362 | snprintf (buf, size, "%u:%d", rd_as.as, rd_as.val); |
| 363 | return buf; |
| 364 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 365 | else if (type == RD_TYPE_IP) |
| 366 | { |
| 367 | decode_rd_ip (pnt + 2, &rd_ip); |
| 368 | snprintf (buf, size, "%s:%d", inet_ntoa (rd_ip.ip), rd_ip.val); |
| 369 | return buf; |
| 370 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 371 | return NULL; |
| 372 | } |
| 373 | |
| 374 | /* For testing purpose, static route of MPLS-VPN. */ |
| 375 | DEFUN (vpnv4_network, |
| 376 | vpnv4_network_cmd, |
| 377 | "network A.B.C.D/M rd ASN:nn_or_IP-address:nn tag WORD", |
| 378 | "Specify a network to announce via BGP\n" |
| 379 | "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n" |
| 380 | "Specify Route Distinguisher\n" |
| 381 | "VPN Route Distinguisher\n" |
| 382 | "BGP tag\n" |
| 383 | "tag value\n") |
| 384 | { |
Lou Berger | a76d9ca | 2016-01-12 13:41:53 -0500 | [diff] [blame] | 385 | return bgp_static_set_safi (SAFI_MPLS_VPN, vty, argv[0], argv[1], argv[2], NULL); |
| 386 | } |
| 387 | |
| 388 | DEFUN (vpnv4_network_route_map, |
| 389 | vpnv4_network_route_map_cmd, |
| 390 | "network A.B.C.D/M rd ASN:nn_or_IP-address:nn tag WORD route-map WORD", |
| 391 | "Specify a network to announce via BGP\n" |
| 392 | "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n" |
| 393 | "Specify Route Distinguisher\n" |
| 394 | "VPN Route Distinguisher\n" |
| 395 | "BGP tag\n" |
| 396 | "tag value\n" |
| 397 | "route map\n" |
| 398 | "route map name\n") |
| 399 | { |
| 400 | return bgp_static_set_safi (SAFI_MPLS_VPN, vty, argv[0], argv[1], argv[2], argv[3]); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 401 | } |
| 402 | |
| 403 | /* For testing purpose, static route of MPLS-VPN. */ |
| 404 | DEFUN (no_vpnv4_network, |
| 405 | no_vpnv4_network_cmd, |
| 406 | "no network A.B.C.D/M rd ASN:nn_or_IP-address:nn tag WORD", |
| 407 | NO_STR |
| 408 | "Specify a network to announce via BGP\n" |
| 409 | "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n" |
| 410 | "Specify Route Distinguisher\n" |
| 411 | "VPN Route Distinguisher\n" |
| 412 | "BGP tag\n" |
| 413 | "tag value\n") |
| 414 | { |
Lou Berger | a76d9ca | 2016-01-12 13:41:53 -0500 | [diff] [blame] | 415 | return bgp_static_unset_safi (SAFI_MPLS_VPN, vty, argv[0], argv[1], argv[2]); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 416 | } |
| 417 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 418 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 419 | show_adj_route_vpn (struct vty *vty, struct peer *peer, struct prefix_rd *prd) |
| 420 | { |
| 421 | struct bgp *bgp; |
| 422 | struct bgp_table *table; |
| 423 | struct bgp_node *rn; |
| 424 | struct bgp_node *rm; |
| 425 | struct attr *attr; |
| 426 | int rd_header; |
| 427 | int header = 1; |
| 428 | char v4_header[] = " Network Next Hop Metric LocPrf Weight Path%s"; |
| 429 | |
| 430 | bgp = bgp_get_default (); |
| 431 | if (bgp == NULL) |
| 432 | { |
| 433 | vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE); |
| 434 | return CMD_WARNING; |
| 435 | } |
| 436 | |
| 437 | for (rn = bgp_table_top (bgp->rib[AFI_IP][SAFI_MPLS_VPN]); rn; |
| 438 | rn = bgp_route_next (rn)) |
| 439 | { |
| 440 | if (prd && memcmp (rn->p.u.val, prd->val, 8) != 0) |
| 441 | continue; |
| 442 | |
| 443 | if ((table = rn->info) != NULL) |
| 444 | { |
| 445 | rd_header = 1; |
| 446 | |
| 447 | for (rm = bgp_table_top (table); rm; rm = bgp_route_next (rm)) |
| 448 | if ((attr = rm->info) != NULL) |
| 449 | { |
| 450 | if (header) |
| 451 | { |
| 452 | vty_out (vty, "BGP table version is 0, local router ID is %s%s", |
| 453 | inet_ntoa (bgp->router_id), VTY_NEWLINE); |
| 454 | vty_out (vty, "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal%s", |
| 455 | VTY_NEWLINE); |
| 456 | vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s%s", |
| 457 | VTY_NEWLINE, VTY_NEWLINE); |
| 458 | vty_out (vty, v4_header, VTY_NEWLINE); |
| 459 | header = 0; |
| 460 | } |
| 461 | |
| 462 | if (rd_header) |
| 463 | { |
| 464 | u_int16_t type; |
| 465 | struct rd_as rd_as; |
| 466 | struct rd_ip rd_ip; |
| 467 | u_char *pnt; |
| 468 | |
| 469 | pnt = rn->p.u.val; |
| 470 | |
| 471 | /* Decode RD type. */ |
| 472 | type = decode_rd_type (pnt); |
| 473 | /* Decode RD value. */ |
| 474 | if (type == RD_TYPE_AS) |
| 475 | decode_rd_as (pnt + 2, &rd_as); |
Lou Berger | a03bd16 | 2016-01-12 13:41:54 -0500 | [diff] [blame] | 476 | else if (type == RD_TYPE_AS4) |
| 477 | decode_rd_as4 (pnt + 2, &rd_as); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 478 | else if (type == RD_TYPE_IP) |
| 479 | decode_rd_ip (pnt + 2, &rd_ip); |
| 480 | |
| 481 | vty_out (vty, "Route Distinguisher: "); |
| 482 | |
| 483 | if (type == RD_TYPE_AS) |
Denis Ovsienko | aea339f | 2009-04-30 17:16:22 +0400 | [diff] [blame] | 484 | vty_out (vty, "%u:%d", rd_as.as, rd_as.val); |
Lou Berger | a03bd16 | 2016-01-12 13:41:54 -0500 | [diff] [blame] | 485 | else if (type == RD_TYPE_AS4) |
| 486 | vty_out (vty, "%u:%d", rd_as.as, rd_as.val); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 487 | else if (type == RD_TYPE_IP) |
| 488 | vty_out (vty, "%s:%d", inet_ntoa (rd_ip.ip), rd_ip.val); |
| 489 | |
| 490 | vty_out (vty, "%s", VTY_NEWLINE); |
| 491 | rd_header = 0; |
| 492 | } |
| 493 | route_vty_out_tmp (vty, &rm->p, attr, SAFI_MPLS_VPN); |
| 494 | } |
| 495 | } |
| 496 | } |
| 497 | return CMD_SUCCESS; |
| 498 | } |
| 499 | |
| 500 | enum bgp_show_type |
| 501 | { |
| 502 | bgp_show_type_normal, |
| 503 | bgp_show_type_regexp, |
| 504 | bgp_show_type_prefix_list, |
| 505 | bgp_show_type_filter_list, |
| 506 | bgp_show_type_neighbor, |
| 507 | bgp_show_type_cidr_only, |
| 508 | bgp_show_type_prefix_longer, |
| 509 | bgp_show_type_community_all, |
| 510 | bgp_show_type_community, |
| 511 | bgp_show_type_community_exact, |
| 512 | bgp_show_type_community_list, |
| 513 | bgp_show_type_community_list_exact |
| 514 | }; |
| 515 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 516 | static int |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 517 | bgp_show_mpls_vpn( |
| 518 | struct vty *vty, |
| 519 | afi_t afi, |
| 520 | struct prefix_rd *prd, |
| 521 | enum bgp_show_type type, |
| 522 | void *output_arg, |
| 523 | int tags) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 524 | { |
| 525 | struct bgp *bgp; |
| 526 | struct bgp_table *table; |
| 527 | struct bgp_node *rn; |
| 528 | struct bgp_node *rm; |
| 529 | struct bgp_info *ri; |
| 530 | int rd_header; |
| 531 | int header = 1; |
| 532 | char v4_header[] = " Network Next Hop Metric LocPrf Weight Path%s"; |
| 533 | char v4_header_tag[] = " Network Next Hop In tag/Out tag%s"; |
| 534 | |
Lou Berger | bf1ae6c | 2016-01-12 13:42:08 -0500 | [diff] [blame] | 535 | unsigned long output_count = 0; |
| 536 | unsigned long total_count = 0; |
| 537 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 538 | bgp = bgp_get_default (); |
| 539 | if (bgp == NULL) |
| 540 | { |
| 541 | vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE); |
| 542 | return CMD_WARNING; |
| 543 | } |
| 544 | |
Lou Berger | 9da04bc | 2016-01-12 13:41:55 -0500 | [diff] [blame] | 545 | if ((afi != AFI_IP) && (afi != AFI_IP6)) |
| 546 | { |
| 547 | vty_out (vty, "Afi %d not supported%s", afi, VTY_NEWLINE); |
| 548 | return CMD_WARNING; |
| 549 | } |
| 550 | |
| 551 | for (rn = bgp_table_top (bgp->rib[afi][SAFI_MPLS_VPN]); rn; rn = bgp_route_next (rn)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 552 | { |
| 553 | if (prd && memcmp (rn->p.u.val, prd->val, 8) != 0) |
| 554 | continue; |
| 555 | |
| 556 | if ((table = rn->info) != NULL) |
| 557 | { |
| 558 | rd_header = 1; |
| 559 | |
| 560 | for (rm = bgp_table_top (table); rm; rm = bgp_route_next (rm)) |
| 561 | for (ri = rm->info; ri; ri = ri->next) |
| 562 | { |
Lou Berger | bf1ae6c | 2016-01-12 13:42:08 -0500 | [diff] [blame] | 563 | total_count++; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 564 | if (type == bgp_show_type_neighbor) |
| 565 | { |
| 566 | union sockunion *su = output_arg; |
| 567 | |
| 568 | if (ri->peer->su_remote == NULL || ! sockunion_same(ri->peer->su_remote, su)) |
| 569 | continue; |
| 570 | } |
| 571 | if (header) |
| 572 | { |
| 573 | if (tags) |
| 574 | vty_out (vty, v4_header_tag, VTY_NEWLINE); |
| 575 | else |
| 576 | { |
| 577 | vty_out (vty, "BGP table version is 0, local router ID is %s%s", |
| 578 | inet_ntoa (bgp->router_id), VTY_NEWLINE); |
| 579 | vty_out (vty, "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal%s", |
| 580 | VTY_NEWLINE); |
| 581 | vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s%s", |
| 582 | VTY_NEWLINE, VTY_NEWLINE); |
| 583 | vty_out (vty, v4_header, VTY_NEWLINE); |
| 584 | } |
| 585 | header = 0; |
| 586 | } |
| 587 | |
| 588 | if (rd_header) |
| 589 | { |
| 590 | u_int16_t type; |
| 591 | struct rd_as rd_as; |
| 592 | struct rd_ip rd_ip; |
| 593 | u_char *pnt; |
| 594 | |
| 595 | pnt = rn->p.u.val; |
| 596 | |
| 597 | /* Decode RD type. */ |
| 598 | type = decode_rd_type (pnt); |
| 599 | /* Decode RD value. */ |
| 600 | if (type == RD_TYPE_AS) |
| 601 | decode_rd_as (pnt + 2, &rd_as); |
Lou Berger | a03bd16 | 2016-01-12 13:41:54 -0500 | [diff] [blame] | 602 | else if (type == RD_TYPE_AS4) |
| 603 | decode_rd_as4 (pnt + 2, &rd_as); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 604 | else if (type == RD_TYPE_IP) |
| 605 | decode_rd_ip (pnt + 2, &rd_ip); |
| 606 | |
| 607 | vty_out (vty, "Route Distinguisher: "); |
| 608 | |
| 609 | if (type == RD_TYPE_AS) |
Lou Berger | a03bd16 | 2016-01-12 13:41:54 -0500 | [diff] [blame] | 610 | vty_out (vty, "as2 %u:%d", rd_as.as, rd_as.val); |
| 611 | else if (type == RD_TYPE_AS4) |
| 612 | vty_out (vty, "as4 %u:%d", rd_as.as, rd_as.val); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 613 | else if (type == RD_TYPE_IP) |
Lou Berger | a03bd16 | 2016-01-12 13:41:54 -0500 | [diff] [blame] | 614 | vty_out (vty, "ip %s:%d", inet_ntoa (rd_ip.ip), rd_ip.val); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 615 | |
| 616 | vty_out (vty, "%s", VTY_NEWLINE); |
| 617 | rd_header = 0; |
| 618 | } |
| 619 | if (tags) |
| 620 | route_vty_out_tag (vty, &rm->p, ri, 0, SAFI_MPLS_VPN); |
| 621 | else |
| 622 | route_vty_out (vty, &rm->p, ri, 0, SAFI_MPLS_VPN); |
Lou Berger | bf1ae6c | 2016-01-12 13:42:08 -0500 | [diff] [blame] | 623 | output_count++; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 624 | } |
| 625 | } |
| 626 | } |
Lou Berger | bf1ae6c | 2016-01-12 13:42:08 -0500 | [diff] [blame] | 627 | |
| 628 | if (output_count == 0) |
| 629 | { |
| 630 | vty_out (vty, "No prefixes displayed, %ld exist%s", total_count, VTY_NEWLINE); |
| 631 | } |
| 632 | else |
| 633 | vty_out (vty, "%sDisplayed %ld out of %ld total prefixes%s", |
| 634 | VTY_NEWLINE, output_count, total_count, VTY_NEWLINE); |
| 635 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 636 | return CMD_SUCCESS; |
| 637 | } |
| 638 | |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 639 | DEFUN (show_bgp_ipv4_vpn, |
| 640 | show_bgp_ipv4_vpn_cmd, |
| 641 | "show bgp ipv4 vpn", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 642 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 643 | BGP_STR |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 644 | "Address Family\n" |
| 645 | "Display VPN NLRI specific information\n") |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 646 | { |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 647 | return bgp_show_mpls_vpn (vty, AFI_IP, NULL, bgp_show_type_normal, NULL, 0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 648 | } |
| 649 | |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 650 | DEFUN (show_bgp_ipv6_vpn, |
| 651 | show_bgp_ipv6_vpn_cmd, |
| 652 | "show bgp ipv6 vpn", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 653 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 654 | BGP_STR |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 655 | "Address Family\n" |
| 656 | "Display VPN NLRI specific information\n") |
| 657 | { |
| 658 | return bgp_show_mpls_vpn (vty, AFI_IP6, NULL, bgp_show_type_normal, NULL, 0); |
| 659 | } |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 660 | |
| 661 | DEFUN (show_bgp_ipv4_vpn_rd, |
| 662 | show_bgp_ipv4_vpn_rd_cmd, |
| 663 | "show bgp ipv4 vpn rd ASN:nn_or_IP-address:nn", |
| 664 | SHOW_STR |
| 665 | BGP_STR |
| 666 | "Address Family\n" |
| 667 | "Display VPN NLRI specific information\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 668 | "Display information for a route distinguisher\n" |
| 669 | "VPN Route Distinguisher\n") |
| 670 | { |
| 671 | int ret; |
| 672 | struct prefix_rd prd; |
| 673 | |
| 674 | ret = str2prefix_rd (argv[0], &prd); |
| 675 | if (! ret) |
| 676 | { |
| 677 | vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE); |
| 678 | return CMD_WARNING; |
| 679 | } |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 680 | return bgp_show_mpls_vpn (vty, AFI_IP, &prd, bgp_show_type_normal, NULL, 0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 681 | } |
| 682 | |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 683 | DEFUN (show_bgp_ipv6_vpn_rd, |
| 684 | show_bgp_ipv6_vpn_rd_cmd, |
| 685 | "show bgp ipv6 vpn rd ASN:nn_or_IP-address:nn", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 686 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 687 | BGP_STR |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 688 | "Address Family\n" |
| 689 | "Display VPN NLRI specific information\n" |
| 690 | "Display information for a route distinguisher\n" |
| 691 | "VPN Route Distinguisher\n") |
| 692 | { |
| 693 | int ret; |
| 694 | struct prefix_rd prd; |
| 695 | |
| 696 | ret = str2prefix_rd (argv[0], &prd); |
| 697 | if (! ret) |
| 698 | { |
| 699 | vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE); |
| 700 | return CMD_WARNING; |
| 701 | } |
| 702 | return bgp_show_mpls_vpn (vty, AFI_IP6, &prd, bgp_show_type_normal, NULL, 0); |
| 703 | } |
| 704 | |
| 705 | |
| 706 | DEFUN (show_bgp_ipv4_vpn_tags, |
| 707 | show_bgp_ipv4_vpn_tags_cmd, |
| 708 | "show bgp ipv4 vpn tags", |
| 709 | SHOW_STR |
| 710 | BGP_STR |
| 711 | "Address Family\n" |
| 712 | "Display VPN NLRI specific information\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 713 | "Display BGP tags for prefixes\n") |
| 714 | { |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 715 | return bgp_show_mpls_vpn (vty, AFI_IP, NULL, bgp_show_type_normal, NULL, 1); |
| 716 | } |
| 717 | DEFUN (show_bgp_ipv6_vpn_tags, |
| 718 | show_bgp_ipv6_vpn_tags_cmd, |
| 719 | "show bgp ipv6 vpn tags", |
| 720 | SHOW_STR |
| 721 | BGP_STR |
| 722 | "Address Family\n" |
| 723 | "Display VPN NLRI specific information\n" |
| 724 | "Display BGP tags for prefixes\n") |
| 725 | { |
| 726 | return bgp_show_mpls_vpn (vty, AFI_IP6, NULL, bgp_show_type_normal, NULL, 1); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 727 | } |
| 728 | |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 729 | DEFUN (show_bgp_ipv4_vpn_rd_tags, |
| 730 | show_bgp_ipv4_vpn_rd_tags_cmd, |
| 731 | "show bgp ipv4 vpn rd ASN:nn_or_IP-address:nn tags", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 732 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 733 | BGP_STR |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 734 | "Address Family\n" |
| 735 | "Display VPN NLRI specific information\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 736 | "Display information for a route distinguisher\n" |
| 737 | "VPN Route Distinguisher\n" |
| 738 | "Display BGP tags for prefixes\n") |
| 739 | { |
| 740 | int ret; |
| 741 | struct prefix_rd prd; |
| 742 | |
| 743 | ret = str2prefix_rd (argv[0], &prd); |
| 744 | if (! ret) |
| 745 | { |
| 746 | vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE); |
| 747 | return CMD_WARNING; |
| 748 | } |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 749 | return bgp_show_mpls_vpn (vty, AFI_IP, &prd, bgp_show_type_normal, NULL, 1); |
| 750 | } |
| 751 | DEFUN (show_bgp_ipv6_vpn_rd_tags, |
| 752 | show_bgp_ipv6_vpn_rd_tags_cmd, |
| 753 | "show bgp ipv6 vpn rd ASN:nn_or_IP-address:nn tags", |
| 754 | SHOW_STR |
| 755 | BGP_STR |
| 756 | "Address Family\n" |
| 757 | "Display VPN NLRI specific information\n" |
| 758 | "Display information for a route distinguisher\n" |
| 759 | "VPN Route Distinguisher\n" |
| 760 | "Display BGP tags for prefixes\n") |
| 761 | { |
| 762 | int ret; |
| 763 | struct prefix_rd prd; |
| 764 | |
| 765 | ret = str2prefix_rd (argv[0], &prd); |
| 766 | if (! ret) |
| 767 | { |
| 768 | vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE); |
| 769 | return CMD_WARNING; |
| 770 | } |
| 771 | return bgp_show_mpls_vpn (vty, AFI_IP6, &prd, bgp_show_type_normal, NULL, 1); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 772 | } |
| 773 | |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 774 | DEFUN (show_bgp_ipv4_vpn_neighbor_routes, |
| 775 | show_bgp_ipv4_vpn_neighbor_routes_cmd, |
| 776 | "show bgp ipv4 vpn neighbors (A.B.C.D|X:X::X:X) routes", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 777 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 778 | BGP_STR |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 779 | "Address Family\n" |
| 780 | "Display VPN NLRI specific information\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 781 | "Detailed information on TCP and BGP neighbor connections\n" |
| 782 | "Neighbor to display information about\n" |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 783 | "Neighbor to display information about\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 784 | "Display routes learned from neighbor\n") |
| 785 | { |
Jorge Boncompte [DTI2] | c63b83f | 2012-04-10 16:57:24 +0200 | [diff] [blame] | 786 | union sockunion su; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 787 | struct peer *peer; |
Jorge Boncompte [DTI2] | c63b83f | 2012-04-10 16:57:24 +0200 | [diff] [blame] | 788 | int ret; |
| 789 | |
| 790 | ret = str2sockunion (argv[0], &su); |
| 791 | if (ret < 0) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 792 | { |
| 793 | vty_out (vty, "Malformed address: %s%s", argv[0], VTY_NEWLINE); |
Jorge Boncompte [DTI2] | c63b83f | 2012-04-10 16:57:24 +0200 | [diff] [blame] | 794 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 795 | } |
| 796 | |
Jorge Boncompte [DTI2] | c63b83f | 2012-04-10 16:57:24 +0200 | [diff] [blame] | 797 | peer = peer_lookup (NULL, &su); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 798 | if (! peer || ! peer->afc[AFI_IP][SAFI_MPLS_VPN]) |
| 799 | { |
| 800 | vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE); |
| 801 | return CMD_WARNING; |
| 802 | } |
| 803 | |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 804 | return bgp_show_mpls_vpn (vty, AFI_IP, NULL, bgp_show_type_neighbor, &su, 0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 805 | } |
| 806 | |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 807 | DEFUN (show_bgp_ipv6_vpn_neighbor_routes, |
| 808 | show_bgp_ipv6_vpn_neighbor_routes_cmd, |
| 809 | "show bgp ipv6 vpn neighbors (A.B.C.D|X:X::X:X) routes", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 810 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 811 | BGP_STR |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 812 | "Address Family\n" |
| 813 | "Display VPN NLRI specific information\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 814 | "Detailed information on TCP and BGP neighbor connections\n" |
| 815 | "Neighbor to display information about\n" |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 816 | "Neighbor to display information about\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 817 | "Display routes learned from neighbor\n") |
| 818 | { |
Jorge Boncompte [DTI2] | c63b83f | 2012-04-10 16:57:24 +0200 | [diff] [blame] | 819 | union sockunion su; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 820 | struct peer *peer; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 821 | |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 822 | int ret; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 823 | |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 824 | ret = str2sockunion (argv[0], &su); |
Jorge Boncompte [DTI2] | c63b83f | 2012-04-10 16:57:24 +0200 | [diff] [blame] | 825 | if (ret < 0) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 826 | { |
| 827 | vty_out (vty, "Malformed address: %s%s", argv[0], VTY_NEWLINE); |
Jorge Boncompte [DTI2] | c63b83f | 2012-04-10 16:57:24 +0200 | [diff] [blame] | 828 | return CMD_WARNING; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 829 | } |
| 830 | |
Jorge Boncompte [DTI2] | c63b83f | 2012-04-10 16:57:24 +0200 | [diff] [blame] | 831 | peer = peer_lookup (NULL, &su); |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 832 | if (! peer || ! peer->afc[AFI_IP6][SAFI_MPLS_VPN]) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 833 | { |
| 834 | vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE); |
| 835 | return CMD_WARNING; |
| 836 | } |
| 837 | |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 838 | return bgp_show_mpls_vpn (vty, AFI_IP6, NULL, bgp_show_type_neighbor, &su, 0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 839 | } |
| 840 | |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 841 | DEFUN (show_bgp_ipv4_vpn_neighbor_advertised_routes, |
| 842 | show_bgp_ipv4_vpn_neighbor_advertised_routes_cmd, |
| 843 | "show bgp ipv4 vpn neighbors (A.B.C.D|X:X::X:X) advertised-routes", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 844 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 845 | BGP_STR |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 846 | "Address Family\n" |
| 847 | "Display VPN NLRI specific information\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 848 | "Detailed information on TCP and BGP neighbor connections\n" |
| 849 | "Neighbor to display information about\n" |
| 850 | "Display the routes advertised to a BGP neighbor\n") |
| 851 | { |
| 852 | int ret; |
| 853 | struct peer *peer; |
| 854 | union sockunion su; |
| 855 | |
| 856 | ret = str2sockunion (argv[0], &su); |
| 857 | if (ret < 0) |
| 858 | { |
| 859 | vty_out (vty, "%% Malformed address: %s%s", argv[0], VTY_NEWLINE); |
| 860 | return CMD_WARNING; |
| 861 | } |
| 862 | peer = peer_lookup (NULL, &su); |
| 863 | if (! peer || ! peer->afc[AFI_IP][SAFI_MPLS_VPN]) |
| 864 | { |
| 865 | vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE); |
| 866 | return CMD_WARNING; |
| 867 | } |
| 868 | |
| 869 | return show_adj_route_vpn (vty, peer, NULL); |
| 870 | } |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 871 | DEFUN (show_bgp_ipv6_vpn_neighbor_advertised_routes, |
| 872 | show_bgp_ipv6_vpn_neighbor_advertised_routes_cmd, |
| 873 | "show bgp ipv6 vpn neighbors (A.B.C.D|X:X::X:X) advertised-routes", |
| 874 | SHOW_STR |
| 875 | BGP_STR |
| 876 | "Address Family\n" |
| 877 | "Display VPN NLRI specific information\n" |
| 878 | "Detailed information on TCP and BGP neighbor connections\n" |
| 879 | "Neighbor to display information about\n" |
| 880 | "Display the routes advertised to a BGP neighbor\n") |
| 881 | { |
| 882 | int ret; |
| 883 | struct peer *peer; |
| 884 | union sockunion su; |
| 885 | |
| 886 | ret = str2sockunion (argv[0], &su); |
| 887 | if (ret < 0) |
| 888 | { |
| 889 | vty_out (vty, "%% Malformed address: %s%s", argv[0], VTY_NEWLINE); |
| 890 | return CMD_WARNING; |
| 891 | } |
| 892 | peer = peer_lookup (NULL, &su); |
| 893 | if (! peer || ! peer->afc[AFI_IP6][SAFI_MPLS_VPN]) |
| 894 | { |
| 895 | vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE); |
| 896 | return CMD_WARNING; |
| 897 | } |
| 898 | |
| 899 | return show_adj_route_vpn (vty, peer, NULL); |
| 900 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 901 | |
| 902 | DEFUN (show_ip_bgp_vpnv4_rd_neighbor_advertised_routes, |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 903 | show_bgp_ipv4_vpn_rd_neighbor_advertised_routes_cmd, |
| 904 | "show bgp ipv4 vpn rd ASN:nn_or_IP-address:nn neighbors (A.B.C.D|X:X::X:X) advertised-routes", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 905 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 906 | BGP_STR |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 907 | "Address Family\n" |
| 908 | "Display VPN NLRI specific information\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 909 | "Display information for a route distinguisher\n" |
| 910 | "VPN Route Distinguisher\n" |
| 911 | "Detailed information on TCP and BGP neighbor connections\n" |
| 912 | "Neighbor to display information about\n" |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 913 | "Neighbor to display information about\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 914 | "Display the routes advertised to a BGP neighbor\n") |
| 915 | { |
| 916 | int ret; |
| 917 | struct peer *peer; |
| 918 | struct prefix_rd prd; |
| 919 | union sockunion su; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 920 | ret = str2sockunion (argv[1], &su); |
| 921 | if (ret < 0) |
| 922 | { |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 923 | vty_out (vty, "%% Malformed address: %s%s", argv[1], VTY_NEWLINE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 924 | return CMD_WARNING; |
| 925 | } |
| 926 | peer = peer_lookup (NULL, &su); |
| 927 | if (! peer || ! peer->afc[AFI_IP][SAFI_MPLS_VPN]) |
| 928 | { |
| 929 | vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE); |
| 930 | return CMD_WARNING; |
| 931 | } |
| 932 | |
| 933 | ret = str2prefix_rd (argv[0], &prd); |
| 934 | if (! ret) |
| 935 | { |
| 936 | vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE); |
| 937 | return CMD_WARNING; |
| 938 | } |
| 939 | |
| 940 | return show_adj_route_vpn (vty, peer, &prd); |
| 941 | } |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 942 | DEFUN (show_ip_bgp_vpnv6_rd_neighbor_advertised_routes, |
| 943 | show_bgp_ipv6_vpn_rd_neighbor_advertised_routes_cmd, |
| 944 | "show bgp ipv6 vpn rd ASN:nn_or_IP-address:nn neighbors (A.B.C.D|X:X::X:X) advertised-routes", |
| 945 | SHOW_STR |
| 946 | BGP_STR |
| 947 | "Address Family\n" |
| 948 | "Display VPN NLRI specific information\n" |
| 949 | "Display information for a route distinguisher\n" |
| 950 | "VPN Route Distinguisher\n" |
| 951 | "Detailed information on TCP and BGP neighbor connections\n" |
| 952 | "Neighbor to display information about\n" |
| 953 | "Neighbor to display information about\n" |
| 954 | "Display the routes advertised to a BGP neighbor\n") |
| 955 | { |
| 956 | int ret; |
| 957 | struct peer *peer; |
| 958 | struct prefix_rd prd; |
| 959 | union sockunion su; |
| 960 | ret = str2sockunion (argv[1], &su); |
| 961 | if (ret < 0) |
| 962 | { |
| 963 | vty_out (vty, "%% Malformed address: %s%s", argv[1], VTY_NEWLINE); |
| 964 | return CMD_WARNING; |
| 965 | } |
| 966 | peer = peer_lookup (NULL, &su); |
| 967 | if (! peer || ! peer->afc[AFI_IP6][SAFI_MPLS_VPN]) |
| 968 | { |
| 969 | vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE); |
| 970 | return CMD_WARNING; |
| 971 | } |
| 972 | |
| 973 | ret = str2prefix_rd (argv[0], &prd); |
| 974 | if (! ret) |
| 975 | { |
| 976 | vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE); |
| 977 | return CMD_WARNING; |
| 978 | } |
| 979 | |
| 980 | return show_adj_route_vpn (vty, peer, &prd); |
| 981 | } |
| 982 | |
| 983 | DEFUN (show_bgp_ipv4_vpn_rd_neighbor_routes, |
| 984 | show_bgp_ipv4_vpn_rd_neighbor_routes_cmd, |
| 985 | "show bgp ipv4 vpn rd ASN:nn_or_IP-address:nn neighbors (A.B.C.D|X:X::X:X) routes", |
| 986 | SHOW_STR |
| 987 | BGP_STR |
| 988 | "Address Family\n" |
| 989 | "Address Family modifier\n" |
| 990 | "Display information for a route distinguisher\n" |
| 991 | "VPN Route Distinguisher\n" |
| 992 | "Detailed information on TCP and BGP neighbor connections\n" |
| 993 | "Neighbor to display information about\n" |
| 994 | "Display routes learned from neighbor\n") |
| 995 | { |
| 996 | int ret; |
| 997 | union sockunion *su; |
| 998 | struct peer *peer; |
| 999 | struct prefix_rd prd; |
| 1000 | |
| 1001 | ret = str2prefix_rd (argv[0], &prd); |
| 1002 | if (! ret) |
| 1003 | { |
| 1004 | vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE); |
| 1005 | return CMD_WARNING; |
| 1006 | } |
| 1007 | |
| 1008 | su = sockunion_str2su (argv[1]); |
| 1009 | if (su == NULL) |
| 1010 | { |
| 1011 | vty_out (vty, "Malformed address: %s%s", argv[1], VTY_NEWLINE); |
| 1012 | return CMD_WARNING; |
| 1013 | } |
| 1014 | |
| 1015 | peer = peer_lookup (NULL, su); |
| 1016 | if (! peer || ! peer->afc[AFI_IP][SAFI_MPLS_VPN]) |
| 1017 | { |
| 1018 | vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE); |
| 1019 | return CMD_WARNING; |
| 1020 | } |
| 1021 | |
| 1022 | return bgp_show_mpls_vpn (vty, AFI_IP, &prd, bgp_show_type_neighbor, su, 0); |
| 1023 | } |
| 1024 | DEFUN (show_bgp_ipv6_vpn_rd_neighbor_routes, |
| 1025 | show_bgp_ipv6_vpn_rd_neighbor_routes_cmd, |
| 1026 | "show bgp ipv6 vpn rd ASN:nn_or_IP-address:nn neighbors (A.B.C.D|X:X::X:X) routes", |
| 1027 | SHOW_STR |
| 1028 | BGP_STR |
| 1029 | "Address Family\n" |
| 1030 | "Address Family modifier\n" |
| 1031 | "Display information for a route distinguisher\n" |
| 1032 | "VPN Route Distinguisher\n" |
| 1033 | "Detailed information on TCP and BGP neighbor connections\n" |
| 1034 | "Neighbor to display information about\n" |
| 1035 | "Display routes learned from neighbor\n") |
| 1036 | { |
| 1037 | int ret; |
| 1038 | union sockunion *su; |
| 1039 | struct peer *peer; |
| 1040 | struct prefix_rd prd; |
| 1041 | |
| 1042 | ret = str2prefix_rd (argv[0], &prd); |
| 1043 | if (! ret) |
| 1044 | { |
| 1045 | vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE); |
| 1046 | return CMD_WARNING; |
| 1047 | } |
| 1048 | |
| 1049 | su = sockunion_str2su (argv[1]); |
| 1050 | if (su == NULL) |
| 1051 | { |
| 1052 | vty_out (vty, "Malformed address: %s%s", argv[1], VTY_NEWLINE); |
| 1053 | return CMD_WARNING; |
| 1054 | } |
| 1055 | |
| 1056 | peer = peer_lookup (NULL, su); |
| 1057 | if (! peer || ! peer->afc[AFI_IP6][SAFI_MPLS_VPN]) |
| 1058 | { |
| 1059 | vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE); |
| 1060 | return CMD_WARNING; |
| 1061 | } |
| 1062 | |
| 1063 | return bgp_show_mpls_vpn (vty, AFI_IP6, &prd, bgp_show_type_neighbor, su, 0); |
| 1064 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1065 | |
| 1066 | void |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 1067 | bgp_mplsvpn_init (void) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1068 | { |
| 1069 | install_element (BGP_VPNV4_NODE, &vpnv4_network_cmd); |
Lou Berger | a76d9ca | 2016-01-12 13:41:53 -0500 | [diff] [blame] | 1070 | install_element (BGP_VPNV4_NODE, &vpnv4_network_route_map_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1071 | install_element (BGP_VPNV4_NODE, &no_vpnv4_network_cmd); |
| 1072 | |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 1073 | install_element (VIEW_NODE, &show_bgp_ipv4_vpn_cmd); |
| 1074 | install_element (VIEW_NODE, &show_bgp_ipv4_vpn_rd_cmd); |
| 1075 | install_element (VIEW_NODE, &show_bgp_ipv4_vpn_tags_cmd); |
| 1076 | install_element (VIEW_NODE, &show_bgp_ipv4_vpn_rd_tags_cmd); |
| 1077 | install_element (VIEW_NODE, &show_bgp_ipv4_vpn_neighbor_routes_cmd); |
| 1078 | install_element (VIEW_NODE, &show_bgp_ipv4_vpn_neighbor_advertised_routes_cmd); |
| 1079 | install_element (VIEW_NODE, &show_bgp_ipv4_vpn_rd_neighbor_advertised_routes_cmd); |
| 1080 | install_element (VIEW_NODE, &show_bgp_ipv4_vpn_rd_neighbor_routes_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1081 | |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 1082 | install_element (VIEW_NODE, &show_bgp_ipv6_vpn_cmd); |
| 1083 | install_element (VIEW_NODE, &show_bgp_ipv6_vpn_rd_cmd); |
| 1084 | install_element (VIEW_NODE, &show_bgp_ipv6_vpn_tags_cmd); |
| 1085 | install_element (VIEW_NODE, &show_bgp_ipv6_vpn_rd_tags_cmd); |
| 1086 | install_element (VIEW_NODE, &show_bgp_ipv6_vpn_neighbor_routes_cmd); |
| 1087 | install_element (VIEW_NODE, &show_bgp_ipv6_vpn_neighbor_advertised_routes_cmd); |
| 1088 | install_element (VIEW_NODE, &show_bgp_ipv6_vpn_rd_neighbor_advertised_routes_cmd); |
| 1089 | install_element (VIEW_NODE, &show_bgp_ipv6_vpn_rd_neighbor_routes_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1090 | |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 1091 | install_element (ENABLE_NODE, &show_bgp_ipv4_vpn_cmd); |
| 1092 | install_element (ENABLE_NODE, &show_bgp_ipv4_vpn_rd_cmd); |
| 1093 | install_element (ENABLE_NODE, &show_bgp_ipv4_vpn_tags_cmd); |
| 1094 | install_element (ENABLE_NODE, &show_bgp_ipv4_vpn_rd_tags_cmd); |
| 1095 | install_element (ENABLE_NODE, &show_bgp_ipv4_vpn_neighbor_routes_cmd); |
| 1096 | install_element (ENABLE_NODE, &show_bgp_ipv4_vpn_neighbor_advertised_routes_cmd); |
| 1097 | install_element (ENABLE_NODE, &show_bgp_ipv4_vpn_rd_neighbor_advertised_routes_cmd); |
| 1098 | install_element (ENABLE_NODE, &show_bgp_ipv4_vpn_rd_neighbor_routes_cmd); |
| 1099 | |
Lou Berger | 35c3686 | 2016-01-12 13:42:06 -0500 | [diff] [blame] | 1100 | install_element (ENABLE_NODE, &show_bgp_ipv6_vpn_cmd); |
| 1101 | install_element (ENABLE_NODE, &show_bgp_ipv6_vpn_rd_cmd); |
| 1102 | install_element (ENABLE_NODE, &show_bgp_ipv6_vpn_tags_cmd); |
| 1103 | install_element (ENABLE_NODE, &show_bgp_ipv6_vpn_rd_tags_cmd); |
| 1104 | install_element (ENABLE_NODE, &show_bgp_ipv6_vpn_neighbor_routes_cmd); |
| 1105 | install_element (ENABLE_NODE, &show_bgp_ipv6_vpn_neighbor_advertised_routes_cmd); |
| 1106 | install_element (ENABLE_NODE, &show_bgp_ipv6_vpn_rd_neighbor_advertised_routes_cmd); |
| 1107 | install_element (ENABLE_NODE, &show_bgp_ipv6_vpn_rd_neighbor_routes_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1108 | } |