summaryrefslogtreecommitdiffstats
path: root/lib/routing_nb_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/routing_nb_config.c')
-rw-r--r--lib/routing_nb_config.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/routing_nb_config.c b/lib/routing_nb_config.c
index f4fe48f..d532279 100644
--- a/lib/routing_nb_config.c
+++ b/lib/routing_nb_config.c
@@ -14,6 +14,8 @@
DEFINE_HOOK(routing_conf_event, (struct nb_cb_create_args *args), (args));
+DEFINE_HOOK(routing_create, (struct nb_cb_create_args *args), (args));
+DEFINE_KOOH(routing_destroy, (struct nb_cb_destroy_args *args), (args));
/*
* XPath: /frr-routing:routing/control-plane-protocols/control-plane-protocol
@@ -44,11 +46,12 @@ int routing_control_plane_protocols_control_plane_protocol_create(
* find the vrf and store the pointer.
*/
if (nb_node_has_dependency(args->dnode->schema->priv)) {
- vrfname = yang_dnode_get_string(args->dnode, "./vrf");
+ vrfname = yang_dnode_get_string(args->dnode, "vrf");
vrf = vrf_lookup_by_name(vrfname);
assert(vrf);
nb_running_set_entry(args->dnode, vrf);
}
+ hook_call(routing_create, args);
break;
};
@@ -61,6 +64,8 @@ int routing_control_plane_protocols_control_plane_protocol_destroy(
if (args->event != NB_EV_APPLY)
return NB_OK;
+ hook_call(routing_destroy, args);
+
/*
* If dependency on VRF module is registered, then VRF
* pointer was stored and must be cleared.
@@ -76,7 +81,7 @@ static void vrf_to_control_plane_protocol(const struct lyd_node *dnode,
{
const char *vrf;
- vrf = yang_dnode_get_string(dnode, "./name");
+ vrf = yang_dnode_get_string(dnode, "name");
snprintf(xpath, XPATH_MAXLEN, FRR_ROUTING_KEY_XPATH_VRF, vrf);
}
@@ -86,7 +91,7 @@ static void control_plane_protocol_to_vrf(const struct lyd_node *dnode,
{
const char *vrf;
- vrf = yang_dnode_get_string(dnode, "./vrf");
+ vrf = yang_dnode_get_string(dnode, "vrf");
snprintf(xpath, XPATH_MAXLEN, FRR_VRF_KEY_XPATH, vrf);
}