diff options
author | Donald Sharp <sharpd@nvidia.com> | 2021-06-05 18:34:46 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2021-06-23 14:28:02 +0200 |
commit | 5df73b05439aab94ccb6b78607d6d01b45074c78 (patch) | |
tree | e4bc93a77af44b00d1cacbcaeb68b0f19d8370d3 /vtysh/vtysh.c | |
parent | Merge pull request #8853 from ton31337/fix/bgp_dest_lock_unlock (diff) | |
download | frr-5df73b05439aab94ccb6b78607d6d01b45074c78.tar.xz frr-5df73b05439aab94ccb6b78607d6d01b45074c78.zip |
vtysh: Expose SR node for non pathd use cases
The SR node is hidden by a `--enable-pathd` configuration option.
But the recent commit of SRv6 uses this node as well. Let's expose
this node and let things work.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to '')
-rw-r--r-- | vtysh/vtysh.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 72835e752..41b7bc8a1 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -1263,7 +1263,6 @@ static struct cmd_node pw_node = { .prompt = "%s(config-pw)# ", }; -#if defined(HAVE_PATHD) static struct cmd_node segment_routing_node = { .name = "segment-routing", .node = SEGMENT_ROUTING_NODE, @@ -1271,6 +1270,7 @@ static struct cmd_node segment_routing_node = { .prompt = "%s(config-sr)# ", }; +#if defined(HAVE_PATHD) static struct cmd_node sr_traffic_eng_node = { .name = "sr traffic-eng", .node = SR_TRAFFIC_ENG_NODE, @@ -2171,7 +2171,6 @@ DEFUNSH(VTYSH_FABRICD, router_openfabric, router_openfabric_cmd, "router openfab } #endif /* HAVE_FABRICD */ -#if defined(HAVE_PATHD) DEFUNSH(VTYSH_SR, segment_routing, segment_routing_cmd, "segment-routing", "Configure segment routing\n") @@ -2180,6 +2179,7 @@ DEFUNSH(VTYSH_SR, segment_routing, segment_routing_cmd, return CMD_SUCCESS; } +#if defined (HAVE_PATHD) DEFUNSH(VTYSH_PATHD, sr_traffic_eng, sr_traffic_eng_cmd, "traffic-eng", "Configure SR traffic engineering\n") @@ -2664,6 +2664,18 @@ DEFUNSH(VTYSH_KEYS, vtysh_quit_keys, vtysh_quit_keys_cmd, "quit", return vtysh_exit_keys(self, vty, argc, argv); } +DEFUNSH(VTYSH_SR, vtysh_exit_sr, vtysh_exit_sr_cmd, "exit", + "Exit current mode and down to previous mode\n") +{ + return vtysh_exit(vty); +} + +DEFUNSH(VTYSH_SR, vtysh_quit_sr, vtysh_quit_sr_cmd, "quit", + "Exit current mode and down to previous mode\n") +{ + return vtysh_exit(vty); +} + #if defined(HAVE_PATHD) DEFUNSH(VTYSH_PATHD, vtysh_exit_pathd, vtysh_exit_pathd_cmd, "exit", "Exit current mode and down to previous mode\n") @@ -4329,15 +4341,17 @@ void vtysh_init_vty(void) install_element(BFD_PROFILE_NODE, &vtysh_end_all_cmd); #endif /* HAVE_BFDD */ -#if defined(HAVE_PATHD) install_node(&segment_routing_node); + install_element(SEGMENT_ROUTING_NODE, &vtysh_exit_sr_cmd); + install_element(SEGMENT_ROUTING_NODE, &vtysh_quit_sr_cmd); + install_element(SEGMENT_ROUTING_NODE, &vtysh_end_all_cmd); + +#if defined(HAVE_PATHD) install_node(&sr_traffic_eng_node); install_node(&srte_segment_list_node); install_node(&srte_policy_node); install_node(&srte_candidate_dyn_node); - install_element(SEGMENT_ROUTING_NODE, &vtysh_exit_pathd_cmd); - install_element(SEGMENT_ROUTING_NODE, &vtysh_quit_pathd_cmd); install_element(SR_TRAFFIC_ENG_NODE, &vtysh_exit_pathd_cmd); install_element(SR_TRAFFIC_ENG_NODE, &vtysh_quit_pathd_cmd); install_element(SR_SEGMENT_LIST_NODE, &vtysh_exit_pathd_cmd); @@ -4347,7 +4361,7 @@ void vtysh_init_vty(void) install_element(SR_CANDIDATE_DYN_NODE, &vtysh_exit_pathd_cmd); install_element(SR_CANDIDATE_DYN_NODE, &vtysh_quit_pathd_cmd); - install_element(SEGMENT_ROUTING_NODE, &vtysh_end_all_cmd); + install_element(SR_TRAFFIC_ENG_NODE, &vtysh_end_all_cmd); install_element(SR_SEGMENT_LIST_NODE, &vtysh_end_all_cmd); install_element(SR_POLICY_NODE, &vtysh_end_all_cmd); |