]> git.proxmox.com Git - mirror_frr.git/blobdiff - ripngd/ripng_nb_config.c
Merge pull request #12780 from opensourcerouting/spdx-license-id
[mirror_frr.git] / ripngd / ripng_nb_config.c
index b39c1d443a6a36bf2d4812b0309603661fc1f45c..006bf79ce8d56cb87d8e9a77e30f6f3a13b721a2 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 1998 Kunihiro Ishiguro
  * Copyright (C) 2018 NetDEF, Inc.
  *                    Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
 /*
  * XPath: /frr-ripngd:ripngd/instance
  */
-int ripngd_instance_create(enum nb_event event, const struct lyd_node *dnode,
-                          union nb_resource *resource)
+int ripngd_instance_create(struct nb_cb_create_args *args)
 {
        struct ripng *ripng;
        struct vrf *vrf;
        const char *vrf_name;
        int socket;
 
-       vrf_name = yang_dnode_get_string(dnode, "./vrf");
+       vrf_name = yang_dnode_get_string(args->dnode, "./vrf");
        vrf = vrf_lookup_by_name(vrf_name);
 
        /*
         * Try to create a RIPng socket only if the VRF is enabled, otherwise
         * create a disabled RIPng instance and wait for the VRF to be enabled.
         */
-       switch (event) {
+       switch (args->event) {
        case NB_EV_VALIDATE:
                break;
        case NB_EV_PREPARE:
@@ -64,48 +50,47 @@ int ripngd_instance_create(enum nb_event event, const struct lyd_node *dnode,
                socket = ripng_make_socket(vrf);
                if (socket < 0)
                        return NB_ERR_RESOURCE;
-               resource->fd = socket;
+               args->resource->fd = socket;
                break;
        case NB_EV_ABORT:
                if (!vrf || !vrf_is_enabled(vrf))
                        break;
 
-               socket = resource->fd;
+               socket = args->resource->fd;
                close(socket);
                break;
        case NB_EV_APPLY:
                if (vrf && vrf_is_enabled(vrf))
-                       socket = resource->fd;
+                       socket = args->resource->fd;
                else
                        socket = -1;
 
                ripng = ripng_create(vrf_name, vrf, socket);
-               nb_running_set_entry(dnode, ripng);
+               nb_running_set_entry(args->dnode, ripng);
                break;
        }
 
        return NB_OK;
 }
 
-int ripngd_instance_destroy(enum nb_event event, const struct lyd_node *dnode)
+int ripngd_instance_destroy(struct nb_cb_destroy_args *args)
 {
        struct ripng *ripng;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_unset_entry(dnode);
+       ripng = nb_running_unset_entry(args->dnode);
        ripng_clean(ripng);
 
        return NB_OK;
 }
 
-const void *ripngd_instance_get_next(const void *parent_list_entry,
-                                    const void *list_entry)
+const void *ripngd_instance_get_next(struct nb_cb_get_next_args *args)
 {
-       struct ripng *ripng = (struct ripng *)list_entry;
+       struct ripng *ripng = (struct ripng *)args->list_entry;
 
-       if (list_entry == NULL)
+       if (args->list_entry == NULL)
                ripng = RB_MIN(ripng_instance_head, &ripng_instances);
        else
                ripng = RB_NEXT(ripng_instance_head, ripng);
@@ -113,21 +98,20 @@ const void *ripngd_instance_get_next(const void *parent_list_entry,
        return ripng;
 }
 
-int ripngd_instance_get_keys(const void *list_entry,
-                            struct yang_list_keys *keys)
+int ripngd_instance_get_keys(struct nb_cb_get_keys_args *args)
 {
-       const struct ripng *ripng = list_entry;
+       const struct ripng *ripng = args->list_entry;
 
-       keys->num = 1;
-       strlcpy(keys->key[0], ripng->vrf_name, sizeof(keys->key[0]));
+       args->keys->num = 1;
+       strlcpy(args->keys->key[0], ripng->vrf_name,
+               sizeof(args->keys->key[0]));
 
        return NB_OK;
 }
 
-const void *ripngd_instance_lookup_entry(const void *parent_list_entry,
-                                        const struct yang_list_keys *keys)
+const void *ripngd_instance_lookup_entry(struct nb_cb_lookup_entry_args *args)
 {
-       const char *vrf_name = keys->key[0];
+       const char *vrf_name = args->keys->key[0];
 
        return ripng_lookup_by_vrf_name(vrf_name);
 }
@@ -135,17 +119,15 @@ const void *ripngd_instance_lookup_entry(const void *parent_list_entry,
 /*
  * XPath: /frr-ripngd:ripngd/instance/allow-ecmp
  */
-int ripngd_instance_allow_ecmp_modify(enum nb_event event,
-                                     const struct lyd_node *dnode,
-                                     union nb_resource *resource)
+int ripngd_instance_allow_ecmp_modify(struct nb_cb_modify_args *args)
 {
        struct ripng *ripng;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       ripng->ecmp = yang_dnode_get_bool(dnode, NULL);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       ripng->ecmp = yang_dnode_get_bool(args->dnode, NULL);
        if (!ripng->ecmp)
                ripng_ecmp_disable(ripng);
 
@@ -156,20 +138,19 @@ int ripngd_instance_allow_ecmp_modify(enum nb_event event,
  * XPath: /frr-ripngd:ripngd/instance/default-information-originate
  */
 int ripngd_instance_default_information_originate_modify(
-       enum nb_event event, const struct lyd_node *dnode,
-       union nb_resource *resource)
+       struct nb_cb_modify_args *args)
 {
        struct ripng *ripng;
        bool default_information;
        struct prefix_ipv6 p;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       default_information = yang_dnode_get_bool(dnode, NULL);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       default_information = yang_dnode_get_bool(args->dnode, NULL);
 
-       str2prefix_ipv6("::/0", &p);
+       (void)str2prefix_ipv6("::/0", &p);
        if (default_information) {
                ripng_redistribute_add(ripng, ZEBRA_ROUTE_RIPNG,
                                       RIPNG_ROUTE_DEFAULT, &p, 0, NULL, 0);
@@ -184,17 +165,15 @@ int ripngd_instance_default_information_originate_modify(
 /*
  * XPath: /frr-ripngd:ripngd/instance/default-metric
  */
-int ripngd_instance_default_metric_modify(enum nb_event event,
-                                         const struct lyd_node *dnode,
-                                         union nb_resource *resource)
+int ripngd_instance_default_metric_modify(struct nb_cb_modify_args *args)
 {
        struct ripng *ripng;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       ripng->default_metric = yang_dnode_get_uint8(dnode, NULL);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       ripng->default_metric = yang_dnode_get_uint8(args->dnode, NULL);
 
        return NB_OK;
 }
@@ -202,34 +181,31 @@ int ripngd_instance_default_metric_modify(enum nb_event event,
 /*
  * XPath: /frr-ripngd:ripngd/instance/network
  */
-int ripngd_instance_network_create(enum nb_event event,
-                                  const struct lyd_node *dnode,
-                                  union nb_resource *resource)
+int ripngd_instance_network_create(struct nb_cb_create_args *args)
 {
        struct ripng *ripng;
        struct prefix p;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       yang_dnode_get_ipv6p(&p, dnode, NULL);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       yang_dnode_get_ipv6p(&p, args->dnode, NULL);
        apply_mask_ipv6((struct prefix_ipv6 *)&p);
 
        return ripng_enable_network_add(ripng, &p);
 }
 
-int ripngd_instance_network_destroy(enum nb_event event,
-                                   const struct lyd_node *dnode)
+int ripngd_instance_network_destroy(struct nb_cb_destroy_args *args)
 {
        struct ripng *ripng;
        struct prefix p;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       yang_dnode_get_ipv6p(&p, dnode, NULL);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       yang_dnode_get_ipv6p(&p, args->dnode, NULL);
        apply_mask_ipv6((struct prefix_ipv6 *)&p);
 
        return ripng_enable_network_delete(ripng, &p);
@@ -238,33 +214,30 @@ int ripngd_instance_network_destroy(enum nb_event event,
 /*
  * XPath: /frr-ripngd:ripngd/instance/interface
  */
-int ripngd_instance_interface_create(enum nb_event event,
-                                    const struct lyd_node *dnode,
-                                    union nb_resource *resource)
+int ripngd_instance_interface_create(struct nb_cb_create_args *args)
 {
        struct ripng *ripng;
        const char *ifname;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       ifname = yang_dnode_get_string(dnode, NULL);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       ifname = yang_dnode_get_string(args->dnode, NULL);
 
        return ripng_enable_if_add(ripng, ifname);
 }
 
-int ripngd_instance_interface_destroy(enum nb_event event,
-                                     const struct lyd_node *dnode)
+int ripngd_instance_interface_destroy(struct nb_cb_destroy_args *args)
 {
        struct ripng *ripng;
        const char *ifname;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       ifname = yang_dnode_get_string(dnode, NULL);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       ifname = yang_dnode_get_string(args->dnode, NULL);
 
        return ripng_enable_if_delete(ripng, ifname);
 }
@@ -272,38 +245,35 @@ int ripngd_instance_interface_destroy(enum nb_event event,
 /*
  * XPath: /frr-ripngd:ripngd/instance/offset-list
  */
-int ripngd_instance_offset_list_create(enum nb_event event,
-                                      const struct lyd_node *dnode,
-                                      union nb_resource *resource)
+int ripngd_instance_offset_list_create(struct nb_cb_create_args *args)
 {
        struct ripng *ripng;
        const char *ifname;
        struct ripng_offset_list *offset;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       ifname = yang_dnode_get_string(dnode, "./interface");
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       ifname = yang_dnode_get_string(args->dnode, "./interface");
 
        offset = ripng_offset_list_new(ripng, ifname);
-       nb_running_set_entry(dnode, offset);
+       nb_running_set_entry(args->dnode, offset);
 
        return NB_OK;
 }
 
-int ripngd_instance_offset_list_destroy(enum nb_event event,
-                                       const struct lyd_node *dnode)
+int ripngd_instance_offset_list_destroy(struct nb_cb_destroy_args *args)
 {
        int direct;
        struct ripng_offset_list *offset;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       direct = yang_dnode_get_enum(dnode, "./direction");
+       direct = yang_dnode_get_enum(args->dnode, "./direction");
 
-       offset = nb_running_unset_entry(dnode);
+       offset = nb_running_unset_entry(args->dnode);
        if (offset->direct[direct].alist_name) {
                free(offset->direct[direct].alist_name);
                offset->direct[direct].alist_name = NULL;
@@ -318,21 +288,20 @@ int ripngd_instance_offset_list_destroy(enum nb_event event,
 /*
  * XPath: /frr-ripngd:ripngd/instance/offset-list/access-list
  */
-int ripngd_instance_offset_list_access_list_modify(enum nb_event event,
-                                                  const struct lyd_node *dnode,
-                                                  union nb_resource *resource)
+int ripngd_instance_offset_list_access_list_modify(
+       struct nb_cb_modify_args *args)
 {
        int direct;
        struct ripng_offset_list *offset;
        const char *alist_name;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       direct = yang_dnode_get_enum(dnode, "../direction");
-       alist_name = yang_dnode_get_string(dnode, NULL);
+       direct = yang_dnode_get_enum(args->dnode, "../direction");
+       alist_name = yang_dnode_get_string(args->dnode, NULL);
 
-       offset = nb_running_get_entry(dnode, NULL, true);
+       offset = nb_running_get_entry(args->dnode, NULL, true);
        if (offset->direct[direct].alist_name)
                free(offset->direct[direct].alist_name);
        offset->direct[direct].alist_name = strdup(alist_name);
@@ -343,21 +312,19 @@ int ripngd_instance_offset_list_access_list_modify(enum nb_event event,
 /*
  * XPath: /frr-ripngd:ripngd/instance/offset-list/metric
  */
-int ripngd_instance_offset_list_metric_modify(enum nb_event event,
-                                             const struct lyd_node *dnode,
-                                             union nb_resource *resource)
+int ripngd_instance_offset_list_metric_modify(struct nb_cb_modify_args *args)
 {
        int direct;
        uint8_t metric;
        struct ripng_offset_list *offset;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       direct = yang_dnode_get_enum(dnode, "../direction");
-       metric = yang_dnode_get_uint8(dnode, NULL);
+       direct = yang_dnode_get_enum(args->dnode, "../direction");
+       metric = yang_dnode_get_uint8(args->dnode, NULL);
 
-       offset = nb_running_get_entry(dnode, NULL, true);
+       offset = nb_running_get_entry(args->dnode, NULL, true);
        offset->direct[direct].metric = metric;
 
        return NB_OK;
@@ -366,33 +333,30 @@ int ripngd_instance_offset_list_metric_modify(enum nb_event event,
 /*
  * XPath: /frr-ripngd:ripngd/instance/passive-interface
  */
-int ripngd_instance_passive_interface_create(enum nb_event event,
-                                            const struct lyd_node *dnode,
-                                            union nb_resource *resource)
+int ripngd_instance_passive_interface_create(struct nb_cb_create_args *args)
 {
        struct ripng *ripng;
        const char *ifname;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       ifname = yang_dnode_get_string(dnode, NULL);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       ifname = yang_dnode_get_string(args->dnode, NULL);
 
        return ripng_passive_interface_set(ripng, ifname);
 }
 
-int ripngd_instance_passive_interface_destroy(enum nb_event event,
-                                             const struct lyd_node *dnode)
+int ripngd_instance_passive_interface_destroy(struct nb_cb_destroy_args *args)
 {
        struct ripng *ripng;
        const char *ifname;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       ifname = yang_dnode_get_string(dnode, NULL);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       ifname = yang_dnode_get_string(args->dnode, NULL);
 
        return ripng_passive_interface_unset(ripng, ifname);
 }
@@ -400,35 +364,32 @@ int ripngd_instance_passive_interface_destroy(enum nb_event event,
 /*
  * XPath: /frr-ripngd:ripngd/instance/redistribute
  */
-int ripngd_instance_redistribute_create(enum nb_event event,
-                                       const struct lyd_node *dnode,
-                                       union nb_resource *resource)
+int ripngd_instance_redistribute_create(struct nb_cb_create_args *args)
 {
        struct ripng *ripng;
        int type;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       type = yang_dnode_get_enum(dnode, "./protocol");
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       type = yang_dnode_get_enum(args->dnode, "./protocol");
 
        ripng->redist[type].enabled = true;
 
        return NB_OK;
 }
 
-int ripngd_instance_redistribute_destroy(enum nb_event event,
-                                        const struct lyd_node *dnode)
+int ripngd_instance_redistribute_destroy(struct nb_cb_destroy_args *args)
 {
        struct ripng *ripng;
        int type;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       type = yang_dnode_get_enum(dnode, "./protocol");
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       type = yang_dnode_get_enum(args->dnode, "./protocol");
 
        ripng->redist[type].enabled = false;
        if (ripng->redist[type].route_map.name) {
@@ -445,13 +406,14 @@ int ripngd_instance_redistribute_destroy(enum nb_event event,
        return NB_OK;
 }
 
-void ripngd_instance_redistribute_apply_finish(const struct lyd_node *dnode)
+void ripngd_instance_redistribute_apply_finish(
+       struct nb_cb_apply_finish_args *args)
 {
        struct ripng *ripng;
        int type;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       type = yang_dnode_get_enum(dnode, "./protocol");
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       type = yang_dnode_get_enum(args->dnode, "./protocol");
 
        if (ripng->enabled)
                ripng_redistribute_conf_update(ripng, type);
@@ -460,20 +422,19 @@ void ripngd_instance_redistribute_apply_finish(const struct lyd_node *dnode)
 /*
  * XPath: /frr-ripngd:ripngd/instance/redistribute/route-map
  */
-int ripngd_instance_redistribute_route_map_modify(enum nb_event event,
-                                                 const struct lyd_node *dnode,
-                                                 union nb_resource *resource)
+int ripngd_instance_redistribute_route_map_modify(
+       struct nb_cb_modify_args *args)
 {
        struct ripng *ripng;
        int type;
        const char *rmap_name;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       type = yang_dnode_get_enum(dnode, "../protocol");
-       rmap_name = yang_dnode_get_string(dnode, NULL);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       type = yang_dnode_get_enum(args->dnode, "../protocol");
+       rmap_name = yang_dnode_get_string(args->dnode, NULL);
 
        if (ripng->redist[type].route_map.name)
                free(ripng->redist[type].route_map.name);
@@ -483,17 +444,17 @@ int ripngd_instance_redistribute_route_map_modify(enum nb_event event,
        return NB_OK;
 }
 
-int ripngd_instance_redistribute_route_map_destroy(enum nb_event event,
-                                                  const struct lyd_node *dnode)
+int ripngd_instance_redistribute_route_map_destroy(
+       struct nb_cb_destroy_args *args)
 {
        struct ripng *ripng;
        int type;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       type = yang_dnode_get_enum(dnode, "../protocol");
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       type = yang_dnode_get_enum(args->dnode, "../protocol");
 
        free(ripng->redist[type].route_map.name);
        ripng->redist[type].route_map.name = NULL;
@@ -505,20 +466,18 @@ int ripngd_instance_redistribute_route_map_destroy(enum nb_event event,
 /*
  * XPath: /frr-ripngd:ripngd/instance/redistribute/metric
  */
-int ripngd_instance_redistribute_metric_modify(enum nb_event event,
-                                              const struct lyd_node *dnode,
-                                              union nb_resource *resource)
+int ripngd_instance_redistribute_metric_modify(struct nb_cb_modify_args *args)
 {
        struct ripng *ripng;
        int type;
        uint8_t metric;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       type = yang_dnode_get_enum(dnode, "../protocol");
-       metric = yang_dnode_get_uint8(dnode, NULL);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       type = yang_dnode_get_enum(args->dnode, "../protocol");
+       metric = yang_dnode_get_uint8(args->dnode, NULL);
 
        ripng->redist[type].metric_config = true;
        ripng->redist[type].metric = metric;
@@ -526,17 +485,16 @@ int ripngd_instance_redistribute_metric_modify(enum nb_event event,
        return NB_OK;
 }
 
-int ripngd_instance_redistribute_metric_destroy(enum nb_event event,
-                                               const struct lyd_node *dnode)
+int ripngd_instance_redistribute_metric_destroy(struct nb_cb_destroy_args *args)
 {
        struct ripng *ripng;
        int type;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       type = yang_dnode_get_enum(dnode, "../protocol");
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       type = yang_dnode_get_enum(args->dnode, "../protocol");
 
        ripng->redist[type].metric_config = false;
        ripng->redist[type].metric = 0;
@@ -547,18 +505,16 @@ int ripngd_instance_redistribute_metric_destroy(enum nb_event event,
 /*
  * XPath: /frr-ripngd:ripngd/instance/static-route
  */
-int ripngd_instance_static_route_create(enum nb_event event,
-                                       const struct lyd_node *dnode,
-                                       union nb_resource *resource)
+int ripngd_instance_static_route_create(struct nb_cb_create_args *args)
 {
        struct ripng *ripng;
        struct prefix_ipv6 p;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       yang_dnode_get_ipv6p(&p, dnode, NULL);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       yang_dnode_get_ipv6p(&p, args->dnode, NULL);
        apply_mask_ipv6(&p);
 
        ripng_redistribute_add(ripng, ZEBRA_ROUTE_RIPNG, RIPNG_ROUTE_STATIC, &p,
@@ -567,17 +523,16 @@ int ripngd_instance_static_route_create(enum nb_event event,
        return NB_OK;
 }
 
-int ripngd_instance_static_route_destroy(enum nb_event event,
-                                        const struct lyd_node *dnode)
+int ripngd_instance_static_route_destroy(struct nb_cb_destroy_args *args)
 {
        struct ripng *ripng;
        struct prefix_ipv6 p;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       yang_dnode_get_ipv6p(&p, dnode, NULL);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       yang_dnode_get_ipv6p(&p, args->dnode, NULL);
        apply_mask_ipv6(&p);
 
        ripng_redistribute_delete(ripng, ZEBRA_ROUTE_RIPNG, RIPNG_ROUTE_STATIC,
@@ -589,18 +544,16 @@ int ripngd_instance_static_route_destroy(enum nb_event event,
 /*
  * XPath: /frr-ripngd:ripngd/instance/aggregate-address
  */
-int ripngd_instance_aggregate_address_create(enum nb_event event,
-                                            const struct lyd_node *dnode,
-                                            union nb_resource *resource)
+int ripngd_instance_aggregate_address_create(struct nb_cb_create_args *args)
 {
        struct ripng *ripng;
        struct prefix_ipv6 p;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       yang_dnode_get_ipv6p(&p, dnode, NULL);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       yang_dnode_get_ipv6p(&p, args->dnode, NULL);
        apply_mask_ipv6(&p);
 
        ripng_aggregate_add(ripng, (struct prefix *)&p);
@@ -608,17 +561,16 @@ int ripngd_instance_aggregate_address_create(enum nb_event event,
        return NB_OK;
 }
 
-int ripngd_instance_aggregate_address_destroy(enum nb_event event,
-                                             const struct lyd_node *dnode)
+int ripngd_instance_aggregate_address_destroy(struct nb_cb_destroy_args *args)
 {
        struct ripng *ripng;
        struct prefix_ipv6 p;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       yang_dnode_get_ipv6p(&p, dnode, NULL);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       yang_dnode_get_ipv6p(&p, args->dnode, NULL);
        apply_mask_ipv6(&p);
 
        ripng_aggregate_delete(ripng, (struct prefix *)&p);
@@ -629,11 +581,11 @@ int ripngd_instance_aggregate_address_destroy(enum nb_event event,
 /*
  * XPath: /frr-ripngd:ripngd/instance/timers
  */
-void ripngd_instance_timers_apply_finish(const struct lyd_node *dnode)
+void ripngd_instance_timers_apply_finish(struct nb_cb_apply_finish_args *args)
 {
        struct ripng *ripng;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
 
        /* Reset update timer thread. */
        ripng_event(ripng, RIPNG_UPDATE_EVENT, 0);
@@ -642,17 +594,15 @@ void ripngd_instance_timers_apply_finish(const struct lyd_node *dnode)
 /*
  * XPath: /frr-ripngd:ripngd/instance/timers/flush-interval
  */
-int ripngd_instance_timers_flush_interval_modify(enum nb_event event,
-                                                const struct lyd_node *dnode,
-                                                union nb_resource *resource)
+int ripngd_instance_timers_flush_interval_modify(struct nb_cb_modify_args *args)
 {
        struct ripng *ripng;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       ripng->garbage_time = yang_dnode_get_uint16(dnode, NULL);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       ripng->garbage_time = yang_dnode_get_uint16(args->dnode, NULL);
 
        return NB_OK;
 }
@@ -661,16 +611,15 @@ int ripngd_instance_timers_flush_interval_modify(enum nb_event event,
  * XPath: /frr-ripngd:ripngd/instance/timers/holddown-interval
  */
 int ripngd_instance_timers_holddown_interval_modify(
-       enum nb_event event, const struct lyd_node *dnode,
-       union nb_resource *resource)
+       struct nb_cb_modify_args *args)
 {
        struct ripng *ripng;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       ripng->timeout_time = yang_dnode_get_uint16(dnode, NULL);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       ripng->timeout_time = yang_dnode_get_uint16(args->dnode, NULL);
 
        return NB_OK;
 }
@@ -678,17 +627,16 @@ int ripngd_instance_timers_holddown_interval_modify(
 /*
  * XPath: /frr-ripngd:ripngd/instance/timers/update-interval
  */
-int ripngd_instance_timers_update_interval_modify(enum nb_event event,
-                                                 const struct lyd_node *dnode,
-                                                 union nb_resource *resource)
+int ripngd_instance_timers_update_interval_modify(
+       struct nb_cb_modify_args *args)
 {
        struct ripng *ripng;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ripng = nb_running_get_entry(dnode, NULL, true);
-       ripng->update_time = yang_dnode_get_uint16(dnode, NULL);
+       ripng = nb_running_get_entry(args->dnode, NULL, true);
+       ripng->update_time = yang_dnode_get_uint16(args->dnode, NULL);
 
        return NB_OK;
 }
@@ -696,19 +644,17 @@ int ripngd_instance_timers_update_interval_modify(enum nb_event event,
 /*
  * XPath: /frr-interface:lib/interface/frr-ripngd:ripng/split-horizon
  */
-int lib_interface_ripng_split_horizon_modify(enum nb_event event,
-                                            const struct lyd_node *dnode,
-                                            union nb_resource *resource)
+int lib_interface_ripng_split_horizon_modify(struct nb_cb_modify_args *args)
 {
        struct interface *ifp;
        struct ripng_interface *ri;
 
-       if (event != NB_EV_APPLY)
+       if (args->event != NB_EV_APPLY)
                return NB_OK;
 
-       ifp = nb_running_get_entry(dnode, NULL, true);
+       ifp = nb_running_get_entry(args->dnode, NULL, true);
        ri = ifp->info;
-       ri->split_horizon = yang_dnode_get_enum(dnode, NULL);
+       ri->split_horizon = yang_dnode_get_enum(args->dnode, NULL);
 
        return NB_OK;
 }