Merge pull request #611 from LabNConsulting/working/3.0/patch-set/deprecateEncap

3.0: remove support for config & show of encap safi
This commit is contained in:
Donald Sharp 2017-05-24 11:04:36 -04:00 committed by GitHub
commit f731a65469
14 changed files with 12 additions and 1093 deletions

View File

@ -80,7 +80,7 @@ libbgp_a_SOURCES = \
bgp_mplsvpn.c bgp_nexthop.c \
bgp_damp.c bgp_table.c bgp_advertise.c bgp_vty.c bgp_mpath.c \
bgp_nht.c bgp_updgrp.c bgp_updgrp_packet.c bgp_updgrp_adv.c bgp_bfd.c \
bgp_encap.c bgp_encap_tlv.c $(BGP_VNC_RFAPI_SRC) bgp_attr_evpn.c \
bgp_encap_tlv.c $(BGP_VNC_RFAPI_SRC) bgp_attr_evpn.c \
bgp_evpn.c bgp_evpn_vty.c bgp_vpn.c
noinst_HEADERS = \
@ -91,7 +91,7 @@ noinst_HEADERS = \
bgp_ecommunity.h bgp_lcommunity.h \
bgp_mplsvpn.h bgp_nexthop.h bgp_damp.h bgp_table.h \
bgp_advertise.h bgp_vty.h bgp_mpath.h bgp_nht.h \
bgp_updgrp.h bgp_bfd.h bgp_encap.h bgp_encap_tlv.h bgp_encap_types.h \
bgp_updgrp.h bgp_bfd.h bgp_encap_tlv.h bgp_encap_types.h \
$(BGP_VNC_RFAPI_HD) bgp_attr_evpn.h bgp_evpn.h bgp_evpn_vty.h bgp_vpn.h
bgpd_SOURCES = bgp_main.c

View File

