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