summaryrefslogtreecommitdiffstats
path: root/isisd/isis_cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'isisd/isis_cli.c')
-rw-r--r--isisd/isis_cli.c280
1 files changed, 142 insertions, 138 deletions
diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c
index 9718a45..2b19cbb 100644
--- a/isisd/isis_cli.c
+++ b/isisd/isis_cli.c
@@ -85,13 +85,13 @@ void cli_show_router_isis(struct vty *vty, const struct lyd_node *dnode,
{
const char *vrf = NULL;
- vrf = yang_dnode_get_string(dnode, "./vrf");
+ vrf = yang_dnode_get_string(dnode, "vrf");
vty_out(vty, "!\n");
vty_out(vty, "router isis %s",
- yang_dnode_get_string(dnode, "./area-tag"));
+ yang_dnode_get_string(dnode, "area-tag"));
if (!strmatch(vrf, VRF_DEFAULT_NAME))
- vty_out(vty, " vrf %s", yang_dnode_get_string(dnode, "./vrf"));
+ vty_out(vty, " vrf %s", yang_dnode_get_string(dnode, "vrf"));
vty_out(vty, "\n");
}
@@ -172,7 +172,7 @@ DEFPY_YANG(no_ip_router_isis, no_ip_router_isis_cmd,
* If both ipv4 and ipv6 are off delete the interface isis container.
*/
if (strmatch(ip, "ipv6")) {
- if (!yang_dnode_get_bool(dnode, "./ipv4-routing"))
+ if (!yang_dnode_get_bool(dnode, "ipv4-routing"))
nb_cli_enqueue_change(vty, "./frr-isisd:isis",
NB_OP_DESTROY, NULL);
else
@@ -180,7 +180,7 @@ DEFPY_YANG(no_ip_router_isis, no_ip_router_isis_cmd,
"./frr-isisd:isis/ipv6-routing",
NB_OP_MODIFY, "false");
} else {
- if (!yang_dnode_get_bool(dnode, "./ipv6-routing"))
+ if (!yang_dnode_get_bool(dnode, "ipv6-routing"))
nb_cli_enqueue_change(vty, "./frr-isisd:isis",
NB_OP_DESTROY, NULL);
else
@@ -280,16 +280,16 @@ void cli_show_ip_isis_bfd_monitoring(struct vty *vty,
const struct lyd_node *dnode,
bool show_defaults)
{
- if (!yang_dnode_get_bool(dnode, "./enabled")) {
+ if (!yang_dnode_get_bool(dnode, "enabled")) {
if (show_defaults)
vty_out(vty, " no isis bfd\n");
} else {
vty_out(vty, " isis bfd\n");
}
- if (yang_dnode_exists(dnode, "./profile"))
+ if (yang_dnode_exists(dnode, "profile"))
vty_out(vty, " isis bfd profile %s\n",
- yang_dnode_get_string(dnode, "./profile"));
+ yang_dnode_get_string(dnode, "profile"));
}
/*
@@ -300,8 +300,12 @@ DEFPY_YANG(net, net_cmd, "[no] net WORD",
"A Network Entity Title for this process (OSI only)\n"
"XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
{
- nb_cli_enqueue_change(vty, "./area-address",
- no ? NB_OP_DESTROY : NB_OP_CREATE, net);
+ char xpath[XPATH_MAXLEN];
+
+ snprintf(xpath, XPATH_MAXLEN, "./area-address[.='%s']", net);
+
+ nb_cli_enqueue_change(vty, xpath, no ? NB_OP_DESTROY : NB_OP_CREATE,
+ NULL);
return nb_cli_apply_changes(vty, NULL);
}
@@ -588,9 +592,9 @@ void cli_show_isis_area_pwd(struct vty *vty, const struct lyd_node *dnode,
const char *snp;
vty_out(vty, " area-password %s %s",
- yang_dnode_get_string(dnode, "./password-type"),
- yang_dnode_get_string(dnode, "./password"));
- snp = yang_dnode_get_string(dnode, "./authenticate-snp");
+ yang_dnode_get_string(dnode, "password-type"),
+ yang_dnode_get_string(dnode, "password"));
+ snp = yang_dnode_get_string(dnode, "authenticate-snp");
if (!strmatch("none", snp))
vty_out(vty, " authenticate snp %s", snp);
vty_out(vty, "\n");
@@ -638,9 +642,9 @@ void cli_show_isis_domain_pwd(struct vty *vty, const struct lyd_node *dnode,
const char *snp;
vty_out(vty, " domain-password %s %s",
- yang_dnode_get_string(dnode, "./password-type"),
- yang_dnode_get_string(dnode, "./password"));
- snp = yang_dnode_get_string(dnode, "./authenticate-snp");
+ yang_dnode_get_string(dnode, "password-type"),
+ yang_dnode_get_string(dnode, "password"));
+ snp = yang_dnode_get_string(dnode, "authenticate-snp");
if (!strmatch("none", snp))
vty_out(vty, " authenticate snp %s", snp);
vty_out(vty, "\n");
@@ -861,17 +865,17 @@ void cli_show_isis_lsp_timers(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
const char *l1_refresh =
- yang_dnode_get_string(dnode, "./level-1/refresh-interval");
+ yang_dnode_get_string(dnode, "level-1/refresh-interval");
const char *l2_refresh =
- yang_dnode_get_string(dnode, "./level-2/refresh-interval");
+ yang_dnode_get_string(dnode, "level-2/refresh-interval");
const char *l1_lifetime =
- yang_dnode_get_string(dnode, "./level-1/maximum-lifetime");
+ yang_dnode_get_string(dnode, "level-1/maximum-lifetime");
const char *l2_lifetime =
- yang_dnode_get_string(dnode, "./level-2/maximum-lifetime");
+ yang_dnode_get_string(dnode, "level-2/maximum-lifetime");
const char *l1_gen =
- yang_dnode_get_string(dnode, "./level-1/generation-interval");
+ yang_dnode_get_string(dnode, "level-1/generation-interval");
const char *l2_gen =
- yang_dnode_get_string(dnode, "./level-2/generation-interval");
+ yang_dnode_get_string(dnode, "level-2/generation-interval");
if (strmatch(l1_refresh, l2_refresh)
&& strmatch(l1_lifetime, l2_lifetime) && strmatch(l1_gen, l2_gen))
vty_out(vty,
@@ -980,8 +984,8 @@ void cli_show_isis_spf_min_interval(struct vty *vty,
const struct lyd_node *dnode,
bool show_defaults)
{
- const char *l1 = yang_dnode_get_string(dnode, "./level-1");
- const char *l2 = yang_dnode_get_string(dnode, "./level-2");
+ const char *l1 = yang_dnode_get_string(dnode, "level-1");
+ const char *l2 = yang_dnode_get_string(dnode, "level-2");
if (strmatch(l1, l2))
vty_out(vty, " spf-interval %s\n", l1);
@@ -1051,11 +1055,11 @@ void cli_show_isis_spf_ietf_backoff(struct vty *vty,
{
vty_out(vty,
" spf-delay-ietf init-delay %s short-delay %s long-delay %s holddown %s time-to-learn %s\n",
- yang_dnode_get_string(dnode, "./init-delay"),
- yang_dnode_get_string(dnode, "./short-delay"),
- yang_dnode_get_string(dnode, "./long-delay"),
- yang_dnode_get_string(dnode, "./hold-down"),
- yang_dnode_get_string(dnode, "./time-to-learn"));
+ yang_dnode_get_string(dnode, "init-delay"),
+ yang_dnode_get_string(dnode, "short-delay"),
+ yang_dnode_get_string(dnode, "long-delay"),
+ yang_dnode_get_string(dnode, "hold-down"),
+ yang_dnode_get_string(dnode, "time-to-learn"));
}
/*
@@ -1364,15 +1368,15 @@ static void vty_print_def_origin(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
vty_out(vty, " default-information originate %s %s", family, level);
- if (yang_dnode_get_bool(dnode, "./always"))
+ if (yang_dnode_get_bool(dnode, "always"))
vty_out(vty, " always");
- if (yang_dnode_exists(dnode, "./route-map"))
+ if (yang_dnode_exists(dnode, "route-map"))
vty_out(vty, " route-map %s",
- yang_dnode_get_string(dnode, "./route-map"));
- if (show_defaults || !yang_dnode_is_default(dnode, "./metric"))
+ yang_dnode_get_string(dnode, "route-map"));
+ if (show_defaults || !yang_dnode_is_default(dnode, "metric"))
vty_out(vty, " metric %s",
- yang_dnode_get_string(dnode, "./metric"));
+ yang_dnode_get_string(dnode, "metric"));
vty_out(vty, "\n");
}
@@ -1381,7 +1385,7 @@ void cli_show_isis_def_origin_ipv4(struct vty *vty,
const struct lyd_node *dnode,
bool show_defaults)
{
- const char *level = yang_dnode_get_string(dnode, "./level");
+ const char *level = yang_dnode_get_string(dnode, "level");
vty_print_def_origin(vty, dnode, "ipv4", level, show_defaults);
}
@@ -1390,7 +1394,7 @@ void cli_show_isis_def_origin_ipv6(struct vty *vty,
const struct lyd_node *dnode,
bool show_defaults)
{
- const char *level = yang_dnode_get_string(dnode, "./level");
+ const char *level = yang_dnode_get_string(dnode, "level");
vty_print_def_origin(vty, dnode, "ipv6", level, show_defaults);
}
@@ -1505,22 +1509,22 @@ static void vty_print_redistribute(struct vty *vty, const struct lyd_node *dnode
if (table) {
level = yang_dnode_get_string(dnode, "../level");
- tableid = yang_dnode_get_uint16(dnode, "./table");
+ tableid = yang_dnode_get_uint16(dnode, "table");
vty_out(vty, " redistribute %s table %d ", family, tableid);
} else {
- protocol = yang_dnode_get_string(dnode, "./protocol");
+ protocol = yang_dnode_get_string(dnode, "protocol");
if (!table && strmatch(protocol, "table"))
return;
- level = yang_dnode_get_string(dnode, "./level");
+ level = yang_dnode_get_string(dnode, "level");
vty_out(vty, " redistribute %s %s ", family, protocol);
}
vty_out(vty, "%s", level);
- if (show_defaults || !yang_dnode_is_default(dnode, "./metric"))
+ if (show_defaults || !yang_dnode_is_default(dnode, "metric"))
vty_out(vty, " metric %s",
- yang_dnode_get_string(dnode, "%s", "./metric"));
+ yang_dnode_get_string(dnode, "%s", "metric"));
- if (yang_dnode_exists(dnode, "./route-map"))
- routemap = yang_dnode_get_string(dnode, "./route-map");
+ if (yang_dnode_exists(dnode, "route-map"))
+ routemap = yang_dnode_get_string(dnode, "route-map");
if (routemap)
vty_out(vty, " route-map %s", routemap);
vty_out(vty, "\n");
@@ -1557,8 +1561,8 @@ void cli_show_isis_redistribute_ipv6_table(struct vty *vty,
int cli_cmp_isis_redistribute_table(const struct lyd_node *dnode1,
const struct lyd_node *dnode2)
{
- uint16_t table1 = yang_dnode_get_uint16(dnode1, "./table");
- uint16_t table2 = yang_dnode_get_uint16(dnode2, "./table");
+ uint16_t table1 = yang_dnode_get_uint16(dnode1, "table");
+ uint16_t table2 = yang_dnode_get_uint16(dnode2, "table");
return table1 - table2;
}
@@ -1619,7 +1623,7 @@ void cli_show_isis_mt_ipv4_multicast(struct vty *vty,
bool show_defaults)
{
vty_out(vty, " topology ipv4-multicast");
- if (yang_dnode_get_bool(dnode, "./overload"))
+ if (yang_dnode_get_bool(dnode, "overload"))
vty_out(vty, " overload");
vty_out(vty, "\n");
}
@@ -1628,7 +1632,7 @@ void cli_show_isis_mt_ipv4_mgmt(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
vty_out(vty, " topology ipv4-mgmt");
- if (yang_dnode_get_bool(dnode, "./overload"))
+ if (yang_dnode_get_bool(dnode, "overload"))
vty_out(vty, " overload");
vty_out(vty, "\n");
}
@@ -1638,7 +1642,7 @@ void cli_show_isis_mt_ipv6_unicast(struct vty *vty,
bool show_defaults)
{
vty_out(vty, " topology ipv6-unicast");
- if (yang_dnode_get_bool(dnode, "./overload"))
+ if (yang_dnode_get_bool(dnode, "overload"))
vty_out(vty, " overload");
vty_out(vty, "\n");
}
@@ -1648,7 +1652,7 @@ void cli_show_isis_mt_ipv6_multicast(struct vty *vty,
bool show_defaults)
{
vty_out(vty, " topology ipv6-multicast");
- if (yang_dnode_get_bool(dnode, "./overload"))
+ if (yang_dnode_get_bool(dnode, "overload"))
vty_out(vty, " overload");
vty_out(vty, "\n");
}
@@ -1657,7 +1661,7 @@ void cli_show_isis_mt_ipv6_mgmt(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
vty_out(vty, " topology ipv6-mgmt");
- if (yang_dnode_get_bool(dnode, "./overload"))
+ if (yang_dnode_get_bool(dnode, "overload"))
vty_out(vty, " overload");
vty_out(vty, "\n");
}
@@ -1666,7 +1670,7 @@ void cli_show_isis_mt_ipv6_dstsrc(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
vty_out(vty, " topology ipv6-dstsrc");
- if (yang_dnode_get_bool(dnode, "./overload"))
+ if (yang_dnode_get_bool(dnode, "overload"))
vty_out(vty, " overload");
vty_out(vty, "\n");
}
@@ -1771,13 +1775,13 @@ void cli_show_isis_label_blocks(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
vty_out(vty, " segment-routing global-block %s %s",
- yang_dnode_get_string(dnode, "./srgb/lower-bound"),
- yang_dnode_get_string(dnode, "./srgb/upper-bound"));
- if (!yang_dnode_is_default(dnode, "./srlb/lower-bound")
- || !yang_dnode_is_default(dnode, "./srlb/upper-bound"))
+ yang_dnode_get_string(dnode, "srgb/lower-bound"),
+ yang_dnode_get_string(dnode, "srgb/upper-bound"));
+ if (!yang_dnode_is_default(dnode, "srlb/lower-bound")
+ || !yang_dnode_is_default(dnode, "srlb/upper-bound"))
vty_out(vty, " local-block %s %s",
- yang_dnode_get_string(dnode, "./srlb/lower-bound"),
- yang_dnode_get_string(dnode, "./srlb/upper-bound"));
+ yang_dnode_get_string(dnode, "srlb/lower-bound"),
+ yang_dnode_get_string(dnode, "srlb/upper-bound"));
vty_out(vty, "\n");
}
@@ -1899,11 +1903,11 @@ void cli_show_isis_prefix_sid(struct vty *vty, const struct lyd_node *dnode,
const char *sid_value;
bool n_flag_clear;
- prefix = yang_dnode_get_string(dnode, "./prefix");
- lh_behavior = yang_dnode_get_string(dnode, "./last-hop-behavior");
- sid_value_type = yang_dnode_get_string(dnode, "./sid-value-type");
- sid_value = yang_dnode_get_string(dnode, "./sid-value");
- n_flag_clear = yang_dnode_get_bool(dnode, "./n-flag-clear");
+ prefix = yang_dnode_get_string(dnode, "prefix");
+ lh_behavior = yang_dnode_get_string(dnode, "last-hop-behavior");
+ sid_value_type = yang_dnode_get_string(dnode, "sid-value-type");
+ sid_value = yang_dnode_get_string(dnode, "sid-value");
+ n_flag_clear = yang_dnode_get_bool(dnode, "n-flag-clear");
vty_out(vty, " segment-routing prefix %s", prefix);
if (strmatch(sid_value_type, "absolute"))
@@ -2013,12 +2017,12 @@ void cli_show_isis_prefix_sid_algorithm(struct vty *vty,
bool n_flag_clear;
uint32_t algorithm;
- prefix = yang_dnode_get_string(dnode, "./prefix");
- sid_value_type = yang_dnode_get_string(dnode, "./sid-value-type");
- sid_value = yang_dnode_get_string(dnode, "./sid-value");
- algorithm = yang_dnode_get_uint32(dnode, "./algo");
- lh_behavior = yang_dnode_get_string(dnode, "./last-hop-behavior");
- n_flag_clear = yang_dnode_get_bool(dnode, "./n-flag-clear");
+ prefix = yang_dnode_get_string(dnode, "prefix");
+ sid_value_type = yang_dnode_get_string(dnode, "sid-value-type");
+ sid_value = yang_dnode_get_string(dnode, "sid-value");
+ algorithm = yang_dnode_get_uint32(dnode, "algo");
+ lh_behavior = yang_dnode_get_string(dnode, "last-hop-behavior");
+ n_flag_clear = yang_dnode_get_bool(dnode, "n-flag-clear");
vty_out(vty, " segment-routing prefix %s", prefix);
vty_out(vty, " algorithm %u", algorithm);
@@ -2220,22 +2224,22 @@ void cli_show_isis_srv6_node_msd(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
vty_out(vty, " node-msd\n");
- if (yang_dnode_get_uint8(dnode, "./max-segs-left") !=
+ if (yang_dnode_get_uint8(dnode, "max-segs-left") !=
yang_get_default_uint8("%s/msd/node-msd/max-segs-left", ISIS_SRV6))
vty_out(vty, " max-segs-left %u\n",
- yang_dnode_get_uint8(dnode, "./max-segs-left"));
- if (yang_dnode_get_uint8(dnode, "./max-end-pop") !=
+ yang_dnode_get_uint8(dnode, "max-segs-left"));
+ if (yang_dnode_get_uint8(dnode, "max-end-pop") !=
yang_get_default_uint8("%s/msd/node-msd/max-end-pop", ISIS_SRV6))
vty_out(vty, " max-end-pop %u\n",
- yang_dnode_get_uint8(dnode, "./max-end-pop"));
- if (yang_dnode_get_uint8(dnode, "./max-h-encaps") !=
+ yang_dnode_get_uint8(dnode, "max-end-pop"));
+ if (yang_dnode_get_uint8(dnode, "max-h-encaps") !=
yang_get_default_uint8("%s/msd/node-msd/max-h-encaps", ISIS_SRV6))
vty_out(vty, " max-h-encaps %u\n",
- yang_dnode_get_uint8(dnode, "./max-h-encaps"));
- if (yang_dnode_get_uint8(dnode, "./max-end-d") !=
+ yang_dnode_get_uint8(dnode, "max-h-encaps"));
+ if (yang_dnode_get_uint8(dnode, "max-end-d") !=
yang_get_default_uint8("%s/msd/node-msd/max-end-d", ISIS_SRV6))
vty_out(vty, " max-end-d %u\n",
- yang_dnode_get_uint8(dnode, "./max-end-d"));
+ yang_dnode_get_uint8(dnode, "max-end-d"));
}
/*
@@ -2381,8 +2385,8 @@ void cli_show_isis_frr_lfa_tiebreaker(struct vty *vty,
bool show_defaults)
{
vty_out(vty, " fast-reroute lfa tiebreaker %s index %s %s\n",
- yang_dnode_get_string(dnode, "./type"),
- yang_dnode_get_string(dnode, "./index"),
+ yang_dnode_get_string(dnode, "type"),
+ yang_dnode_get_string(dnode, "index"),
dnode->parent->parent->schema->name);
}
@@ -2554,8 +2558,8 @@ void cli_show_ip_isis_password(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
vty_out(vty, " isis password %s %s\n",
- yang_dnode_get_string(dnode, "./password-type"),
- yang_dnode_get_string(dnode, "./password"));
+ yang_dnode_get_string(dnode, "password-type"),
+ yang_dnode_get_string(dnode, "password"));
}
/*
@@ -2601,8 +2605,8 @@ DEFPY_YANG(no_isis_metric, no_isis_metric_cmd,
void cli_show_ip_isis_metric(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
- const char *l1 = yang_dnode_get_string(dnode, "./level-1");
- const char *l2 = yang_dnode_get_string(dnode, "./level-2");
+ const char *l1 = yang_dnode_get_string(dnode, "level-1");
+ const char *l2 = yang_dnode_get_string(dnode, "level-2");
if (strmatch(l1, l2))
vty_out(vty, " isis metric %s\n", l1);
@@ -2660,8 +2664,8 @@ void cli_show_ip_isis_hello_interval(struct vty *vty,
const struct lyd_node *dnode,
bool show_defaults)
{
- const char *l1 = yang_dnode_get_string(dnode, "./level-1");
- const char *l2 = yang_dnode_get_string(dnode, "./level-2");
+ const char *l1 = yang_dnode_get_string(dnode, "level-1");
+ const char *l2 = yang_dnode_get_string(dnode, "level-2");
if (strmatch(l1, l2))
vty_out(vty, " isis hello-interval %s\n", l1);
@@ -2718,8 +2722,8 @@ DEFPY_YANG(no_isis_hello_multiplier, no_isis_hello_multiplier_cmd,
void cli_show_ip_isis_hello_multi(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
- const char *l1 = yang_dnode_get_string(dnode, "./level-1");
- const char *l2 = yang_dnode_get_string(dnode, "./level-2");
+ const char *l1 = yang_dnode_get_string(dnode, "level-1");
+ const char *l2 = yang_dnode_get_string(dnode, "level-2");
if (strmatch(l1, l2))
vty_out(vty, " isis hello-multiplier %s\n", l1);
@@ -2837,8 +2841,8 @@ void cli_show_ip_isis_csnp_interval(struct vty *vty,
const struct lyd_node *dnode,
bool show_defaults)
{
- const char *l1 = yang_dnode_get_string(dnode, "./level-1");
- const char *l2 = yang_dnode_get_string(dnode, "./level-2");
+ const char *l1 = yang_dnode_get_string(dnode, "level-1");
+ const char *l2 = yang_dnode_get_string(dnode, "level-2");
if (strmatch(l1, l2))
vty_out(vty, " isis csnp-interval %s\n", l1);
@@ -2896,8 +2900,8 @@ void cli_show_ip_isis_psnp_interval(struct vty *vty,
const struct lyd_node *dnode,
bool show_defaults)
{
- const char *l1 = yang_dnode_get_string(dnode, "./level-1");
- const char *l2 = yang_dnode_get_string(dnode, "./level-2");
+ const char *l1 = yang_dnode_get_string(dnode, "level-1");
+ const char *l2 = yang_dnode_get_string(dnode, "level-2");
if (strmatch(l1, l2))
vty_out(vty, " isis psnp-interval %s\n", l1);
@@ -3054,12 +3058,16 @@ void cli_show_ip_isis_circ_type(struct vty *vty, const struct lyd_node *dnode,
}
static int ag_change(struct vty *vty, int argc, struct cmd_token **argv,
- const char *xpath, bool no, int start_idx)
+ const char *xpath_base, bool no, int start_idx)
{
- for (int i = start_idx; i < argc; i++)
+ char xpath[XPATH_MAXLEN];
+
+ for (int i = start_idx; i < argc; i++) {
+ snprintf(xpath, XPATH_MAXLEN, "%s[.='%s']", xpath_base,
+ argv[i]->arg);
nb_cli_enqueue_change(vty, xpath,
- no ? NB_OP_DESTROY : NB_OP_CREATE,
- argv[i]->arg);
+ no ? NB_OP_DESTROY : NB_OP_CREATE, NULL);
+ }
return nb_cli_apply_changes(vty, NULL);
}
@@ -3140,8 +3148,8 @@ DEFPY_YANG(no_isis_priority, no_isis_priority_cmd,
void cli_show_ip_isis_priority(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
- const char *l1 = yang_dnode_get_string(dnode, "./level-1");
- const char *l2 = yang_dnode_get_string(dnode, "./level-2");
+ const char *l1 = yang_dnode_get_string(dnode, "level-1");
+ const char *l2 = yang_dnode_get_string(dnode, "level-2");
if (strmatch(l1, l2))
vty_out(vty, " isis priority %s\n", l1);
@@ -3162,8 +3170,8 @@ void cli_show_ip_isis_frr(struct vty *vty, const struct lyd_node *dnode,
bool l1_link_fallback, l2_link_fallback;
/* Classic LFA */
- l1_enabled = yang_dnode_get_bool(dnode, "./level-1/lfa/enable");
- l2_enabled = yang_dnode_get_bool(dnode, "./level-2/lfa/enable");
+ l1_enabled = yang_dnode_get_bool(dnode, "level-1/lfa/enable");
+ l2_enabled = yang_dnode_get_bool(dnode, "level-2/lfa/enable");
if (l1_enabled || l2_enabled) {
if (l1_enabled == l2_enabled) {
@@ -3180,8 +3188,8 @@ void cli_show_ip_isis_frr(struct vty *vty, const struct lyd_node *dnode,
}
/* Remote LFA */
- l1_enabled = yang_dnode_get_bool(dnode, "./level-1/remote-lfa/enable");
- l2_enabled = yang_dnode_get_bool(dnode, "./level-2/remote-lfa/enable");
+ l1_enabled = yang_dnode_get_bool(dnode, "level-1/remote-lfa/enable");
+ l2_enabled = yang_dnode_get_bool(dnode, "level-2/remote-lfa/enable");
if (l1_enabled || l2_enabled) {
if (l1_enabled == l2_enabled) {
@@ -3199,16 +3207,16 @@ void cli_show_ip_isis_frr(struct vty *vty, const struct lyd_node *dnode,
}
/* TI-LFA */
- l1_enabled = yang_dnode_get_bool(dnode, "./level-1/ti-lfa/enable");
- l2_enabled = yang_dnode_get_bool(dnode, "./level-2/ti-lfa/enable");
+ l1_enabled = yang_dnode_get_bool(dnode, "level-1/ti-lfa/enable");
+ l2_enabled = yang_dnode_get_bool(dnode, "level-2/ti-lfa/enable");
l1_node_protection =
- yang_dnode_get_bool(dnode, "./level-1/ti-lfa/node-protection");
+ yang_dnode_get_bool(dnode, "level-1/ti-lfa/node-protection");
l2_node_protection =
- yang_dnode_get_bool(dnode, "./level-2/ti-lfa/node-protection");
+ yang_dnode_get_bool(dnode, "level-2/ti-lfa/node-protection");
l1_link_fallback =
- yang_dnode_get_bool(dnode, "./level-1/ti-lfa/link-fallback");
+ yang_dnode_get_bool(dnode, "level-1/ti-lfa/link-fallback");
l2_link_fallback =
- yang_dnode_get_bool(dnode, "./level-2/ti-lfa/link-fallback");
+ yang_dnode_get_bool(dnode, "level-2/ti-lfa/link-fallback");
if (l1_enabled || l2_enabled) {
@@ -3302,31 +3310,27 @@ DEFPY(isis_lfa_exclude_interface, isis_lfa_exclude_interface_cmd,
"Exclude an interface from computation\n"
"Interface name\n")
{
+ char xpath[XPATH_MAXLEN];
+
if (!level || strmatch(level, "level-1")) {
- if (no) {
- nb_cli_enqueue_change(
- vty,
- "./frr-isisd:isis/fast-reroute/level-1/lfa/exclude-interface",
- NB_OP_DESTROY, ifname);
- } else {
- nb_cli_enqueue_change(
- vty,
- "./frr-isisd:isis/fast-reroute/level-1/lfa/exclude-interface",
- NB_OP_CREATE, ifname);
- }
+ snprintf(xpath, sizeof(xpath),
+ "./frr-isisd:isis/fast-reroute/level-1/lfa/exclude-interface[.='%s']",
+ ifname);
+
+ if (no)
+ nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
+ else
+ nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
}
if (!level || strmatch(level, "level-2")) {
- if (no) {
- nb_cli_enqueue_change(
- vty,
- "./frr-isisd:isis/fast-reroute/level-2/lfa/exclude-interface",
- NB_OP_DESTROY, ifname);
- } else {
- nb_cli_enqueue_change(
- vty,
- "./frr-isisd:isis/fast-reroute/level-2/lfa/exclude-interface",
- NB_OP_CREATE, ifname);
- }
+ snprintf(xpath, sizeof(xpath),
+ "./frr-isisd:isis/fast-reroute/level-2/lfa/exclude-interface[.='%s']",
+ ifname);
+
+ if (no)
+ nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
+ else
+ nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
}
return nb_cli_apply_changes(vty, NULL);
@@ -3874,24 +3878,24 @@ void cli_show_isis_flex_algo(struct vty *vty, const struct lyd_node *dnode,
uint32_t priority;
char type_str[10];
- algorithm = yang_dnode_get_uint32(dnode, "./flex-algo");
+ algorithm = yang_dnode_get_uint32(dnode, "flex-algo");
vty_out(vty, " flex-algo %u\n", algorithm);
- if (yang_dnode_exists(dnode, "./advertise-definition"))
+ if (yang_dnode_exists(dnode, "advertise-definition"))
vty_out(vty, " advertise-definition\n");
- if (yang_dnode_exists(dnode, "./dplane-sr-mpls"))
+ if (yang_dnode_exists(dnode, "dplane-sr-mpls"))
vty_out(vty, " dataplane sr-mpls\n");
- if (yang_dnode_exists(dnode, "./dplane-srv6"))
+ if (yang_dnode_exists(dnode, "dplane-srv6"))
vty_out(vty, " dataplane srv6\n");
- if (yang_dnode_exists(dnode, "./dplane-ip"))
+ if (yang_dnode_exists(dnode, "dplane-ip"))
vty_out(vty, " dataplane ip\n");
- if (yang_dnode_exists(dnode, "./prefix-metric"))
+ if (yang_dnode_exists(dnode, "prefix-metric"))
vty_out(vty, " prefix-metric\n");
- if (yang_dnode_exists(dnode, "./metric-type")) {
- metric_type = yang_dnode_get_enum(dnode, "./metric-type");
+ if (yang_dnode_exists(dnode, "metric-type")) {
+ metric_type = yang_dnode_get_enum(dnode, "metric-type");
if (metric_type != MT_IGP) {
flex_algo_metric_type_print(type_str, sizeof(type_str),
metric_type);
@@ -3899,8 +3903,8 @@ void cli_show_isis_flex_algo(struct vty *vty, const struct lyd_node *dnode,
}
}
- if (yang_dnode_exists(dnode, "./priority")) {
- priority = yang_dnode_get_uint32(dnode, "./priority");
+ if (yang_dnode_exists(dnode, "priority")) {
+ priority = yang_dnode_get_uint32(dnode, "priority");
if (priority != FLEX_ALGO_PRIO_DEFAULT)
vty_out(vty, " priority %u\n", priority);
}