From bfaab44d1e6ffa23cfc983ccd72d98e6082e38df Mon Sep 17 00:00:00 2001 From: Hiroki Shirokura Date: Sat, 19 Dec 2020 08:47:11 +0900 Subject: *: new cli-nodes for BGP SRv6 VPNv4 (step4) This commit add just CLI-nodes for MP-BGP VPN configuration with SRv6 backend rather than MPLS. Actual configuration cli will be implemented after this commit. Example Configuration follow. This cli design is based on Cisco IOS-XR but actual cli tree design is defferent between FRR and Cisco. It's just based on cisco. ref: https://www.cisco.com/c/en/us/td/docs/routers/asr9000/software/asr9k-r6-6/segment-routing/configuration/guide/b-segment-routing-cg-asr9000-66x/b-segment-routing-cg-asr9000-66x_chapter_011.html#concept_hwj_trf_dlb router bgp 1 bgp router-id 1.1.1.1 ! segment-routing srv6 ! new cli-node locator LOC1 ! this cli will be added after this commit. ! ! Signed-off-by: Hiroki Shirokura --- vtysh/vtysh.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'vtysh/vtysh.c') diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index e55a8cfb1..e8184c2dc 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -1507,6 +1507,13 @@ static struct cmd_node bmp_node = { .parent_node = BGP_NODE, .prompt = "%s(config-bgp-bmp)# " }; + +static struct cmd_node bgp_srv6_node = { + .name = "bgp srv6", + .node = BGP_SRV6_NODE, + .parent_node = BGP_NODE, + .prompt = "%s(config-router-srv6)# ", +}; #endif /* HAVE_BGPD */ #ifdef HAVE_OSPFD @@ -1862,6 +1869,39 @@ DEFUNSH(VTYSH_BGPD, return CMD_SUCCESS; } +DEFUNSH(VTYSH_BGPD, + bgp_srv6, + bgp_srv6_cmd, + "segment-routing srv6", + "Segment-Routing configuration\n" + "Segment-Routing SRv6 configuration\n") +{ + vty->node = BGP_SRV6_NODE; + return CMD_SUCCESS; +} + +DEFUNSH(VTYSH_BGPD, + exit_bgp_srv6, + exit_bgp_srv6_cmd, + "exit", + "exit Segment-Routing SRv6 configuration\n") +{ + if (vty->node == BGP_SRV6_NODE) + vty->node = BGP_NODE; + return CMD_SUCCESS; +} + +DEFUNSH(VTYSH_BGPD, + quit_bgp_srv6, + quit_bgp_srv6_cmd, + "quit", + "quit Segment-Routing SRv6 configuration\n") +{ + if (vty->node == BGP_SRV6_NODE) + vty->node = BGP_NODE; + return CMD_SUCCESS; +} + DEFUNSH(VTYSH_BGPD, address_family_evpn, address_family_evpn_cmd, "address-family ", "Enter Address Family command mode\n" @@ -4201,6 +4241,12 @@ void vtysh_init_vty(void) install_element(BMP_NODE, &bmp_exit_cmd); install_element(BMP_NODE, &bmp_quit_cmd); install_element(BMP_NODE, &vtysh_end_all_cmd); + + install_node(&bgp_srv6_node); + install_element(BGP_NODE, &bgp_srv6_cmd); + install_element(BGP_SRV6_NODE, &exit_bgp_srv6_cmd); + install_element(BGP_SRV6_NODE, &quit_bgp_srv6_cmd); + install_element(BGP_SRV6_NODE, &vtysh_end_all_cmd); #endif /* HAVE_BGPD */ /* ripd */ -- cgit v1.2.3