After loading the schema of your YANG data model using either maapi_load_schemas() or confd_load_schemas() API call, you can walk through the confd_cs_node data structure to reconstruct your data model dynamically at run time. confd_cs_node contains a structure called info that is defined as “struct confd_cs_node_info”. The info.shallow_type field contains the primitive confd data types for the node, such as C_STR, CINT32, C_BOOL, etc… However, this info.shallow_type field is defined as C_XMLTAG for both container and list nodes. How do you tell them apart?
What you do is to resort to the info.keys field which is defined as a pointer to u_int32_t. The info.keys field of a container node is NULL, whereas the info.keys field of a list node is a zero-terminated array of XML tags of the keys in the list.