bgpd: add network commands for encapv6

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
Renato Westphal 2017-05-19 12:34:26 -03:00
parent d81e237001
commit 4042205e76

View File

@ -232,6 +232,42 @@ DEFUN (no_encap_network,
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)
{
@ -752,6 +788,8 @@ 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);