Hi I have implemented the get_next_object_list() (GET_NEXT_OBJECT_LIST) for the below yang format

list employees {
key id;
leaf id { type string;}
leaf name { type string;}
container address {
leaf street {type string;}
leaf pincode{type string;}

When we implemented the GET_NEXT_LIST_OBJECT when user requests for command - “show employees” i am not able to return any values for the container address and its leaf. Only the direct leaf values are being displayed. After that there is no request sent from confd through get_elem() for the container and its leaf.
but when user requests command as “show employees 1 address” it requests for the address and its lead through get_elem().

Is there a way to get the containers as well through the get_next_object_list() itself.

Sweetlin S

Hi Can anybody help me with the above query. Just want to know if its the expected behaviour or a bug in confd which will be fixed later.

Your question is a bit confusing since there is no callback called get_next_object_list() in the ConfD API - perhaps you mean that you have implemented a get_next_object() callback that returns multiple list entries by calling confd_data_reply_next_object_arrays() or confd_data_reply_next_object_tag_value_arrays().

Anyway, this seems unrelated to the problem you describe - exactly how to include a sub-container and its contents in the reply depends on which of those two functions you use, and it’s the same as for a single-entry reply to get_next_object() (or get_object()). As described in the confd_lib_dp(3) man page, the reply array is populated according to the specification of the “Value Array” (for confd_data_reply_next_object_arrays()) or “Tagged Value Array” (for confd_data_reply_next_object_tag_value_arrays()) format in the XML STRUCTURES section of the confd_types(3) man page.

I can venture a guess that you use the tag_value format, in which case this is the relevant text from confd_types(3):

  2. List and container nodes use one array element where the value
     has type C_XMLBEGIN, and tag and ns set according to the node name,
     followed by array elements for the sub-nodes according to this
     list, followed by one array element where the value has type
     C_XMLEND, and tag and ns set according to the node name.

You’d typically use the macros CONFD_SET_TAG_XMLBEGIN() and CONFD_SET_TAG_XMLEND() to set these array elements.