blob: 8d1f24a5fdc317154e81741672bf6db0aaa20f41 [file] [log] [blame]
Radek Krejcif0e1ba52020-05-22 15:14:35 +02001/**
2 * @file parser_internal.h
3 * @author Radek Krejci <rkrejci@cesnet.cz>
4 * @brief Internal structures and functions for libyang parsers
5 *
6 * Copyright (c) 2020 CESNET, z.s.p.o.
7 *
8 * This source code is licensed under BSD 3-Clause License (the "License").
9 * You may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * https://opensource.org/licenses/BSD-3-Clause
13 */
14
15#ifndef LY_PARSER_INTERNAL_H_
16#define LY_PARSER_INTERNAL_H_
17
Michal Vaskoe0665742021-02-11 11:08:44 +010018#include "parser_data.h"
aPiecek704f8e92021-08-25 13:35:05 +020019#include "set.h"
Radek Krejcif0e1ba52020-05-22 15:14:35 +020020
Radek Krejci1798aae2020-07-14 13:26:06 +020021struct lyd_ctx;
Michal Vaskoafac7822020-10-20 14:22:26 +020022struct ly_in;
aPiecek704f8e92021-08-25 13:35:05 +020023struct lys_yang_parser_ctx;
24struct lys_yin_parser_ctx;
25struct lys_parser_ctx;
Michal Vaskoc8a230d2020-08-14 12:17:10 +020026
Radek Krejci1798aae2020-07-14 13:26:06 +020027/**
Radek Krejci84d7fd72021-07-14 18:32:21 +020028 * @brief Callback for ::lyd_ctx to free the structure
Radek Krejci1798aae2020-07-14 13:26:06 +020029 *
30 * @param[in] ctx Data parser context to free.
31 */
32typedef void (*lyd_ctx_free_clb)(struct lyd_ctx *ctx);
33
34/**
Michal Vaskoe0665742021-02-11 11:08:44 +010035 * @brief Internal data parser flags.
36 */
37#define LYD_INTOPT_RPC 0x01 /**< RPC request is being parsed. */
38#define LYD_INTOPT_ACTION 0x02 /**< Action request is being parsed. */
39#define LYD_INTOPT_REPLY 0x04 /**< RPC/action reply is being parsed. */
40#define LYD_INTOPT_NOTIF 0x08 /**< Notification is being parsed. */
Michal Vasko02ed9d82021-07-15 14:58:04 +020041#define LYD_INTOPT_ANY 0x10 /**< Anydata/anyxml content is being parsed, there can be anything. */
42#define LYD_INTOPT_WITH_SIBLINGS 0x20 /**< Parse the whole input with any siblings. */
43#define LYD_INTOPT_NO_SIBLINGS 0x40 /**< If there are any siblings, return an error. */
Michal Vaskoe0665742021-02-11 11:08:44 +010044
45/**
Radek Krejci1798aae2020-07-14 13:26:06 +020046 * @brief Internal (common) context for YANG data parsers.
Radek Krejci4f2e3e52021-03-30 14:20:28 +020047 *
Radek Krejci84d7fd72021-07-14 18:32:21 +020048 * Covers ::lyd_xml_ctx, ::lyd_json_ctx and ::lyd_lyb_ctx.
Radek Krejci1798aae2020-07-14 13:26:06 +020049 */
50struct lyd_ctx {
Radek Krejcif16e2542021-02-17 15:39:23 +010051 const struct lysc_ext_instance *ext; /**< extension instance possibly changing document root context of the data being parsed */
Michal Vaskoe0665742021-02-11 11:08:44 +010052 uint32_t parse_opts; /**< various @ref dataparseroptions. */
53 uint32_t val_opts; /**< various @ref datavalidationoptions. */
54 uint32_t int_opts; /**< internal parser options */
Radek Krejci1798aae2020-07-14 13:26:06 +020055 uint32_t path_len; /**< used bytes in the path buffer */
Michal Vasko26bbb272022-08-02 14:54:33 +020056
Radek Krejci1798aae2020-07-14 13:26:06 +020057#define LYD_PARSER_BUFSIZE 4078
58 char path[LYD_PARSER_BUFSIZE]; /**< buffer for the generated path */
Michal Vaskoc43c8ab2021-03-05 13:32:44 +010059 struct ly_set node_when; /**< set of nodes with "when" conditions */
Michal Vasko32711382020-12-03 14:14:31 +010060 struct ly_set node_types; /**< set of nodes validated with LY_EINCOMPLETE result */
61 struct ly_set meta_types; /**< set of metadata validated with LY_EINCOMPLETE result */
Michal Vaskoddd76592022-01-17 13:34:48 +010062 struct ly_set ext_val; /**< set of first siblings parsed by extensions to validate */
Radek Krejci1798aae2020-07-14 13:26:06 +020063 struct lyd_node *op_node; /**< if an RPC/action/notification is being parsed, store the pointer to it */
64
65 /* callbacks */
Radek Krejci0bff0b12020-08-15 18:37:50 +020066 lyd_ctx_free_clb free; /**< destructor */
Radek Krejci1798aae2020-07-14 13:26:06 +020067
68 struct {
Radek Krejci0bff0b12020-08-15 18:37:50 +020069 const struct ly_ctx *ctx; /**< libyang context */
70 uint64_t line; /**< current line */
71 struct ly_in *in; /**< input structure */
72 } *data_ctx; /**< generic pointer supposed to map to and access (common part of) XML/JSON/... parser contexts */
Radek Krejci1798aae2020-07-14 13:26:06 +020073};
74
Radek Krejci7931b192020-06-25 17:05:03 +020075/**
Michal Vasko03fbaed2021-07-15 09:18:32 +020076 * @brief Internal context for XML data parser.
77 */
78struct lyd_xml_ctx {
79 const struct lysc_ext_instance *ext;
80 uint32_t parse_opts;
81 uint32_t val_opts;
82 uint32_t int_opts;
83 uint32_t path_len;
84 char path[LYD_PARSER_BUFSIZE];
85 struct ly_set node_when;
Michal Vasko03fbaed2021-07-15 09:18:32 +020086 struct ly_set node_types;
87 struct ly_set meta_types;
Michal Vaskoddd76592022-01-17 13:34:48 +010088 struct ly_set ext_val;
Michal Vasko03fbaed2021-07-15 09:18:32 +020089 struct lyd_node *op_node;
90
91 /* callbacks */
92 lyd_ctx_free_clb free;
93
94 struct lyxml_ctx *xmlctx; /**< XML context */
95};
96
97/**
98 * @brief Internal context for JSON data parser.
99 */
100struct lyd_json_ctx {
101 const struct lysc_ext_instance *ext;
102 uint32_t parse_opts;
103 uint32_t val_opts;
104 uint32_t int_opts;
105 uint32_t path_len;
106 char path[LYD_PARSER_BUFSIZE];
107 struct ly_set node_when;
Michal Vasko03fbaed2021-07-15 09:18:32 +0200108 struct ly_set node_types;
109 struct ly_set meta_types;
Michal Vaskoddd76592022-01-17 13:34:48 +0100110 struct ly_set ext_val;
Michal Vasko03fbaed2021-07-15 09:18:32 +0200111 struct lyd_node *op_node;
112
113 /* callbacks */
114 lyd_ctx_free_clb free;
115
116 struct lyjson_ctx *jsonctx; /**< JSON context */
117};
118
119/**
120 * @brief Internal context for LYB data parser/printer.
121 */
122struct lyd_lyb_ctx {
123 const struct lysc_ext_instance *ext;
Michal Vasko26bbb272022-08-02 14:54:33 +0200124
Michal Vasko03fbaed2021-07-15 09:18:32 +0200125 union {
126 struct {
127 uint32_t parse_opts;
128 uint32_t val_opts;
129 };
130 uint32_t print_options;
131 };
132 uint32_t int_opts;
133 uint32_t path_len;
134 char path[LYD_PARSER_BUFSIZE];
135 struct ly_set node_when;
Michal Vasko03fbaed2021-07-15 09:18:32 +0200136 struct ly_set node_types;
137 struct ly_set meta_types;
Michal Vaskoddd76592022-01-17 13:34:48 +0100138 struct ly_set ext_val;
Michal Vasko03fbaed2021-07-15 09:18:32 +0200139 struct lyd_node *op_node;
140
141 /* callbacks */
142 lyd_ctx_free_clb free;
143
144 struct lylyb_ctx *lybctx; /* LYB context */
145};
146
147/**
Michal Vaskoddd76592022-01-17 13:34:48 +0100148 * @brief Parsed extension instance data to validate.
149 */
150struct lyd_ctx_ext_val {
151 struct lysc_ext_instance *ext;
152 struct lyd_node *sibling;
153};
154
155/**
Radek Krejci84d7fd72021-07-14 18:32:21 +0200156 * @brief Common part to supplement the specific ::lyd_ctx_free_clb callbacks.
Radek Krejci1798aae2020-07-14 13:26:06 +0200157 */
Michal Vaskoddd76592022-01-17 13:34:48 +0100158void lyd_ctx_free(struct lyd_ctx *ctx);
Radek Krejci1798aae2020-07-14 13:26:06 +0200159
160/**
Radek Krejcif0e1ba52020-05-22 15:14:35 +0200161 * @brief Parse submodule from YANG data.
Radek Krejci84d7fd72021-07-14 18:32:21 +0200162 * @param[in,out] context Parser context.
Radek Krejcif0e1ba52020-05-22 15:14:35 +0200163 * @param[in] ly_ctx Context of YANG schemas.
164 * @param[in] main_ctx Parser context of main module.
Michal Vasko63f3d842020-07-08 10:10:14 +0200165 * @param[in] in Input structure.
Radek Krejcif0e1ba52020-05-22 15:14:35 +0200166 * @param[out] submod Pointer to the parsed submodule structure.
167 * @return LY_ERR value - LY_SUCCESS, LY_EINVAL or LY_EVALID.
168 */
169LY_ERR yang_parse_submodule(struct lys_yang_parser_ctx **context, struct ly_ctx *ly_ctx, struct lys_parser_ctx *main_ctx,
Radek Krejci0f969882020-08-21 16:56:47 +0200170 struct ly_in *in, struct lysp_submodule **submod);
Radek Krejcif0e1ba52020-05-22 15:14:35 +0200171
172/**
173 * @brief Parse module from YANG data.
Radek Krejci84d7fd72021-07-14 18:32:21 +0200174 * @param[in] context Parser context.
Michal Vasko63f3d842020-07-08 10:10:14 +0200175 * @param[in] in Input structure.
176 * @param[in,out] mod Prepared module structure where the parsed information, including the parsed
Radek Krejcif0e1ba52020-05-22 15:14:35 +0200177 * module structure, will be filled in.
Michal Vasko405cc9e2020-12-01 12:01:27 +0100178 * @return LY_ERR values.
Radek Krejcif0e1ba52020-05-22 15:14:35 +0200179 */
aPiecekc3e26142021-06-22 14:25:49 +0200180LY_ERR yang_parse_module(struct lys_yang_parser_ctx **context, struct ly_in *in, struct lys_module *mod);
Radek Krejcif0e1ba52020-05-22 15:14:35 +0200181
182/**
183 * @brief Parse module from YIN data.
184 *
185 * @param[in,out] yin_ctx Context created during parsing, is used to finalize lysp_model after it's completly parsed.
Michal Vasko63f3d842020-07-08 10:10:14 +0200186 * @param[in] in Input structure.
Radek Krejcif0e1ba52020-05-22 15:14:35 +0200187 * @param[in,out] mod Prepared module structure where the parsed information, including the parsed
188 * module structure, will be filled in.
Radek Krejcif0e1ba52020-05-22 15:14:35 +0200189 * @return LY_ERR values.
190 */
aPiecekc3e26142021-06-22 14:25:49 +0200191LY_ERR yin_parse_module(struct lys_yin_parser_ctx **yin_ctx, struct ly_in *in, struct lys_module *mod);
Radek Krejcif0e1ba52020-05-22 15:14:35 +0200192
193/**
194 * @brief Parse submodule from YIN data.
195 *
196 * @param[in,out] yin_ctx Context created during parsing, is used to finalize lysp_model after it's completly parsed.
197 * @param[in] ctx Libyang context.
198 * @param[in] main_ctx Parser context of main module.
Michal Vasko63f3d842020-07-08 10:10:14 +0200199 * @param[in] in Input structure.
Radek Krejcif0e1ba52020-05-22 15:14:35 +0200200 * @param[in,out] submod Submodule structure where the parsed information, will be filled in.
201 * @return LY_ERR values.
202 */
203LY_ERR yin_parse_submodule(struct lys_yin_parser_ctx **yin_ctx, struct ly_ctx *ctx, struct lys_parser_ctx *main_ctx,
Radek Krejci0f969882020-08-21 16:56:47 +0200204 struct ly_in *in, struct lysp_submodule **submod);
Radek Krejcif0e1ba52020-05-22 15:14:35 +0200205
Radek Krejci1798aae2020-07-14 13:26:06 +0200206/**
Michal Vaskoe0665742021-02-11 11:08:44 +0100207 * @brief Parse XML string as a YANG data tree.
Michal Vaskoafac7822020-10-20 14:22:26 +0200208 *
Michal Vaskoe0665742021-02-11 11:08:44 +0100209 * @param[in] ctx libyang context.
aPiecekb0445f22021-06-24 11:34:07 +0200210 * @param[in] ext Optional extension instance to parse data following the schema tree specified in the extension instance
Michal Vaskoe0665742021-02-11 11:08:44 +0100211 * @param[in] parent Parent to connect the parsed nodes to, if any.
212 * @param[in,out] first_p Pointer to the first top-level parsed node, used only if @p parent is NULL.
Michal Vaskoafac7822020-10-20 14:22:26 +0200213 * @param[in] in Input structure.
Michal Vaskoe0665742021-02-11 11:08:44 +0100214 * @param[in] parse_opts Options for parser, see @ref dataparseroptions.
215 * @param[in] val_opts Options for the validation phase, see @ref datavalidationoptions.
216 * @param[in] data_type Expected data type of the data.
Michal Vasko299d5d12021-02-16 16:36:37 +0100217 * @param[out] envp Individual parsed envelopes tree, returned only by specific @p data_type and possibly even if
218 * an error occurs later.
Michal Vaskoe0665742021-02-11 11:08:44 +0100219 * @param[out] parsed Set to add all the parsed siblings into.
Michal Vaskoddd76592022-01-17 13:34:48 +0100220 * @param[out] subtree_sibling Set if ::LYD_PARSE_SUBTREE is used and another subtree is following in @p in.
Michal Vaskoafac7822020-10-20 14:22:26 +0200221 * @param[out] lydctx_p Data parser context to finish validation.
222 * @return LY_ERR value.
223 */
Radek Krejcif16e2542021-02-17 15:39:23 +0100224LY_ERR lyd_parse_xml(const struct ly_ctx *ctx, const struct lysc_ext_instance *ext, struct lyd_node *parent,
225 struct lyd_node **first_p, struct ly_in *in, uint32_t parse_opts, uint32_t val_opts, enum lyd_type data_type,
Michal Vaskoddd76592022-01-17 13:34:48 +0100226 struct lyd_node **envp, struct ly_set *parsed, ly_bool *subtree_sibling, struct lyd_ctx **lydctx_p);
Michal Vaskoafac7822020-10-20 14:22:26 +0200227
228/**
Michal Vaskoe0665742021-02-11 11:08:44 +0100229 * @brief Parse JSON string as a YANG data tree.
Michal Vaskoafac7822020-10-20 14:22:26 +0200230 *
Michal Vaskoafac7822020-10-20 14:22:26 +0200231 * @param[in] ctx libyang context.
aPiecekb0445f22021-06-24 11:34:07 +0200232 * @param[in] ext Optional extension instance to parse data following the schema tree specified in the extension instance
Michal Vaskoe0665742021-02-11 11:08:44 +0100233 * @param[in] parent Parent to connect the parsed nodes to, if any.
234 * @param[in,out] first_p Pointer to the first top-level parsed node, used only if @p parent is NULL.
Michal Vaskoafac7822020-10-20 14:22:26 +0200235 * @param[in] in Input structure.
Michal Vaskoe0665742021-02-11 11:08:44 +0100236 * @param[in] parse_opts Options for parser, see @ref dataparseroptions.
237 * @param[in] val_opts Options for the validation phase, see @ref datavalidationoptions.
238 * @param[in] data_type Expected data type of the data.
239 * @param[out] parsed Set to add all the parsed siblings into.
Michal Vaskoddd76592022-01-17 13:34:48 +0100240 * @param[out] subtree_sibling Set if ::LYD_PARSE_SUBTREE is used and another subtree is following in @p in.
Michal Vaskoafac7822020-10-20 14:22:26 +0200241 * @param[out] lydctx_p Data parser context to finish validation.
242 * @return LY_ERR value.
243 */
Radek Krejcif16e2542021-02-17 15:39:23 +0100244LY_ERR lyd_parse_json(const struct ly_ctx *ctx, const struct lysc_ext_instance *ext, struct lyd_node *parent,
245 struct lyd_node **first_p, struct ly_in *in, uint32_t parse_opts, uint32_t val_opts, enum lyd_type data_type,
Michal Vaskoddd76592022-01-17 13:34:48 +0100246 struct ly_set *parsed, ly_bool *subtree_sibling, struct lyd_ctx **lydctx_p);
Michal Vaskoafac7822020-10-20 14:22:26 +0200247
248/**
Michal Vaskoe0665742021-02-11 11:08:44 +0100249 * @brief Parse binary LYB data as a YANG data tree.
Michal Vaskoafac7822020-10-20 14:22:26 +0200250 *
Michal Vaskoafac7822020-10-20 14:22:26 +0200251 * @param[in] ctx libyang context.
aPiecekb0445f22021-06-24 11:34:07 +0200252 * @param[in] ext Optional extension instance to parse data following the schema tree specified in the extension instance
Michal Vaskoe0665742021-02-11 11:08:44 +0100253 * @param[in] parent Parent to connect the parsed nodes to, if any.
254 * @param[in,out] first_p Pointer to the first top-level parsed node, used only if @p parent is NULL.
Michal Vaskoafac7822020-10-20 14:22:26 +0200255 * @param[in] in Input structure.
Michal Vaskoe0665742021-02-11 11:08:44 +0100256 * @param[in] parse_opts Options for parser, see @ref dataparseroptions.
257 * @param[in] val_opts Options for the validation phase, see @ref datavalidationoptions.
258 * @param[in] data_type Expected data type of the data.
259 * @param[out] parsed Set to add all the parsed siblings into.
Michal Vaskoddd76592022-01-17 13:34:48 +0100260 * @param[out] subtree_sibling Set if ::LYD_PARSE_SUBTREE is used and another subtree is following in @p in.
Michal Vaskoafac7822020-10-20 14:22:26 +0200261 * @param[out] lydctx_p Data parser context to finish validation.
262 * @return LY_ERR value.
263 */
Radek Krejcif16e2542021-02-17 15:39:23 +0100264LY_ERR lyd_parse_lyb(const struct ly_ctx *ctx, const struct lysc_ext_instance *ext, struct lyd_node *parent,
265 struct lyd_node **first_p, struct ly_in *in, uint32_t parse_opts, uint32_t val_opts, enum lyd_type data_type,
Michal Vaskoddd76592022-01-17 13:34:48 +0100266 struct ly_set *parsed, ly_bool *subtree_sibling, struct lyd_ctx **lydctx_p);
Michal Vaskoafac7822020-10-20 14:22:26 +0200267
268/**
Michal Vaskoe0665742021-02-11 11:08:44 +0100269 * @brief Search all the parents for an operation node, check validity based on internal parser flags.
Michal Vaskoafac7822020-10-20 14:22:26 +0200270 *
Michal Vaskoe0665742021-02-11 11:08:44 +0100271 * @param[in] parent Parent to connect the parsed nodes to.
Radek Krejci84d7fd72021-07-14 18:32:21 +0200272 * @param[in] int_opts Internal parser options.
Michal Vaskoe0665742021-02-11 11:08:44 +0100273 * @param[out] op Found operation, if any.
Michal Vaskoafac7822020-10-20 14:22:26 +0200274 * @return LY_ERR value.
275 */
Michal Vaskoe0665742021-02-11 11:08:44 +0100276LY_ERR lyd_parser_find_operation(const struct lyd_node *parent, uint32_t int_opts, struct lyd_node **op);
Michal Vaskoafac7822020-10-20 14:22:26 +0200277
278/**
Radek Krejci1798aae2020-07-14 13:26:06 +0200279 * @brief Check that a data node representing the @p snode is suitable based on options.
280 *
281 * @param[in] lydctx Common data parsers context.
282 * @param[in] snode Schema node to check.
283 * @return LY_SUCCESS or LY_EVALID
284 */
285LY_ERR lyd_parser_check_schema(struct lyd_ctx *lydctx, const struct lysc_node *snode);
286
287/**
Radek Krejci8678fa42020-08-18 16:07:28 +0200288 * @brief Wrapper around ::lyd_create_term() for data parsers.
Radek Krejci1798aae2020-07-14 13:26:06 +0200289 *
290 * @param[in] lydctx Data parser context.
Radek Krejci84d7fd72021-07-14 18:32:21 +0200291 * @param[in] schema Schema node of the new data node.
292 * @param[in] value String value to be parsed.
293 * @param[in] value_len Length of @p value, must be set correctly.
294 * @param[in,out] dynamic Flag if @p value is dynamically allocated, is adjusted when @p value is consumed.
295 * @param[in] format Input format of @p value.
296 * @param[in] prefix_data Format-specific data for resolving any prefixes (see ::ly_resolve_prefix).
297 * @param[in] hints [Data parser's hints](@ref lydvalhints) for the value's type.
298 * @param[out] node Created node.
299 * @return LY_SUCCESS on success.
300 * @return LY_EINCOMPLETE in case data tree is needed to finish the validation.
301 * @return LY_ERR value if an error occurred.
Radek Krejci1798aae2020-07-14 13:26:06 +0200302 */
Radek Krejci09c77442021-04-26 11:10:34 +0200303LY_ERR lyd_parser_create_term(struct lyd_ctx *lydctx, const struct lysc_node *schema, const void *value, size_t value_len,
Radek Krejci8df109d2021-04-23 12:19:08 +0200304 ly_bool *dynamic, LY_VALUE_FORMAT format, void *prefix_data, uint32_t hints, struct lyd_node **node);
Radek Krejci1798aae2020-07-14 13:26:06 +0200305
306/**
Radek Krejci8678fa42020-08-18 16:07:28 +0200307 * @brief Wrapper around ::lyd_create_meta() for data parsers.
Radek Krejci1798aae2020-07-14 13:26:06 +0200308 *
309 * @param[in] lydctx Data parser context.
Michal Vaskob68571a2020-11-06 17:18:41 +0100310 * @param[in] parent Parent of the created meta. Must be set if @p meta is NULL.
311 * @param[in,out] meta First existing meta to connect to or empty pointer to set. Must be set if @p parent is NULL.
312 * @param[in] mod Module of the created metadata.
313 * @param[in] name Metadata name.
314 * @param[in] name_len Length of @p name.
315 * @param[in] value Metadata value.
316 * @param[in] value_len Length of @p value.
317 * @param[in,out] dynamic Whether the @p value is dynamically allocated, is adjusted once the value is assigned.
318 * @param[in] format Prefix format.
319 * @param[in] prefix_data Prefix format data (see ::ly_resolve_prefix()).
Michal Vaskofeca4fb2020-10-05 08:58:40 +0200320 * @param[in] hints [Value hint](@ref lydvalhints) from the parser regarding the value type.
Michal Vaskoddd76592022-01-17 13:34:48 +0100321 * @param[in] ctx_node Value context node.
Michal Vaskob68571a2020-11-06 17:18:41 +0100322 * @return LY_ERR value.
Radek Krejci1798aae2020-07-14 13:26:06 +0200323 */
Michal Vaskoc8a230d2020-08-14 12:17:10 +0200324LY_ERR lyd_parser_create_meta(struct lyd_ctx *lydctx, struct lyd_node *parent, struct lyd_meta **meta,
Michal Vaskoddd76592022-01-17 13:34:48 +0100325 const struct lys_module *mod, const char *name, size_t name_len, const void *value, size_t value_len,
326 ly_bool *dynamic, LY_VALUE_FORMAT format, void *prefix_data, uint32_t hints, const struct lysc_node *ctx_node);
Radek Krejci1798aae2020-07-14 13:26:06 +0200327
Michal Vasko95c6d5c2022-05-20 10:33:39 +0200328/**
329 * @brief Check that a list has all its keys.
330 *
331 * @param[in] node List to check.
332 * @return LY_SUCCESS on success.
333 * @return LY_ENOT on a missing key.
334 */
335LY_ERR lyd_parse_check_keys(struct lyd_node *node);
336
337/**
338 * @brief Set data flags for a newly parsed node.
339 *
340 * @param[in] node Node to use.
341 * @param[in,out] meta Node metadata, may be removed from.
342 * @param[in] lydctx Data parsing context.
343 * @param[in] ext Extension instance if @p node was parsed for one.
344 * @return LY_ERR value.
345 */
346LY_ERR lyd_parse_set_data_flags(struct lyd_node *node, struct lyd_meta **meta, struct lyd_ctx *lydctx,
347 struct lysc_ext_instance *ext);
348
Radek Krejcif0e1ba52020-05-22 15:14:35 +0200349#endif /* LY_PARSER_INTERNAL_H_ */