Loading...
Searching...
No Matches
Plugins: Extensions parsing support
Plugins: Extensions
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.

## 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.
LIBYANG_API_DECL const struct lysp_module * | lyplg_ext_parse_get_cur_pmod (const struct lysp_ctx *pctx)
| Get current parsed module from a 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.

## Detailed Description

Implementing extension plugin parse callback.

## Typedef Documentation

## lyplg_ext_parse_clb

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] | pctx | Parse context.
  [in,out] | ext | Parsed 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

## lyplg_ext_parse_extension_instance()

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

Returns
  LY_SUCCESS on success.
  LY_ERR error on error.

## lyplg_ext_parse_get_cur_pmod()

LIBYANG_API_DECL const struct lysp_module * lyplg_ext_parse_get_cur_pmod | ( | const struct lysp_ctx * | pctx | ) |

Get current parsed module from a parse context.

Parameters

  [in] | pctx | Parse context.

Returns
  Current (local) parse mod.

## lyplg_ext_parse_log()

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