debug print of backend state, split test-stream into a netconf and restconf part, change restconf yang auth-type from leaf-list to leaf

This commit is contained in:
Olof hagsand 2021-01-27 14:40:34 +01:00
parent a5f32fbedf
commit b41f68b677
13 changed files with 244 additions and 63 deletions

View file

@ -560,3 +560,32 @@ xmldb_modified_set(clicon_handle h,
de->de_modified = value;
return 0;
}
/* Print the datastore meta-info to file
*/
int
xmldb_print(clicon_handle h,
FILE *f)
{
int retval = -1;
db_elmnt *de = NULL;
char **keys = NULL;
size_t klen;
int i;
if (clicon_hash_keys(clicon_db_elmnt(h), &keys, &klen) < 0)
goto done;
for (i = 0; i < klen; i++){
/* XXX name */
if ((de = clicon_db_elmnt_get(h, keys[i])) == NULL)
continue;
fprintf(f, "Datastore: %s\n", keys[i]);
fprintf(f, " Session: %u\n", de->de_id);
fprintf(f, " XML: %p\n", de->de_xml);
fprintf(f, " Modified: %d\n", de->de_modified);
fprintf(f, " Empty: %d\n", de->de_empty);
}
retval = 0;
done:
return retval;
}