@ -1,811 +0,0 @@
/*
* This file created by LabN Consulting, L.L.C.
*
*
* This file is based on bgp_mplsvpn.c which is Copyright (C) 2000
* Kunihiro Ishiguro <kunihiro@zebra.org>
*
*/
/*
This file is part of GNU Zebra.
GNU Zebra is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
GNU Zebra is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Zebra; see the file COPYING. If not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#include <zebra.h>
#include "command.h"
#include "prefix.h"
#include "log.h"
#include "memory.h"
#include "stream.h"
#include "filter.h"
#include "bgpd/bgpd.h"
#include "bgpd/bgp_table.h"
#include "bgpd/bgp_route.h"
#include "bgpd/bgp_attr.h"
#include "bgpd/bgp_ecommunity.h"
#include "bgpd/bgp_lcommunity.h"
#include "bgpd/bgp_mplsvpn.h"
#include "bgpd/bgp_vty.h"
#include "bgpd/bgp_encap.h"
#if ENABLE_BGP_VNC
#include "bgpd/rfapi/rfapi_backend.h"
#endif
static void
ecom2prd(struct ecommunity *ecom, struct prefix_rd *prd)
{
int i;
memset(prd, 0, sizeof(struct prefix_rd));
prd->family = AF_UNSPEC;
prd->prefixlen = 64;
if (!ecom)
return;
for (i = 0; i < (ecom->size * ECOMMUNITY_SIZE); i += ECOMMUNITY_SIZE) {
uint8_t *ep;
ep = ecom->val + i;
switch (ep[0]) {
default:
continue;
case 0x80:
case 0x81:
case 0x82:
if (ep[1] == 0x0) {
prd->val[1] = ep[0] & 0x03;
memcpy(prd->val + 2, ep + 2, 6);
return;
}
}
}
}
int
bgp_nlri_parse_encap(
struct peer *peer,
struct attr *attr,
struct bgp_nlri *packet)
{
u_char *pnt;
u_char *lim;
afi_t afi = packet->afi;
struct prefix p;
int psize = 0;
int prefixlen;
struct rd_as rd_as;
struct rd_ip rd_ip;
struct prefix_rd prd;
struct ecommunity *pEcom = NULL;
u_int16_t rdtype = 0xffff;
char buf[BUFSIZ];
/* Check peer status. */
if (peer->status != Established)
return 0;
/* Make prefix_rd */
if (attr && attr->extra && attr->extra->ecommunity)
pEcom = attr->extra->ecommunity;
ecom2prd(pEcom, &prd);
memset(&rd_as, 0, sizeof(rd_as));
memset(&rd_ip, 0, sizeof(rd_ip));
if (pEcom) {
rdtype = (prd.val[0] << 8) | prd.val[1];
/* Decode RD value. */
if (rdtype == RD_TYPE_AS)
decode_rd_as (prd.val + 2, &rd_as);
else if (rdtype == RD_TYPE_IP)
decode_rd_ip (prd.val + 2, &rd_ip);
else if (rdtype == RD_TYPE_AS4)
decode_rd_as4 (prd.val + 2, &rd_as);
else
{
zlog_err ("Invalid RD type %d", rdtype);
}
}
/*
* NB: this code was based on the MPLS VPN code, which supported RDs.
* For the moment we are retaining the underlying RIB structure that
* keeps a per-RD radix tree, but since the RDs are not carried over
* the wire, we set the RD internally to 0.
*/
prd.family = AF_UNSPEC;
prd.prefixlen = 64;
memset(prd.val, 0, sizeof(prd.val));
pnt = packet->nlri;
lim = pnt + packet->length;
for (; pnt < lim; pnt += psize)
{
/* Clear prefix structure. */
memset (&p, 0, sizeof (struct prefix));
/* Fetch prefix length. */
prefixlen = *pnt++;
p.family = afi2family(afi);
if (p.family == 0) {
/* bad afi, shouldn't happen */
zlog_warn("%s: bad afi %d, dropping incoming route", __func__, afi);
continue;
}
psize = PSIZE (prefixlen);
p.prefixlen = prefixlen;
memcpy (&p.u.prefix, pnt, psize);
if (pnt + psize > lim)
return -1;
if (rdtype == RD_TYPE_AS)
zlog_info ("rd-as %u:%u prefix %s/%d", rd_as.as, rd_as.val,
inet_ntop (p.family, &p.u.prefix, buf, BUFSIZ),
p.prefixlen);
else if (rdtype == RD_TYPE_IP)
zlog_info ("rd-ip %s:%u prefix %s/%d", inet_ntoa (rd_ip.ip),
rd_ip.val,
inet_ntop (p.family, &p.u.prefix, buf, BUFSIZ),
p.prefixlen);
else if (rdtype == RD_TYPE_AS4)
zlog_info ("rd-as4 %u:%u prefix %s/%d", rd_as.as, rd_as.val,
inet_ntop (p.family, &p.u.prefix, buf, BUFSIZ),
p.prefixlen);
else
zlog_info ("rd unknown, default to 0:0 prefix %s/%d",
inet_ntop (p.family, &p.u.prefix, buf, BUFSIZ),
p.prefixlen);
if (attr) {
bgp_update (peer, &p, 0, attr, afi, SAFI_ENCAP,
ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, NULL, 0, NULL);
} else {
bgp_withdraw (peer, &p, 0, attr, afi, SAFI_ENCAP,
ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, NULL, NULL);
}
}
/* Packet length consistency check. */
if (pnt != lim)
return -1;
return 0;
}
/* TBD: these routes should probably all be host routes */
/* For testing purpose, static route of ENCAP. */
DEFUN (encap_network,
encap_network_cmd,
"network A.B.C.D/M rd ASN:nn_or_IP-address:nn",
"Specify a network to announce via BGP\n"
"IPv4 prefix\n"
"Specify Route Distinguisher\n"
"ENCAP Route Distinguisher\n")
{
int idx_ipv4 = 1;
int idx_rd = 3;
return bgp_static_set_safi (AFI_IP, SAFI_ENCAP, vty, argv[idx_ipv4]->arg, argv[idx_rd]->arg, NULL,
NULL, 0, NULL, NULL, NULL, NULL);
}
/* For testing purpose, static route of ENCAP. */
DEFUN (no_encap_network,
no_encap_network_cmd,
"no network A.B.C.D/M rd ASN:nn_or_IP-address:nn",
NO_STR
"Specify a network to announce via BGP\n"
"IPv4 prefix\n"
"Specify Route Distinguisher\n"
"ENCAP Route Distinguisher\n"
"BGP tag\n"
"tag value\n")
{
int idx_ipv4 = 2;
int idx_rd = 4;
return bgp_static_unset_safi (AFI_IP, SAFI_ENCAP, vty, argv[idx_ipv4]->arg, argv[idx_rd]->arg, NULL,
0, NULL, NULL, NULL);
}
DEFUN (encapv6_network,
encapv6_network_cmd,
"network X:X::X:X/M rd ASN:nn_or_IP-address:nn [route-map WORD]",
"Specify a network to announce via BGP\n"
"IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n"
"Specify Route Distinguisher\n"
"VPN Route Distinguisher\n"
"route map\n"
"route map name\n")
{
int idx_ipv6 = 1;
int idx_rd = 3;
int idx_rmap = 5;
const char *rmap_str = (argc == 6) ? argv[idx_rmap]->arg : NULL;
return bgp_static_set_safi (AFI_IP6, SAFI_ENCAP, vty, argv[idx_ipv6]->arg,
argv[idx_rd]->arg, NULL, rmap_str, 0, NULL,
NULL, NULL, NULL);
}
DEFUN (no_encapv6_network,
no_encapv6_network_cmd,
"no network X:X::X:X/M rd ASN:nn_or_IP-address:nn [route-map WORD]",
NO_STR
"Specify a network to announce via BGP\n"
"IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n"
"Specify Route Distinguisher\n"
"VPN Route Distinguisher\n"
"route map\n"
"route map name\n")
{
int idx_ipv6 = 2;
int idx_rd = 4;
return bgp_static_unset_safi (AFI_IP6, SAFI_ENCAP, vty, argv[idx_ipv6]->arg,
argv[idx_rd]->arg, NULL, 0, NULL, NULL, NULL);
}
static int
show_adj_route_encap (struct vty *vty, struct peer *peer, struct prefix_rd *prd)
{
struct bgp *bgp;
struct bgp_table *table;
struct bgp_node *rn;
struct bgp_node *rm;
struct attr *attr;
int rd_header;
int header = 1;
char v4_header[] = " Network Next Hop Metric LocPrf Weight Path%s";
bgp = bgp_get_default ();
if (bgp == NULL)
{
vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
return CMD_WARNING;
}
for (rn = bgp_table_top (bgp->rib[AFI_IP][SAFI_ENCAP]); rn;
rn = bgp_route_next (rn))
{
if (prd && memcmp (rn->p.u.val, prd->val, 8) != 0)
continue;
if ((table = rn->info) != NULL)
{
rd_header = 1;
for (rm = bgp_table_top (table); rm; rm = bgp_route_next (rm))
if ((attr = rm->info) != NULL)
{
if (header)
{
vty_out (vty, "BGP table version is 0, local router ID is %s%s",
inet_ntoa (bgp->router_id), VTY_NEWLINE);
vty_out (vty, "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal%s",
VTY_NEWLINE);
vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s%s",
VTY_NEWLINE, VTY_NEWLINE);
vty_out (vty, v4_header, VTY_NEWLINE);
header = 0;
}
if (rd_header)
{
u_int16_t type;
struct rd_as rd_as;
struct rd_ip rd_ip;
u_char *pnt;
pnt = rn->p.u.val;
vty_out (vty, "Route Distinguisher: ");
/* Decode RD type. */
type = decode_rd_type (pnt);
switch (type) {
case RD_TYPE_AS:
decode_rd_as (pnt + 2, &rd_as);
vty_out (vty, "%u:%d", rd_as.as, rd_as.val);
break;
case RD_TYPE_IP:
decode_rd_ip (pnt + 2, &rd_ip);
vty_out (vty, "%s:%d", inet_ntoa (rd_ip.ip), rd_ip.val);
break;
default:
vty_out (vty, "unknown RD type");
}
vty_out (vty, "%s", VTY_NEWLINE);
rd_header = 0;
}
route_vty_out_tmp (vty, &rm->p, attr, SAFI_ENCAP, 0, NULL);
}
}
}
return CMD_SUCCESS;
}
int
bgp_show_encap (
struct vty *vty,
afi_t afi,
struct prefix_rd *prd,
enum bgp_show_type type,
void *output_arg,
int tags)
{
struct bgp *bgp;
struct bgp_table *table;
struct bgp_node *rn;
struct bgp_node *rm;
struct bgp_info *ri;
int rd_header;
int header = 1;
char v4_header[] = " Network Next Hop Metric LocPrf Weight Path%s";
char v4_header_tag[] = " Network Next Hop In tag/Out tag%s";
unsigned long output_count = 0;
unsigned long total_count = 0;
bgp = bgp_get_default ();
if (bgp == NULL)
{
vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
return CMD_WARNING;
}
if ((afi != AFI_IP) && (afi != AFI_IP6)) {
vty_out (vty, "Afi %d not supported%s", afi, VTY_NEWLINE);
return CMD_WARNING;
}
for (rn = bgp_table_top (bgp->rib[afi][SAFI_ENCAP]); rn; rn = bgp_route_next (rn))
{
if (prd && memcmp (rn->p.u.val, prd->val, 8) != 0)
continue;
if ((table = rn->info) != NULL)
{
rd_header = 1;
for (rm = bgp_table_top (table); rm; rm = bgp_route_next (rm))
for (ri = rm->info; ri; ri = ri->next)
{
total_count++;
if (type == bgp_show_type_neighbor)
{
union sockunion *su = output_arg;
if (ri->peer->su_remote == NULL || ! sockunion_same(ri->peer->su_remote, su))
continue;
}
if (header)
{
if (tags)
vty_out (vty, v4_header_tag, VTY_NEWLINE);
else
{
vty_out (vty, "BGP table version is 0, local router ID is %s%s",
inet_ntoa (bgp->router_id), VTY_NEWLINE);
vty_out (vty, "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal%s",
VTY_NEWLINE);
vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s%s",
VTY_NEWLINE, VTY_NEWLINE);
vty_out (vty, v4_header, VTY_NEWLINE);
}
header = 0;
}
if (rd_header)
{
u_int16_t type;
struct rd_as rd_as;
struct rd_ip rd_ip;
u_char *pnt;
pnt = rn->p.u.val;
/* Decode RD type. */
type = decode_rd_type (pnt);
vty_out (vty, "Route Distinguisher: ");
switch (type) {
case RD_TYPE_AS:
decode_rd_as (pnt + 2, &rd_as);
vty_out (vty, "%u:%d", rd_as.as, rd_as.val);
break;
case RD_TYPE_IP:
decode_rd_ip (pnt + 2, &rd_ip);
vty_out (vty, "%s:%d", inet_ntoa (rd_ip.ip), rd_ip.val);
break;
default:
vty_out (vty, "Unknown RD type");
break;
}
vty_out (vty, "%s", VTY_NEWLINE);
rd_header = 0;
}
if (tags)
route_vty_out_tag (vty, &rm->p, ri, 0, SAFI_ENCAP, NULL);
else
route_vty_out (vty, &rm->p, ri, 0, SAFI_ENCAP, NULL);
output_count++;
}
}
}
if (output_count == 0)
{
vty_out (vty, "No prefixes displayed, %ld exist%s", total_count, VTY_NEWLINE);
}
else
vty_out (vty, "%sDisplayed %ld routes and %ld total paths%s",
VTY_NEWLINE, output_count, total_count, VTY_NEWLINE);
return CMD_SUCCESS;
}
DEFUN (show_bgp_ipv4_encap_rd,
show_bgp_ipv4_encap_rd_cmd,
"show [ip] bgp ipv4 encap rd ASN:nn_or_IP-address:nn",
SHOW_STR
IP_STR
BGP_STR
"Address Family\n"
"Display ENCAP NLRI specific information\n"
"Display information for a route distinguisher\n"
"ENCAP Route Distinguisher\n")
{
int idx_rd = 5;
int ret;
struct prefix_rd prd;
ret = str2prefix_rd (argv[idx_rd]->arg, &prd);
if (! ret)
{
vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);
return CMD_WARNING;
}
return bgp_show_encap (vty, AFI_IP, &prd, bgp_show_type_normal, NULL, 0);
}
DEFUN (show_bgp_ipv6_encap_rd,
show_bgp_ipv6_encap_rd_cmd,
"show [ip] bgp ipv6 encap rd ASN:nn_or_IP-address:nn",
SHOW_STR
IP_STR
BGP_STR
"Address Family\n"
"Display ENCAP NLRI specific information\n"
"Display information for a route distinguisher\n"
"ENCAP Route Distinguisher\n"
"Display BGP tags for prefixes\n")
{
int idx_rd = 5;
int ret;
struct prefix_rd prd;
ret = str2prefix_rd (argv[idx_rd]->arg, &prd);
if (! ret)
{
vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);
return CMD_WARNING;
}
return bgp_show_encap (vty, AFI_IP6, &prd, bgp_show_type_normal, NULL, 0);
}
DEFUN (show_bgp_ipv4_encap_tags,
show_bgp_ipv4_encap_tags_cmd,
"show [ip] bgp ipv4 encap tags",
SHOW_STR
IP_STR
BGP_STR
"Address Family\n"
"Display ENCAP NLRI specific information\n"
"Display BGP tags for prefixes\n")
{
return bgp_show_encap (vty, AFI_IP, NULL, bgp_show_type_normal, NULL, 1);
}
DEFUN (show_bgp_ipv6_encap_tags,
show_bgp_ipv6_encap_tags_cmd,
"show [ip] bgp ipv6 encap tags",
SHOW_STR
IP_STR
BGP_STR
"Address Family\n"
"Display ENCAP NLRI specific information\n"
"Display BGP tags for prefixes\n")
{
return bgp_show_encap (vty, AFI_IP6, NULL, bgp_show_type_normal, NULL, 1);
}
DEFUN (show_bgp_ipv4_encap_rd_tags,
show_bgp_ipv4_encap_rd_tags_cmd,
"show [ip] bgp ipv4 encap rd ASN:nn_or_IP-address:nn tags",
SHOW_STR
IP_STR
BGP_STR
"Address Family\n"
"Display ENCAP NLRI specific information\n"
"Display information for a route distinguisher\n"
"ENCAP Route Distinguisher\n"
"Display BGP tags for prefixes\n")
{
int idx_rd = 5;
int ret;
struct prefix_rd prd;
ret = str2prefix_rd (argv[idx_rd]->arg, &prd);
if (! ret)
{
vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);
return CMD_WARNING;
}
return bgp_show_encap (vty, AFI_IP, &prd, bgp_show_type_normal, NULL, 1);
}
DEFUN (show_bgp_ipv6_encap_rd_tags,
show_bgp_ipv6_encap_rd_tags_cmd,
"show [ip] bgp ipv6 encap rd ASN:nn_or_IP-address:nn tags",
SHOW_STR
IP_STR
BGP_STR
"Address Family\n"
"Display ENCAP NLRI specific information\n"
"Display information for a route distinguisher\n"
"ENCAP Route Distinguisher\n"
"Display BGP tags for prefixes\n")
{
int idx_rd = 5;
int ret;
struct prefix_rd prd;
ret = str2prefix_rd (argv[idx_rd]->arg, &prd);
if (! ret)
{
vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);
return CMD_WARNING;
}
return bgp_show_encap (vty, AFI_IP6, &prd, bgp_show_type_normal, NULL, 1);
}
DEFUN (show_bgp_ipv4_encap_rd_neighbor_routes,
show_bgp_ipv4_encap_rd_neighbor_routes_cmd,
"show [ip] bgp ipv4 encap rd ASN:nn_or_IP-address:nn neighbors <A.B.C.D|X:X::X:X> routes",
SHOW_STR
IP_STR
BGP_STR
"Address Family\n"
"Display ENCAP NLRI specific information\n"
"Display information for a route distinguisher\n"
"ENCAP Route Distinguisher\n"
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
"Neighbor to display information about\n"
"Display routes learned from neighbor\n")
{
int idx_rd = 5;
int idx_peer = 7;
int ret;
union sockunion su;
struct peer *peer;
struct prefix_rd prd;
ret = str2prefix_rd (argv[idx_rd]->arg, &prd);
if (! ret)
{
vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);
return CMD_WARNING;
}
if (str2sockunion(argv[idx_peer]->arg, &su))
{
vty_out (vty, "Malformed address: %s%s", argv[idx_peer]->arg, VTY_NEWLINE);
return CMD_WARNING;
}
peer = peer_lookup (NULL, &su);
if (! peer || ! peer->afc[AFI_IP][SAFI_ENCAP])
{
vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE);
return CMD_WARNING;
}
return bgp_show_encap (vty, AFI_IP, &prd, bgp_show_type_neighbor, &su, 0);
}
DEFUN (show_bgp_ipv6_encap_rd_neighbor_routes,
show_bgp_ipv6_encap_rd_neighbor_routes_cmd,
"show [ip] bgp ipv6 encap rd ASN:nn_or_IP-address:nn neighbors <A.B.C.D|X:X::X:X> routes",
SHOW_STR
IP_STR
BGP_STR
"Address Family\n"
"Display ENCAP NLRI specific information\n"
"Display information for a route distinguisher\n"
"ENCAP Route Distinguisher\n"
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
"Neighbor to display information about\n"
"Display routes learned from neighbor\n")
{
int idx_rd = 5;
int idx_peer = 7;
int ret;
union sockunion su;
struct peer *peer;
struct prefix_rd prd;
ret = str2prefix_rd (argv[idx_rd]->arg, &prd);
if (! ret)
{
vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);
return CMD_WARNING;
}
if (str2sockunion(argv[idx_peer]->arg, &su))
{
vty_out (vty, "Malformed address: %s%s", argv[idx_peer]->arg, VTY_NEWLINE);
return CMD_WARNING;
}
peer = peer_lookup (NULL, &su);
if (! peer || ! peer->afc[AFI_IP6][SAFI_ENCAP])
{
vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE);
return CMD_WARNING;
}
return bgp_show_encap (vty, AFI_IP6, &prd, bgp_show_type_neighbor, &su, 0);
}
DEFUN (show_bgp_ipv4_encap_rd_neighbor_advertised_routes,
show_bgp_ipv4_encap_rd_neighbor_advertised_routes_cmd,
"show [ip] bgp ipv4 encap rd ASN:nn_or_IP-address:nn neighbors <A.B.C.D|X:X::X:X> advertised-routes",
SHOW_STR
IP_STR
BGP_STR
"Address Family\n"
"Display ENCAP NLRI specific information\n"
"Display information for a route distinguisher\n"
"ENCAP Route Distinguisher\n"
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
"Neighbor to display information about\n"
"Display the routes advertised to a BGP neighbor\n")
{
int idx_rd = 5;
int idx_peer = 7;
int ret;
struct peer *peer;
struct prefix_rd prd;
union sockunion su;
ret = str2sockunion (argv[idx_peer]->arg, &su);
if (ret < 0)
{
vty_out (vty, "%% Malformed address: %s%s", argv[idx_peer]->arg, VTY_NEWLINE);
return CMD_WARNING;
}
peer = peer_lookup (NULL, &su);
if (! peer || ! peer->afc[AFI_IP][SAFI_ENCAP])
{
vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE);
return CMD_WARNING;
}
ret = str2prefix_rd (argv[idx_rd]->arg, &prd);
if (! ret)
{
vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);
return CMD_WARNING;
}
return show_adj_route_encap (vty, peer, &prd);
}
DEFUN (show_bgp_ipv6_encap_rd_neighbor_advertised_routes,
show_bgp_ipv6_encap_rd_neighbor_advertised_routes_cmd,
"show [ip] bgp ipv6 encap rd ASN:nn_or_IP-address:nn neighbors <A.B.C.D|X:X::X:X> advertised-routes",
SHOW_STR
IP_STR
BGP_STR
"Address Family\n"
"Display ENCAP NLRI specific information\n"
"Display information for a route distinguisher\n"
"ENCAP Route Distinguisher\n"
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
"Neighbor to display information about\n"
"Display the routes advertised to a BGP neighbor\n")
{
int idx_rd = 5;
int idx_peer = 7;
int ret;
struct peer *peer;
struct prefix_rd prd;
union sockunion su;
ret = str2sockunion (argv[idx_peer]->arg, &su);
if (ret < 0)
{
vty_out (vty, "%% Malformed address: %s%s", argv[idx_peer]->arg, VTY_NEWLINE);
return CMD_WARNING;
}
peer = peer_lookup (NULL, &su);
if (! peer || ! peer->afc[AFI_IP6][SAFI_ENCAP])
{
vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE);
return CMD_WARNING;
}
ret = str2prefix_rd (argv[idx_rd]->arg, &prd);
if (! ret)
{
vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);
return CMD_WARNING;
}
return show_adj_route_encap (vty, peer, &prd);
}
void
bgp_encap_init (void)
{
install_element (BGP_ENCAP_NODE, &encap_network_cmd);
install_element (BGP_ENCAP_NODE, &no_encap_network_cmd);
install_element (BGP_ENCAPV6_NODE, &encapv6_network_cmd);
install_element (BGP_ENCAPV6_NODE, &no_encapv6_network_cmd);
install_element (VIEW_NODE, &show_bgp_ipv4_encap_rd_cmd);
install_element (VIEW_NODE, &show_bgp_ipv4_encap_tags_cmd);
install_element (VIEW_NODE, &show_bgp_ipv4_encap_rd_tags_cmd);
install_element (VIEW_NODE, &show_bgp_ipv4_encap_rd_neighbor_routes_cmd);
install_element (VIEW_NODE, &show_bgp_ipv4_encap_rd_neighbor_advertised_routes_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_encap_rd_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_encap_tags_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_encap_rd_tags_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_encap_rd_neighbor_routes_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_encap_rd_neighbor_advertised_routes_cmd);
}

