summaryrefslogtreecommitdiffstats
path: root/tools/gen_northbound_callbacks.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* lib, tests: major rework in the operational-data callbacksRenato Westphal2018-11-261-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | The northbound infrastructure for operational data was subpar compared to the infrastructure for configuration data. This commit addresses most of the existing problems, making it possible to write operational-data callbacks for more complex YANG models. Summary of the changes: * Add support for nested YANG lists. * Add support for leaf-lists. * Add support for leafs of type "empty". * Introduce the "show yang operational-data XPATH" command, and write an unit test for it. The main purpose of this command is to make it easier to test the operational-data northbound callbacks. * Introduce the nb_oper_data_iterate() function, that can be used to iterate over operational data. Make the CLI and sysrepo use this function. * Since ConfD has a very peculiar API, it can't reuse the nb_oper_data_iterate() like the other northbound clients. In this case, adapt the existing ConfD callbacks to support the new features (and make some performance improvements in the process). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* lib: add support for YANG lists with mixed config and state dataRenato Westphal2018-11-261-2/+10
| | | | | | | | A YANG list that contains both configuration and state data must have the following callbacks: create(), delete(), get_next(), get_keys() and lookup_entry(). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* lib: rework the yang schema node iteration functionsRenato Westphal2018-11-261-10/+10
| | | | | | | | | | | | | * Rename yang_snodes_iterate() to yang_snodes_iterate_subtree() and expose it in the public API. * Rename yang_module_snodes_iterate() to yang_snodes_iterate_module(). * Rename yang_all_snodes_iterate() to yang_snodes_iterate_all(). * Make it possible to stop the iteration at any time by returning YANG_ITER_STOP in the iteration callbacks. * Make the iteration callbacks accept only one user argument and not two. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* lib, tools: use CHECK_FLAG/SET_FLAG more often in the northbound codeRenato Westphal2018-11-261-3/+3
| | | | | | Cosmetic change to improve code readability a bit. No binary changes. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* lib: introduce new northbound APIRenato Westphal2018-10-271-0/+302
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>