diff options
Diffstat (limited to 'isisd/isis_cli.c')
| -rw-r--r-- | isisd/isis_cli.c | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c index 52f68eff5a..0094852825 100644 --- a/isisd/isis_cli.c +++ b/isisd/isis_cli.c @@ -136,8 +136,6 @@ DEFPY(ip_router_isis, ip_router_isis_cmd, "ip router isis WORD$tag", const char *circ_type; struct isis_area *area; struct interface *ifp; - const struct lyd_node *dnode = - yang_dnode_get(running_config->dnode, VTY_CURR_XPATH); /* area will be created if it is not present. make sure the yang model * is synced with FRR and call the appropriate NB cb. @@ -190,7 +188,7 @@ DEFPY(ip_router_isis, ip_router_isis_cmd, "ip router isis WORD$tag", } /* check if the interface is a loopback and if so set it as passive */ - ifp = yang_dnode_get_entry(dnode, false); + ifp = nb_running_get_entry(NULL, VTY_CURR_XPATH, false); if (ifp && if_is_loopback(ifp)) nb_cli_enqueue_change(vty, "./frr-isisd:isis/passive", NB_OP_MODIFY, "true"); @@ -208,8 +206,6 @@ DEFPY(ip6_router_isis, ip6_router_isis_cmd, "ipv6 router isis WORD$tag", const char *circ_type; struct isis_area *area; struct interface *ifp; - const struct lyd_node *dnode = - yang_dnode_get(running_config->dnode, VTY_CURR_XPATH); /* area will be created if it is not present. make sure the yang model * is synced with FRR and call the appropriate NB cb. @@ -262,7 +258,7 @@ DEFPY(ip6_router_isis, ip6_router_isis_cmd, "ipv6 router isis WORD$tag", } /* check if the interface is a loopback and if so set it as passive */ - ifp = yang_dnode_get_entry(dnode, false); + ifp = nb_running_get_entry(NULL, VTY_CURR_XPATH, false); if (ifp && if_is_loopback(ifp)) nb_cli_enqueue_change(vty, "./frr-isisd:isis/passive", NB_OP_MODIFY, "true"); @@ -373,9 +369,9 @@ DEFPY(no_is_type, no_is_type_cmd, "Act as an area router only\n") { const char *value = NULL; - const struct lyd_node *dnode = - yang_dnode_get(running_config->dnode, VTY_CURR_XPATH); - struct isis_area *area = yang_dnode_get_entry(dnode, false); + struct isis_area *area; + + area = nb_running_get_entry(NULL, VTY_CURR_XPATH, false); /* * Put the is-type back to defaults: @@ -932,12 +928,12 @@ void cli_show_isis_purge_origin(struct vty *vty, struct lyd_node *dnode, } /* - * XPath: /frr-isisd:isis/mpls-te + * XPath: /frr-isisd:isis/instance/mpls-te */ DEFPY(isis_mpls_te_on, isis_mpls_te_on_cmd, "mpls-te on", MPLS_TE_STR "Enable the MPLS-TE functionality\n") { - nb_cli_enqueue_change(vty, "/frr-isisd:isis/mpls-te", NB_OP_CREATE, + nb_cli_enqueue_change(vty, "./mpls-te", NB_OP_CREATE, NULL); return nb_cli_apply_changes(vty, NULL); @@ -946,9 +942,9 @@ DEFPY(isis_mpls_te_on, isis_mpls_te_on_cmd, "mpls-te on", DEFPY(no_isis_mpls_te_on, no_isis_mpls_te_on_cmd, "no mpls-te [on]", NO_STR "Disable the MPLS-TE functionality\n" - "Enable the MPLS-TE functionality\n") + "Disable the MPLS-TE functionality\n") { - nb_cli_enqueue_change(vty, "/frr-isisd:isis/mpls-te", NB_OP_DESTROY, + nb_cli_enqueue_change(vty, "./mpls-te", NB_OP_DESTROY, NULL); return nb_cli_apply_changes(vty, NULL); @@ -961,7 +957,7 @@ void cli_show_isis_mpls_te(struct vty *vty, struct lyd_node *dnode, } /* - * XPath: /frr-isisd:isis/mpls-te/router-address + * XPath: /frr-isisd:isis/instance/mpls-te/router-address */ DEFPY(isis_mpls_te_router_addr, isis_mpls_te_router_addr_cmd, "mpls-te router-address A.B.C.D", @@ -969,12 +965,24 @@ DEFPY(isis_mpls_te_router_addr, isis_mpls_te_router_addr_cmd, "Stable IP address of the advertising router\n" "MPLS-TE router address in IPv4 address format\n") { - nb_cli_enqueue_change(vty, "/frr-isisd:isis/mpls-te/router-address", + nb_cli_enqueue_change(vty, "./mpls-te/router-address", NB_OP_MODIFY, router_address_str); return nb_cli_apply_changes(vty, NULL); } +DEFPY(no_isis_mpls_te_router_addr, no_isis_mpls_te_router_addr_cmd, + "no mpls-te router-address [A.B.C.D]", + NO_STR MPLS_TE_STR + "Delete IP address of the advertising router\n" + "MPLS-TE router address in IPv4 address format\n") +{ + nb_cli_enqueue_change(vty, "./mpls-te/router-address", + NB_OP_DESTROY, NULL); + + return nb_cli_apply_changes(vty, NULL); +} + void cli_show_isis_mpls_te_router_addr(struct vty *vty, struct lyd_node *dnode, bool show_defaults) { @@ -990,7 +998,7 @@ DEFPY(isis_mpls_te_inter_as, isis_mpls_te_inter_as_cmd, "AREA native mode self originate INTER-AS LSP with L1 and L2 flooding scope\n" "AS native mode self originate INTER-AS LSP with L2 only flooding scope\n") { - vty_out(vty, "MPLS-TE Inter-AS is not yet supported."); + vty_out(vty, "MPLS-TE Inter-AS is not yet supported\n"); return CMD_SUCCESS; } @@ -1761,7 +1769,6 @@ DEFPY(no_isis_circuit_type, no_isis_circuit_type_cmd, "Level-1-2 adjacencies are formed\n" "Level-2 only adjacencies are formed\n") { - const struct lyd_node *dnode; struct interface *ifp; struct isis_circuit *circuit; int is_type; @@ -1772,8 +1779,7 @@ DEFPY(no_isis_circuit_type, no_isis_circuit_type_cmd, * and the is-type of the area if there is one. So we need to do this * here. */ - dnode = yang_dnode_get(running_config->dnode, VTY_CURR_XPATH); - ifp = yang_dnode_get_entry(dnode, false); + ifp = nb_running_get_entry(NULL, VTY_CURR_XPATH, false); if (!ifp) goto def_val; @@ -1973,6 +1979,7 @@ void isis_cli_init(void) install_element(ISIS_NODE, &isis_mpls_te_on_cmd); install_element(ISIS_NODE, &no_isis_mpls_te_on_cmd); install_element(ISIS_NODE, &isis_mpls_te_router_addr_cmd); + install_element(ISIS_NODE, &no_isis_mpls_te_router_addr_cmd); install_element(ISIS_NODE, &isis_mpls_te_inter_as_cmd); install_element(ISIS_NODE, &isis_default_originate_cmd); |
