How to add the support of the get_next_object() callback to the 5-c_stats example?

Hello,

please see description in the man confd_types manpage,
namely section “XML STRUCTURES”, subsection “Value Array
(or Tagged Value Array, depending on which callback/data you need to return):
specifically:

2. List nodes use a single array element, with type C_NOEXISTS (value ignored), regardless of the actual number of entries or their contents

(plus other specific rules for list entry child nodes, e.g. empty leaves etc.)

Returning the “C_NOEXISTS” as a value of the inner list will then cause ConfD to invoke another get_object() (or other) callbacks to iterate the children list entries of inner list with appropriate input keypath…

Assuming e.g. pseudo-model:

list outer {
    key "a";
    leaf a { type int32; }
    list inner {
        key "x";
        leaf x { type int32; }
        // other child-leaves
    }
    leaf b { type string; }
}

For a get_next_object() request with input keypath “/outer”, you can yield response like 11 C_NOEXISTS london.
(array of three confd_value_t the one representing inner list == C_NOEXISTS)

In case ConfD is interested internally in inner list values too, it will invoke further requests with input keypath “/outer{11}/inner”…