View File

@ -1,31 +0,0 @@
/*
*
* Copyright 2009-2015, LabN Consulting, L.L.C.
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef _QUAGGA_BGP_ENCAP_H
#define _QUAGGA_BGP_ENCAP_H
#include "bgpd/bgp_route.h"
extern void bgp_encap_init (void);
extern int bgp_nlri_parse_encap (struct peer *, struct attr *, struct bgp_nlri *);
extern int bgp_show_encap (struct vty *vty, afi_t afi, struct prefix_rd *prd,
enum bgp_show_type type, void *output_arg, int tags);
#include "bgp_encap_types.h"
#endif /* _QUAGGA_BGP_ENCAP_H */

View File

@ -50,8 +50,6 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#include "bgpd/bgp_network.h"
#include "bgpd/bgp_mplsvpn.h"
#include "bgpd/bgp_evpn.h"
#include "bgpd/bgp_encap.h"
#include "bgpd/bgp_evpn.h"
#include "bgpd/bgp_advertise.h"
#include "bgpd/bgp_vty.h"
#include "bgpd/bgp_updgrp.h"
@ -1347,8 +1345,6 @@ bgp_nlri_parse (struct peer *peer, struct attr *attr, struct bgp_nlri *packet, i
return bgp_nlri_parse_ip (peer, mp_withdraw?NULL:attr, packet);
case SAFI_MPLS_VPN:
return bgp_nlri_parse_vpn (peer, mp_withdraw?NULL:attr, packet);
case SAFI_ENCAP:
return bgp_nlri_parse_encap (peer, mp_withdraw?NULL:attr, packet);
case SAFI_EVPN:
return bgp_nlri_parse_evpn (peer, attr, packet, mp_withdraw);
}

