]> git.proxmox.com Git - mirror_frr.git/commit
lib, tests: add support for keyless YANG lists
authorRenato Westphal <renato@opensourcerouting.org>
Sat, 8 Dec 2018 19:31:16 +0000 (17:31 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Sun, 9 Dec 2018 15:58:53 +0000 (13:58 -0200)
commit99fb518fef7d40c20921ce63764e7578d1149fa8
treec2f15f9d552ed00f4cc1b5f8bbf3dbbc30a71b26
parentca6541963cd00cc24d53debee2c570810c609aec
lib, tests: add support for keyless YANG lists

YANG allows lists without keys for operational data, in which case
the list elements are uniquely identified using a positional index
(starting from one).

This commit does the following:
* Remove the need to implement the 'get_keys' and 'lookup_entry'
  callbacks for keyless lists.
* Extend nb_oper_data_iter_list() so that it special-cases keyless
  lists appropriately. Since both the CLI and the sysrepo plugin
  use nb_oper_data_iterate() to fetch operational data, both these
  northbound clients automatically gain the ability to understand
  keyless lists without additional changes.
* Extend the confd plugin to special-case keyless lists as well. This
  was a bit painful to implement given ConfD's clumsy API, but
  keyless lists should work ok now.
* Update the "test_oper_data" unit test to test keyless YANG lists in
  addition to regular lists.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
lib/northbound.c
lib/northbound.h
lib/northbound_confd.c
tests/lib/northbound/test_oper_data.c
yang/frr-test-module.yang