![]() |
libyang
1.0.253
YANG data modeling language library
|
libyang representation of data model trees. More...
#include <limits.h>#include <stddef.h>#include <stdint.h>#include <stdio.h>#include <sys/types.h>Go to the source code of this file.
Data Structures | |
| struct | lyext_substmt |
| Description of the extension instance substatement. More... | |
| struct | lys_ext |
| YANG extension definition. More... | |
| struct | lys_ext_instance |
| Generic extension instance structure. More... | |
| struct | lys_ext_instance_complex |
| Complex extension instance structure. More... | |
| struct | lys_module |
| Main schema node structure representing YANG module. More... | |
| struct | lys_submodule |
| Submodule schema node structure that can be included into a YANG module. More... | |
| struct | lys_type_info_binary |
| struct | lys_type_bit |
| Single bit value specification for lys_type_info_bits. More... | |
| struct | lys_type_info_bits |
| Container for information about bits types (LY_TYPE_BINARY), used in lys_type_info. More... | |
| struct | lys_type_info_dec64 |
| Container for information about decimal64 types (LY_TYPE_DEC64), used in lys_type_info. More... | |
| struct | lys_type_enum |
| Single enumeration value specification for lys_type_info_enums. More... | |
| struct | lys_type_info_enums |
| Container for information about enumeration types (LY_TYPE_ENUM), used in lys_type_info. More... | |
| struct | lys_type_info_ident |
| Container for information about identity types (LY_TYPE_IDENT), used in lys_type_info. More... | |
| struct | lys_type_info_inst |
| Container for information about instance-identifier types (LY_TYPE_INST), used in lys_type_info. More... | |
| struct | lys_type_info_num |
| Container for information about integer types, used in lys_type_info. More... | |
| struct | lys_type_info_lref |
| Container for information about leafref types (LY_TYPE_LEAFREF), used in lys_type_info. More... | |
| struct | lys_type_info_str |
| Container for information about string types (LY_TYPE_STRING), used in lys_type_info. More... | |
| struct | lys_type_info_union |
| Container for information about union types (LY_TYPE_UNION), used in lys_type_info. More... | |
| union | lys_type_info |
| Union for holding type-specific information in lys_type. More... | |
| struct | lys_type |
| YANG type structure providing information from the schema. More... | |
| struct | lys_iffeature |
| Compiled if-feature expression structure. More... | |
| struct | lys_node |
| Common structure representing single YANG data statement describing. More... | |
| struct | lys_node_container |
| Schema container node structure. More... | |
| struct | lys_node_choice |
| Schema choice node structure. More... | |
| struct | lys_node_leaf |
| Schema leaf node structure. More... | |
| struct | lys_node_leaflist |
| Schema leaf-list node structure. More... | |
| struct | lys_node_list |
| Schema list node structure. More... | |
| struct | lys_node_anydata |
| Schema anydata (and anyxml) node structure. More... | |
| struct | lys_node_uses |
| Schema uses node structure. More... | |
| struct | lys_node_grp |
| Schema grouping node structure. More... | |
| struct | lys_node_case |
| Schema case node structure. More... | |
| struct | lys_node_inout |
| RPC input and output node structure. More... | |
| struct | lys_node_notif |
| Schema notification node structure. More... | |
| struct | lys_node_rpc_action |
| Schema rpc/action node structure. More... | |
| struct | lys_node_augment |
| YANG augment structure (covering both possibilities - uses's substatement as well as (sub)module's substatement). More... | |
| struct | lys_refine_mod_list |
| Container for list modifications in lys_refine_mod. More... | |
| union | lys_refine_mod |
| Union to hold target modification in lys_refine. More... | |
| struct | lys_refine |
| YANG uses's refine substatement structure, see RFC 6020 sec. 7.12.2 More... | |
| struct | lys_deviate |
| YANG deviate statement structure, see RFC 6020 sec. 7.18.3.2 More... | |
| struct | lys_deviation |
| YANG deviation statement structure, see RFC 6020 sec. 7.18.3 More... | |
| struct | lys_import |
| YANG import structure used to reference other schemas (modules). More... | |
| struct | lys_include |
| YANG include structure used to reference submodules. More... | |
| struct | lys_revision |
| YANG revision statement for (sub)modules. More... | |
| struct | lys_tpdf |
| YANG typedef structure providing information from the schema. More... | |
| struct | lys_unique |
| YANG list's unique statement structure, see RFC 6020 sec. 7.8.3 More... | |
| struct | lys_feature |
| YANG feature definition structure. More... | |
| struct | lys_restr |
| YANG validity restriction (must, length, etc.) structure providing information from the schema. More... | |
| struct | lys_when |
| YANG when restriction, see RFC 6020 sec. 7.19.5 More... | |
| struct | lys_ident |
| Structure to hold information about identity, see RFC 6020 sec. 7.16 More... | |
Macros | |
| #define | LY_TREE_FOR(START, ELEM) |
| Macro to iterate via all sibling elements without affecting the list itself. More... | |
| #define | LY_TREE_FOR_SAFE(START, NEXT, ELEM) |
| Macro to iterate via all sibling elements allowing to modify the list itself (e.g. removing elements) More... | |
| #define | LY_TREE_DFS_BEGIN(START, NEXT, ELEM) |
| Macro to iterate via all elements in a tree. This is the opening part to the LY_TREE_DFS_END - they always have to be used together. More... | |
| #define | TYPES_COMPATIBLE(type1, type2) _Generic(*(type1), type2: 1, default: 0) |
| Macro to iterate via all elements in a tree. This is the closing part to the LY_TREE_DFS_BEGIN - they always have to be used together. More... | |
| #define | LY_TREE_DFS_END(START, NEXT, ELEM) |
| #define | LY_ARRAY_MAX(var) (sizeof(var) == 8 ? ULLONG_MAX : ((1ULL << (sizeof(var) * 8)) - 1)) |
| #define | LY_REV_SIZE 11 |
| #define | LYS_OUTOPT_TREE_RFC 0x01 |
| #define | LYS_OUTOPT_TREE_GROUPING 0x02 |
| #define | LYS_OUTOPT_TREE_USES 0x04 |
| #define | LYS_OUTOPT_TREE_NO_LEAFREF 0x08 |
| #define | LYS_YANG 1 |
| #define | LYS_YIN 2 |
| #define | LYS_NO_RPC_NOTIF_NODE 0x807F |
| #define | LYS_ANY 0xFFFF |
| #define | LYEXT_OPT_INHERIT 0x01 |
| #define | LYEXT_OPT_VALID 0x08 |
| #define | LYEXT_OPT_VALID_SUBTREE 0x10 |
| #define | LYEXT_OPT_PLUGIN1 0x0100 |
| #define | LYEXT_OPT_PLUGIN2 0x0200 |
| #define | LYEXT_OPT_PLUGIN3 0x0400 |
| #define | LYEXT_OPT_PLUGIN4 0x0800 |
| #define | LYEXT_OPT_PLUGIN5 0x1000 |
| #define | LYEXT_OPT_PLUGIN6 0x2000 |
| #define | LYEXT_OPT_PLUGIN7 0x4000 |
| #define | LYEXT_OPT_PLUGIN8 0x8000 |
| #define | LY_DATA_TYPE_COUNT 20 |
| #define | LYS_IFF_NOT 0x00 |
| #define | LYS_IFF_AND 0x01 |
| #define | LYS_IFF_OR 0x02 |
| #define | LYS_IFF_F 0x03 |
| #define | LYS_CONFIG_W 0x01 |
| #define | LYS_CONFIG_R 0x02 |
| #define | LYS_CONFIG_SET 0x04 |
| #define | LYS_CONFIG_MASK 0x03 |
| #define | LYS_STATUS_CURR 0x08 |
| #define | LYS_STATUS_DEPRC 0x10 |
| #define | LYS_STATUS_OBSLT 0x20 |
| #define | LYS_STATUS_MASK 0x38 |
| #define | LYS_RFN_MAXSET 0x08 |
| #define | LYS_RFN_MINSET 0x10 |
| #define | LYS_MAND_TRUE 0x40 |
| #define | LYS_MAND_FALSE 0x80 |
| #define | LYS_INCL_STATUS 0x80 |
| #define | LYS_MAND_MASK 0xc0 |
| #define | LYS_USERORDERED 0x100 |
| #define | LYS_FENABLED 0x100 |
| #define | LYS_UNIQUE 0x100 |
| #define | LYS_AUTOASSIGNED 0x01 |
| #define | LYS_USESGRP 0x01 |
| #define | LYS_IMPLICIT 0x40 |
| #define | LYS_XPCONF_DEP 0x200 |
| #define | LYS_XPSTATE_DEP 0x400 |
| #define | LYS_LEAFREF_DEP 0x800 |
| #define | LYS_DFLTJSON 0x1000 |
| #define | LYS_NOTAPPLIED 0x01 |
| #define | LYS_YINELEM 0x01 |
| #define | LYS_VALID_EXT 0x2000 |
| #define | LYS_VALID_EXT_SUBTREE 0x4000 |
| #define | LYS_GETNEXT_WITHCHOICE 0x01 |
| #define | LYS_GETNEXT_WITHCASE 0x02 |
| #define | LYS_GETNEXT_WITHGROUPING 0x04 |
| #define | LYS_GETNEXT_WITHINOUT 0x08 |
| #define | LYS_GETNEXT_WITHUSES 0x10 |
| #define | LYS_GETNEXT_INTOUSES 0x20 |
| #define | LYS_GETNEXT_INTONPCONT 0x40 |
| #define | LYS_GETNEXT_PARENTUSES 0x80 |
| #define | LYS_GETNEXT_NOSTATECHECK 0x100 |
| #define | LYXP_MUST 0x01 |
| #define | LYXP_WHEN 0x02 |
| #define | LYXP_RECURSIVE 0x01 |
| #define | LYXP_NO_LOCAL 0x02 |
| #define | LYS_PATH_FIRST_PREFIX 0x01 |
Typedefs | |
| typedef enum lys_nodetype | LYS_NODE |
| YANG schema node types. More... | |
| typedef enum LYS_VERSION | LYS_VERSION |
| supported YANG schema version values More... | |
| typedef enum lys_deviate_type | LYS_DEVIATE_TYPE |
| Possible deviation modifications, see RFC 6020 sec. 7.18.3.2 More... | |
Functions | |
| const void * | lys_ext_instance_substmt (const struct lys_ext_instance *ext) |
| Get address of the substatement structure to which the extension instance refers. More... | |
| int | lys_ext_instance_presence (struct lys_ext *def, struct lys_ext_instance **ext, uint8_t ext_size) |
| Get the position of the extension instance in the extensions list. More... | |
| void * | lys_ext_complex_get_substmt (LY_STMT stmt, struct lys_ext_instance_complex *ext, struct lyext_substmt **info) |
| get pointer to the place where the specified extension's substatement is supposed to be stored in the complex extension instance. More... | |
| const char *const * | ly_get_loaded_plugins (void) |
| Get list of all the loaded plugins, both extension and user type ones. More... | |
| void | ly_load_plugins (void) |
| Load the available YANG extension and type plugins from the plugin directory (LIBDIR/libyang/). More... | |
| int | ly_register_exts (struct lyext_plugin_list *plugin, const char *log_name) |
| Directly register a YANG extension by pointer. More... | |
| int | ly_register_types (struct lytype_plugin_list *plugin, const char *log_name) |
| Directly register a YANG type by pointer. More... | |
| int | ly_clean_plugins (void) |
| Unload all the YANG extension and type plugins. More... | |
| struct lys_module * | lys_parse_mem (struct ly_ctx *ctx, const char *data, LYS_INFORMAT format) |
| Load a schema into the specified context. More... | |
| struct lys_module * | lys_parse_fd (struct ly_ctx *ctx, int fd, LYS_INFORMAT format) |
| Read a schema from file descriptor into the specified context. More... | |
| struct lys_module * | lys_parse_path (struct ly_ctx *ctx, const char *path, LYS_INFORMAT format) |
| Load a schema into the specified context from a file. More... | |
| int | lys_search_localfile (const char *const *searchpaths, int cwd, const char *name, const char *revision, char **localfile, LYS_INFORMAT *format) |
| Search for the schema file in the specified searchpaths. More... | |
| const char ** | lys_features_list (const struct lys_module *module, uint8_t **states) |
| Get list of all the defined features in the module and its submodules. More... | |
| int | lys_features_enable (const struct lys_module *module, const char *feature) |
| Enable specified feature in the module. In case its if-feature evaluates to false, return an error. More... | |
| int | lys_features_disable (const struct lys_module *module, const char *feature) |
| Disable specified feature in the module. If it causes some dependant features to be disabled, they are also set to disabled. More... | |
| int | lys_features_enable_force (const struct lys_module *module, const char *feature) |
| Enable specified feature in the module disregarding its if-features. More... | |
| int | lys_features_disable_force (const struct lys_module *module, const char *feature) |
| Disable specified feature in the module disregarding dependant features. More... | |
| int | lys_features_state (const struct lys_module *module, const char *feature) |
| Get the current status of the specified feature in the module. Even if the feature is enabled but some of its if-features evaluate to false, it is reported as disabled. More... | |
| struct lys_node * | lys_is_disabled (const struct lys_node *node, int recursive) |
| Check if the schema node is disabled in the schema tree, i.e. there is any disabled if-feature statement affecting the node. More... | |
| int | lys_iffeature_value (const struct lys_iffeature *iff) |
| Learn how the if-feature statement currently evaluates. More... | |
| struct lys_node_list * | lys_is_key (const struct lys_node_leaf *node, uint8_t *index) |
| Check if the schema leaf node is used as a key for a list. More... | |
| struct lys_node * | lys_getnext (const struct lys_node *last, const struct lys_node *parent, const struct lys_module *module, int options) |
| Get next schema tree (sibling) node element that can be instantiated in a data tree. Returned node can be from an augment. More... | |
| struct lys_type * | lys_getnext_union_type (const struct lys_type *last, const struct lys_type *type) |
| Get next type of a union. More... | |
| struct ly_set * | lys_find_path (const struct lys_module *cur_module, const struct lys_node *cur_node, const char *path) |
| Search for schema nodes matching the provided path. More... | |
| struct ly_set * | lys_xpath_atomize (const struct lys_node *ctx_node, enum lyxp_node_type ctx_node_type, const char *expr, int options) |
Get all the partial XPath nodes (atoms) that are required for expr to be evaluated. More... | |
| struct ly_set * | lys_node_xpath_atomize (const struct lys_node *node, int options) |
| Call lys_xpath_atomize() on all the when and must expressions of the node. This node must be a descendant of an input, output, or notification node. This subtree then forms the local subtree. More... | |
| char * | lys_path (const struct lys_node *node, int options) |
| Build schema path (usable as path, see howtoxpath) of the schema node. More... | |
| char * | lys_data_path (const struct lys_node *node) |
| Build data path (usable as path, see howtoxpath) of the schema node. More... | |
| char * | lys_data_path_pattern (const struct lys_node *node, const char *placeholder) |
| Build the data path pattern of a schema node. More... | |
| struct lys_node * | lys_parent (const struct lys_node *node) |
| Return parent node in the schema tree. More... | |
| struct lys_module * | lys_node_module (const struct lys_node *node) |
| Return main module of the schema tree node. More... | |
| struct lys_module * | lys_main_module (const struct lys_module *module) |
| Return main module of the module. More... | |
| struct lys_module * | lys_implemented_module (const struct lys_module *mod) |
| Find the implemented revision of the given module in the context. More... | |
| int | lys_set_implemented (const struct lys_module *module) |
| Mark imported module as "implemented". More... | |
| int | lys_set_disabled (const struct lys_module *module) |
| Disable module in its context to avoid its further usage (it will be hidden for module getters). More... | |
| int | lys_set_enabled (const struct lys_module *module) |
| Enable previously disabled module. More... | |
| void * | lys_set_private (const struct lys_node *node, void *priv) |
| Set a schema private pointer to a user pointer. More... | |
| int | lys_print_mem (char **strp, const struct lys_module *module, LYS_OUTFORMAT format, const char *target_node, int line_length, int options) |
| Print schema tree in the specified format into a memory block. It is up to caller to free the returned string by free(). More... | |
| int | lys_print_fd (int fd, const struct lys_module *module, LYS_OUTFORMAT format, const char *target_node, int line_length, int options) |
| Print schema tree in the specified format into a file descriptor. More... | |
| int | lys_print_file (FILE *f, const struct lys_module *module, LYS_OUTFORMAT format, const char *target_node, int line_length, int options) |
| Print schema tree in the specified format into a file stream. More... | |
| int | lys_print_path (const char *path, const struct lys_module *module, LYS_OUTFORMAT format, const char *target_node, int line_length, int options) |
| Print schema tree in the specified format into a file. More... | |
| int | lys_print_clb (ssize_t(*writeclb)(void *arg, const void *buf, size_t count), void *arg, const struct lys_module *module, LYS_OUTFORMAT format, const char *target_node, int line_length, int options) |
| Print schema tree in the specified format using a provided callback. More... | |
libyang representation of data model trees.
This source code is licensed under BSD 3-Clause License (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at
https://opensource.org/licenses/BSD-3-Clause
Definition in file tree_schema.h.
| #define LY_TREE_DFS_END | ( | START, | |
| NEXT, | |||
| ELEM | |||
| ) |
Definition at line 122 of file tree_schema.h.