]> git.proxmox.com Git - mirror_frr.git/blobdiff - ripd/rip_northbound.c
Merge pull request #4690 from donaldsharp/staticstuff
[mirror_frr.git] / ripd / rip_northbound.c
index c1ff678f25ad53778e4f85a069ff9119f31270ba..1238d0f0fc8b4ff50e85d78f8e4305767bd92a0a 100644 (file)
@@ -33,6 +33,7 @@
 #include "ripd/ripd.h"
 #include "ripd/rip_debug.h"
 #include "ripd/rip_cli.h"
+#include "ripd/rip_interface.h"
 
 /*
  * XPath: /frr-ripd:ripd/instance
@@ -79,7 +80,7 @@ static int ripd_instance_create(enum nb_event event,
                        socket = -1;
 
                rip = rip_create(vrf_name, vrf, socket);
-               yang_dnode_set_entry(dnode, rip);
+               nb_running_set_entry(dnode, rip);
                break;
        }
 
@@ -94,7 +95,7 @@ static int ripd_instance_destroy(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_unset_entry(dnode);
        rip_clean(rip);
 
        return NB_OK;
@@ -103,12 +104,12 @@ static int ripd_instance_destroy(enum nb_event event,
 static const void *ripd_instance_get_next(const void *parent_list_entry,
                                          const void *list_entry)
 {
-       const struct rip *rip = list_entry;
+       struct rip *rip = (struct rip *)list_entry;
 
        if (list_entry == NULL)
                rip = RB_MIN(rip_instance_head, &rip_instances);
        else
-               rip = RB_NEXT(rip_instance_head, (struct rip *)rip);
+               rip = RB_NEXT(rip_instance_head, rip);
 
        return rip;
 }
@@ -144,7 +145,7 @@ static int ripd_instance_allow_ecmp_modify(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        rip->ecmp = yang_dnode_get_bool(dnode, NULL);
        if (!rip->ecmp)
                rip_ecmp_disable(rip);
@@ -167,7 +168,7 @@ ripd_instance_default_information_originate_modify(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        default_information = yang_dnode_get_bool(dnode, NULL);
 
        memset(&p, 0, sizeof(struct prefix_ipv4));
@@ -199,7 +200,7 @@ static int ripd_instance_default_metric_modify(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        rip->default_metric = yang_dnode_get_uint8(dnode, NULL);
        /* rip_update_default_metric (); */
 
