]> git.proxmox.com Git - mirror_frr.git/commit - lib/yang.c
lib: better support for nested YANG augmentations
authorRenato Westphal <renato@opensourcerouting.org>
Thu, 10 Sep 2020 20:12:09 +0000 (17:12 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Fri, 11 Sep 2020 18:46:40 +0000 (15:46 -0300)
commit8a923b48513316bda9ab9868ebe4f9ff4865c8a9
tree49aad94aa0ca0f857bbb3f580ad29c0c6b575b5c
parenta77bd0f4e6b7d63e6f66288d7ea715ae8c55feee
lib: better support for nested YANG augmentations

Change the way the YANG schema node iteration functions work so that
the northbound layer won't have issues with more complex YANG modules
that contain multiple levels of YANG augmentations or modules that
augment themselves indirectly (by augmenting groupings).

Summary of the changes:
* Change the yang_snodes_iterate_subtree() function to always follow
  augmentations and add an optional "module" parameter to narrow down
  the iteration to nodes of a single module (which is necessary in
  some cases). Also, remove the YANG_ITER_ALLOW_AUGMENTATIONS flag
  as it's no longer necessary.
* Change yang_snodes_iterate_all() to do a DFS iteration on the resolved
  YANG data hierarchy instead of iterating over each module and their
  augmentations sequentially.

Reported-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
lib/northbound.c
lib/yang.c
lib/yang.h