1 /*************************************************************************
3 * Copyright 2021 highstreet technologies GmbH and others
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 ***************************************************************************/
21 #include <libyang/libyang.h>
24 #define POPULATE_LEAFREF_TEST_ENTRIES_TOTAL 11
31 const struct lys_module **modules;
35 struct lyd_node *operational;
36 struct lyd_node *running;
37 } populate_instance_t;
41 struct lyd_node *operational;
42 struct lyd_node *running;
46 int late_resolve_count;
47 struct lys_node **late_resolve_schema;
48 struct lyd_node **late_resolve_parent_d;
49 struct lyd_node **late_resolve_parent_o;
50 struct lyd_node **late_resolve_parent_r;
51 populate_instance_t **late_resolve_instance;
55 struct lyd_node *datastore_load_external(const char *filename, bool operational);
57 char populate_info_get_mandatory(const struct lys_node *schema);
58 const char* populate_leafref_test_val(int index);
60 int populate_instance_add_module(populate_instance_t *instance, const struct lys_module *module);
61 int populate_instance_get_count(const char *path);
62 char *populate_get_restrict_schema(const char *path);
64 //populate_late_resolve.c
65 int populate_late_resolve_add_leaf(populate_job_t *job, populate_instance_t *instance, struct lys_node *schema, struct lyd_node *parent_d, struct lyd_node *parent_o, struct lyd_node *parent_r);
66 int populate_late_resolve(populate_job_t *job);
68 //populate_recursive.c
69 int populate_recursive(populate_job_t *job, populate_instance_t *instance, struct lys_node *schema, struct lyd_node *parent_d, struct lyd_node *parent_o, struct lyd_node *parent_r, int operational_only);
70 int populate_add_leaf(populate_job_t *job, populate_instance_t *instance, struct lys_node *schema, struct lyd_node *parent_d, struct lyd_node *parent_o, struct lyd_node *parent_r);
72 //populate_validation.c
73 int populate_validate(populate_instance_t *instance, int count);