libyang  3.4.2
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Plugins: Extensions parsing support
Collaboration diagram for Plugins: Extensions parsing support:

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...
 

Detailed Description

Implementing extension plugin parse callback.

Typedef Documentation

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.

Parameters
[in]pctxParse context.
[in,out]extParsed extension instance data.
Returns
LY_SUCCESS on success.
LY_ENOT if the extension instance is not supported and should be removed.
LY_ERR error on error.

Definition at line 484 of file plugins_exts.h.

Function Documentation

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.

Parameters
[in]pctxParse context.
[in,out]extParsed extension instance with the prepared lysp_ext_instance.substmts array, which will be updated by storing the parsed data.
Returns
LY_SUCCESS on success.
LY_ERR error on error.
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.

Parameters
[in]pctxParse context.
Returns
Current (local) parse mod.
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.

Parameters
[in]pctxParse context to use.
[in]extParsed extensiopn instance.
[in]levelLog message level (error, warning, etc.)
[in]errError type code.
[in]formatFormat string to print.
[in]...Format variable parameters.