diff options
author | G. Paul Ziemba <paulz@labn.net> | 2018-03-16 19:11:37 +0100 |
---|---|---|
committer | G. Paul Ziemba <paulz@labn.net> | 2018-03-20 06:13:43 +0100 |
commit | b9c7bc5ab0ee57f4052b625c0e76663f50c1249f (patch) | |
tree | 72a2ec7ecf75be31dc6bf7db63ae29446e9d760e /vtysh | |
parent | Merge pull request #1885 from msablic/pim_mtrace_client (diff) | |
download | frr-b9c7bc5ab0ee57f4052b625c0e76663f50c1249f.tar.xz frr-b9c7bc5ab0ee57f4052b625c0e76663f50c1249f.zip |
bgpd: new vpn-policy CLI
PR #1739 added code to leak routes between (default VRF) VPN safi and unicast RIBs in any VRF. That set of changes included temporary CLI including vpn-policy blocks to specify RD/RT/label/&c. After considerable discussion, we arrived at a consensus CLI shown below.
The code of this PR implements the vpn-specific parts of this syntax:
router bgp <as> [vrf <FOO>]
address-family <afi> unicast
rd (vpn|evpn) export (AS:NN | IP:nn)
label (vpn|evpn) export (0..1048575)
rt (vpn|evpn) (import|export|both) RTLIST...
nexthop vpn (import|export) (A.B.C.D | X:X::X:X)
route-map (vpn|evpn|vrf NAME) (import|export) MAP
[no] import|export [vpn|evpn|evpn8]
[no] import|export vrf NAME
User documentation of the vpn-specific parts of the above syntax is in PR #1937
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
Diffstat (limited to 'vtysh')
-rw-r--r-- | vtysh/vtysh.c | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 556ce2722..efef106d9 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -360,9 +360,7 @@ static int vtysh_execute_func(const char *line, int pager) } else if ((saved_node == KEYCHAIN_KEY_NODE || saved_node == LDP_PSEUDOWIRE_NODE || saved_node == LDP_IPV4_IFACE_NODE - || saved_node == LDP_IPV6_IFACE_NODE - || saved_node == BGP_VPNPOLICY_IPV4_NODE - || saved_node == BGP_VPNPOLICY_IPV6_NODE) + || saved_node == LDP_IPV6_IFACE_NODE) && (tried == 1)) { vtysh_execute("exit"); } else if (tried) { @@ -634,9 +632,7 @@ int vtysh_mark_file(const char *filename) } else if ((prev_node == BGP_EVPN_VNI_NODE) && (tried == 1)) { fprintf(outputfile, "exit-vni\n"); - } else if ((prev_node == KEYCHAIN_KEY_NODE - || prev_node == BGP_VPNPOLICY_IPV4_NODE - || prev_node == BGP_VPNPOLICY_IPV6_NODE) + } else if ((prev_node == KEYCHAIN_KEY_NODE) && (tried == 1)) { fprintf(outputfile, "exit\n"); } else if (tried) { @@ -1017,12 +1013,6 @@ static struct cmd_node bgp_evpn_node = {BGP_EVPN_NODE, static struct cmd_node bgp_evpn_vni_node = {BGP_EVPN_VNI_NODE, "%s(config-router-af-vni)# "}; -static struct cmd_node bgp_vpn_policy_ipv4_node = { - BGP_VPNPOLICY_IPV4_NODE, "%s(config-router-vpn-policy-ipv4)# ", 1}; - -static struct cmd_node bgp_vpn_policy_ipv6_node = { - BGP_VPNPOLICY_IPV6_NODE, "%s(config-router-vpn-policy-ipv6)# ", 1}; - static struct cmd_node bgp_ipv6l_node = {BGP_IPV6L_NODE, "%s(config-router-af)# "}; @@ -1274,20 +1264,6 @@ DEFUNSH(VTYSH_BGPD, bgp_evpn_vni, bgp_evpn_vni_cmd, "vni (1-16777215)", return CMD_SUCCESS; } -DEFUNSH(VTYSH_BGPD, vpn_policy_afi, vpn_policy_afi_cmd, "vpn-policy <ipv4|ipv6>", - "Configure a VPN policy\n" - BGP_AFI_HELP_STR) -{ - int idx = 1; - - if (argv_find(argv, argc, "ipv4", &idx)) - vty->node = BGP_VPNPOLICY_IPV4_NODE; - else - vty->node = BGP_VPNPOLICY_IPV6_NODE; - return CMD_SUCCESS; -} - - #if defined(ENABLE_BGP_VNC) DEFUNSH(VTYSH_BGPD, vnc_defaults, vnc_defaults_cmd, "vnc defaults", "VNC/RFP related configuration\n" @@ -1562,8 +1538,6 @@ static int vtysh_exit(struct vty *vty) case BGP_IPV6M_NODE: case BGP_IPV6L_NODE: case BGP_VRF_POLICY_NODE: - case BGP_VPNPOLICY_IPV4_NODE: - case BGP_VPNPOLICY_IPV6_NODE: case BGP_EVPN_NODE: case BGP_VNC_DEFAULTS_NODE: case BGP_VNC_NVE_GROUP_NODE: @@ -3112,8 +3086,6 @@ void vtysh_init_vty(void) install_node(&bgp_vrf_policy_node, NULL); install_node(&bgp_evpn_node, NULL); install_node(&bgp_evpn_vni_node, NULL); - install_node(&bgp_vpn_policy_ipv4_node, NULL); - install_node(&bgp_vpn_policy_ipv6_node, NULL); install_node(&bgp_vnc_defaults_node, NULL); install_node(&bgp_vnc_nve_group_node, NULL); install_node(&bgp_vnc_l2_group_node, NULL); @@ -3206,10 +3178,6 @@ void vtysh_init_vty(void) install_element(BGP_EVPN_VNI_NODE, &vtysh_quit_bgpd_cmd); install_element(BGP_IPV6L_NODE, &vtysh_exit_bgpd_cmd); install_element(BGP_IPV6L_NODE, &vtysh_quit_bgpd_cmd); - install_element(BGP_VPNPOLICY_IPV4_NODE, &vtysh_exit_bgpd_cmd); - install_element(BGP_VPNPOLICY_IPV4_NODE, &vtysh_quit_bgpd_cmd); - install_element(BGP_VPNPOLICY_IPV6_NODE, &vtysh_exit_bgpd_cmd); - install_element(BGP_VPNPOLICY_IPV6_NODE, &vtysh_quit_bgpd_cmd); #if defined(ENABLE_BGP_VNC) install_element(BGP_VRF_POLICY_NODE, &vtysh_exit_bgpd_cmd); install_element(BGP_VRF_POLICY_NODE, &vtysh_quit_bgpd_cmd); @@ -3262,8 +3230,6 @@ void vtysh_init_vty(void) install_element(BGP_VNC_DEFAULTS_NODE, &vtysh_end_all_cmd); install_element(BGP_VNC_NVE_GROUP_NODE, &vtysh_end_all_cmd); install_element(BGP_VNC_L2_GROUP_NODE, &vtysh_end_all_cmd); - install_element(BGP_VPNPOLICY_IPV4_NODE, &vtysh_end_all_cmd); - install_element(BGP_VPNPOLICY_IPV6_NODE, &vtysh_end_all_cmd); install_element(ISIS_NODE, &vtysh_end_all_cmd); install_element(KEYCHAIN_NODE, &vtysh_end_all_cmd); install_element(KEYCHAIN_KEY_NODE, &vtysh_end_all_cmd); @@ -3313,7 +3279,6 @@ void 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, &vpn_policy_afi_cmd); #if defined(ENABLE_BGP_VNC) install_element(BGP_NODE, &vnc_vrf_policy_cmd); install_element(BGP_NODE, &vnc_defaults_cmd); |