summaryrefslogtreecommitdiff
path: root/eigrpd
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2024-01-24 10:49:52 -0500
committerGitHub <noreply@github.com>2024-01-24 10:49:52 -0500
commit16406a31d388b6fdbf3d7445f8a4f0cedce0f926 (patch)
treee695af8b514955276700ffe7fb7844cf0bf35100 /eigrpd
parent1ea73983fd1056f5f6232424185057cb58c90319 (diff)
parenta594cda8cec0a67d59ee28d5fb59e958611370c9 (diff)
Merge pull request #15196 from idryzhov/nb-leaf-list
lib: remove leaf-list xpath hack from northbound
Diffstat (limited to 'eigrpd')
-rw-r--r--eigrpd/eigrp_cli.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/eigrpd/eigrp_cli.c b/eigrpd/eigrp_cli.c
index 4bd3434aeb..eaede73fb3 100644
--- a/eigrpd/eigrp_cli.c
+++ b/eigrpd/eigrp_cli.c
@@ -131,12 +131,14 @@ DEFPY_YANG(
"Suppress routing updates on an interface\n"
"Interface to suppress on\n")
{
+ char xpath[XPATH_MAXLEN];
+
+ snprintf(xpath, sizeof(xpath), "./passive-interface[.='%s']", ifname);
+
if (no)
- nb_cli_enqueue_change(vty, "./passive-interface",
- NB_OP_DESTROY, ifname);
+ nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
else
- nb_cli_enqueue_change(vty, "./passive-interface",
- NB_OP_CREATE, ifname);
+ nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
return nb_cli_apply_changes(vty, NULL);
}
@@ -354,12 +356,14 @@ DEFPY_YANG(
"Enable routing on an IP network\n"
"EIGRP network prefix\n")
{
+ char xpath[XPATH_MAXLEN];
+
+ snprintf(xpath, sizeof(xpath), "./network[.='%s']", prefix_str);
+
if (no)
- nb_cli_enqueue_change(vty, "./network", NB_OP_DESTROY,
- prefix_str);
+ nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
else
- nb_cli_enqueue_change(vty, "./network", NB_OP_CREATE,
- prefix_str);
+ nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
return nb_cli_apply_changes(vty, NULL);
}
@@ -383,12 +387,14 @@ DEFPY_YANG(
"Specify a neighbor router\n"
"Neighbor address\n")
{
+ char xpath[XPATH_MAXLEN];
+
+ snprintf(xpath, sizeof(xpath), "./neighbor[.='%s']", addr_str);
+
if (no)
- nb_cli_enqueue_change(vty, "./neighbor", NB_OP_DESTROY,
- addr_str);
+ nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
else
- nb_cli_enqueue_change(vty, "./neighbor", NB_OP_CREATE,
- addr_str);
+ nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
return nb_cli_apply_changes(vty, NULL);
}
@@ -769,8 +775,9 @@ DEFPY_YANG(
as_str);
nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
- snprintf(xpath_auth, sizeof(xpath_auth), "%s/summarize-addresses", xpath);
- nb_cli_enqueue_change(vty, xpath_auth, NB_OP_CREATE, prefix_str);
+ snprintf(xpath_auth, sizeof(xpath_auth),
+ "%s/summarize-addresses[.='%s']", xpath, prefix_str);
+ nb_cli_enqueue_change(vty, xpath_auth, NB_OP_CREATE, NULL);
return nb_cli_apply_changes(vty, NULL);
}
@@ -792,8 +799,9 @@ DEFPY_YANG(
as_str);
nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
- snprintf(xpath_auth, sizeof(xpath_auth), "%s/summarize-addresses", xpath);
- nb_cli_enqueue_change(vty, xpath_auth, NB_OP_DESTROY, prefix_str);
+ snprintf(xpath_auth, sizeof(xpath_auth),
+ "%s/summarize-addresses[.='%s']", xpath, prefix_str);
+ nb_cli_enqueue_change(vty, xpath_auth, NB_OP_DESTROY, NULL);
return nb_cli_apply_changes(vty, NULL);
}