Add VES stndDefined PM and subscription for O-DU.
[sim/o1-interface.git] / ntsimulator / ntsim-ng / core / datastore / populate_internal.h
1 /*************************************************************************
2 *
3 * Copyright 2021 highstreet technologies GmbH and others
4 *
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
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
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 ***************************************************************************/
17
18 #pragma once
19
20 #include <stdint.h>
21 #include <libyang/libyang.h>
22 #include <stdbool.h>
23
24 #define POPULATE_LEAFREF_TEST_ENTRIES_TOTAL      11
25
26 typedef struct {
27     int init;
28
29     char *xpath;
30
31     const struct lys_module **modules;
32     int mod_count;
33
34     struct lyd_node *dev;
35     struct lyd_node *operational;
36     struct lyd_node *running;
37 } populate_instance_t;
38
39 typedef struct {
40     struct lyd_node *dev;
41     struct lyd_node *operational;
42     struct lyd_node *running;
43
44     bool late_resolving;
45
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;
52 } populate_job_t;
53
54 //populate_aux.c
55 struct lyd_node *datastore_load_external(const char *filename, bool operational);
56
57 char populate_info_get_mandatory(const struct lys_node *schema);
58 const char* populate_leafref_test_val(int index);
59
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);
63
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);
67
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);
71
72 //populate_validation.c
73 int populate_validate(populate_instance_t *instance, int count);