]> git.proxmox.com Git - mirror_frr.git/commit - lib/northbound_cli.c
lib, tests: major rework in the operational-data callbacks
authorRenato Westphal <renato@opensourcerouting.org>
Sat, 3 Nov 2018 00:16:55 +0000 (22:16 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Mon, 26 Nov 2018 20:28:53 +0000 (18:28 -0200)
commit1a4bc045deac52e5c0b66d151dbbce8cc3675497
treefa244f4c2f65da6f20bc8b44dd78315483e47bce
parent85cd3326fd4fd424e17c964255d18f3803369e05
lib, tests: major rework in the operational-data callbacks

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>
17 files changed:
lib/lib_errors.c
lib/lib_errors.h
lib/northbound.c
lib/northbound.h
lib/northbound_cli.c
lib/northbound_confd.c
lib/northbound_sysrepo.c
ripd/rip_northbound.c
tests/.gitignore
tests/lib/northbound/test_oper_data.c [new file with mode: 0644]
tests/lib/northbound/test_oper_data.in [new file with mode: 0644]
tests/lib/northbound/test_oper_data.py [new file with mode: 0644]
tests/lib/northbound/test_oper_data.refout [new file with mode: 0644]
tests/subdir.am
tools/gen_northbound_callbacks.c
yang/frr-test-module.yang [new file with mode: 0644]
yang/subdir.am