@@ -218,7 +219,7 @@ static int ripd_instance_distance_default_modify(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        rip->distance = yang_dnode_get_uint8(dnode, NULL);
 
        return NB_OK;
@@ -242,10 +243,10 @@ static int ripd_instance_distance_source_create(enum nb_event event,
        apply_mask_ipv4(&prefix);
 
        /* Get RIP distance node. */
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        rn = route_node_get(rip->distance_table, (struct prefix *)&prefix);
        rn->info = rip_distance_new();
-       yang_dnode_set_entry(dnode, rn);
+       nb_running_set_entry(dnode, rn);
 
        return NB_OK;
 }
@@ -259,7 +260,7 @@ static int ripd_instance_distance_source_destroy(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rn = yang_dnode_get_entry(dnode, true);
+       rn = nb_running_unset_entry(dnode);
        rdistance = rn->info;
        rip_distance_free(rdistance);
        rn->info = NULL;
@@ -284,7 +285,7 @@ ripd_instance_distance_source_distance_modify(enum nb_event event,
                return NB_OK;
 
        /* Set distance value. */
-       rn = yang_dnode_get_entry(dnode, true);
+       rn = nb_running_get_entry(dnode, NULL, true);
        distance = yang_dnode_get_uint8(dnode, NULL);
        rdistance = rn->info;
        rdistance->distance = distance;
@@ -310,7 +311,7 @@ ripd_instance_distance_source_access_list_modify(enum nb_event event,
        acl_name = yang_dnode_get_string(dnode, NULL);
 
        /* Set access-list */
-       rn = yang_dnode_get_entry(dnode, true);
+       rn = nb_running_get_entry(dnode, NULL, true);
        rdistance = rn->info;
        if (rdistance->access_list)
                free(rdistance->access_list);
@@ -330,7 +331,7 @@ ripd_instance_distance_source_access_list_destroy(enum nb_event event,
                return NB_OK;
 
        /* Reset access-list configuration. */
-       rn = yang_dnode_get_entry(dnode, true);
+       rn = nb_running_get_entry(dnode, NULL, true);
        rdistance = rn->info;
        free(rdistance->access_list);
        rdistance->access_list = NULL;
@@ -351,7 +352,7 @@ static int ripd_instance_explicit_neighbor_create(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        p.family = AF_INET;
        p.prefixlen = IPV4_MAX_BITLEN;
        yang_dnode_get_ipv4(&p.prefix, dnode, NULL);
@@ -368,7 +369,7 @@ static int ripd_instance_explicit_neighbor_destroy(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        p.family = AF_INET;
        p.prefixlen = IPV4_MAX_BITLEN;
        yang_dnode_get_ipv4(&p.prefix, dnode, NULL);
@@ -389,7 +390,7 @@ static int ripd_instance_network_create(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        yang_dnode_get_ipv4p(&p, dnode, NULL);
        apply_mask_ipv4((struct prefix_ipv4 *)&p);
 
@@ -405,7 +406,7 @@ static int ripd_instance_network_destroy(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        yang_dnode_get_ipv4p(&p, dnode, NULL);
        apply_mask_ipv4((struct prefix_ipv4 *)&p);
 
@@ -425,7 +426,7 @@ static int ripd_instance_interface_create(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        ifname = yang_dnode_get_string(dnode, NULL);
 
        return rip_enable_if_add(rip, ifname);
@@ -440,7 +441,7 @@ static int ripd_instance_interface_destroy(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        ifname = yang_dnode_get_string(dnode, NULL);
 
        return rip_enable_if_delete(rip, ifname);
@@ -460,11 +461,11 @@ static int ripd_instance_offset_list_create(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        ifname = yang_dnode_get_string(dnode, "./interface");
 
        offset = rip_offset_list_new(rip, ifname);
-       yang_dnode_set_entry(dnode, offset);
+       nb_running_set_entry(dnode, offset);
 
        return NB_OK;
 }
@@ -480,7 +481,7 @@ static int ripd_instance_offset_list_destroy(enum nb_event event,
 
        direct = yang_dnode_get_enum(dnode, "./direction");
 
-       offset = yang_dnode_get_entry(dnode, true);
+       offset = nb_running_unset_entry(dnode);
        if (offset->direct[direct].alist_name) {
                free(offset->direct[direct].alist_name);
                offset->direct[direct].alist_name = NULL;
@@ -510,7 +511,7 @@ ripd_instance_offset_list_access_list_modify(enum nb_event event,
        direct = yang_dnode_get_enum(dnode, "../direction");
        alist_name = yang_dnode_get_string(dnode, NULL);
 
-       offset = yang_dnode_get_entry(dnode, true);
+       offset = nb_running_get_entry(dnode, NULL, true);
        if (offset->direct[direct].alist_name)
                free(offset->direct[direct].alist_name);
        offset->direct[direct].alist_name = strdup(alist_name);
@@ -535,7 +536,7 @@ static int ripd_instance_offset_list_metric_modify(enum nb_event event,
        direct = yang_dnode_get_enum(dnode, "../direction");
        metric = yang_dnode_get_uint8(dnode, NULL);
 
-       offset = yang_dnode_get_entry(dnode, true);
+       offset = nb_running_get_entry(dnode, NULL, true);
        offset->direct[direct].metric = metric;
 
        return NB_OK;
@@ -553,7 +554,7 @@ static int ripd_instance_passive_default_modify(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        rip->passive_default = yang_dnode_get_bool(dnode, NULL);
        rip_passive_nondefault_clean(rip);
 
@@ -573,7 +574,7 @@ static int ripd_instance_passive_interface_create(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        ifname = yang_dnode_get_string(dnode, NULL);
 
        return rip_passive_nondefault_set(rip, ifname);
@@ -588,7 +589,7 @@ static int ripd_instance_passive_interface_destroy(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        ifname = yang_dnode_get_string(dnode, NULL);
 
        return rip_passive_nondefault_unset(rip, ifname);
@@ -608,7 +609,7 @@ ripd_instance_non_passive_interface_create(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        ifname = yang_dnode_get_string(dnode, NULL);
 
        return rip_passive_nondefault_unset(rip, ifname);
@@ -624,7 +625,7 @@ ripd_instance_non_passive_interface_destroy(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        ifname = yang_dnode_get_string(dnode, NULL);
 
        return rip_passive_nondefault_set(rip, ifname);
@@ -643,7 +644,7 @@ static int ripd_instance_redistribute_create(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        type = yang_dnode_get_enum(dnode, "./protocol");
 
        rip->redist[type].enabled = true;
@@ -660,7 +661,7 @@ static int ripd_instance_redistribute_destroy(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        type = yang_dnode_get_enum(dnode, "./protocol");
 
        rip->redist[type].enabled = false;
@@ -684,7 +685,7 @@ ripd_instance_redistribute_apply_finish(const struct lyd_node *dnode)
        struct rip *rip;
        int type;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        type = yang_dnode_get_enum(dnode, "./protocol");
 
        if (rip->enabled)
@@ -706,7 +707,7 @@ ripd_instance_redistribute_route_map_modify(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        type = yang_dnode_get_enum(dnode, "../protocol");
        rmap_name = yang_dnode_get_string(dnode, NULL);
 
@@ -728,7 +729,7 @@ ripd_instance_redistribute_route_map_destroy(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        type = yang_dnode_get_enum(dnode, "../protocol");
 
        free(rip->redist[type].route_map.name);
@@ -753,7 +754,7 @@ ripd_instance_redistribute_metric_modify(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        type = yang_dnode_get_enum(dnode, "../protocol");
        metric = yang_dnode_get_uint8(dnode, NULL);
 
@@ -773,7 +774,7 @@ ripd_instance_redistribute_metric_destroy(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        type = yang_dnode_get_enum(dnode, "../protocol");
 
        rip->redist[type].metric_config = false;
@@ -796,7 +797,7 @@ static int ripd_instance_static_route_create(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        yang_dnode_get_ipv4p(&p, dnode, NULL);
        apply_mask_ipv4(&p);
 
@@ -817,7 +818,7 @@ static int ripd_instance_static_route_destroy(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        yang_dnode_get_ipv4p(&p, dnode, NULL);
        apply_mask_ipv4(&p);
 
@@ -833,7 +834,7 @@ static void ripd_instance_timers_apply_finish(const struct lyd_node *dnode)
 {
        struct rip *rip;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
 
        /* Reset update timer thread. */
        rip_event(rip, RIP_UPDATE_EVENT, 0);
@@ -852,7 +853,7 @@ ripd_instance_timers_flush_interval_modify(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        rip->garbage_time = yang_dnode_get_uint32(dnode, NULL);
 
        return NB_OK;
@@ -871,7 +872,7 @@ ripd_instance_timers_holddown_interval_modify(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        rip->timeout_time = yang_dnode_get_uint32(dnode, NULL);
 
        return NB_OK;
@@ -890,7 +891,7 @@ ripd_instance_timers_update_interval_modify(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        rip->update_time = yang_dnode_get_uint32(dnode, NULL);
 
        return NB_OK;
@@ -908,7 +909,7 @@ static int ripd_instance_version_receive_modify(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        rip->version_recv = yang_dnode_get_enum(dnode, NULL);
 
        return NB_OK;
@@ -926,7 +927,7 @@ static int ripd_instance_version_send_modify(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       rip = yang_dnode_get_entry(dnode, true);
+       rip = nb_running_get_entry(dnode, NULL, true);
        rip->version_send = yang_dnode_get_enum(dnode, NULL);
 
        return NB_OK;
@@ -945,7 +946,7 @@ static int lib_interface_rip_split_horizon_modify(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       ifp = yang_dnode_get_entry(dnode, true);
+       ifp = nb_running_get_entry(dnode, NULL, true);
        ri = ifp->info;
        ri->split_horizon = yang_dnode_get_enum(dnode, NULL);
 
@@ -965,7 +966,7 @@ static int lib_interface_rip_v2_broadcast_modify(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       ifp = yang_dnode_get_entry(dnode, true);
+       ifp = nb_running_get_entry(dnode, NULL, true);
        ri = ifp->info;
        ri->v2_broadcast = yang_dnode_get_bool(dnode, NULL);
 
@@ -986,7 +987,7 @@ lib_interface_rip_version_receive_modify(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       ifp = yang_dnode_get_entry(dnode, true);
+       ifp = nb_running_get_entry(dnode, NULL, true);
        ri = ifp->info;
        ri->ri_receive = yang_dnode_get_enum(dnode, NULL);
 
@@ -1006,7 +1007,7 @@ static int lib_interface_rip_version_send_modify(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       ifp = yang_dnode_get_entry(dnode, true);
+       ifp = nb_running_get_entry(dnode, NULL, true);
        ri = ifp->info;
        ri->ri_send = yang_dnode_get_enum(dnode, NULL);
 
@@ -1026,7 +1027,7 @@ static int lib_interface_rip_authentication_scheme_mode_modify(
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       ifp = yang_dnode_get_entry(dnode, true);
+       ifp = nb_running_get_entry(dnode, NULL, true);
        ri = ifp->info;
        ri->auth_type = yang_dnode_get_enum(dnode, NULL);
 
@@ -1047,7 +1048,7 @@ static int lib_interface_rip_authentication_scheme_md5_auth_length_modify(
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       ifp = yang_dnode_get_entry(dnode, true);
+       ifp = nb_running_get_entry(dnode, NULL, true);
        ri = ifp->info;
        ri->md5_auth_len = yang_dnode_get_enum(dnode, NULL);
 
@@ -1063,7 +1064,7 @@ static int lib_interface_rip_authentication_scheme_md5_auth_length_destroy(
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       ifp = yang_dnode_get_entry(dnode, true);
+       ifp = nb_running_get_entry(dnode, NULL, true);
        ri = ifp->info;
        ri->md5_auth_len = yang_get_default_enum(
                "%s/authentication-scheme/md5-auth-length", RIP_IFACE);
@@ -1085,7 +1086,7 @@ lib_interface_rip_authentication_password_modify(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       ifp = yang_dnode_get_entry(dnode, true);
+       ifp = nb_running_get_entry(dnode, NULL, true);
        ri = ifp->info;
        XFREE(MTYPE_RIP_INTERFACE_STRING, ri->auth_str);
        ri->auth_str = XSTRDUP(MTYPE_RIP_INTERFACE_STRING,
@@ -1104,7 +1105,7 @@ lib_interface_rip_authentication_password_destroy(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       ifp = yang_dnode_get_entry(dnode, true);
+       ifp = nb_running_get_entry(dnode, NULL, true);
        ri = ifp->info;
        XFREE(MTYPE_RIP_INTERFACE_STRING, ri->auth_str);
 
@@ -1125,7 +1126,7 @@ lib_interface_rip_authentication_key_chain_modify(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       ifp = yang_dnode_get_entry(dnode, true);
+       ifp = nb_running_get_entry(dnode, NULL, true);
        ri = ifp->info;
        XFREE(MTYPE_RIP_INTERFACE_STRING, ri->key_chain);
        ri->key_chain = XSTRDUP(MTYPE_RIP_INTERFACE_STRING,
@@ -1144,7 +1145,7 @@ lib_interface_rip_authentication_key_chain_destroy(enum nb_event event,
        if (event != NB_EV_APPLY)
                return NB_OK;
 
-       ifp = yang_dnode_get_entry(dnode, true);
+       ifp = nb_running_get_entry(dnode, NULL, true);
        ri = ifp->info;
        XFREE(MTYPE_RIP_INTERFACE_STRING, ri->key_chain);
 
@@ -1483,241 +1484,337 @@ const struct frr_yang_module_info frr_ripd_info = {
        .nodes = {
                {
                        .xpath = "/frr-ripd:ripd/instance",
-                       .cbs.create = ripd_instance_create,
-                       .cbs.destroy = ripd_instance_destroy,
-                       .cbs.get_next = ripd_instance_get_next,
-                       .cbs.get_keys = ripd_instance_get_keys,
-                       .cbs.lookup_entry = ripd_instance_lookup_entry,
-                       .cbs.cli_show = cli_show_router_rip,
+                       .cbs = {
+                               .cli_show = cli_show_router_rip,
+                               .create = ripd_instance_create,
+                               .destroy = ripd_instance_destroy,
+                               .get_keys = ripd_instance_get_keys,
+                               .get_next = ripd_instance_get_next,
+                               .lookup_entry = ripd_instance_lookup_entry,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/allow-ecmp",
-                       .cbs.modify = ripd_instance_allow_ecmp_modify,
-                       .cbs.cli_show = cli_show_rip_allow_ecmp,
+                       .cbs = {
+                               .cli_show = cli_show_rip_allow_ecmp,
+                               .modify = ripd_instance_allow_ecmp_modify,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/default-information-originate",
-                       .cbs.modify = ripd_instance_default_information_originate_modify,
-                       .cbs.cli_show = cli_show_rip_default_information_originate,
+                       .cbs = {
+                               .cli_show = cli_show_rip_default_information_originate,
+                               .modify = ripd_instance_default_information_originate_modify,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/default-metric",
-                       .cbs.modify = ripd_instance_default_metric_modify,
-                       .cbs.cli_show = cli_show_rip_default_metric,
+                       .cbs = {
+                               .cli_show = cli_show_rip_default_metric,
+                               .modify = ripd_instance_default_metric_modify,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/distance/default",
-                       .cbs.modify = ripd_instance_distance_default_modify,
-                       .cbs.cli_show = cli_show_rip_distance,
+                       .cbs = {
+                               .cli_show = cli_show_rip_distance,
+                               .modify = ripd_instance_distance_default_modify,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/distance/source",
-                       .cbs.create = ripd_instance_distance_source_create,
-                       .cbs.destroy = ripd_instance_distance_source_destroy,
-                       .cbs.cli_show = cli_show_rip_distance_source,
+                       .cbs = {
+                               .cli_show = cli_show_rip_distance_source,
+                               .create = ripd_instance_distance_source_create,
+                               .destroy = ripd_instance_distance_source_destroy,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/distance/source/distance",
-                       .cbs.modify = ripd_instance_distance_source_distance_modify,
+                       .cbs = {
+                               .modify = ripd_instance_distance_source_distance_modify,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/distance/source/access-list",
-                       .cbs.modify = ripd_instance_distance_source_access_list_modify,
-                       .cbs.destroy = ripd_instance_distance_source_access_list_destroy,
+                       .cbs = {
+                               .destroy = ripd_instance_distance_source_access_list_destroy,
+                               .modify = ripd_instance_distance_source_access_list_modify,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/explicit-neighbor",
-                       .cbs.create = ripd_instance_explicit_neighbor_create,
-                       .cbs.destroy = ripd_instance_explicit_neighbor_destroy,
-                       .cbs.cli_show = cli_show_rip_neighbor,
+                       .cbs = {
+                               .cli_show = cli_show_rip_neighbor,
+                               .create = ripd_instance_explicit_neighbor_create,
+                               .destroy = ripd_instance_explicit_neighbor_destroy,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/network",
-                       .cbs.create = ripd_instance_network_create,
-                       .cbs.destroy = ripd_instance_network_destroy,
-                       .cbs.cli_show = cli_show_rip_network_prefix,
+                       .cbs = {
+                               .cli_show = cli_show_rip_network_prefix,
+                               .create = ripd_instance_network_create,
+                               .destroy = ripd_instance_network_destroy,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/interface",
-                       .cbs.create = ripd_instance_interface_create,
-                       .cbs.destroy = ripd_instance_interface_destroy,
-                       .cbs.cli_show = cli_show_rip_network_interface,
+                       .cbs = {
+                               .cli_show = cli_show_rip_network_interface,
+                               .create = ripd_instance_interface_create,
+                               .destroy = ripd_instance_interface_destroy,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/offset-list",
-                       .cbs.create = ripd_instance_offset_list_create,
-                       .cbs.destroy = ripd_instance_offset_list_destroy,
-                       .cbs.cli_show = cli_show_rip_offset_list,
+                       .cbs = {
+                               .cli_show = cli_show_rip_offset_list,
+                               .create = ripd_instance_offset_list_create,
+                               .destroy = ripd_instance_offset_list_destroy,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/offset-list/access-list",
-                       .cbs.modify = ripd_instance_offset_list_access_list_modify,
+                       .cbs = {
+                               .modify = ripd_instance_offset_list_access_list_modify,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/offset-list/metric",
-                       .cbs.modify = ripd_instance_offset_list_metric_modify,
+                       .cbs = {
+                               .modify = ripd_instance_offset_list_metric_modify,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/passive-default",
-                       .cbs.modify = ripd_instance_passive_default_modify,
-                       .cbs.cli_show = cli_show_rip_passive_default,
+                       .cbs = {
+                               .cli_show = cli_show_rip_passive_default,
+                               .modify = ripd_instance_passive_default_modify,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/passive-interface",
-                       .cbs.create = ripd_instance_passive_interface_create,
-                       .cbs.destroy = ripd_instance_passive_interface_destroy,
-                       .cbs.cli_show = cli_show_rip_passive_interface,
+                       .cbs = {
+                               .cli_show = cli_show_rip_passive_interface,
+                               .create = ripd_instance_passive_interface_create,
+                               .destroy = ripd_instance_passive_interface_destroy,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/non-passive-interface",
-                       .cbs.create = ripd_instance_non_passive_interface_create,
-                       .cbs.destroy = ripd_instance_non_passive_interface_destroy,
-                       .cbs.cli_show = cli_show_rip_non_passive_interface,
+                       .cbs = {
+                               .cli_show = cli_show_rip_non_passive_interface,
+                               .create = ripd_instance_non_passive_interface_create,
+                               .destroy = ripd_instance_non_passive_interface_destroy,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/redistribute",
-                       .cbs.create = ripd_instance_redistribute_create,
-                       .cbs.destroy = ripd_instance_redistribute_destroy,
-                       .cbs.apply_finish = ripd_instance_redistribute_apply_finish,
-                       .cbs.cli_show = cli_show_rip_redistribute,
+                       .cbs = {
+                               .apply_finish = ripd_instance_redistribute_apply_finish,
+                               .cli_show = cli_show_rip_redistribute,
+                               .create = ripd_instance_redistribute_create,
+                               .destroy = ripd_instance_redistribute_destroy,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/redistribute/route-map",
-                       .cbs.modify = ripd_instance_redistribute_route_map_modify,
-                       .cbs.destroy = ripd_instance_redistribute_route_map_destroy,
+                       .cbs = {
+                               .destroy = ripd_instance_redistribute_route_map_destroy,
+                               .modify = ripd_instance_redistribute_route_map_modify,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/redistribute/metric",
-                       .cbs.modify = ripd_instance_redistribute_metric_modify,
-                       .cbs.destroy = ripd_instance_redistribute_metric_destroy,
+                       .cbs = {
+                               .destroy = ripd_instance_redistribute_metric_destroy,
+                               .modify = ripd_instance_redistribute_metric_modify,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/static-route",
-                       .cbs.create = ripd_instance_static_route_create,
-                       .cbs.destroy = ripd_instance_static_route_destroy,
-                       .cbs.cli_show = cli_show_rip_route,
+                       .cbs = {
+                               .cli_show = cli_show_rip_route,
+                               .create = ripd_instance_static_route_create,
+                               .destroy = ripd_instance_static_route_destroy,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/timers",
-                       .cbs.apply_finish = ripd_instance_timers_apply_finish,
-                       .cbs.cli_show = cli_show_rip_timers,
+                       .cbs = {
+                               .apply_finish = ripd_instance_timers_apply_finish,
+                               .cli_show = cli_show_rip_timers,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/timers/flush-interval",
-                       .cbs.modify = ripd_instance_timers_flush_interval_modify,
+                       .cbs = {
+                               .modify = ripd_instance_timers_flush_interval_modify,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/timers/holddown-interval",
-                       .cbs.modify = ripd_instance_timers_holddown_interval_modify,
+                       .cbs = {
+                               .modify = ripd_instance_timers_holddown_interval_modify,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/timers/update-interval",
-                       .cbs.modify = ripd_instance_timers_update_interval_modify,
+                       .cbs = {
+                               .modify = ripd_instance_timers_update_interval_modify,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/version",
-                       .cbs.cli_show = cli_show_rip_version,
+                       .cbs = {
+                               .cli_show = cli_show_rip_version,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/version/receive",
-                       .cbs.modify = ripd_instance_version_receive_modify,
+                       .cbs = {
+                               .modify = ripd_instance_version_receive_modify,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/version/send",
-                       .cbs.modify = ripd_instance_version_send_modify,
+                       .cbs = {
+                               .modify = ripd_instance_version_send_modify,
+                       },
                },
                {
                        .xpath = "/frr-interface:lib/interface/frr-ripd:rip/split-horizon",
-                       .cbs.modify = lib_interface_rip_split_horizon_modify,
-                       .cbs.cli_show = cli_show_ip_rip_split_horizon,
+                       .cbs = {
+                               .cli_show = cli_show_ip_rip_split_horizon,
+                               .modify = lib_interface_rip_split_horizon_modify,
+                       },
                },
                {
                        .xpath = "/frr-interface:lib/interface/frr-ripd:rip/v2-broadcast",
-                       .cbs.modify = lib_interface_rip_v2_broadcast_modify,
-                       .cbs.cli_show = cli_show_ip_rip_v2_broadcast,
+                       .cbs = {
+                               .cli_show = cli_show_ip_rip_v2_broadcast,
+                               .modify = lib_interface_rip_v2_broadcast_modify,
+                       },
                },
                {
                        .xpath = "/frr-interface:lib/interface/frr-ripd:rip/version-receive",
-                       .cbs.modify = lib_interface_rip_version_receive_modify,
-                       .cbs.cli_show = cli_show_ip_rip_receive_version,
+                       .cbs = {
+                               .cli_show = cli_show_ip_rip_receive_version,
+                               .modify = lib_interface_rip_version_receive_modify,
+                       },
                },
                {
                        .xpath = "/frr-interface:lib/interface/frr-ripd:rip/version-send",
-                       .cbs.modify = lib_interface_rip_version_send_modify,
-                       .cbs.cli_show = cli_show_ip_rip_send_version,
+                       .cbs = {
+                               .cli_show = cli_show_ip_rip_send_version,
+                               .modify = lib_interface_rip_version_send_modify,
+                       },
                },
                {
                        .xpath = "/frr-interface:lib/interface/frr-ripd:rip/authentication-scheme",
-                       .cbs.cli_show = cli_show_ip_rip_authentication_scheme,
+                       .cbs = {
+                               .cli_show = cli_show_ip_rip_authentication_scheme,
+                       },
                },
                {
                        .xpath = "/frr-interface:lib/interface/frr-ripd:rip/authentication-scheme/mode",
-                       .cbs.modify = lib_interface_rip_authentication_scheme_mode_modify,
+                       .cbs = {
+                               .modify = lib_interface_rip_authentication_scheme_mode_modify,
+                       },
                },
                {
                        .xpath = "/frr-interface:lib/interface/frr-ripd:rip/authentication-scheme/md5-auth-length",
-                       .cbs.modify = lib_interface_rip_authentication_scheme_md5_auth_length_modify,
-                       .cbs.destroy = lib_interface_rip_authentication_scheme_md5_auth_length_destroy,
+                       .cbs = {
+                               .destroy = lib_interface_rip_authentication_scheme_md5_auth_length_destroy,
+                               .modify = lib_interface_rip_authentication_scheme_md5_auth_length_modify,
+                       },
                },
                {
                        .xpath = "/frr-interface:lib/interface/frr-ripd:rip/authentication-password",
-                       .cbs.modify = lib_interface_rip_authentication_password_modify,
-                       .cbs.destroy = lib_interface_rip_authentication_password_destroy,
-                       .cbs.cli_show = cli_show_ip_rip_authentication_string,
+                       .cbs = {
+                               .cli_show = cli_show_ip_rip_authentication_string,
+                               .destroy = lib_interface_rip_authentication_password_destroy,
+                               .modify = lib_interface_rip_authentication_password_modify,
+                       },
                },
                {
                        .xpath = "/frr-interface:lib/interface/frr-ripd:rip/authentication-key-chain",
-                       .cbs.modify = lib_interface_rip_authentication_key_chain_modify,
-                       .cbs.destroy = lib_interface_rip_authentication_key_chain_destroy,
-                       .cbs.cli_show = cli_show_ip_rip_authentication_key_chain,
+                       .cbs = {
+                               .cli_show = cli_show_ip_rip_authentication_key_chain,
+                               .destroy = lib_interface_rip_authentication_key_chain_destroy,
+                               .modify = lib_interface_rip_authentication_key_chain_modify,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/state/neighbors/neighbor",
-                       .cbs.get_next = ripd_instance_state_neighbors_neighbor_get_next,
-                       .cbs.get_keys = ripd_instance_state_neighbors_neighbor_get_keys,
-                       .cbs.lookup_entry = ripd_instance_state_neighbors_neighbor_lookup_entry,
+                       .cbs = {
+                               .get_keys = ripd_instance_state_neighbors_neighbor_get_keys,
+                               .get_next = ripd_instance_state_neighbors_neighbor_get_next,
+                               .lookup_entry = ripd_instance_state_neighbors_neighbor_lookup_entry,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/state/neighbors/neighbor/address",
-                       .cbs.get_elem = ripd_instance_state_neighbors_neighbor_address_get_elem,
+                       .cbs = {
+                               .get_elem = ripd_instance_state_neighbors_neighbor_address_get_elem,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/state/neighbors/neighbor/last-update",
-                       .cbs.get_elem = ripd_instance_state_neighbors_neighbor_last_update_get_elem,
+                       .cbs = {
+                               .get_elem = ripd_instance_state_neighbors_neighbor_last_update_get_elem,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/state/neighbors/neighbor/bad-packets-rcvd",
-                       .cbs.get_elem = ripd_instance_state_neighbors_neighbor_bad_packets_rcvd_get_elem,
+                       .cbs = {
+                               .get_elem = ripd_instance_state_neighbors_neighbor_bad_packets_rcvd_get_elem,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/state/neighbors/neighbor/bad-routes-rcvd",
-                       .cbs.get_elem = ripd_instance_state_neighbors_neighbor_bad_routes_rcvd_get_elem,
+                       .cbs = {
+                               .get_elem = ripd_instance_state_neighbors_neighbor_bad_routes_rcvd_get_elem,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/state/routes/route",
-                       .cbs.get_next = ripd_instance_state_routes_route_get_next,
-                       .cbs.get_keys = ripd_instance_state_routes_route_get_keys,
-                       .cbs.lookup_entry = ripd_instance_state_routes_route_lookup_entry,
+                       .cbs = {
+                               .get_keys = ripd_instance_state_routes_route_get_keys,
+                               .get_next = ripd_instance_state_routes_route_get_next,
+                               .lookup_entry = ripd_instance_state_routes_route_lookup_entry,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/state/routes/route/prefix",
-                       .cbs.get_elem = ripd_instance_state_routes_route_prefix_get_elem,
+                       .cbs = {
+                               .get_elem = ripd_instance_state_routes_route_prefix_get_elem,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/state/routes/route/next-hop",
-                       .cbs.get_elem = ripd_instance_state_routes_route_next_hop_get_elem,
+                       .cbs = {
+                               .get_elem = ripd_instance_state_routes_route_next_hop_get_elem,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/state/routes/route/interface",
-                       .cbs.get_elem = ripd_instance_state_routes_route_interface_get_elem,
+                       .cbs = {
+                               .get_elem = ripd_instance_state_routes_route_interface_get_elem,
+                       },
                },
                {
                        .xpath = "/frr-ripd:ripd/instance/state/routes/route/metric",
-                       .cbs.get_elem = ripd_instance_state_routes_route_metric_get_elem,
+                       .cbs = {
+                               .get_elem = ripd_instance_state_routes_route_metric_get_elem,
+                       },
                },
                {
                        .xpath = "/frr-ripd:clear-rip-route",
-                       .cbs.rpc = clear_rip_route_rpc,
+                       .cbs = {
+                               .rpc = clear_rip_route_rpc,
+                       },
                },
                {
                        .xpath = NULL,