summaryrefslogtreecommitdiff
path: root/lib/yang_translator.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2020-10-22 22:19:10 -0300
committerRenato Westphal <renato@opensourcerouting.org>2020-10-23 18:18:22 -0300
commit8d869d378bf10ee02e4aed66c9c3c16f15fe0c26 (patch)
tree04dadc1e6681ffa3f4939da8367889d62f95cdb5 /lib/yang_translator.c
parent9bde0b256919ff3987ea60101229fec195324102 (diff)
lib: combine two YANG schema iteration functions into one
Combine yang_snodes_iterate_module() and yang_snodes_iterate_all() into an unified yang_snodes_iterate() function, where the first "module" parameter is optional. There's no point in having two separate YANG schema iteration functions anymore now that they are too similar. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/yang_translator.c')
-rw-r--r--lib/yang_translator.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/yang_translator.c b/lib/yang_translator.c
index 7dbb1f3f1a..1f64675d6a 100644
--- a/lib/yang_translator.c
+++ b/lib/yang_translator.c
@@ -469,12 +469,12 @@ static unsigned int yang_translator_validate(struct yang_translator *translator)
args.errors = 0;
for (ALL_LIST_ELEMENTS_RO(translator->modules, ln, tmodule)) {
- yang_snodes_iterate_module(
- tmodule->module, yang_translator_validate_cb,
- YANG_ITER_FILTER_NPCONTAINERS
- | YANG_ITER_FILTER_LIST_KEYS
- | YANG_ITER_FILTER_INPUT_OUTPUT,
- &args);
+ yang_snodes_iterate(tmodule->module,
+ yang_translator_validate_cb,
+ YANG_ITER_FILTER_NPCONTAINERS
+ | YANG_ITER_FILTER_LIST_KEYS
+ | YANG_ITER_FILTER_INPUT_OUTPUT,
+ &args);
}
if (args.errors)
@@ -500,11 +500,11 @@ static unsigned int yang_module_nodes_count(const struct lys_module *module)
{
unsigned int total = 0;
- yang_snodes_iterate_module(module, yang_module_nodes_count_cb,
- YANG_ITER_FILTER_NPCONTAINERS
- | YANG_ITER_FILTER_LIST_KEYS
- | YANG_ITER_FILTER_INPUT_OUTPUT,
- &total);
+ yang_snodes_iterate(module, yang_module_nodes_count_cb,
+ YANG_ITER_FILTER_NPCONTAINERS
+ | YANG_ITER_FILTER_LIST_KEYS
+ | YANG_ITER_FILTER_INPUT_OUTPUT,
+ &total);
return total;
}