View File

@ -53,7 +53,6 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#include "bgpd/bgp_filter.h"
#include "bgpd/bgp_fsm.h"
#include "bgpd/bgp_mplsvpn.h"
#include "bgpd/bgp_encap.h"
#include "bgpd/bgp_nexthop.h"
#include "bgpd/bgp_damp.h"
#include "bgpd/bgp_advertise.h"
@ -7840,12 +7839,6 @@ bgp_show (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
return bgp_show_mpls_vpn(vty, afi, NULL, type, output_arg,
0, use_json);
}
if (safi == SAFI_ENCAP)
{
return bgp_show_encap(vty, afi, NULL, type, output_arg,
0);
}
table = bgp->rib[afi][safi];
@ -8217,7 +8210,7 @@ bgp_show_lcommunity_list (struct vty *vty, struct bgp *bgp, const char *lcom,
DEFUN (show_ip_bgp_large_community_list,
show_ip_bgp_large_community_list_cmd,
"show [ip] bgp [<view|vrf> WORD] [<ipv4|ipv6> [<unicast|multicast|vpn|encap>]] large-community-list <(1-500)|WORD> [json]",
"show [ip] bgp [<view|vrf> WORD] [<ipv4|ipv6> [<unicast|multicast|vpn>]] large-community-list <(1-500)|WORD> [json]",
SHOW_STR
IP_STR
BGP_STR
@ -8227,7 +8220,6 @@ DEFUN (show_ip_bgp_large_community_list,
"Address Family modifier\n"
"Address Family modifier\n"
"Address Family modifier\n"
"Address Family modifier\n"
"Display routes matching the large-community-list\n"
"large-community-list number\n"
"large-community-list name\n"
@ -8263,7 +8255,7 @@ DEFUN (show_ip_bgp_large_community_list,
}
DEFUN (show_ip_bgp_large_community,
show_ip_bgp_large_community_cmd,
"show [ip] bgp [<view|vrf> WORD] [<ipv4|ipv6> [<unicast|multicast|vpn|encap>]] large-community [AA:BB:CC] [json]",
"show [ip] bgp [<view|vrf> WORD] [<ipv4|ipv6> [<unicast|multicast|vpn>]] large-community [AA:BB:CC] [json]",
SHOW_STR
IP_STR
BGP_STR
@ -8273,7 +8265,6 @@ DEFUN (show_ip_bgp_large_community,
"Address Family modifier\n"
"Address Family modifier\n"
"Address Family modifier\n"
"Address Family modifier\n"
"Display routes matching the large-communities\n"
"List of large-community numbers\n"
JSON_STR)
@ -8429,8 +8420,6 @@ DEFUN (show_ip_bgp,
if (safi == SAFI_MPLS_VPN)
return bgp_show_mpls_vpn (vty, afi, NULL, bgp_show_type_normal, NULL, 0, uj);
else if (safi == SAFI_ENCAP)
return bgp_show_encap (vty, afi, NULL, bgp_show_type_normal, NULL, 0);
else
return bgp_show (vty, bgp, afi, safi, sh_type, NULL, uj);
}
@ -9214,7 +9203,7 @@ bgp_peer_counts (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, u_c
DEFUN (show_ip_bgp_instance_neighbor_prefix_counts,
show_ip_bgp_instance_neighbor_prefix_counts_cmd,
"show [ip] bgp [<view|vrf> WORD] [<ipv4|ipv6> [<unicast|multicast|vpn|encap>]] "
"show [ip] bgp [<view|vrf> WORD] [<ipv4|ipv6> [<unicast|multicast|vpn>]] "
"neighbors <A.B.C.D|X:X::X:X|WORD> prefix-counts [json]",
SHOW_STR
IP_STR
@ -9225,7 +9214,6 @@ DEFUN (show_ip_bgp_instance_neighbor_prefix_counts,
"Address Family modifier\n"
"Address Family modifier\n"
"Address Family modifier\n"
"Address Family modifier\n"
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
"Neighbor to display information about\n"

View File

@ -71,7 +71,6 @@ bgp_node_afi (struct vty *vty)
case BGP_IPV6_NODE:
case BGP_IPV6M_NODE:
case BGP_VPNV6_NODE:
case BGP_ENCAPV6_NODE:
afi = AFI_IP6;
break;
case BGP_EVPN_NODE:
@ -92,10 +91,6 @@ bgp_node_safi (struct vty *vty)
safi_t safi;
switch (vty->node)
{
case BGP_ENCAP_NODE:
case BGP_ENCAPV6_NODE:
safi = SAFI_ENCAP;
break;
case BGP_VPNV4_NODE:
case BGP_VPNV6_NODE:
safi = SAFI_MPLS_VPN;
@ -160,7 +155,7 @@ argv_find_and_parse_afi(struct cmd_token **argv, int argc, int *index, afi_t *af
return ret;
}
/* supports <unicast|multicast|vpn|encap> */
/* supports <unicast|multicast|vpn> */
safi_t
bgp_vty_safi_from_arg(const char *safi_str)
{
@ -169,8 +164,6 @@ bgp_vty_safi_from_arg(const char *safi_str)
safi = SAFI_MULTICAST;
else if (strncmp (safi_str, "u", 1) == 0)
safi = SAFI_UNICAST;
else if (strncmp (safi_str, "e", 1) == 0)
safi = SAFI_ENCAP;
else if (strncmp (safi_str, "v", 1) == 0)
safi = SAFI_MPLS_VPN;
return safi;
@ -198,12 +191,6 @@ argv_find_and_parse_safi (struct cmd_token **argv, int argc, int *index, safi_t
if (safi)
*safi = SAFI_MPLS_VPN;
}
else if (argv_find (argv, argc, "encap", index))
{
ret = 1;
if (safi)
*safi = SAFI_ENCAP;
}
else if (argv_find (argv, argc, "evpn", index))
{
ret = 1;
@ -223,12 +210,12 @@ argv_find_and_parse_safi (struct cmd_token **argv, int argc, int *index, safi_t
* that is being parsed.
*
* The show commands are generally of the form:
* "show [ip] bgp [<view|vrf> WORD] [<ipv4|ipv6> [<unicast|multicast|vpn|encap>]] ..."
* "show [ip] bgp [<view|vrf> WORD] [<ipv4|ipv6> [<unicast|multicast|vpn>]] ..."
*
* Since we use argv_find if the show command in particular doesn't have:
* [ip]
* [<view|vrf> WORD]
* [<ipv4|ipv6> [<unicast|multicast|vpn|encap>]]
* [<ipv4|ipv6> [<unicast|multicast|vpn>]]
* The command parsing should still be ok.
*
* vty -> The vty for the command so we can output some useful data in
@ -5656,7 +5643,7 @@ DEFUN (no_neighbor_addpath_tx_bestpath_per_as,
DEFUN_NOSH (address_family_ipv4_safi,
address_family_ipv4_safi_cmd,
"address-family ipv4 [<unicast|multicast|vpn|encap>]",
"address-family ipv4 [<unicast|multicast|vpn>]",
"Enter Address Family command mode\n"
"Address Family\n"
BGP_SAFI_HELP_STR)
@ -5669,9 +5656,6 @@ DEFUN_NOSH (address_family_ipv4_safi,
case SAFI_MULTICAST:
vty->node = BGP_IPV4M_NODE;
break;
case SAFI_ENCAP:
vty->node = BGP_ENCAP_NODE;
break;
case SAFI_MPLS_VPN:
vty->node = BGP_VPNV4_NODE;
break;
@ -5689,7 +5673,7 @@ DEFUN_NOSH (address_family_ipv4_safi,
DEFUN_NOSH (address_family_ipv6_safi,
address_family_ipv6_safi_cmd,
"address-family ipv6 [<unicast|multicast|vpn|encap>]",
"address-family ipv6 [<unicast|multicast|vpn>]",
"Enter Address Family command mode\n"
"Address Family\n"
BGP_SAFI_HELP_STR)
@ -5702,9 +5686,6 @@ DEFUN_NOSH (address_family_ipv6_safi,
case SAFI_MULTICAST:
vty->node = BGP_IPV6M_NODE;
break;
case SAFI_ENCAP:
vty->node = BGP_ENCAPV6_NODE;
break;
case SAFI_MPLS_VPN:
vty->node = BGP_VPNV6_NODE;
break;
@ -5744,28 +5725,6 @@ DEFUN_NOSH (address_family_vpnv6,
}
#endif
DEFUN_NOSH (address_family_encap,
address_family_encap_cmd,
"address-family <encap|encapv4>",
"Enter Address Family command mode\n"
"Address Family\n"
"Address Family\n")
{
vty->node = BGP_ENCAP_NODE;
return CMD_SUCCESS;
}
DEFUN_NOSH (address_family_encapv6,
address_family_encapv6_cmd,
"address-family encapv6",
"Enter Address Family command mode\n"
"Address Family\n")
{
vty->node = BGP_ENCAPV6_NODE;
return CMD_SUCCESS;
}
DEFUN_NOSH (address_family_evpn,
address_family_evpn_cmd,
"address-family <l2vpn evpn>",
@ -5789,8 +5748,6 @@ DEFUN_NOSH (exit_address_family,
|| vty->node == BGP_IPV6_NODE
|| vty->node == BGP_IPV6M_NODE
|| vty->node == BGP_VPNV6_NODE
|| vty->node == BGP_ENCAP_NODE
|| vty->node == BGP_ENCAPV6_NODE
|| vty->node == BGP_EVPN_NODE)
vty->node = BGP_NODE;
return CMD_SUCCESS;
@ -10094,20 +10051,6 @@ static struct cmd_node bgp_vpnv6_node =
1
};
static struct cmd_node bgp_encap_node =
{
BGP_ENCAP_NODE,
"%s(config-router-af-encap)# ",
1
};
static struct cmd_node bgp_encapv6_node =
{
BGP_ENCAPV6_NODE,
"%s(config-router-af-encapv6)# ",
1
};
static struct cmd_node bgp_evpn_node =
{
BGP_EVPN_NODE,
@ -10128,8 +10071,6 @@ bgp_vty_init (void)
install_node (&bgp_ipv6_multicast_node, NULL);
install_node (&bgp_vpnv4_node, NULL);
install_node (&bgp_vpnv6_node, NULL);
install_node (&bgp_encap_node, NULL);
install_node (&bgp_encapv6_node, NULL);
install_node (&bgp_evpn_node, NULL);
/* Install default VTY commands to new nodes. */
@ -10140,8 +10081,6 @@ bgp_vty_init (void)
install_default (BGP_IPV6M_NODE);
install_default (BGP_VPNV4_NODE);
install_default (BGP_VPNV6_NODE);
install_default (BGP_ENCAP_NODE);
install_default (BGP_ENCAPV6_NODE);
install_default (BGP_EVPN_NODE);
/* "bgp multiple-instance" commands. */
@ -10354,8 +10293,6 @@ bgp_vty_init (void)
install_element (BGP_IPV6M_NODE, &neighbor_activate_cmd);
install_element (BGP_VPNV4_NODE, &neighbor_activate_cmd);
install_element (BGP_VPNV6_NODE, &neighbor_activate_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_activate_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_activate_cmd);
install_element (BGP_EVPN_NODE, &neighbor_activate_cmd);
/* "no neighbor activate" commands. */
@ -10366,8 +10303,6 @@ bgp_vty_init (void)
install_element (BGP_IPV6M_NODE, &no_neighbor_activate_cmd);
install_element (BGP_VPNV4_NODE, &no_neighbor_activate_cmd);
install_element (BGP_VPNV6_NODE, &no_neighbor_activate_cmd);
install_element (BGP_ENCAP_NODE, &no_neighbor_activate_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_activate_cmd);
install_element (BGP_EVPN_NODE, &no_neighbor_activate_cmd);
/* "neighbor peer-group" set commands.
@ -10383,8 +10318,6 @@ bgp_vty_init (void)
install_element (BGP_IPV6M_NODE, &neighbor_set_peer_group_cmd);
install_element (BGP_VPNV4_NODE, &neighbor_set_peer_group_cmd);
install_element (BGP_VPNV6_NODE, &neighbor_set_peer_group_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_set_peer_group_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_set_peer_group_cmd);
/* "no neighbor peer-group unset" commands. */
install_element (BGP_NODE, &no_neighbor_set_peer_group_cmd);
@ -10394,8 +10327,6 @@ bgp_vty_init (void)
install_element (BGP_IPV6M_NODE, &no_neighbor_set_peer_group_cmd);
install_element (BGP_VPNV4_NODE, &no_neighbor_set_peer_group_cmd);
install_element (BGP_VPNV6_NODE, &no_neighbor_set_peer_group_cmd);
install_element (BGP_ENCAP_NODE, &no_neighbor_set_peer_group_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_set_peer_group_cmd);
/* "neighbor softreconfiguration inbound" commands.*/
install_element (BGP_NODE, &neighbor_soft_reconfiguration_cmd);
@ -10412,10 +10343,6 @@ bgp_vty_init (void)
install_element (BGP_VPNV4_NODE, &no_neighbor_soft_reconfiguration_cmd);
install_element (BGP_VPNV6_NODE, &neighbor_soft_reconfiguration_cmd);
install_element (BGP_VPNV6_NODE, &no_neighbor_soft_reconfiguration_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_soft_reconfiguration_cmd);
install_element (BGP_ENCAP_NODE, &no_neighbor_soft_reconfiguration_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_soft_reconfiguration_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_soft_reconfiguration_cmd);
/* "neighbor attribute-unchanged" commands. */
install_element (BGP_NODE, &neighbor_attr_unchanged_cmd);
@ -10433,12 +10360,6 @@ bgp_vty_init (void)
install_element (BGP_VPNV6_NODE, &neighbor_attr_unchanged_cmd);
install_element (BGP_VPNV6_NODE, &no_neighbor_attr_unchanged_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_attr_unchanged_cmd);
install_element (BGP_ENCAP_NODE, &no_neighbor_attr_unchanged_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_attr_unchanged_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_attr_unchanged_cmd);
install_element (BGP_EVPN_NODE, &neighbor_attr_unchanged_cmd);
install_element (BGP_EVPN_NODE, &no_neighbor_attr_unchanged_cmd);
@ -10461,10 +10382,6 @@ bgp_vty_init (void)
install_element (BGP_VPNV4_NODE, &no_neighbor_nexthop_self_cmd);
install_element (BGP_VPNV6_NODE, &neighbor_nexthop_self_cmd);
install_element (BGP_VPNV6_NODE, &no_neighbor_nexthop_self_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_nexthop_self_cmd);
install_element (BGP_ENCAP_NODE, &no_neighbor_nexthop_self_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_nexthop_self_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_nexthop_self_cmd);
/* "neighbor next-hop-self force" commands. */
install_element (BGP_NODE, &neighbor_nexthop_self_force_cmd);
@ -10555,10 +10472,6 @@ bgp_vty_init (void)
install_element (BGP_VPNV6_NODE, &no_neighbor_remove_private_as_replace_as_cmd);
install_element (BGP_VPNV6_NODE, &neighbor_remove_private_as_all_replace_as_cmd);
install_element (BGP_VPNV6_NODE, &no_neighbor_remove_private_as_all_replace_as_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_remove_private_as_cmd);
install_element (BGP_ENCAP_NODE, &no_neighbor_remove_private_as_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_remove_private_as_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_remove_private_as_cmd);
/* "neighbor send-community" commands.*/
install_element (BGP_NODE, &neighbor_send_community_cmd);
@ -10589,14 +10502,6 @@ bgp_vty_init (void)
install_element (BGP_VPNV6_NODE, &neighbor_send_community_type_cmd);
install_element (BGP_VPNV6_NODE, &no_neighbor_send_community_cmd);
install_element (BGP_VPNV6_NODE, &no_neighbor_send_community_type_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_send_community_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_send_community_type_cmd);
install_element (BGP_ENCAP_NODE, &no_neighbor_send_community_cmd);
install_element (BGP_ENCAP_NODE, &no_neighbor_send_community_type_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_send_community_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_send_community_type_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_send_community_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_send_community_type_cmd);
/* "neighbor route-reflector" commands.*/
install_element (BGP_NODE, &neighbor_route_reflector_client_cmd);
@ -10613,10 +10518,6 @@ bgp_vty_init (void)
install_element (BGP_VPNV4_NODE, &no_neighbor_route_reflector_client_cmd);
install_element (BGP_VPNV6_NODE, &neighbor_route_reflector_client_cmd);
install_element (BGP_VPNV6_NODE, &no_neighbor_route_reflector_client_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_route_reflector_client_cmd);
install_element (BGP_ENCAP_NODE, &no_neighbor_route_reflector_client_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_route_reflector_client_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_route_reflector_client_cmd);
/* "neighbor route-server" commands.*/
install_element (BGP_NODE, &neighbor_route_server_client_cmd);
@ -10633,10 +10534,6 @@ bgp_vty_init (void)
install_element (BGP_VPNV4_NODE, &no_neighbor_route_server_client_cmd);
install_element (BGP_VPNV6_NODE, &neighbor_route_server_client_cmd);
install_element (BGP_VPNV6_NODE, &no_neighbor_route_server_client_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_route_server_client_cmd);
install_element (BGP_ENCAP_NODE, &no_neighbor_route_server_client_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_route_server_client_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_route_server_client_cmd);
/* "neighbor addpath-tx-all-paths" commands.*/
install_element (BGP_NODE, &neighbor_addpath_tx_all_paths_cmd);
@ -10759,10 +10656,6 @@ bgp_vty_init (void)
install_element (BGP_VPNV4_NODE, &no_neighbor_weight_cmd);
install_element (BGP_VPNV6_NODE, &neighbor_weight_cmd);
install_element (BGP_VPNV6_NODE, &no_neighbor_weight_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_weight_cmd);
install_element (BGP_ENCAP_NODE, &no_neighbor_weight_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_weight_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_weight_cmd);
/* "neighbor override-capability" commands. */
install_element (BGP_NODE, &neighbor_override_capability_cmd);
@ -10803,10 +10696,6 @@ bgp_vty_init (void)
install_element (BGP_VPNV4_NODE, &no_neighbor_distribute_list_cmd);
install_element (BGP_VPNV6_NODE, &neighbor_distribute_list_cmd);
install_element (BGP_VPNV6_NODE, &no_neighbor_distribute_list_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_distribute_list_cmd);
install_element (BGP_ENCAP_NODE, &no_neighbor_distribute_list_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_distribute_list_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_distribute_list_cmd);
/* "neighbor prefix-list" commands. */
install_element (BGP_NODE, &neighbor_prefix_list_cmd);
@ -10823,10 +10712,6 @@ bgp_vty_init (void)
install_element (BGP_VPNV4_NODE, &no_neighbor_prefix_list_cmd);
install_element (BGP_VPNV6_NODE, &neighbor_prefix_list_cmd);
install_element (BGP_VPNV6_NODE, &no_neighbor_prefix_list_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_prefix_list_cmd);
install_element (BGP_ENCAP_NODE, &no_neighbor_prefix_list_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_prefix_list_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_prefix_list_cmd);
/* "neighbor filter-list" commands. */
install_element (BGP_NODE, &neighbor_filter_list_cmd);
@ -10843,10 +10728,6 @@ bgp_vty_init (void)
install_element (BGP_VPNV4_NODE, &no_neighbor_filter_list_cmd);
install_element (BGP_VPNV6_NODE, &neighbor_filter_list_cmd);
install_element (BGP_VPNV6_NODE, &no_neighbor_filter_list_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_filter_list_cmd);
install_element (BGP_ENCAP_NODE, &no_neighbor_filter_list_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_filter_list_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_filter_list_cmd);
/* "neighbor route-map" commands. */
install_element (BGP_NODE, &neighbor_route_map_cmd);
@ -10863,10 +10744,6 @@ bgp_vty_init (void)
install_element (BGP_VPNV4_NODE, &no_neighbor_route_map_cmd);
install_element (BGP_VPNV6_NODE, &neighbor_route_map_cmd);
install_element (BGP_VPNV6_NODE, &no_neighbor_route_map_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_route_map_cmd);
install_element (BGP_ENCAP_NODE, &no_neighbor_route_map_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_route_map_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_route_map_cmd);
/* "neighbor unsuppress-map" commands. */
install_element (BGP_NODE, &neighbor_unsuppress_map_cmd);
@ -10883,10 +10760,6 @@ bgp_vty_init (void)
install_element (BGP_VPNV4_NODE, &no_neighbor_unsuppress_map_cmd);
install_element (BGP_VPNV6_NODE, &neighbor_unsuppress_map_cmd);
install_element (BGP_VPNV6_NODE, &no_neighbor_unsuppress_map_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_unsuppress_map_cmd);
install_element (BGP_ENCAP_NODE, &no_neighbor_unsuppress_map_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_unsuppress_map_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_unsuppress_map_cmd);
/* "neighbor maximum-prefix" commands. */
install_element (BGP_NODE, &neighbor_maximum_prefix_cmd);
@ -10939,22 +10812,6 @@ bgp_vty_init (void)
install_element (BGP_VPNV6_NODE, &neighbor_maximum_prefix_threshold_restart_cmd);
install_element (BGP_VPNV6_NODE, &no_neighbor_maximum_prefix_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_threshold_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_warning_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_threshold_warning_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_restart_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_maximum_prefix_threshold_restart_cmd);
install_element (BGP_ENCAP_NODE, &no_neighbor_maximum_prefix_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_threshold_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_warning_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_threshold_warning_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_restart_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_maximum_prefix_threshold_restart_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_maximum_prefix_cmd);
/* "neighbor allowas-in" */
install_element (BGP_NODE, &neighbor_allowas_in_cmd);
install_element (BGP_NODE, &no_neighbor_allowas_in_cmd);
@ -10970,10 +10827,6 @@ bgp_vty_init (void)
install_element (BGP_VPNV4_NODE, &no_neighbor_allowas_in_cmd);
install_element (BGP_VPNV6_NODE, &neighbor_allowas_in_cmd);
install_element (BGP_VPNV6_NODE, &no_neighbor_allowas_in_cmd);
install_element (BGP_ENCAP_NODE, &neighbor_allowas_in_cmd);
install_element (BGP_ENCAP_NODE, &no_neighbor_allowas_in_cmd);
install_element (BGP_ENCAPV6_NODE, &neighbor_allowas_in_cmd);
install_element (BGP_ENCAPV6_NODE, &no_neighbor_allowas_in_cmd);
/* address-family commands. */
install_element (BGP_NODE, &address_family_ipv4_safi_cmd);
@ -10983,9 +10836,6 @@ bgp_vty_init (void)
install_element (BGP_NODE, &address_family_vpnv6_cmd);
#endif /* KEEP_OLD_VPN_COMMANDS */
install_element (BGP_NODE, &address_family_encap_cmd);
install_element (BGP_NODE, &address_family_encapv6_cmd);
install_element (BGP_NODE, &address_family_evpn_cmd);
/* "exit-address-family" command. */
@ -10995,8 +10845,6 @@ bgp_vty_init (void)
install_element (BGP_IPV6M_NODE, &exit_address_family_cmd);
install_element (BGP_VPNV4_NODE, &exit_address_family_cmd);
install_element (BGP_VPNV6_NODE, &exit_address_family_cmd);
install_element (BGP_ENCAP_NODE, &exit_address_family_cmd);
install_element (BGP_ENCAPV6_NODE, &exit_address_family_cmd);
install_element (BGP_EVPN_NODE, &exit_address_family_cmd);
/* "clear ip bgp commands" */

View File

@ -28,9 +28,8 @@ struct bgp;
#define BGP_AFI_CMD_STR "<ipv4|ipv6>"
#define BGP_AFI_HELP_STR "Address Family\nAddress Family\n"
#define BGP_SAFI_CMD_STR "<unicast|multicast|vpn|encap>"
#define BGP_SAFI_CMD_STR "<unicast|multicast|vpn>"
#define BGP_SAFI_HELP_STR \
"Address Family modifier\n" \
"Address Family modifier\n" \
"Address Family modifier\n" \
"Address Family modifier\n"

View File

@ -61,7 +61,6 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#include "bgpd/bgp_nexthop.h"
#include "bgpd/bgp_damp.h"
#include "bgpd/bgp_mplsvpn.h"
#include "bgpd/bgp_encap.h"
#if ENABLE_BGP_VNC
#include "bgpd/rfapi/bgp_rfapi_cfg.h"
#include "bgpd/rfapi/rfapi_backend.h"
@ -7695,7 +7694,6 @@ bgp_init (void)
bgp_route_map_init ();
bgp_scan_vty_init();
bgp_mplsvpn_init ();
bgp_encap_init ();
#if ENABLE_BGP_VNC
rfapi_init ();
#endif

View File

@ -291,10 +291,9 @@ bgp_rfapi_is_vnc_configured (struct bgp *bgp)
DEFUN (vnc_advertise_un_method,
vnc_advertise_un_method_cmd,
"vnc advertise-un-method <encap-safi|encap-attr>",
"vnc advertise-un-method encap-attr",
VNC_CONFIG_STR
"Method of advertising UN addresses\n"
"Via Encapsulation SAFI\n"
"Via Tunnel Encap attribute (in VPN SAFI)\n")
{
VTY_DECLVAR_CONTEXT(bgp, bgp);

View File

@ -1047,8 +1047,6 @@ node_parent ( enum node_type node )
{
case BGP_VPNV4_NODE:
case BGP_VPNV6_NODE:
case BGP_ENCAP_NODE:
case BGP_ENCAPV6_NODE:
case BGP_VRF_POLICY_NODE:
case BGP_VNC_DEFAULTS_NODE:
case BGP_VNC_NVE_GROUP_NODE:
@ -1416,8 +1414,6 @@ cmd_exit (struct vty *vty)
case BGP_IPV4M_NODE:
case BGP_VPNV4_NODE:
case BGP_VPNV6_NODE:
case BGP_ENCAP_NODE:
case BGP_ENCAPV6_NODE:
case BGP_VRF_POLICY_NODE:
case BGP_VNC_DEFAULTS_NODE:
case BGP_VNC_NVE_GROUP_NODE:
@ -1481,8 +1477,6 @@ DEFUN (config_end,
case RIP_NODE:
case RIPNG_NODE:
case BGP_NODE:
case BGP_ENCAP_NODE:
case BGP_ENCAPV6_NODE:
case BGP_VRF_POLICY_NODE:
case BGP_VNC_DEFAULTS_NODE:
case BGP_VNC_NVE_GROUP_NODE:

View File

@ -98,8 +98,6 @@ enum node_type
BGP_IPV4M_NODE, /* BGP IPv4 multicast address family. */
BGP_IPV6_NODE, /* BGP IPv6 address family */
BGP_IPV6M_NODE, /* BGP IPv6 multicast address family. */
BGP_ENCAP_NODE, /* BGP ENCAP SAFI */
BGP_ENCAPV6_NODE, /* BGP ENCAP SAFI */
BGP_VRF_POLICY_NODE, /* BGP VRF policy */
BGP_VNC_DEFAULTS_NODE, /* BGP VNC nve defaults */
BGP_VNC_NVE_GROUP_NODE, /* BGP VNC nve group */

View File

@ -737,8 +737,6 @@ vty_end_config (struct vty *vty)
case BGP_NODE:
case BGP_VPNV4_NODE:
case BGP_VPNV6_NODE:
case BGP_ENCAP_NODE:
case BGP_ENCAPV6_NODE:
case BGP_VRF_POLICY_NODE:
case BGP_VNC_DEFAULTS_NODE:
case BGP_VNC_NVE_GROUP_NODE:

View File

@ -47,7 +47,6 @@ if BGPD
vtysh_scan += $(top_srcdir)/bgpd/bgp_bfd.c
vtysh_scan += $(top_srcdir)/bgpd/bgp_debug.c
vtysh_scan += $(top_srcdir)/bgpd/bgp_dump.c
vtysh_scan += $(top_srcdir)/bgpd/bgp_encap.c
vtysh_scan += $(top_srcdir)/bgpd/bgp_evpn_vty.c
vtysh_scan += $(top_srcdir)/bgpd/bgp_filter.c
vtysh_scan += $(top_srcdir)/bgpd/bgp_mplsvpn.c

View File

@ -306,7 +306,6 @@ vtysh_execute_func (const char *line, int pager)
if (ret == CMD_SUCCESS || ret == CMD_SUCCESS_DAEMON || ret == CMD_WARNING)
{
if ((saved_node == BGP_VPNV4_NODE || saved_node == BGP_VPNV6_NODE
|| saved_node == BGP_ENCAP_NODE || saved_node == BGP_ENCAPV6_NODE
|| saved_node == BGP_IPV4_NODE
|| saved_node == BGP_IPV6_NODE || saved_node == BGP_IPV4M_NODE
|| saved_node == BGP_IPV6M_NODE || saved_node == BGP_EVPN_NODE)
@ -927,18 +926,6 @@ static struct cmd_node bgp_vpnv6_node =
"%s(config-router-af)# "
};
static struct cmd_node bgp_encap_node =
{
BGP_ENCAP_NODE,
"%s(config-router-af)# "
};
static struct cmd_node bgp_encapv6_node =
{
BGP_ENCAPV6_NODE,
"%s(config-router-af)# "
};
static struct cmd_node bgp_ipv4_node =
{
BGP_IPV4_NODE,
@ -1137,31 +1124,6 @@ DEFUNSH (VTYSH_BGPD,
return CMD_SUCCESS;
}
DEFUNSH (VTYSH_BGPD,
address_family_encapv4,
address_family_encapv4_cmd,
"address-family [ipv4] <encap|encapv4>",
"Enter Address Family command mode\n"
"Address Family\n"
"Address Family\n"
"Address Family\n")
{
vty->node = BGP_ENCAP_NODE;
return CMD_SUCCESS;
}
DEFUNSH (VTYSH_BGPD,
address_family_encapv6,
address_family_encapv6_cmd,
"address-family [ipv6] encapv6",
"Enter Address Family command mode\n"
"Address Family\n"
"Address Family\n")
{
vty->node = BGP_ENCAPV6_NODE;
return CMD_SUCCESS;
}
DEFUNSH (VTYSH_BGPD,
address_family_ipv4,
address_family_ipv4_cmd,
@ -1548,8 +1510,6 @@ vtysh_exit (struct vty *vty)
break;
case BGP_VPNV4_NODE:
case BGP_VPNV6_NODE:
case BGP_ENCAP_NODE:
case BGP_ENCAPV6_NODE:
case BGP_IPV4_NODE:
case BGP_IPV4M_NODE:
case BGP_IPV6_NODE:
@ -1614,8 +1574,6 @@ DEFUNSH (VTYSH_BGPD,
|| vty->node == BGP_IPV4M_NODE
|| vty->node == BGP_VPNV4_NODE
|| vty->node == BGP_VPNV6_NODE
|| vty->node == BGP_ENCAP_NODE
|| vty->node == BGP_ENCAPV6_NODE
|| vty->node == BGP_IPV6_NODE
|| vty->node == BGP_IPV6M_NODE)
vty->node = BGP_NODE;
@ -3140,8 +3098,6 @@ vtysh_init_vty (void)
install_node (&zebra_node, NULL);
install_node (&bgp_vpnv4_node, NULL);
install_node (&bgp_vpnv6_node, NULL);
install_node (&bgp_encap_node, NULL);
install_node (&bgp_encapv6_node, NULL);
install_node (&bgp_ipv4_node, NULL);
install_node (&bgp_ipv4m_node, NULL);
install_node (&bgp_ipv6_node, NULL);
@ -3178,8 +3134,6 @@ vtysh_init_vty (void)
vtysh_install_default (ZEBRA_NODE);
vtysh_install_default (BGP_VPNV4_NODE);
vtysh_install_default (BGP_VPNV6_NODE);
vtysh_install_default (BGP_ENCAP_NODE);
vtysh_install_default (BGP_ENCAPV6_NODE);
vtysh_install_default (BGP_IPV4_NODE);
vtysh_install_default (BGP_IPV4M_NODE);
vtysh_install_default (BGP_IPV6_NODE);
@ -3245,10 +3199,6 @@ vtysh_init_vty (void)
install_element (BGP_VPNV4_NODE, &vtysh_quit_bgpd_cmd);
install_element (BGP_VPNV6_NODE, &vtysh_exit_bgpd_cmd);
install_element (BGP_VPNV6_NODE, &vtysh_quit_bgpd_cmd);
install_element (BGP_ENCAP_NODE, &vtysh_exit_bgpd_cmd);
install_element (BGP_ENCAP_NODE, &vtysh_quit_bgpd_cmd);
install_element (BGP_ENCAPV6_NODE, &vtysh_exit_bgpd_cmd);
install_element (BGP_ENCAPV6_NODE, &vtysh_quit_bgpd_cmd);
install_element (BGP_IPV4_NODE, &vtysh_exit_bgpd_cmd);
install_element (BGP_IPV4_NODE, &vtysh_quit_bgpd_cmd);
install_element (BGP_IPV4M_NODE, &vtysh_exit_bgpd_cmd);
@ -3298,8 +3248,6 @@ vtysh_init_vty (void)
install_element (BGP_IPV4M_NODE, &vtysh_end_all_cmd);
install_element (BGP_VPNV4_NODE, &vtysh_end_all_cmd);
install_element (BGP_VPNV6_NODE, &vtysh_end_all_cmd);
install_element (BGP_ENCAP_NODE, &vtysh_end_all_cmd);
install_element (BGP_ENCAPV6_NODE, &vtysh_end_all_cmd);
install_element (BGP_IPV6_NODE, &vtysh_end_all_cmd);
install_element (BGP_IPV6M_NODE, &vtysh_end_all_cmd);
install_element (BGP_VRF_POLICY_NODE, &vtysh_end_all_cmd);
@ -3349,8 +3297,6 @@ vtysh_init_vty (void)
install_element (CONFIG_NODE, &router_bgp_cmd);
install_element (BGP_NODE, &address_family_vpnv4_cmd);
install_element (BGP_NODE, &address_family_vpnv6_cmd);
install_element (BGP_NODE, &address_family_encapv4_cmd);
install_element (BGP_NODE, &address_family_encapv6_cmd);
#if defined(ENABLE_BGP_VNC)
install_element (BGP_NODE, &vnc_vrf_policy_cmd);
install_element (BGP_NODE, &vnc_defaults_cmd);
@ -3366,8 +3312,6 @@ vtysh_init_vty (void)
install_element (BGP_NODE, &address_family_evpn_cmd);
install_element (BGP_VPNV4_NODE, &exit_address_family_cmd);
install_element (BGP_VPNV6_NODE, &exit_address_family_cmd);
install_element (BGP_ENCAP_NODE, &exit_address_family_cmd);
install_element (BGP_ENCAPV6_NODE, &exit_address_family_cmd);
install_element (BGP_IPV4_NODE, &exit_address_family_cmd);
install_element (BGP_IPV4M_NODE, &exit_address_family_cmd);
install_element (BGP_IPV6_NODE, &exit_address_family_cmd);