diff options
author | Hiroki Shirokura <slank.dev@gmail.com> | 2020-12-19 00:47:11 +0100 |
---|---|---|
committer | Mark Stapp <mjs@voltanet.io> | 2021-06-02 16:24:48 +0200 |
commit | bfaab44d1e6ffa23cfc983ccd72d98e6082e38df (patch) | |
tree | ebf77021a9a2a009c89071cd364d5ad1e1148aff /vtysh/vtysh.c | |
parent | bgpd: fix prefix-sid crash bug and add topotest (step4) (diff) | |
download | frr-bfaab44d1e6ffa23cfc983ccd72d98e6082e38df.tar.xz frr-bfaab44d1e6ffa23cfc983ccd72d98e6082e38df.zip |
*: 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 <slank.dev@gmail.com>
Diffstat (limited to '')
-rw-r--r-- | vtysh/vtysh.c | 46 |
1 files changed, 46 insertions, 0 deletions
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 <l2vpn evpn>", "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 */ |