libyang
3.4.2
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
|
Typedefs | |
typedef LY_ERR(* | lyplg_ext_parse_clb )(struct lysp_ctx *pctx, struct lysp_ext_instance *ext) |
Callback for parsing extension instance substatements. More... | |
Functions | |
LIBYANG_API_DECL LY_ERR | lyplg_ext_parse_extension_instance (struct lysp_ctx *pctx, struct lysp_ext_instance *ext) |
Parse substatements of an extension instance. More... | |
LIBYANG_API_DECL struct lysp_module * | lyplg_ext_parse_get_cur_pmod (const struct lysp_ctx *pctx) |
Get current parsed module from a parse context. More... | |
LIBYANG_API_DECL void | lyplg_ext_parse_log (const struct lysp_ctx *pctx, const struct lysp_ext_instance *ext, LY_LOG_LEVEL level, LY_ERR err, const char *format,...) |
Log a message from an extension plugin using the parsed extension instance. More... | |
Implementing extension plugin parse callback.
typedef LY_ERR(* lyplg_ext_parse_clb)(struct lysp_ctx *pctx, struct lysp_ext_instance *ext) |
Callback for parsing extension instance substatements.
All known YANG substatements can easily be parsed using lyplg_ext_parse_extension_instance.
[in] | pctx | Parse context. |
[in,out] | ext | Parsed extension instance data. |
Definition at line 484 of file plugins_exts.h.
LIBYANG_API_DECL LY_ERR lyplg_ext_parse_extension_instance | ( | struct lysp_ctx * | pctx, |
struct lysp_ext_instance * | ext | ||
) |
Parse substatements of an extension instance.
Uses standard libyang schema compiler to transform YANG statements into the parsed schema structures. The plugins are supposed to use this function when the extension instance's substatements can be parsed in a standard way.
[in] | pctx | Parse context. |
[in,out] | ext | Parsed extension instance with the prepared lysp_ext_instance.substmts array, which will be updated by storing the parsed data. |
LIBYANG_API_DECL struct lysp_module* lyplg_ext_parse_get_cur_pmod | ( | const struct lysp_ctx * | pctx | ) |
Get current parsed module from a parse context.
[in] | pctx | Parse context. |
LIBYANG_API_DECL void lyplg_ext_parse_log | ( | const struct lysp_ctx * | pctx, |
const struct lysp_ext_instance * | ext, | ||
LY_LOG_LEVEL | level, | ||
LY_ERR | err, | ||
const char * | format, | ||
... | |||
) |
Log a message from an extension plugin using the parsed extension instance.
[in] | pctx | Parse context to use. |
[in] | ext | Parsed extensiopn instance. |
[in] | level | Log message level (error, warning, etc.) |
[in] | err | Error type code. |
[in] | format | Format string to print. |
[in] | ... | Format variable parameters. |