libyang 2.1.55
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
plugins_exts.h
Go to the documentation of this file.
1
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
112#define LYPLG_EXT_API_VERSION 6
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
146 LY_STMT_NOTIFICATION = 0x0001,
148 LY_STMT_INPUT = 0x0002,
150 LY_STMT_OUTPUT = 0x0004,
152 LY_STMT_ACTION = 0x0008,
154 LY_STMT_RPC = 0x0010,
156 LY_STMT_ANYDATA = 0x0020,
158 LY_STMT_ANYXML = 0x0040,
160 LY_STMT_AUGMENT = 0x0080,
163 LY_STMT_CASE = 0x0100,
165 LY_STMT_CHOICE = 0x0200,
167 LY_STMT_CONTAINER = 0x0400,
169 LY_STMT_GROUPING = 0x0800,
172 LY_STMT_LEAF = 0x1000,
174 LY_STMT_LEAF_LIST = 0x2000,
176 LY_STMT_LIST = 0x4000,
178 LY_STMT_USES = 0x8000,
181 LY_STMT_ARGUMENT = 0x10000,
185 LY_STMT_BASE = 0x20000,
188 LY_STMT_BELONGS_TO = 0x30000,
192 LY_STMT_BIT = 0x40000,
196 LY_STMT_CONFIG = 0x50000,
199 LY_STMT_CONTACT = 0x60000,
203 LY_STMT_DEFAULT = 0x70000,
206 LY_STMT_DESCRIPTION = 0x80000,
209 LY_STMT_DEVIATE = 0x90000,
212 LY_STMT_DEVIATION = 0xA0000,
216 LY_STMT_ENUM = 0xB0000,
220 LY_STMT_ERROR_APP_TAG = 0xC0000,
224 LY_STMT_ERROR_MESSAGE = 0xD0000,
228 LY_STMT_EXTENSION = 0xE0000,
234 LY_STMT_FEATURE = 0x100000,
237 LY_STMT_FRACTION_DIGITS = 0x110000,
241 LY_STMT_IDENTITY = 0x120000,
245 LY_STMT_IF_FEATURE = 0x130000,
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,
263 LY_STMT_MAX_ELEMENTS = 0x190000,
266 LY_STMT_MIN_ELEMENTS = 0x1A0000,
269 LY_STMT_MODIFIER = 0x1B0000,
273 LY_STMT_MODULE = 0x1C0000,
276 LY_STMT_MUST = 0x1D0000,
280 LY_STMT_NAMESPACE = 0x1E0000,
284 LY_STMT_ORDERED_BY = 0x1F0000,
288 LY_STMT_ORGANIZATION = 0x200000,
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,
319 LY_STMT_REQUIRE_INSTANCE = 0x290000,
323 LY_STMT_REVISION = 0x2A0000,
326 LY_STMT_REVISION_DATE = 0x2B0000,
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,
352 LY_STMT_YANG_VERSION = 0x340000,
356 LY_STMT_YIN_ELEMENT = 0x350000,
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 */
375
379struct lysp_stmt {
380 const char *stmt;
381 const char *arg;
385 struct lysp_stmt *next;
386 struct lysp_stmt *child;
387 uint16_t flags;
388 enum ly_stmt kw;
389};
390
396 void *storage;
398};
399
404 const char *name;
405 const char *argument;
408 struct lysp_ext *def;
410 void *parent;
415 uint16_t flags;
417 const struct lyplg_ext_record *record;
420 void *parsed;
421 struct lysp_stmt *child;
422};
423
429 void *storage;
431};
432
437 struct lysc_ext *def;
438 const char *argument;
442 void *parent;
450 void *compiled;
451};
452
459#define LYPLG_EXTENSIONS \
460 uint32_t plugins_extensions_apiver__ = LYPLG_EXT_API_VERSION; \
461 const struct lyplg_ext_record plugins_extensions__[]
462
483typedef LY_ERR (*lyplg_ext_parse_clb)(struct lysp_ctx *pctx, struct lysp_ext_instance *ext);
484
495LIBYANG_API_DECL void lyplg_ext_parse_log(const struct lysp_ctx *pctx, const struct lysp_ext_instance *ext,
496 LY_LOG_LEVEL level, LY_ERR err_no, const char *format, ...);
497
504LIBYANG_API_DECL const struct lysp_module *lyplg_ext_parse_get_cur_pmod(const struct lysp_ctx *pctx);
505
518LIBYANG_API_DECL LY_ERR lyplg_ext_parse_extension_instance(struct lysp_ctx *pctx, struct lysp_ext_instance *ext);
519
537#define LYS_COMPILE_GROUPING 0x01
542#define LYS_COMPILE_DISABLED 0x02
545#define LYS_COMPILE_NO_CONFIG 0x04
546#define LYS_COMPILE_NO_DISABLED 0x08
548#define LYS_COMPILE_RPC_INPUT (LYS_IS_INPUT | LYS_COMPILE_NO_CONFIG)
549#define LYS_COMPILE_RPC_OUTPUT (LYS_IS_OUTPUT | LYS_COMPILE_NO_CONFIG)
550#define LYS_COMPILE_NOTIFICATION (LYS_IS_NOTIF | LYS_COMPILE_NO_CONFIG)
569typedef LY_ERR (*lyplg_ext_compile_clb)(struct lysc_ctx *cctx, const struct lysp_ext_instance *extp,
570 struct lysc_ext_instance *ext);
571
581LIBYANG_API_DECL void lyplg_ext_compile_log(const struct lysc_ctx *cctx, const struct lysc_ext_instance *ext,
582 LY_LOG_LEVEL level, LY_ERR err_no, const char *format, ...);
583
593LIBYANG_API_DECL void lyplg_ext_compile_log_path(const char *path, const struct lysc_ext_instance *ext,
594 LY_LOG_LEVEL level, LY_ERR err_no, const char *format, ...);
595
602LIBYANG_API_DEF void lyplg_ext_compile_log_err(const struct ly_err_item *err, const struct lysc_ext_instance *ext);
603
610LIBYANG_API_DECL struct ly_ctx *lyplg_ext_compile_get_ctx(const struct lysc_ctx *ctx);
611
618LIBYANG_API_DECL uint32_t *lyplg_ext_compile_get_options(const struct lysc_ctx *ctx);
619
626LIBYANG_API_DECL const struct lys_module *lyplg_ext_compile_get_cur_mod(const struct lysc_ctx *ctx);
627
634LIBYANG_API_DECL struct lysp_module *lyplg_ext_compile_get_pmod(const struct lysc_ctx *ctx);
635
651LIBYANG_API_DECL LY_ERR lyplg_ext_compile_extension_instance(struct lysc_ctx *ctx, const struct lysp_ext_instance *extp,
652 struct lysc_ext_instance *ext);
653
674typedef LY_ERR (*lyplg_ext_sprinter_info_clb)(struct lyspr_ctx *ctx, struct lysc_ext_instance *ext, ly_bool *flag);
675
683LIBYANG_API_DECL struct ly_out **lyplg_ext_print_get_out(const struct lyspr_ctx *ctx);
684
691LIBYANG_API_DECL uint32_t *lyplg_ext_print_get_options(const struct lyspr_ctx *ctx);
692
699LIBYANG_API_DECL uint16_t *lyplg_ext_print_get_level(const struct lyspr_ctx *ctx);
700
711LIBYANG_API_DECL void lyplg_ext_print_info_extension_instance(struct lyspr_ctx *ctx, const struct lysc_ext_instance *ext,
712 ly_bool *flag);
713
742typedef LY_ERR (*lyplg_ext_sprinter_ctree_clb)(struct lysc_ext_instance *ext, const struct lyspr_tree_ctx *ctx,
743 const char **flags, const char **add_opts);
744
757typedef LY_ERR (*lyplg_ext_sprinter_ctree_override_clb)(const struct lysc_node *node, const void *plugin_priv,
758 ly_bool *skip, const char **flags, const char **add_opts);
759
768LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ctree_add_ext_nodes(const struct lyspr_tree_ctx *ctx,
770
779LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ctree_add_nodes(const struct lyspr_tree_ctx *ctx, struct lysc_node *nodes,
781
790LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_tree_set_priv(const struct lyspr_tree_ctx *ctx, void *plugin_priv,
791 void (*free_clb)(void *plugin_priv));
792
796typedef LY_ERR (*lyplg_ext_sprinter_ptree_clb)(struct lysp_ext_instance *ext, const struct lyspr_tree_ctx *ctx,
797 const char **flags, const char **add_opts);
798
802typedef LY_ERR (*lyplg_ext_sprinter_ptree_override_clb)(const struct lysp_node *node, const void *plugin_priv,
803 ly_bool *skip, const char **flags, const char **add_opts);
804
808LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ptree_add_ext_nodes(const struct lyspr_tree_ctx *ctx,
810
814LIBYANG_API_DECL LY_ERR lyplg_ext_sprinter_ptree_add_nodes(const struct lyspr_tree_ctx *ctx, struct lysp_node *nodes,
816
819/*
820 * data node
821 */
822
835typedef LY_ERR (*lyplg_ext_data_node_clb)(struct lysc_ext_instance *ext, struct lyd_node *node, uint32_t validate_options);
836
837/*
838 * snode
839 */
840
860 const struct lysc_node *sparent, const char *prefix, size_t prefix_len, LY_VALUE_FORMAT format, void *prefix_data,
861 const char *name, size_t name_len, const struct lysc_node **snode);
862
863/*
864 * validate
865 */
866
882typedef LY_ERR (*lyplg_ext_data_validate_clb)(struct lysc_ext_instance *ext, struct lyd_node *sibling,
883 const struct lyd_node *dep_tree, enum lyd_type data_type, uint32_t val_opts, struct lyd_node **diff);
884
885/*
886 * parse free
887 */
888
895typedef void (*lyplg_ext_parse_free_clb)(const struct ly_ctx *ctx, struct lysp_ext_instance *ext);
896
903LIBYANG_API_DECL void lyplg_ext_pfree_instance_substatements(const struct ly_ctx *ctx, struct lysp_ext_substmt *substmts);
904
905/*
906 * compile free
907 */
908
915typedef void (*lyplg_ext_compile_free_clb)(const struct ly_ctx *ctx, struct lysc_ext_instance *ext);
916
923LIBYANG_API_DECL void lyplg_ext_cfree_instance_substatements(const struct ly_ctx *ctx, struct lysc_ext_substmt *substmts);
924
928struct lyplg_ext {
929 const char *id;
947};
948
950 /* plugin identification */
951 const char *module;
952 const char *revision;
957 const char *name;
959 /* runtime data */
961};
962
969LIBYANG_API_DECL const char *lyplg_ext_stmt2str(enum ly_stmt stmt);
970
977LIBYANG_API_DECL enum ly_stmt lyplg_ext_nodetype2stmt(uint16_t nodetype);
978
990LIBYANG_API_DECL LY_ERR lyplg_ext_get_storage(const struct lysc_ext_instance *ext, int stmt, uint32_t storage_size,
991 const void **storage);
992
1004LIBYANG_API_DECL LY_ERR lyplg_ext_parsed_get_storage(const struct lysc_ext_instance *ext, int stmt,
1005 uint32_t storage_size, const void **storage);
1006
1017LIBYANG_API_DECL LY_ERR lyplg_ext_get_data(const struct ly_ctx *ctx, const struct lysc_ext_instance *ext, void **ext_data,
1018 ly_bool *ext_data_free);
1019
1028LIBYANG_API_DECL LY_ERR lyplg_ext_insert(struct lyd_node *parent, struct lyd_node *first);
1029
1037LIBYANG_API_DECL LY_ERR lyplg_ext_schema_mount_get_parent_ref(const struct lysc_ext_instance *ext, struct ly_set **refs);
1038
1047LIBYANG_API_DECL LY_ERR lyplg_ext_schema_mount_create_context(const struct lysc_ext_instance *ext, struct ly_ctx **ctx);
1048
1051#ifdef __cplusplus
1052}
1053#endif
1054
1055#endif /* LY_PLUGINS_EXTS_H_ */
libyang context handler.
lyd_type
Definition: parser_data.h:312
LY_ERR
libyang's error codes returned by the libyang functions.
Definition: log.h:251
Libyang full error structure.
Definition: log.h:296
LY_LOG_LEVEL
Verbosity levels of the libyang logger.
Definition: log.h:88
Structure to hold a set of (not necessary somehow connected) objects. Usually used for lyd_node,...
Definition: set.h:46
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)
Compile substatements of an extension 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_no, const char *format,...)
Log a message from an extension plugin using the compiled extension instance.
LIBYANG_API_DEF void lyplg_ext_compile_log_err(const struct ly_err_item *err, 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 void lyplg_ext_compile_log_path(const char *path, const struct lysc_ext_instance *ext, LY_LOG_LEVEL level, LY_ERR err_no, 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....
Definition: plugins_exts.h:569
const char * argument
Definition: plugins_exts.h:405
uint64_t parent_stmt_index
Definition: plugins_exts.h:445
lyplg_ext_data_node_clb node
Definition: plugins_exts.h:939
enum ly_stmt stmt
Definition: plugins_exts.h:395
const struct lyplg_ext_record * record
Definition: plugins_exts.h:417
const char * name
Definition: plugins_exts.h:404
lyplg_ext_data_snode_clb snode
Definition: plugins_exts.h:941
const char * arg
Definition: plugins_exts.h:381
LY_VALUE_FORMAT format
Definition: plugins_exts.h:406
const char * argument
Definition: plugins_exts.h:438
struct lysp_stmt * child
Definition: plugins_exts.h:386
uint16_t flags
Definition: plugins_exts.h:387
const char * id
Definition: plugins_exts.h:929
struct lysp_ext_substmt * substmts
Definition: plugins_exts.h:418
lyplg_ext_sprinter_info_clb printer_info
Definition: plugins_exts.h:933
enum ly_stmt parent_stmt
Definition: plugins_exts.h:412
const char * revision
Definition: plugins_exts.h:952
const char * module
Definition: plugins_exts.h:951
LY_VALUE_FORMAT format
Definition: plugins_exts.h:382
lyplg_ext_compile_free_clb cfree
Definition: plugins_exts.h:946
struct lysc_ext_substmt * substmts
Definition: plugins_exts.h:448
struct lysp_stmt * child
Definition: plugins_exts.h:421
enum ly_stmt kw
Definition: plugins_exts.h:388
struct lyplg_ext plugin
Definition: plugins_exts.h:960
lyplg_ext_parse_clb parse
Definition: plugins_exts.h:931
lyplg_ext_sprinter_ctree_clb printer_ctree
Definition: plugins_exts.h:935
lyplg_ext_data_validate_clb validate
Definition: plugins_exts.h:942
struct lysc_ext * def
Definition: plugins_exts.h:437
uint64_t parent_stmt_index
Definition: plugins_exts.h:413
struct lysc_ext_instance * exts
Definition: plugins_exts.h:440
const char * stmt
Definition: plugins_exts.h:380
lyplg_ext_parse_free_clb pfree
Definition: plugins_exts.h:945
enum ly_stmt stmt
Definition: plugins_exts.h:428
struct lysp_ext * def
Definition: plugins_exts.h:408
struct lysp_stmt * next
Definition: plugins_exts.h:385
struct lys_module * module
Definition: plugins_exts.h:439
enum ly_stmt parent_stmt
Definition: plugins_exts.h:444
lyplg_ext_compile_clb compile
Definition: plugins_exts.h:932
void * prefix_data
Definition: plugins_exts.h:383
const char * name
Definition: plugins_exts.h:957
lyplg_ext_sprinter_ptree_clb printer_ptree
Definition: plugins_exts.h:937
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.
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, size_t prefix_len, LY_VALUE_FORMAT format, void *prefix_data, const char *name, size_t name_len, const struct lysc_node **snode)
Callback for getting a schema node for a new YANG instance data described by an extension instance....
Definition: plugins_exts.h:859
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.
LY_ERR(* lyplg_ext_data_validate_clb)(struct lysc_ext_instance *ext, struct lyd_node *sibling, 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.
Definition: plugins_exts.h:882
LY_ERR(* lyplg_ext_data_node_clb)(struct lysc_ext_instance *ext, struct lyd_node *node, uint32_t validate_options)
Callback called for all data nodes connected to the extension instance.
Definition: plugins_exts.h:835
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.
Definition: plugins_exts.h:915
ly_stmt
List of YANG statements.
Definition: plugins_exts.h:143
LIBYANG_API_DECL LY_ERR lyplg_ext_schema_mount_get_parent_ref(const struct lysc_ext_instance *ext, struct ly_set **refs)
Expand parent-reference xpath expressions.
LIBYANG_API_DECL enum ly_stmt lyplg_ext_nodetype2stmt(uint16_t nodetype)
Convert nodetype to statement identifier.
LIBYANG_API_DECL LY_ERR lyplg_ext_insert(struct lyd_node *parent, struct lyd_node *first)
Insert extension instance data into a parent.
LIBYANG_API_DECL LY_ERR lyplg_ext_schema_mount_create_context(const struct lysc_ext_instance *ext, 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.
Definition: plugins_exts.h:895
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 LY_ERR lyplg_ext_get_data(const struct ly_ctx *ctx, const struct lysc_ext_instance *ext, 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().
@ LY_STMT_REVISION
Definition: plugins_exts.h:323
@ LY_STMT_MUST
Definition: plugins_exts.h:276
@ LY_STMT_ARGUMENT
Definition: plugins_exts.h:181
@ LY_STMT_ENUM
Definition: plugins_exts.h:216
@ LY_STMT_LEAF
Definition: plugins_exts.h:172
@ LY_STMT_ERROR_APP_TAG
Definition: plugins_exts.h:220
@ LY_STMT_MAX_ELEMENTS
Definition: plugins_exts.h:263
@ LY_STMT_REFERENCE
Definition: plugins_exts.h:312
@ LY_STMT_REVISION_DATE
Definition: plugins_exts.h:326
@ LY_STMT_SYNTAX_LEFT_BRACE
Definition: plugins_exts.h:366
@ LY_STMT_UNIQUE
Definition: plugins_exts.h:340
@ LY_STMT_REQUIRE_INSTANCE
Definition: plugins_exts.h:319
@ LY_STMT_DEVIATION
Definition: plugins_exts.h:212
@ LY_STMT_IMPORT
Definition: plugins_exts.h:248
@ LY_STMT_CONTACT
Definition: plugins_exts.h:199
@ LY_STMT_LENGTH
Definition: plugins_exts.h:258
@ LY_STMT_IF_FEATURE
Definition: plugins_exts.h:245
@ LY_STMT_SYNTAX_RIGHT_BRACE
Definition: plugins_exts.h:367
@ LY_STMT_ANYDATA
Definition: plugins_exts.h:156
@ LY_STMT_CONTAINER
Definition: plugins_exts.h:167
@ LY_STMT_PATTERN
Definition: plugins_exts.h:296
@ LY_STMT_POSITION
Definition: plugins_exts.h:300
@ LY_STMT_PREFIX
Definition: plugins_exts.h:304
@ LY_STMT_WHEN
Definition: plugins_exts.h:350
@ LY_STMT_BELONGS_TO
Definition: plugins_exts.h:188
@ LY_STMT_ORGANIZATION
Definition: plugins_exts.h:288
@ LY_STMT_AUGMENT
Definition: plugins_exts.h:160
@ LY_STMT_SUBMODULE
Definition: plugins_exts.h:331
@ LY_STMT_ANYXML
Definition: plugins_exts.h:158
@ LY_STMT_MIN_ELEMENTS
Definition: plugins_exts.h:266
@ LY_STMT_SYNTAX_SEMICOLON
Definition: plugins_exts.h:365
@ LY_STMT_NAMESPACE
Definition: plugins_exts.h:280
@ LY_STMT_YANG_VERSION
Definition: plugins_exts.h:352
@ LY_STMT_MANDATORY
Definition: plugins_exts.h:260
@ LY_STMT_PATH
Definition: plugins_exts.h:292
@ LY_STMT_EXTENSION
Definition: plugins_exts.h:228
@ LY_STMT_CASE
Definition: plugins_exts.h:163
@ LY_STMT_MODULE
Definition: plugins_exts.h:273
@ LY_STMT_ERROR_MESSAGE
Definition: plugins_exts.h:224
@ LY_STMT_OUTPUT
Definition: plugins_exts.h:150
@ LY_STMT_REFINE
Definition: plugins_exts.h:315
@ LY_STMT_IDENTITY
Definition: plugins_exts.h:241
@ LY_STMT_TYPEDEF
Definition: plugins_exts.h:336
@ LY_STMT_NONE
Definition: plugins_exts.h:144
@ LY_STMT_ARG_VALUE
Definition: plugins_exts.h:373
@ LY_STMT_DESCRIPTION
Definition: plugins_exts.h:206
@ LY_STMT_ARG_TEXT
Definition: plugins_exts.h:372
@ LY_STMT_CONFIG
Definition: plugins_exts.h:196
@ LY_STMT_RANGE
Definition: plugins_exts.h:310
@ LY_STMT_ORDERED_BY
Definition: plugins_exts.h:284
@ LY_STMT_INCLUDE
Definition: plugins_exts.h:251
@ LY_STMT_YIN_ELEMENT
Definition: plugins_exts.h:356
@ LY_STMT_EXTENSION_INSTANCE
Definition: plugins_exts.h:232
@ LY_STMT_BIT
Definition: plugins_exts.h:192
@ LY_STMT_FRACTION_DIGITS
Definition: plugins_exts.h:237
@ LY_STMT_ACTION
Definition: plugins_exts.h:152
@ LY_STMT_MODIFIER
Definition: plugins_exts.h:269
@ LY_STMT_TYPE
Definition: plugins_exts.h:334
@ LY_STMT_BASE
Definition: plugins_exts.h:185
@ LY_STMT_LEAF_LIST
Definition: plugins_exts.h:174
@ LY_STMT_FEATURE
Definition: plugins_exts.h:234
@ LY_STMT_RPC
Definition: plugins_exts.h:154
@ LY_STMT_DEVIATE
Definition: plugins_exts.h:209
@ LY_STMT_UNITS
Definition: plugins_exts.h:343
@ LY_STMT_GROUPING
Definition: plugins_exts.h:169
@ LY_STMT_KEY
Definition: plugins_exts.h:254
@ LY_STMT_NOTIFICATION
Definition: plugins_exts.h:146
@ LY_STMT_CHOICE
Definition: plugins_exts.h:165
@ LY_STMT_VALUE
Definition: plugins_exts.h:346
@ LY_STMT_USES
Definition: plugins_exts.h:178
@ LY_STMT_PRESENCE
Definition: plugins_exts.h:307
@ LY_STMT_STATUS
Definition: plugins_exts.h:328
@ LY_STMT_INPUT
Definition: plugins_exts.h:148
@ LY_STMT_LIST
Definition: plugins_exts.h:176
@ LY_STMT_DEFAULT
Definition: plugins_exts.h:203
Extension plugin implementing various aspects of a YANG extension.
Definition: plugins_exts.h:928
YANG extension compiled instance.
Definition: plugins_exts.h:436
Structure representing a compiled known YANG substatement in an extension instance.
Definition: plugins_exts.h:427
YANG extension parsed instance.
Definition: plugins_exts.h:403
Structure representing a parsed known YANG substatement in an extension instance.
Definition: plugins_exts.h:394
Structure representing a generic parsed YANG substatement in an extension instance.
Definition: plugins_exts.h:379
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.
Definition: plugins_exts.h:483
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_no, const char *format,...)
Log a message from an extension plugin using the parsed extension instance.
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.
Definition: plugins_exts.h:674
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.
Definition: plugins_exts.h:742
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.
Definition: plugins_exts.h:796
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.
Definition: plugins_exts.h:802
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.
Definition: plugins_exts.h:757
uint16_t flags
Definition: tree_schema.h:733
uint16_t flags
Definition: tree_schema.h:1400
const char * name
Definition: tree_schema.h:1409
struct ly_ctx * ctx
Definition: tree_schema.h:2083
Available YANG schema tree structures representing YANG module.
Definition: tree_schema.h:2082
Compiled YANG extension-stmt.
Definition: tree_schema.h:1182
Compiled YANG data node.
Definition: tree_schema.h:1398
YANG extension-stmt.
Definition: tree_schema.h:296
Printable YANG schema tree structure representing YANG module.
Definition: tree_schema.h:1098
Generic YANG data node.
Definition: tree_schema.h:730
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:28
Parser input structure specifying where the data are read.
Printer output structure specifying where the data are printed.
Data parsers for libyang.
Plugins manipulation.
libyang representation of YANG data trees.
struct lyd_node_inner * parent
Definition: tree_data.h:788
Generic structure for a data node.
Definition: tree_data.h:781
libyang generic macros and functions to modify YANG schema or data trees. Intended for internal use a...
libyang representation of YANG schema trees.