libyang 5.0.8
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
Loading...
Searching...
No Matches
plugins_exts.h
Go to the documentation of this file.
1
15
16#ifndef LY_PLUGINS_EXTS_H_
17#define LY_PLUGINS_EXTS_H_
18
19#include "log.h"
20#include "parser_data.h"
21#include "plugins.h"
22#include "tree_data.h"
23#include "tree_edit.h"
24#include "tree_schema.h"
25
26struct ly_ctx;
27struct ly_in;
28struct lyd_node;
29struct lysc_ctx;
30struct lysc_ext_substmt;
31struct lysp_ctx;
32struct lyspr_ctx;
33struct lyspr_tree_ctx;
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
97
108
112#define LYPLG_EXT_API_VERSION 11
113
119#define LY_STMT_OP_MASK (LY_STMT_ACTION | LY_STMT_RPC)
120
126#define LY_STMT_DATA_NODE_MASK (LY_STMT_ANYDATA | LY_STMT_ANYXML | LY_STMT_CASE | LY_STMT_CHOICE | LY_STMT_CONTAINER |\
127 LY_STMT_LEAF | LY_STMT_LEAF_LIST | LY_STMT_LIST)
128
135#define LY_STMT_NODE_MASK 0xFFFF
136
145
148 LY_STMT_INPUT = 0x0002,
150 LY_STMT_OUTPUT = 0x0004,
152 LY_STMT_ACTION = 0x0008,
154 LY_STMT_RPC = 0x0010,
158 LY_STMT_ANYXML = 0x0040,
163 LY_STMT_CASE = 0x0100,
165 LY_STMT_CHOICE = 0x0200,
172 LY_STMT_LEAF = 0x1000,
176 LY_STMT_LIST = 0x4000,
178 LY_STMT_USES = 0x8000,
180
185 LY_STMT_BASE = 0x20000,
192 LY_STMT_BIT = 0x40000,
196 LY_STMT_CONFIG = 0x50000,
199 LY_STMT_CONTACT = 0x60000,
203 LY_STMT_DEFAULT = 0x70000,
209 LY_STMT_DEVIATE = 0x90000,
216 LY_STMT_ENUM = 0xB0000,
234 LY_STMT_FEATURE = 0x100000,
241 LY_STMT_IDENTITY = 0x120000,
248 LY_STMT_IMPORT = 0x140000,
251 LY_STMT_INCLUDE = 0x150000,
254 LY_STMT_KEY = 0x160000,
258 LY_STMT_LENGTH = 0x170000,
260 LY_STMT_MANDATORY = 0x180000,
269 LY_STMT_MODIFIER = 0x1B0000,
273 LY_STMT_MODULE = 0x1C0000,
276 LY_STMT_MUST = 0x1D0000,
280 LY_STMT_NAMESPACE = 0x1E0000,
292 LY_STMT_PATH = 0x210000,
296 LY_STMT_PATTERN = 0x220000,
300 LY_STMT_POSITION = 0x230000,
304 LY_STMT_PREFIX = 0x240000,
307 LY_STMT_PRESENCE = 0x250000,
310 LY_STMT_RANGE = 0x260000,
312 LY_STMT_REFERENCE = 0x270000,
315 LY_STMT_REFINE = 0x280000,
323 LY_STMT_REVISION = 0x2A0000,
328 LY_STMT_STATUS = 0x2C0000,
331 LY_STMT_SUBMODULE = 0x2D0000,
334 LY_STMT_TYPE = 0x2E0000,
336 LY_STMT_TYPEDEF = 0x2F0000,
340 LY_STMT_UNIQUE = 0x300000,
343 LY_STMT_UNITS = 0x310000,
346 LY_STMT_VALUE = 0x320000,
350 LY_STMT_WHEN = 0x330000,
360
361 /* separated from the list of statements
362 * the following tokens are part of the syntax and parsers have to work
363 * with them, but they are not a standard YANG statements
364 */
368
369 /*
370 * YIN-specific tokens, still they are part of the syntax, but not the standard statements
371 */
374};
375
379struct lysp_stmt {
380 const char *stmt;
381 const char *arg;
384
385 struct lysp_stmt *next;
386 struct lysp_stmt *child;
387 uint16_t flags;
388 enum ly_stmt kw;
389};
390
396 void **storage_p;
398};
399
424
430 void **storage_p;
432};
433
453
460#define LYPLG_EXTENSIONS \
461 uint32_t plugins_extensions_apiver__ = LYPLG_EXT_API_VERSION; \
462 const struct lyplg_ext_record plugins_extensions__[]
463
472
484typedef LY_ERR (*lyplg_ext_parse_clb)(struct lysp_ctx *pctx, struct lysp_ext_instance *ext);
485
496LIBYANG_API_DECL void lyplg_ext_parse_log(const struct lysp_ctx *pctx, const struct lysp_ext_instance *ext,
497 LY_LOG_LEVEL level, LY_ERR err, const char *format, ...);
498
505LIBYANG_API_DECL const struct lysp_module *lyplg_ext_parse_get_cur_pmod(const struct lysp_ctx *pctx);
506
519LIBYANG_API_DECL LY_ERR lyplg_ext_parse_extension_instance(struct lysp_ctx *pctx, struct lysp_ext_instance *ext);
520
522
531
538#define LYS_COMPILE_GROUPING 0x01
543#define LYS_COMPILE_DISABLED 0x02
546#define LYS_COMPILE_NO_CONFIG 0x04
547#define LYS_COMPILE_NO_DISABLED 0x08
548
549#define LYS_COMPILE_RPC_INPUT (LYS_IS_INPUT | LYS_COMPILE_NO_CONFIG)
550#define LYS_COMPILE_RPC_OUTPUT (LYS_IS_OUTPUT | LYS_COMPILE_NO_CONFIG)
551#define LYS_COMPILE_NOTIFICATION (LYS_IS_NOTIF | LYS_COMPILE_NO_CONFIG)
552
554
570typedef LY_ERR (*lyplg_ext_compile_clb)(struct lysc_ctx *cctx, const struct lysp_ext_instance *extp,
571 struct lysc_ext_instance *ext);
572
582LIBYANG_API_DECL void lyplg_ext_compile_log(const struct lysc_ctx *cctx, const struct lysc_ext_instance *ext,
583 LY_LOG_LEVEL level, LY_ERR err, const char *format, ...);
584
594LIBYANG_API_DECL void lyplg_ext_compile_log_path(const char *path, const struct lysc_ext_instance *ext,
595 LY_LOG_LEVEL level, LY_ERR err, const char *format, ...);
596
603LIBYANG_API_DEF void lyplg_ext_compile_log_err(const struct ly_err_item *eitem, const struct lysc_ext_instance *ext);
604
611LIBYANG_API_DECL struct ly_ctx *lyplg_ext_compile_get_ctx(const struct lysc_ctx *ctx);
612
619LIBYANG_API_DECL uint32_t *lyplg_ext_compile_get_options(const struct lysc_ctx *ctx);
620
627LIBYANG_API_DECL const struct lys_module *lyplg_ext_compile_get_cur_mod(const struct lysc_ctx *ctx);
628
635LIBYANG_API_DECL struct lysp_module *lyplg_ext_compile_get_pmod(const struct lysc_ctx *ctx);
636
653LIBYANG_API_DECL LY_ERR lyplg_ext_compile_extension_instance(struct lysc_ctx *ctx, const struct lysp_ext_instance *extp,
654 struct lysc_ext_instance *ext, struct lysc_node *parent);
655
667LIBYANG_API_DECL LY_ERR lyplg_ext_compiled_node_augments(struct lysc_ctx *ctx, struct lysc_ext_instance *ext,
668 struct lysc_node *node);
669
671
680
690typedef LY_ERR (*lyplg_ext_sprinter_info_clb)(struct lyspr_ctx *ctx, struct lysc_ext_instance *ext, ly_bool *flag);
691
699LIBYANG_API_DECL struct ly_out **lyplg_ext_print_get_out(const struct lyspr_ctx *ctx);
700
707LIBYANG_API_DECL uint32_t *lyplg_ext_print_get_options(const struct lyspr_ctx *ctx);
708
715LIBYANG_API_DECL uint16_t *lyplg_ext_print_get_level(const struct lyspr_ctx *ctx);
716
727LIBYANG_API_DECL void lyplg_ext_print_info_extension_instance(struct lyspr_ctx *ctx, const struct lysc_ext_instance *ext,
728 ly_bool *flag);
729
731
740
758typedef LY_ERR (*lyplg_ext_sprinter_ctree_clb)(struct lysc_ext_instance *ext, const struct lyspr_tree_ctx *ctx,
759 const char **flags, const char **add_opts);
760
773typedef LY_ERR (*lyplg_ext_sprinter_ctree_override_clb)(const struct lysc_node *node, const void *plugin_priv,
774 ly_bool *skip, const char **flags, const char **add_opts);
775
784LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ctree_add_ext_nodes(const struct lyspr_tree_ctx *ctx,
786
795LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ctree_add_nodes(const struct lyspr_tree_ctx *ctx, struct lysc_node *nodes,
797
806LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_tree_set_priv(const struct lyspr_tree_ctx *ctx, void *plugin_priv,
807 void (*free_clb)(void *plugin_priv));
808
812typedef LY_ERR (*lyplg_ext_sprinter_ptree_clb)(struct lysp_ext_instance *ext, const struct lyspr_tree_ctx *ctx,
813 const char **flags, const char **add_opts);
814
818typedef LY_ERR (*lyplg_ext_sprinter_ptree_override_clb)(const struct lysp_node *node, const void *plugin_priv,
819 ly_bool *skip, const char **flags, const char **add_opts);
820
824LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ptree_add_ext_nodes(const struct lyspr_tree_ctx *ctx,
826
830LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ptree_add_nodes(const struct lyspr_tree_ctx *ctx, struct lysp_node *nodes,
832
834
835/*
836 * node xpath
837 */
838
846typedef void (*lyplg_ext_node_xpath_clb)(struct lysc_ext_instance *ext, const struct lyd_node *cur_node,
847 const struct lyd_node **node);
848
849/*
850 * snode xpath
851 */
852
865typedef LY_ERR (*lyplg_ext_snode_xpath_clb)(struct lysc_ext_instance *ext, const char *prefix, uint32_t prefix_len,
866 LY_VALUE_FORMAT format, void *prefix_data, const char *name, uint32_t name_len, const struct lysc_node **snode);
867
868/*
869 * data snode
870 */
871
902 const struct lysc_node *sparent, const char *prefix, uint32_t prefix_len, LY_VALUE_FORMAT format, void *prefix_data,
903 const char *name, uint32_t name_len, const struct lysc_node **snode);
904
905/*
906 * data validate
907 */
908
930 const struct lyd_node *dep_tree, enum lyd_type data_type, uint32_t val_opts, struct lyd_node **diff);
931
932/*
933 * parse free
934 */
935
942typedef void (*lyplg_ext_parse_free_clb)(const struct ly_ctx *ctx, struct lysp_ext_instance *ext);
943
950LIBYANG_API_DECL void lyplg_ext_pfree_instance_substatements(const struct ly_ctx *ctx, struct lysp_ext_substmt *substmts);
951
952/*
953 * compile free
954 */
955
962typedef void (*lyplg_ext_compile_free_clb)(const struct ly_ctx *ctx, struct lysc_ext_instance *ext);
963
970LIBYANG_API_DECL void lyplg_ext_cfree_instance_substatements(const struct ly_ctx *ctx, struct lysc_ext_substmt *substmts);
971
972/*
973 * compiled size
974 */
975
979#define LY_CTXP_MEM_ALIGN 8
980
986#define LY_CTXP_MEM_SIZE(SIZE) ((SIZE) + ((~(SIZE) + 1) & (LY_CTXP_MEM_ALIGN - 1)))
987
998typedef int (*lyplg_ext_compiled_size_clb)(const struct lysc_ext_instance *ext, struct ly_ht *addr_ht);
999
1008LIBYANG_API_DECL int lyplg_ext_compiled_stmts_storage_size(const struct lysc_ext_substmt *substmts, struct ly_ht *addr_ht);
1009
1010/*
1011 * compiled print
1012 */
1013
1027typedef LY_ERR (*lyplg_ext_compiled_print_clb)(const struct lysc_ext_instance *orig_ext, struct lysc_ext_instance *ext,
1028 struct ly_ht *addr_ht, struct ly_set *ptr_set, void **mem);
1029
1042LIBYANG_API_DECL LY_ERR lyplg_ext_compiled_stmts_storage_print(const struct lysc_ext_substmt *orig_substmts,
1043 struct lysc_ext_substmt *substmts, struct ly_ht *addr_ht, struct ly_set *ptr_set, void **mem);
1044
1053LIBYANG_API_DECL void *lyplg_ext_compiled_print_get_addr(const struct ly_ht *addr_ht, const void *addr);
1054
1065LIBYANG_API_DECL LY_ERR lyplg_ext_compiled_print_add_addr(struct ly_ht *addr_ht, const void *orig_addr,
1066 const void *addr);
1067
1093
1095 /* plugin identification */
1096 const char *module;
1097 const char *revision;
1102 const char *name;
1103
1104 /* runtime data */
1106};
1107
1114LIBYANG_API_DECL const char *lyplg_ext_stmt2str(enum ly_stmt stmt);
1115
1122LIBYANG_API_DECL enum ly_stmt lyplg_ext_nodetype2stmt(uint16_t nodetype);
1123
1135LIBYANG_API_DECL LY_ERR lyplg_ext_get_storage(const struct lysc_ext_instance *ext, int stmt, uint32_t storage_size,
1136 const void **storage);
1137
1149LIBYANG_API_DECL LY_ERR lyplg_ext_parsed_get_storage(const struct lysc_ext_instance *ext, int stmt,
1150 uint32_t storage_size, const void **storage);
1151
1163LIBYANG_API_DECL LY_ERR lyplg_ext_get_data(const struct ly_ctx *ctx, const struct lysc_ext_instance *ext,
1164 const struct lyd_node *parent, void **ext_data, ly_bool *ext_data_free);
1165
1174LIBYANG_API_DECL LY_ERR lyplg_ext_set_parent_ctx(struct ly_ctx *ctx, const struct ly_ctx *parent_ctx);
1175
1185 const struct lyd_node *parent, struct ly_set **refs);
1186
1197 const struct lyd_node *parent, struct ly_ctx **ctx);
1198
1212 const struct lyd_node *ext_data);
1213
1226
1240
1242
1243#ifdef __cplusplus
1244}
1245#endif
1246
1247#endif /* LY_PLUGINS_EXTS_H_ */
libyang context handler.
lyd_type
LY_ERR
libyang's error codes returned by the libyang functions.
Definition log.h:252
Libyang full error structure.
Definition log.h:297
Parser input structure specifying the type of data input.
LY_LOG_LEVEL
Verbosity levels of the libyang logger.
Definition log.h:89
Structure to hold a set of (not necessary somehow connected) objects. Usually used for lyd_node,...
Definition set.h:47
Printer output structure specifying the type of data output.
LIBYANG_API_DEF void lyplg_ext_compile_log_err(const struct ly_err_item *eitem, const struct lysc_ext_instance *ext)
Log a message from an extension plugin using the compiled extension instance and a generated error it...
LIBYANG_API_DECL struct lysp_module * lyplg_ext_compile_get_pmod(const struct lysc_ctx *ctx)
YANG schema compilation context getter for currently processed module.
LIBYANG_API_DECL struct ly_ctx * lyplg_ext_compile_get_ctx(const struct lysc_ctx *ctx)
YANG schema compilation context getter for libyang context.
LIBYANG_API_DECL const struct lys_module * lyplg_ext_compile_get_cur_mod(const struct lysc_ctx *ctx)
YANG schema compilation context getter for current module.
LIBYANG_API_DECL uint32_t * lyplg_ext_compile_get_options(const struct lysc_ctx *ctx)
YANG schema compilation context getter for compilation options.
LIBYANG_API_DECL LY_ERR lyplg_ext_compile_extension_instance(struct lysc_ctx *ctx, const struct lysp_ext_instance *extp, struct lysc_ext_instance *ext, struct lysc_node *parent)
Compile substatements of an extension instance.
LIBYANG_API_DECL void lyplg_ext_compile_log_path(const char *path, const struct lysc_ext_instance *ext, LY_LOG_LEVEL level, LY_ERR err, const char *format,...)
Log a message from an extension plugin using the compiled extension instance with an explicit error p...
LY_ERR(* lyplg_ext_compile_clb)(struct lysc_ctx *cctx, const struct lysp_ext_instance *extp, struct lysc_ext_instance *ext)
Callback to compile extension from the lysp_ext_instance to the lysc_ext_instance....
LIBYANG_API_DECL void lyplg_ext_compile_log(const struct lysc_ctx *cctx, const struct lysc_ext_instance *ext, LY_LOG_LEVEL level, LY_ERR err, const char *format,...)
Log a message from an extension plugin using the compiled extension instance.
LIBYANG_API_DECL LY_ERR lyplg_ext_compiled_node_augments(struct lysc_ctx *ctx, struct lysc_ext_instance *ext, struct lysc_node *node)
Compile augments for a specific node in an extension instance.
const char * argument
uint64_t parent_stmt_index
enum ly_stmt stmt
lyplg_ext_snode_xpath_clb snode_xpath
const char * name
struct lysp_ext_instance * exts
lyplg_ext_data_snode_clb snode
const char * arg
LY_VALUE_FORMAT format
const char * argument
struct lysp_stmt * child
uint16_t flags
const char * id
struct lysp_ext_substmt * substmts
lyplg_ext_sprinter_info_clb printer_info
lyplg_ext_compiled_print_clb compiled_print
enum ly_stmt parent_stmt
const char * revision
const char * module
LY_VALUE_FORMAT format
lyplg_ext_compile_free_clb cfree
struct lysc_ext_substmt * substmts
struct lysp_stmt * child
lyplg_ext_compiled_size_clb compiled_size
enum ly_stmt kw
struct lyplg_ext plugin
lyplg_ext_node_xpath_clb node_xpath
lyplg_ext_parse_clb parse
lyplg_ext_sprinter_ctree_clb printer_ctree
lyplg_ext_data_validate_clb validate
struct lysc_ext * def
uint64_t parent_stmt_index
struct lysc_ext_instance * exts
const char * stmt
lyplg_ext_parse_free_clb pfree
enum ly_stmt stmt
struct lysp_stmt * next
struct lys_module * module
enum ly_stmt parent_stmt
lyplg_ext_compile_clb compile
void * prefix_data
const char * name
lyplg_ext_sprinter_ptree_clb printer_ptree
LIBYANG_API_DECL LY_ERR lyplg_ext_compiled_stmts_storage_print(const struct lysc_ext_substmt *orig_substmts, struct lysc_ext_substmt *substmts, struct ly_ht *addr_ht, struct ly_set *ptr_set, void **mem)
Print the substatements array storage and assign it to the serialized extension instance substatement...
int(* lyplg_ext_compiled_size_clb)(const struct lysc_ext_instance *ext, struct ly_ht *addr_ht)
Callback to return the size of the custom compiled structure and substmts array. If there are none,...
LIBYANG_API_DECL LY_ERR lyplg_ext_get_storage(const struct lysc_ext_instance *ext, int stmt, uint32_t storage_size, const void **storage)
Get compiled ext instance storage for a specific statement.
void(* lyplg_ext_node_xpath_clb)(struct lysc_ext_instance *ext, const struct lyd_node *cur_node, const struct lyd_node **node)
Callback for getting the first child data node of an XPath document root of the extension instance.
LIBYANG_API_DECL LY_ERR lyplg_ext_parsed_get_storage(const struct lysc_ext_instance *ext, int stmt, uint32_t storage_size, const void **storage)
Get parsed ext instance storage for a specific statement.
LIBYANG_API_DECL LY_ERR lyplg_ext_get_data(const struct ly_ctx *ctx, const struct lysc_ext_instance *ext, const struct lyd_node *parent, void **ext_data, ly_bool *ext_data_free)
Get specific run-time extension instance data from a callback set by ly_ctx_set_ext_data_clb().
LIBYANG_API_DECL void * lyplg_ext_compiled_print_get_addr(const struct ly_ht *addr_ht, const void *addr)
Get the printed address of a shared structure, in case it has already been printed.
LIBYANG_API_DECL LY_ERR lyplg_ext_compiled_print_add_addr(struct ly_ht *addr_ht, const void *orig_addr, const void *addr)
Add a printed address of a shared structure to be reused by later prints.
LIBYANG_API_DECL int lyplg_ext_compiled_stmts_storage_size(const struct lysc_ext_substmt *substmts, struct ly_ht *addr_ht)
Get the size of the compiled substatements storage.
LY_ERR(* lyplg_ext_compiled_print_clb)(const struct lysc_ext_instance *orig_ext, struct lysc_ext_instance *ext, struct ly_ht *addr_ht, struct ly_set *ptr_set, void **mem)
Callback to print (serialize) the custom compiled structure and substmts array storage.
LY_ERR(* lyplg_ext_data_validate_clb)(struct lysc_ext_instance *ext, struct lyd_node *node, const struct lyd_node *dep_tree, enum lyd_type data_type, uint32_t val_opts, struct lyd_node **diff)
Callback for validating parsed YANG instance data described by an extension instance.
LIBYANG_API_DECL LY_ERR lyplg_ext_schema_mount_get_parent_ref(const struct lysc_ext_instance *ext, const struct lyd_node *parent, struct ly_set **refs)
Expand parent-reference xpath expressions.
LIBYANG_API_DECL LY_ERR lyplg_ext_schema_mount_create_shared_context(struct lysc_ext_instance *ext, const struct lyd_node *ext_data)
Create a shared schema mount context for a schema mount point.
void(* lyplg_ext_compile_free_clb)(const struct ly_ctx *ctx, struct lysc_ext_instance *ext)
Callback to free the extension-specific data created by its compilation.
ly_stmt
List of YANG statements.
LIBYANG_API_DECL void lyplg_ext_schema_mount_destroy_shared_contexts(struct lysc_ext_instance *ext)
Destroy all the shared schema mount contexts for a given libyang context.
LIBYANG_API_DECL enum ly_stmt lyplg_ext_nodetype2stmt(uint16_t nodetype)
Convert nodetype to statement identifier.
LIBYANG_API_DECL LY_ERR lyplg_ext_set_parent_ctx(struct ly_ctx *ctx, const struct ly_ctx *parent_ctx)
Set parent context of a context. Errors and callbacks of the parent context will then always be used.
LIBYANG_API_DECL LY_ERR lyplg_ext_schema_mount_create_context(const struct lysc_ext_instance *ext, const struct lyd_node *parent, struct ly_ctx **ctx)
Allocate a new context for a particular instance of the yangmnt:mount-point extension....
LIBYANG_API_DECL const char * lyplg_ext_stmt2str(enum ly_stmt stmt)
Stringify statement identifier.
LIBYANG_API_DECL void lyplg_ext_cfree_instance_substatements(const struct ly_ctx *ctx, struct lysc_ext_substmt *substmts)
Free the extension instance's data compiled with lyplg_ext_compile_extension_instance().
void(* lyplg_ext_parse_free_clb)(const struct ly_ctx *ctx, struct lysp_ext_instance *ext)
Callback to free the extension-specific data created by its parsing.
LY_ERR(* lyplg_ext_snode_xpath_clb)(struct lysc_ext_instance *ext, const char *prefix, uint32_t prefix_len, LY_VALUE_FORMAT format, void *prefix_data, const char *name, uint32_t name_len, const struct lysc_node **snode)
Callback for getting the first child schema node of an XPath document root of the extension instance.
LY_ERR(* lyplg_ext_data_snode_clb)(struct lysc_ext_instance *ext, const struct lyd_node *parent, const struct lysc_node *sparent, const char *prefix, uint32_t prefix_len, LY_VALUE_FORMAT format, void *prefix_data, const char *name, uint32_t name_len, const struct lysc_node **snode)
Callback for getting a schema node for new YANG instance data described by an extension instance.
LIBYANG_API_DECL void lyplg_ext_pfree_instance_substatements(const struct ly_ctx *ctx, struct lysp_ext_substmt *substmts)
Free the extension instance's data parsed with lyplg_ext_parse_extension_instance().
LIBYANG_API_DECL void lyplg_ext_schema_mount_destroy_inline_contexts(struct lysc_ext_instance *ext)
Destroy all the inline contexts for a given libyang context.
@ LY_STMT_REVISION
@ LY_STMT_MUST
@ LY_STMT_ARGUMENT
@ LY_STMT_ENUM
@ LY_STMT_LEAF
@ LY_STMT_ERROR_APP_TAG
@ LY_STMT_MAX_ELEMENTS
@ LY_STMT_REFERENCE
@ LY_STMT_REVISION_DATE
@ LY_STMT_SYNTAX_LEFT_BRACE
@ LY_STMT_UNIQUE
@ LY_STMT_REQUIRE_INSTANCE
@ LY_STMT_DEVIATION
@ LY_STMT_IMPORT
@ LY_STMT_CONTACT
@ LY_STMT_LENGTH
@ LY_STMT_IF_FEATURE
@ LY_STMT_SYNTAX_RIGHT_BRACE
@ LY_STMT_ANYDATA
@ LY_STMT_CONTAINER
@ LY_STMT_PATTERN
@ LY_STMT_POSITION
@ LY_STMT_PREFIX
@ LY_STMT_WHEN
@ LY_STMT_BELONGS_TO
@ LY_STMT_ORGANIZATION
@ LY_STMT_AUGMENT
@ LY_STMT_SUBMODULE
@ LY_STMT_ANYXML
@ LY_STMT_MIN_ELEMENTS
@ LY_STMT_SYNTAX_SEMICOLON
@ LY_STMT_NAMESPACE
@ LY_STMT_YANG_VERSION
@ LY_STMT_MANDATORY
@ LY_STMT_PATH
@ LY_STMT_EXTENSION
@ LY_STMT_CASE
@ LY_STMT_MODULE
@ LY_STMT_ERROR_MESSAGE
@ LY_STMT_OUTPUT
@ LY_STMT_REFINE
@ LY_STMT_IDENTITY
@ LY_STMT_TYPEDEF
@ LY_STMT_NONE
@ LY_STMT_ARG_VALUE
@ LY_STMT_DESCRIPTION
@ LY_STMT_ARG_TEXT
@ LY_STMT_CONFIG
@ LY_STMT_RANGE
@ LY_STMT_ORDERED_BY
@ LY_STMT_INCLUDE
@ LY_STMT_YIN_ELEMENT
@ LY_STMT_EXTENSION_INSTANCE
@ LY_STMT_BIT
@ LY_STMT_FRACTION_DIGITS
@ LY_STMT_ACTION
@ LY_STMT_MODIFIER
@ LY_STMT_TYPE
@ LY_STMT_BASE
@ LY_STMT_LEAF_LIST
@ LY_STMT_FEATURE
@ LY_STMT_RPC
@ LY_STMT_DEVIATE
@ LY_STMT_UNITS
@ LY_STMT_GROUPING
@ LY_STMT_KEY
@ LY_STMT_NOTIFICATION
@ LY_STMT_CHOICE
@ LY_STMT_VALUE
@ LY_STMT_USES
@ LY_STMT_PRESENCE
@ LY_STMT_STATUS
@ LY_STMT_INPUT
@ LY_STMT_LIST
@ LY_STMT_DEFAULT
Extension plugin implementing various aspects of a YANG extension.
YANG extension compiled instance.
Structure representing a compiled known YANG substatement in an extension instance.
YANG extension parsed instance.
Structure representing a parsed known YANG substatement in an extension instance.
Structure representing a generic parsed YANG substatement in an 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.
LY_ERR(* lyplg_ext_parse_clb)(struct lysp_ctx *pctx, struct lysp_ext_instance *ext)
Callback for parsing extension instance substatements.
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.
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 uint16_t * lyplg_ext_print_get_level(const struct lyspr_ctx *ctx)
YANG printer context getter for printer indentation level.
LY_ERR(* lyplg_ext_sprinter_info_clb)(struct lyspr_ctx *ctx, struct lysc_ext_instance *ext, ly_bool *flag)
Callback to print the compiled extension instance's private data in the INFO format.
LIBYANG_API_DECL struct ly_out ** lyplg_ext_print_get_out(const struct lyspr_ctx *ctx)
YANG printer context getter for output handler.
LIBYANG_API_DECL uint32_t * lyplg_ext_print_get_options(const struct lyspr_ctx *ctx)
YANG printer context getter for printer options.
LIBYANG_API_DECL void lyplg_ext_print_info_extension_instance(struct lyspr_ctx *ctx, const struct lysc_ext_instance *ext, ly_bool *flag)
Print substatements of an extension instance in info format (compiled YANG).
LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_tree_set_priv(const struct lyspr_tree_ctx *ctx, void *plugin_priv, void(*free_clb)(void *plugin_priv))
Registration of plugin-private data defined by the plugin that is shared between override_clb calls.
LY_ERR(* lyplg_ext_sprinter_ctree_clb)(struct lysc_ext_instance *ext, const struct lyspr_tree_ctx *ctx, const char **flags, const char **add_opts)
Callback to print parent node of ext or to print the contents of the extension.
LY_ERR(* lyplg_ext_sprinter_ptree_clb)(struct lysp_ext_instance *ext, const struct lyspr_tree_ctx *ctx, const char **flags, const char **add_opts)
Callback to print parent node of ext or to print the contents of the extension.
LY_ERR(* lyplg_ext_sprinter_ptree_override_clb)(const struct lysp_node *node, const void *plugin_priv, ly_bool *skip, const char **flags, const char **add_opts)
Callback for rewriting the tree-diagram form of a specific node.
LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ctree_add_ext_nodes(const struct lyspr_tree_ctx *ctx, struct lysc_ext_instance *ext, lyplg_ext_sprinter_ctree_override_clb clb)
Registration of printing a group of nodes, which is already in the extension.
LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ptree_add_nodes(const struct lyspr_tree_ctx *ctx, struct lysp_node *nodes, lyplg_ext_sprinter_ptree_override_clb clb)
Registration of printing the group of nodes which were defined in the plugin.
LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ctree_add_nodes(const struct lyspr_tree_ctx *ctx, struct lysc_node *nodes, lyplg_ext_sprinter_ctree_override_clb clb)
Registration of printing the group of nodes which were defined in the plugin.
LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ptree_add_ext_nodes(const struct lyspr_tree_ctx *ctx, struct lysp_ext_instance *ext, lyplg_ext_sprinter_ptree_override_clb clb)
Registration of printing a group of nodes, which is already in the extension.
LY_ERR(* lyplg_ext_sprinter_ctree_override_clb)(const struct lysc_node *node, const void *plugin_priv, ly_bool *skip, const char **flags, const char **add_opts)
Callback for rewriting the tree-diagram form of a specific node.
uint16_t flags
uint16_t flags
const char * name
struct ly_ctx * ctx
Available YANG schema tree structures representing YANG module.
Compiled YANG extension-stmt.
Compiled YANG data node.
Printable YANG schema tree structure representing YANG module.
Generic YANG data node.
LY_VALUE_FORMAT
All kinds of supported value formats and prefix mappings to modules.
Definition tree.h:234
#define LY_ARRAY_COUNT_TYPE
Type (i.e. size) of the sized array's size counter.
Definition tree.h:104
Logger manipulation routines and error definitions.
uint8_t ly_bool
Type to indicate boolean value.
Definition log.h:36
libyang hash table.
Data parsers for libyang.
Plugins manipulation.
libyang representation of YANG data trees.
struct lyd_node * parent
Definition tree_data.h:807
Generic structure for a data node.
Definition tree_data.h:800
libyang generic macros and functions to modify YANG schema or data trees. Intended for internal use a...
libyang representation of YANG schema trees.