libyang  2.0.7
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
Schema Tree
Collaboration diagram for Schema Tree:

Modules

 Atomize XPath options
 
 Compiled schema nodes flags
 
 Deviate types
 
 Options for ::lys_getnext() and ::lys_getnext_ext().
 
 Parsed schema nodes flags
 
 Schema Node Types
 
 Schema nodes flags
 
 Schema output options
 
 if-feature expression tokens
 

Data Structures

struct  lys_module
 Available YANG schema tree structures representing YANG module. More...
 
struct  lysc_ext
 Compiled YANG extension-stmt. More...
 
struct  lysc_ext_instance
 YANG extension instance. More...
 
struct  lysc_ext_substmt
 Description of the extension instance substatements. More...
 
struct  lysc_ident
 YANG identity-stmt. More...
 
struct  lysc_iffeature
 Compiled YANG if-feature-stmt. More...
 
struct  lysc_module
 Compiled YANG schema tree structure representing YANG module. More...
 
struct  lysc_must
 
struct  lysc_node
 Compiled YANG data node. More...
 
struct  lysc_node_action
 
union  lysc_node_action.__unnamed85__
 
struct  lysc_node_action.__unnamed85__.__unnamed87__
 
struct  lysc_node_action_inout
 
union  lysc_node_action_inout.__unnamed81__
 
struct  lysc_node_action_inout.__unnamed81__.__unnamed83__
 
struct  lysc_node_anydata
 
union  lysc_node_anydata.__unnamed117__
 
struct  lysc_node_anydata.__unnamed117__.__unnamed119__
 
struct  lysc_node_case
 
union  lysc_node_case.__unnamed97__
 
struct  lysc_node_case.__unnamed97__.__unnamed99__
 
struct  lysc_node_choice
 
union  lysc_node_choice.__unnamed101__
 
struct  lysc_node_choice.__unnamed101__.__unnamed103__
 
struct  lysc_node_container
 
union  lysc_node_container.__unnamed93__
 
struct  lysc_node_container.__unnamed93__.__unnamed95__
 
struct  lysc_node_leaf
 
union  lysc_node_leaf.__unnamed105__
 
struct  lysc_node_leaf.__unnamed105__.__unnamed107__
 
struct  lysc_node_leaflist
 
union  lysc_node_leaflist.__unnamed109__
 
struct  lysc_node_leaflist.__unnamed109__.__unnamed111__
 
struct  lysc_node_list
 
union  lysc_node_list.__unnamed113__
 
struct  lysc_node_list.__unnamed113__.__unnamed115__
 
struct  lysc_node_notif
 
union  lysc_node_notif.__unnamed89__
 
struct  lysc_node_notif.__unnamed89__.__unnamed91__
 
struct  lysc_pattern
 
struct  lysc_prefix
 Compiled prefix data pair mapping of prefixes to modules. In case the format is LY_VALUE_SCHEMA_RESOLVED, the expected prefix data is a sized array of these structures. More...
 
struct  lysc_range
 
struct  lysc_revision
 Compiled YANG revision statement. More...
 
struct  lysc_type
 
struct  lysc_type_bin
 
struct  lysc_type_bitenum_item
 
union  lysc_type_bitenum_item.__unnamed79__
 
struct  lysc_type_bits
 
struct  lysc_type_dec
 
struct  lysc_type_enum
 
struct  lysc_type_identityref
 
struct  lysc_type_instanceid
 
struct  lysc_type_leafref
 
struct  lysc_type_num
 
struct  lysc_type_str
 
struct  lysc_type_union
 
struct  lysc_when
 YANG when-stmt. More...
 
struct  lysp_deviate
 Generic deviate structure to get type and cast to lysp_deviate_* structure. More...
 
struct  lysp_deviate_add
 
struct  lysp_deviate_del
 
struct  lysp_deviate_rpl
 
struct  lysp_deviation
 
struct  lysp_ext
 YANG extension-stmt. More...
 
struct  lysp_ext_instance
 YANG extension instance. More...
 
struct  lysp_feature
 YANG feature-stmt. More...
 
struct  lysp_ident
 YANG identity-stmt. More...
 
struct  lysp_import
 YANG import-stmt. More...
 
struct  lysp_include
 YANG include-stmt. More...
 
struct  lysp_module
 Printable YANG schema tree structure representing YANG module. More...
 
struct  lysp_node
 Generic YANG data node. More...
 
struct  lysp_node_action
 YANG rpc-stmt and action-stmt. More...
 
union  lysp_node_action.__unnamed59__
 
struct  lysp_node_action.__unnamed59__.__unnamed61__
 
struct  lysp_node_action_inout
 YANG input-stmt and output-stmt. More...
 
union  lysp_node_action_inout.__unnamed55__
 
struct  lysp_node_action_inout.__unnamed55__.__unnamed57__
 
struct  lysp_node_anydata
 
union  lysp_node_anydata.__unnamed47__
 
struct  lysp_node_anydata.__unnamed47__.__unnamed49__
 
struct  lysp_node_augment
 YANG uses-augment-stmt and augment-stmt (compatible with struct lysp_node ) More...
 
union  lysp_node_augment.__unnamed71__
 
struct  lysp_node_augment.__unnamed71__.__unnamed73__
 
struct  lysp_node_case
 
union  lysp_node_case.__unnamed43__
 
struct  lysp_node_case.__unnamed43__.__unnamed45__
 
struct  lysp_node_choice
 
union  lysp_node_choice.__unnamed39__
 
struct  lysp_node_choice.__unnamed39__.__unnamed41__
 
struct  lysp_node_container
 Extension structure of the lysp_node for YANG container. More...
 
union  lysp_node_container.__unnamed23__
 
struct  lysp_node_container.__unnamed23__.__unnamed25__
 
struct  lysp_node_grp
 YANG grouping-stmt. More...
 
union  lysp_node_grp.__unnamed67__
 
struct  lysp_node_grp.__unnamed67__.__unnamed69__
 
struct  lysp_node_leaf
 
union  lysp_node_leaf.__unnamed27__
 
struct  lysp_node_leaf.__unnamed27__.__unnamed29__
 
struct  lysp_node_leaflist
 
union  lysp_node_leaflist.__unnamed31__
 
struct  lysp_node_leaflist.__unnamed31__.__unnamed33__
 
struct  lysp_node_list
 
union  lysp_node_list.__unnamed35__
 
struct  lysp_node_list.__unnamed35__.__unnamed37__
 
struct  lysp_node_notif
 YANG notification-stmt. More...
 
union  lysp_node_notif.__unnamed63__
 
struct  lysp_node_notif.__unnamed63__.__unnamed65__
 
struct  lysp_node_uses
 
union  lysp_node_uses.__unnamed51__
 
struct  lysp_node_uses.__unnamed51__.__unnamed53__
 
struct  lysp_qname
 Qualified name (optional prefix followed by an identifier). More...
 
struct  lysp_refine
 YANG refine-stmt. More...
 
struct  lysp_restr
 Covers restrictions: range, length, pattern, must. More...
 
struct  lysp_revision
 YANG revision-stmt. More...
 
struct  lysp_stmt
 Helper structure for generic storage of the extension instances content. More...
 
struct  lysp_submodule
 
struct  lysp_tpdf
 YANG typedef-stmt. More...
 
struct  lysp_type
 YANG type-stmt. More...
 
struct  lysp_type_enum
 Enumeration/Bit value definition. More...
 
struct  lysp_when
 YANG when-stmt. More...
 

Macros

#define _LYSC_TREE_DFS_NEXT(START, ELEM, NEXT)
 Helper macro for LYSC_TREE_DFS_END, should not be used directly! More...
 
#define LY_REV_SIZE   11
 
#define LY_STMT_IS_DATA_NODE(STMT)   (((STMT) >= LY_STMT_ANYDATA) && ((STMT) <= LY_STMT_LIST))
 Generic test for schema data nodes. More...
 
#define LY_STMT_IS_NODE(STMT)   (((STMT) >= LY_STMT_NOTIFICATION) && ((STMT) <= LY_STMT_LIST))
 Generic test for any schema node that maps to common lysc_node or lysp_node structures. More...
 
#define LY_STMT_IS_OP(STMT)   (((STMT) == LY_STMT_ACTION) || ((STMT) == LY_STMT_RPC))
 Generic test for operation statements. More...
 
#define LYS_NODE_HASH_COUNT   4
 Maximum number of hashes stored in a schema node. More...
 
#define LYS_YIN   0x1
 
#define lysc_is_dup_inst_list(lysc_node)
 Examine whether a node is a key-less list or a non-configuration leaf-list. More...
 
#define lysc_is_key(lysc_node)    ((!lysc_node || (lysc_node->nodetype != LYS_LEAF) || !(lysc_node->flags & LYS_KEY)) ? 0 : 1)
 Examine whether a node is a list's key. More...
 
#define lysc_is_np_cont(lysc_node)    ((!lysc_node || (lysc_node->nodetype != LYS_CONTAINER) || (lysc_node->flags & LYS_PRESENCE)) ? 0 : 1)
 Examine whether a node is a non-presence container. More...
 
#define lysc_is_userordered(lysc_node)    ((!lysc_node || !(lysc_node->nodetype & (LYS_LEAFLIST | LYS_LIST)) || !(lysc_node->flags & LYS_ORDBY_USER)) ? 0 : 1)
 Examine whether a node is user-ordered list or leaf-list. More...
 
#define LYSC_TREE_DFS_BEGIN(START, ELEM)
 Macro to iterate via all elements in a schema (sub)tree including input and output. Note that actions and notifications of traversed nodes are ignored! To traverse on all the nodes including those, use lysc_tree_dfs_full() instead. More...
 
#define LYSC_TREE_DFS_END(START, ELEM)
 Macro to iterate via all elements in a (sub)tree. This is the closing part to the LYSC_TREE_DFS_BEGIN - they always have to be used together. More...
 
#define LYSP_MODULE_NAME(PMOD)   (PMOD->is_submod ? ((struct lysp_submodule *)PMOD)->name : ((struct lysp_module *)PMOD)->mod->name)
 Get the parsed module or submodule name. More...
 

Typedefs

typedef enum LYS_VERSION LYS_VERSION
 supported YANG schema version values More...
 
typedef LY_ERR(* lysc_dfs_clb) (struct lysc_node *node, void *data, ly_bool *dfs_continue)
 Callback to be called for every schema node in a DFS traversal. More...
 

Enumerations

enum  ly_stmt {
  LY_STMT_NONE = 0 , LY_STMT_NOTIFICATION , LY_STMT_INPUT , LY_STMT_OUTPUT ,
  LY_STMT_ACTION , LY_STMT_RPC , LY_STMT_ANYDATA , LY_STMT_ANYXML ,
  LY_STMT_AUGMENT , LY_STMT_CASE , LY_STMT_CHOICE , LY_STMT_CONTAINER ,
  LY_STMT_GROUPING , LY_STMT_LEAF , LY_STMT_LEAF_LIST , LY_STMT_LIST ,
  LY_STMT_USES , LY_STMT_ARGUMENT , LY_STMT_BASE , LY_STMT_BELONGS_TO ,
  LY_STMT_BIT , LY_STMT_CONFIG , LY_STMT_CONTACT , LY_STMT_DEFAULT ,
  LY_STMT_DESCRIPTION , LY_STMT_DEVIATE , LY_STMT_DEVIATION , LY_STMT_ENUM ,
  LY_STMT_ERROR_APP_TAG , LY_STMT_ERROR_MESSAGE , LY_STMT_EXTENSION , LY_STMT_EXTENSION_INSTANCE ,
  LY_STMT_FEATURE , LY_STMT_FRACTION_DIGITS , LY_STMT_IDENTITY , LY_STMT_IF_FEATURE ,
  LY_STMT_IMPORT , LY_STMT_INCLUDE , LY_STMT_KEY , LY_STMT_LENGTH ,
  LY_STMT_MANDATORY , LY_STMT_MAX_ELEMENTS , LY_STMT_MIN_ELEMENTS , LY_STMT_MODIFIER ,
  LY_STMT_MODULE , LY_STMT_MUST , LY_STMT_NAMESPACE , LY_STMT_ORDERED_BY ,
  LY_STMT_ORGANIZATION , LY_STMT_PATH , LY_STMT_PATTERN , LY_STMT_POSITION ,
  LY_STMT_PREFIX , LY_STMT_PRESENCE , LY_STMT_RANGE , LY_STMT_REFERENCE ,
  LY_STMT_REFINE , LY_STMT_REQUIRE_INSTANCE , LY_STMT_REVISION , LY_STMT_REVISION_DATE ,
  LY_STMT_STATUS , LY_STMT_SUBMODULE , LY_STMT_TYPE , LY_STMT_TYPEDEF ,
  LY_STMT_UNIQUE , LY_STMT_UNITS , LY_STMT_VALUE , LY_STMT_WHEN ,
  LY_STMT_YANG_VERSION , LY_STMT_YIN_ELEMENT , LY_STMT_SYNTAX_SEMICOLON , LY_STMT_SYNTAX_LEFT_BRACE ,
  LY_STMT_SYNTAX_RIGHT_BRACE , LY_STMT_ARG_TEXT , LY_STMT_ARG_VALUE
}
 List of YANG statements. More...
 
enum  ly_stmt_cardinality { LY_STMT_CARD_OPT , LY_STMT_CARD_MAND , LY_STMT_CARD_SOME , LY_STMT_CARD_ANY }
 Possible cardinalities of the YANG statements. More...
 
enum  LYS_INFORMAT { LYS_IN_UNKNOWN = 0 , LYS_IN_YANG = 1 , LYS_IN_YIN = 3 }
 Schema input formats accepted by libyang parser functions. More...
 
enum  LYS_OUTFORMAT {
  LYS_OUT_UNKNOWN = 0 , LYS_OUT_YANG = 1 , LYS_OUT_YANG_COMPILED = 2 , LYS_OUT_YIN = 3 ,
  LYS_OUT_TREE
}
 Schema output formats accepted by libyang printer functions. More...
 
enum  LYS_VERSION { LYS_VERSION_UNDEF = 0 , LYS_VERSION_1_0 = 1 , LYS_VERSION_1_1 = 2 }
 supported YANG schema version values More...
 
enum  LYSC_PATH_TYPE { LYSC_PATH_LOG , LYSC_PATH_DATA }
 Types of the different schema paths. More...
 

Functions

const char * ly_stmt2str (enum ly_stmt stmt)
 Stringify statement identifier. More...
 
LY_ERR lys_feature_value (const struct lys_module *module, const char *feature)
 Get the current real status of the specified feature in the module. More...
 
const struct lysc_nodelys_find_child (const struct lysc_node *parent, const struct lys_module *module, const char *name, size_t name_len, uint16_t nodetype, uint32_t options)
 Get child node according to the specified criteria. More...
 
LY_ERR lys_find_expr_atoms (const struct lysc_node *ctx_node, const struct lys_module *cur_mod, const struct lyxp_expr *expr, const struct lysc_prefix *prefixes, uint32_t options, struct ly_set **set)
 Get all the schema nodes that are required for expr to be evaluated (atoms). More...
 
LY_ERR lys_find_lypath_atoms (const struct ly_path *path, struct ly_set **set)
 Get all the schema nodes that are required for path to be evaluated (atoms). More...
 
const struct lysc_nodelys_find_path (const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *path, ly_bool output)
 Get a schema node based on the given data path (JSON format, see XPath Addressing). More...
 
LY_ERR lys_find_path_atoms (const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *path, ly_bool output, struct ly_set **set)
 Get all the schema nodes that are required for path to be evaluated (atoms). More...
 
LY_ERR lys_find_xpath (const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *xpath, uint32_t options, struct ly_set **set)
 Evaluate an xpath expression on schema nodes. More...
 
LY_ERR lys_find_xpath_atoms (const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *xpath, uint32_t options, struct ly_set **set)
 Get all the schema nodes that are required for xpath to be evaluated (atoms). More...
 
const struct lysc_nodelys_getnext (const struct lysc_node *last, const struct lysc_node *parent, const struct lysc_module *module, uint32_t options)
 Get next schema tree (sibling) node element that can be instantiated in a data tree. Returned node can be from an augment. More...
 
const struct lysc_nodelys_getnext_ext (const struct lysc_node *last, const struct lysc_node *parent, const struct lysc_ext_instance *ext, uint32_t options)
 Get next schema tree (sibling) node element that can be instantiated in a data tree. More...
 
enum ly_stmt lys_nodetype2stmt (uint16_t nodetype)
 Convert nodetype to statement identifier. More...
 
const char * lys_nodetype2str (uint16_t nodetype)
 Stringify schema nodetype. More...
 
LY_ERR lys_parse (struct ly_ctx *ctx, struct ly_in *in, LYS_INFORMAT format, const char **features, const struct lys_module **module)
 Load a schema into the specified context. More...
 
LY_ERR lys_parse_fd (struct ly_ctx *ctx, int fd, LYS_INFORMAT format, const struct lys_module **module)
 Read a schema from file descriptor into the specified context. More...
 
LY_ERR lys_parse_mem (struct ly_ctx *ctx, const char *data, LYS_INFORMAT format, const struct lys_module **module)
 Load a schema into the specified context. More...
 
LY_ERR lys_parse_path (struct ly_ctx *ctx, const char *path, LYS_INFORMAT format, const struct lys_module **module)
 Load a schema into the specified context from a file. More...
 
LY_ERR lys_print_clb (ly_write_clb writeclb, void *user_data, const struct lys_module *module, LYS_OUTFORMAT format, uint32_t options)
 Print schema tree in the specified format using a provided callback. More...
 
LY_ERR lys_print_fd (int fd, const struct lys_module *module, LYS_OUTFORMAT format, uint32_t options)
 Print schema tree in the specified format into a file descriptor. More...
 
LY_ERR lys_print_file (FILE *f, const struct lys_module *module, LYS_OUTFORMAT format, uint32_t options)
 Print schema tree in the specified format into a file stream. More...
 
LY_ERR lys_print_mem (char **strp, const struct lys_module *module, LYS_OUTFORMAT format, uint32_t 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...
 
LY_ERR lys_print_module (struct ly_out *out, const struct lys_module *module, LYS_OUTFORMAT format, size_t line_length, uint32_t options)
 Schema module printer. More...
 
LY_ERR lys_print_node (struct ly_out *out, const struct lysc_node *node, LYS_OUTFORMAT format, size_t line_length, uint32_t options)
 Schema node printer. More...
 
LY_ERR lys_print_path (const char *path, const struct lys_module *module, LYS_OUTFORMAT format, uint32_t options)
 Print schema tree in the specified format into a file. More...
 
LY_ERR lys_print_submodule (struct ly_out *out, const struct lysp_submodule *submodule, LYS_OUTFORMAT format, size_t line_length, uint32_t options)
 Schema submodule printer. More...
 
LY_ERR lys_search_localfile (const char *const *searchpaths, ly_bool cwd, const char *name, const char *revision, char **localfile, LYS_INFORMAT *format)
 Search for the schema file in the specified searchpaths. More...
 
LY_ERR lys_set_implemented (struct lys_module *mod, const char **features)
 Make the specific module implemented. More...
 
LY_ERR lysc_ext_substmt (const struct lysc_ext_instance *ext, enum ly_stmt substmt, void **instance_p, enum ly_stmt_cardinality *cardinality_p)
 Get pointer to the storage of the specified substatement in the given extension instance. More...
 
const struct lysc_whenlysc_has_when (const struct lysc_node *node)
 Check whether the schema node data instance existence depends on any when conditions. This node and any direct parent choice and case schema nodes are also examined for when conditions. More...
 
LY_ERR lysc_iffeature_value (const struct lysc_iffeature *iff)
 Get how the if-feature statement currently evaluates. More...
 
LY_ERR lysc_module_dfs_full (const struct lys_module *mod, lysc_dfs_clb dfs_clb, void *data)
 DFS traversal of all the schema nodes in a module including RPCs and notifications. More...
 
const struct lysc_node_actionlysc_node_actions (const struct lysc_node *node)
 Get the actions/RPCs linked list of the given (compiled) schema node. Decides the node's type and in case it has a actions/RPCs array, returns it. More...
 
const struct lysc_nodelysc_node_child (const struct lysc_node *node)
 Get the children linked list of the given (compiled) schema node. More...
 
struct lysc_mustlysc_node_musts (const struct lysc_node *node)
 Get the must statements list if present in the node. More...
 
const struct lysc_node_notiflysc_node_notifs (const struct lysc_node *node)
 Get the Notifications linked list of the given (compiled) schema node. Decides the node's type and in case it has a Notifications array, returns it. More...
 
struct lysc_when ** lysc_node_when (const struct lysc_node *node)
 Get the when statements list if present in the node. More...
 
char * lysc_path (const struct lysc_node *node, LYSC_PATH_TYPE pathtype, char *buffer, size_t buflen)
 Generate path of the given node in the requested format. More...
 
LY_ERR lysc_tree_dfs_full (const struct lysc_node *root, lysc_dfs_clb dfs_clb, void *data)
 DFS traversal of all the schema nodes in a (sub)tree including any actions and nested notifications. More...
 
struct lysp_featurelysp_feature_next (const struct lysp_feature *last, const struct lysp_module *pmod, uint32_t *idx)
 Get the next feature in the module or submodules. More...
 
const struct lysp_node_actionlysp_node_actions (const struct lysp_node *node)
 Get the actions/RPCs linked list of the given (parsed) schema node. Decides the node's type and in case it has a actions/RPCs array, returns it. More...
 
const struct lysp_nodelysp_node_child (const struct lysp_node *node)
 Get the children linked list of the given (parsed) schema node. Decides the node's type and in case it has a children list, returns it. More...
 
const struct lysp_node_grplysp_node_groupings (const struct lysp_node *node)
 Get the groupings linked list of the given (parsed) schema node. Decides the node's type and in case it has a groupings array, returns it. More...
 
const struct lysp_node_notiflysp_node_notifs (const struct lysp_node *node)
 Get the Notifications linked list of the given (parsed) schema node. Decides the node's type and in case it has a Notifications array, returns it. More...
 
const struct lysp_tpdflysp_node_typedefs (const struct lysp_node *node)
 Get the typedefs sized array of the given (parsed) schema node. Decides the node's type and in case it has a typedefs array, returns it. More...
 
const char * lyxp_get_expr (const struct lyxp_expr *path)
 Getter for original XPath expression from a parsed expression. More...
 

Detailed Description

Data structures and functions to manipulate and access schema tree.


Data Structure Documentation

◆ lys_module

struct lys_module

Available YANG schema tree structures representing YANG module.

Definition at line 2295 of file tree_schema.h.

Data Fields
struct lys_module ** augmented_by

List of modules that augment this module (sized array)

struct lysc_module * compiled

Compiled and fully validated YANG schema tree for data parsing. Available only for implemented modules.

const char * contact

contact information for the module

struct ly_ctx * ctx

libyang context of the module (mandatory)

struct lys_module ** deviated_by

List of modules that deviate this module (sized array)

const char * dsc

description of the module

const char * filepath

path, if the schema was read from a file, NULL in case of reading from memory

struct lysc_ident * identities

List of compiled identities of the module (sized array) Identities are outside the compiled tree to allow their linkage to the identities from the implemented modules. This avoids problems when the module became implemented in future (no matter if implicitly via augment/deviate or explicitly via lys_set_implemented()). Note that if the module is not implemented (compiled), the identities cannot be instantiated in data (in identityrefs).

ly_bool implemented

flag if the module is implemented, not just imported

uint8_t latest_revision

flag to mark the latest available revision: 1 - the latest revision in searchdirs was not searched yet and this is the latest revision in the current context 2 - searchdirs were searched and this is the latest available revision

const char * name

name of the module (mandatory)

const char * ns

namespace of the module (module - mandatory)

const char * org

party/company responsible for the module

struct lysp_module * parsed

Simply parsed (unresolved) YANG schema tree

const char * prefix

module prefix or submodule belongsto prefix of main module (mandatory)

const char * ref

cross-reference for the module

const char * revision

revision of the module (if present)

ly_bool to_compile

flag marking a module that was changed but not (re)compiled, see LY_CTX_EXPLICIT_COMPILE.

◆ lysc_ext

struct lysc_ext

Compiled YANG extension-stmt.

Note that the compiled extension definition is created only in case the extension is instantiated. It is not available from the compiled schema, but from the parsed extension definition which is being searched when an extension instance is being compiled.

Definition at line 1399 of file tree_schema.h.

Data Fields
const char * argname

argument name, NULL if not specified

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

LYS_STATUS_* value (Schema nodes flags)

struct lys_module * module

module structure

const char * name

extension name

struct lyplg_ext * plugin

Plugin implementing the specific extension

uint32_t refcount

reference counter since extension definition is shared among all its instances

◆ lysc_ext_instance

struct lysc_ext_instance

YANG extension instance.

Definition at line 1425 of file tree_schema.h.

Data Fields
const char * argument

optional value of the extension's argument

void * data

private plugins's data, not used by libyang

struct lysc_ext * def

pointer to the extension definition

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lys_module * module

module where the extension instantiated is defined

void * parent

pointer to the parent element holding the extension instance(s), use lysc_ext_instance::parent_stmt to access the schema element

enum ly_stmt parent_stmt

value identifying placement of the extension instance in specific statement

uint64_t parent_stmt_index

in case the instance is in a substatement, this identifies the index of that substatement in its sized array (if any)

struct lysc_ext_substmt * substmts

list of allowed substatements with the storage to access the present substatements (sized array)

◆ lysc_ext_substmt

struct lysc_ext_substmt

Description of the extension instance substatements.

Provided by extensions plugins to libyang to be able to correctly compile the content of extension instances. Note that order of the defined records matters - just follow the values of ly_stmt and order the records from lower to higher values.

Definition at line 1415 of file tree_schema.h.

Data Fields
enum ly_stmt_cardinality cardinality

cardinality of the substatement

enum ly_stmt stmt

allowed substatement

void * storage

pointer to the storage of the compiled statement according to the specific lysc_ext_substmt::stmt and lysc_ext_substmt::cardinality

◆ lysc_ident

struct lysc_ident

YANG identity-stmt.

Definition at line 1458 of file tree_schema.h.

Data Fields
struct lysc_ident ** derived

list of (pointers to the) derived identities (sized array)

const char * dsc

description

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags - only LYS_STATUS_ values are allowed

struct lys_module * module

module structure

const char * name

identity name (mandatory), including possible prefix

const char * ref

reference

◆ lysc_iffeature

struct lysc_iffeature

Compiled YANG if-feature-stmt.

Definition at line 561 of file tree_schema.h.

Data Fields
uint8_t * expr

2bits array describing the if-feature expression in prefix format, see if-feature expression tokens

struct lysp_feature ** features

array of pointers to the features used in expression (sized array)

◆ lysc_module

struct lysc_module

Compiled YANG schema tree structure representing YANG module.

Semantically validated YANG schema tree for data tree parsing. Contains only the necessary information for the data validation.

Definition at line 1959 of file tree_schema.h.

Data Fields
struct lysc_node * data

list of module's top-level data nodes (linked list)

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lys_module * mod

covering module structure

struct lysc_node_notif * notifs

first of notifications nodes (linked list)

struct lysc_node_action * rpcs

first of actions nodes (linked list)

◆ lysc_must

struct lysc_must

Definition at line 1518 of file tree_schema.h.

Data Fields
struct lyxp_expr * cond

XPath when condition

const char * dsc

description

const char * eapptag

error-app-tag value

const char * emsg

error-message

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lysc_prefix * prefixes

compiled used prefixes in the condition

const char * ref

reference

◆ lysc_node

struct lysc_node

Compiled YANG data node.

Definition at line 1644 of file tree_schema.h.

Data Fields
const char * dsc

description

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

uint8_t hash[4]

schema hash required for LYB printer/parser

struct lys_module * module

module structure

const char * name

node name (mandatory)

struct lysc_node * next

next sibling node (NULL if there is no one)

uint16_t nodetype

type of the node (mandatory)

struct lysc_node * parent

parent node (NULL in case of top level node)

struct lysc_node * prev

pointer to the previous sibling node

Note
Note that this pointer is never NULL. If there is no sibling node, pointer points to the node itself. In case of the first node, this pointer points to the last node in the list.
void * priv

private arbitrary user data, not used by libyang unless LY_CTX_SET_PRIV_PARSED is set

const char * ref

reference

◆ lysc_node_action

struct lysc_node_action

Definition at line 1685 of file tree_schema.h.

Data Fields
union lysc_node_action __unnamed__
struct lysc_node_action_inout input

RPC's/action's input

struct lysc_node_action_inout output

RPC's/action's output

struct lysc_when ** when

list of pointers to when statements (sized array), the action/RPC nodes do not contain the when statement on their own, but they can inherit it from the parent's uses.

◆ lysc_node_action.__unnamed85__

union lysc_node_action.__unnamed85__

Definition at line 1686 of file tree_schema.h.

Data Fields
__unnamed85__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_action.__unnamed85__.__unnamed87__

struct lysc_node_action.__unnamed85__.__unnamed87__

Definition at line 1688 of file tree_schema.h.

Data Fields
const char * dsc

description

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

uint8_t hash[4]

schema hash required for LYB printer/parser

struct lys_module * module

module structure

const char * name

action/RPC name (mandatory)

struct lysc_node_action * next

next sibling node (NULL if there is no one)

uint16_t nodetype

LYS_RPC or LYS_ACTION

struct lysc_node * parent

parent node (NULL in case of top level node - RPC)

struct lysc_node_action * prev

pointer to the previous sibling node

Note
Note that this pointer is never NULL. If there is no sibling node, pointer points to the node itself. In case of the first node, this pointer points to the last node in the list.
void * priv
const char * ref

reference

◆ lysc_node_action_inout

struct lysc_node_action_inout

Definition at line 1662 of file tree_schema.h.

Data Fields
union lysc_node_action_inout __unnamed__
struct lysc_node * child

first child node (linked list)

struct lysc_must * musts

list of must restrictions (sized array)

◆ lysc_node_action_inout.__unnamed81__

union lysc_node_action_inout.__unnamed81__

Definition at line 1663 of file tree_schema.h.

Data Fields
__unnamed81__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_action_inout.__unnamed81__.__unnamed83__

struct lysc_node_action_inout.__unnamed81__.__unnamed83__

Definition at line 1665 of file tree_schema.h.

Data Fields
const char * dsc

ALWAYS NULL, compatibility member with lysc_node

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

uint8_t hash[4]

schema hash required for LYB printer/parser

struct lys_module * module

module structure

const char * name

"input" or "output"

struct lysc_node * next

next sibling node (output node for input, NULL for output)

uint16_t nodetype

LYS_INPUT or LYS_OUTPUT

struct lysc_node * parent

parent node (NULL in case of top level node)

struct lysc_node * prev

pointer to the previous sibling node (input and output node pointing to each other)

void * priv
const char * ref

ALWAYS NULL, compatibility member with lysc_node

◆ lysc_node_anydata

struct lysc_node_anydata

Definition at line 1927 of file tree_schema.h.

Data Fields
union lysc_node_anydata __unnamed__
struct lysc_must * musts

list of must restrictions (sized array)

struct lysc_when ** when

list of pointers to when statements (sized array)

◆ lysc_node_anydata.__unnamed117__

union lysc_node_anydata.__unnamed117__

Definition at line 1928 of file tree_schema.h.

Data Fields
__unnamed117__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_anydata.__unnamed117__.__unnamed119__

struct lysc_node_anydata.__unnamed117__.__unnamed119__

Definition at line 1930 of file tree_schema.h.

Data Fields
const char * dsc

description

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

uint8_t hash[4]

schema hash required for LYB printer/parser

struct lys_module * module

module structure

const char * name

node name (mandatory)

struct lysc_node * next

next sibling node (NULL if there is no one)

uint16_t nodetype

LYS_ANYXML or LYS_ANYDATA

struct lysc_node * parent

parent node (NULL in case of top level node)

struct lysc_node * prev

pointer to the previous sibling node

Note
Note that this pointer is never NULL. If there is no sibling node, pointer points to the node itself. In case of the first node, this pointer points to the last node in the list.
void * priv

private arbitrary user data, not used by libyang unless LY_CTX_SET_PRIV_PARSED is set

const char * ref

reference

◆ lysc_node_case

struct lysc_node_case

Definition at line 1773 of file tree_schema.h.

Data Fields
union lysc_node_case __unnamed__
struct lysc_node * child

first child node of the case (linked list). Note that all the children of all the sibling cases are linked each other as siblings with the parent pointer pointing to appropriate case node.

struct lysc_when ** when

list of pointers to when statements (sized array)

◆ lysc_node_case.__unnamed97__

union lysc_node_case.__unnamed97__

Definition at line 1774 of file tree_schema.h.

Data Fields
__unnamed97__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_case.__unnamed97__.__unnamed99__

struct lysc_node_case.__unnamed97__.__unnamed99__

Definition at line 1776 of file tree_schema.h.

Data Fields
const char * dsc

description

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

uint8_t hash[4]

schema hash required for LYB printer/parser, unused

struct lys_module * module

module structure

const char * name

name of the case, including the implicit case

struct lysc_node * next

next sibling node (NULL if there is no one)

uint16_t nodetype

LYS_CASE

struct lysc_node * parent

parent node (NULL in case of top level node)

struct lysc_node * prev

pointer to the previous sibling node

Note
Note that this pointer is never NULL. If there is no sibling node, pointer points to the node itself. In case of the first node, this pointer points to the last node in the list.
void * priv

private arbitrary user data, not used by libyang unless LY_CTX_SET_PRIV_PARSED is set

const char * ref

reference

◆ lysc_node_choice

struct lysc_node_choice

Definition at line 1800 of file tree_schema.h.

Data Fields
union lysc_node_choice __unnamed__
struct lysc_node_case * cases

list of the cases (linked list). Note that all the children of all the cases are linked each other as siblings. Their parent pointers points to the specific case they belongs to, so distinguish the case is simple.

struct lysc_node_case * dflt

default case of the choice, only a pointer into the cases array.

struct lysc_when ** when

list of pointers to when statements (sized array)

◆ lysc_node_choice.__unnamed101__

union lysc_node_choice.__unnamed101__

Definition at line 1801 of file tree_schema.h.

Data Fields
__unnamed101__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_choice.__unnamed101__.__unnamed103__

struct lysc_node_choice.__unnamed101__.__unnamed103__

Definition at line 1803 of file tree_schema.h.

Data Fields
const char * dsc

description

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

uint8_t hash[4]

schema hash required for LYB printer/parser, unused

struct lys_module * module

module structure

const char * name

node name (mandatory)

struct lysc_node * next

next sibling node (NULL if there is no one)

uint16_t nodetype

LYS_CHOICE

struct lysc_node * parent

parent node (NULL in case of top level node)

struct lysc_node * prev

pointer to the previous sibling node

Note
Note that this pointer is never NULL. If there is no sibling node, pointer points to the node itself. In case of the first node, this pointer points to the last node in the list.
void * priv

private arbitrary user data, not used by libyang unless LY_CTX_SET_PRIV_PARSED is set

const char * ref

reference

◆ lysc_node_container

struct lysc_node_container

Definition at line 1744 of file tree_schema.h.

Data Fields
union lysc_node_container __unnamed__
struct lysc_node_action * actions

first of actions nodes (linked list)

struct lysc_node * child

first child node (linked list)

struct lysc_must * musts

list of must restrictions (sized array)

struct lysc_node_notif * notifs

first of notifications nodes (linked list)

struct lysc_when ** when

list of pointers to when statements (sized array)

◆ lysc_node_container.__unnamed93__

union lysc_node_container.__unnamed93__

Definition at line 1745 of file tree_schema.h.

Data Fields
__unnamed93__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_container.__unnamed93__.__unnamed95__

struct lysc_node_container.__unnamed93__.__unnamed95__

Definition at line 1747 of file tree_schema.h.

Data Fields
const char * dsc

description

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

uint8_t hash[4]

schema hash required for LYB printer/parser

struct lys_module * module

module structure

const char * name

node name (mandatory)

struct lysc_node * next

next sibling node (NULL if there is no one)

uint16_t nodetype

LYS_CONTAINER

struct lysc_node * parent

parent node (NULL in case of top level node)

struct lysc_node * prev

pointer to the previous sibling node

Note
Note that this pointer is never NULL. If there is no sibling node, pointer points to the node itself. In case of the first node, this pointer points to the last node in the list.
void * priv

private arbitrary user data, not used by libyang unless LY_CTX_SET_PRIV_PARSED is set

const char * ref

reference

◆ lysc_node_leaf

struct lysc_node_leaf

Definition at line 1829 of file tree_schema.h.

Data Fields
union lysc_node_leaf __unnamed__
struct lyd_value * dflt

default value, use lyd_value_get_canonical() to get the canonical string

struct lysc_must * musts

list of must restrictions (sized array)

struct lysc_type * type

type of the leaf node (mandatory)

const char * units

units of the leaf's type

struct lysc_when ** when

list of pointers to when statements (sized array)

◆ lysc_node_leaf.__unnamed105__

union lysc_node_leaf.__unnamed105__

Definition at line 1830 of file tree_schema.h.

Data Fields
__unnamed105__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_leaf.__unnamed105__.__unnamed107__

struct lysc_node_leaf.__unnamed105__.__unnamed107__

Definition at line 1832 of file tree_schema.h.

Data Fields
const char * dsc

description

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

uint8_t hash[4]

schema hash required for LYB printer/parser

struct lys_module * module

module structure

const char * name

node name (mandatory)

struct lysc_node * next

next sibling node (NULL if there is no one)

uint16_t nodetype

LYS_LEAF

struct lysc_node * parent

parent node (NULL in case of top level node)

struct lysc_node * prev

pointer to the previous sibling node

Note
Note that this pointer is never NULL. If there is no sibling node, pointer points to the node itself. In case of the first node, this pointer points to the last node in the list.
void * priv

private arbitrary user data, not used by libyang unless LY_CTX_SET_PRIV_PARSED is set

const char * ref

reference

◆ lysc_node_leaflist

struct lysc_node_leaflist

Definition at line 1859 of file tree_schema.h.

Data Fields
union lysc_node_leaflist __unnamed__
struct lyd_value ** dflts

list (sized array) of default values, use lyd_value_get_canonical() to get the canonical strings

uint32_t max

max-elements constraint

uint32_t min

min-elements constraint

struct lysc_must * musts

list of must restrictions (sized array)

struct lysc_type * type

type of the leaf node (mandatory)

const char * units

units of the leaf's type

struct lysc_when ** when

list of pointers to when statements (sized array)

◆ lysc_node_leaflist.__unnamed109__

union lysc_node_leaflist.__unnamed109__

Definition at line 1860 of file tree_schema.h.

Data Fields
__unnamed109__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_leaflist.__unnamed109__.__unnamed111__

struct lysc_node_leaflist.__unnamed109__.__unnamed111__

Definition at line 1862 of file tree_schema.h.

Data Fields
const char * dsc

description

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

uint8_t hash[4]

schema hash required for LYB printer/parser

struct lys_module * module

module structure

const char * name

node name (mandatory)

struct lysc_node * next

next sibling node (NULL if there is no one)

uint16_t nodetype

LYS_LEAFLIST

struct lysc_node * parent

parent node (NULL in case of top level node)

struct lysc_node * prev

pointer to the previous sibling node

Note
Note that this pointer is never NULL. If there is no sibling node, pointer points to the node itself. In case of the first node, this pointer points to the last node in the list.
void * priv

private arbitrary user data, not used by libyang unless LY_CTX_SET_PRIV_PARSED is set

const char * ref

reference

◆ lysc_node_list

struct lysc_node_list

Definition at line 1894 of file tree_schema.h.

Data Fields
union lysc_node_list __unnamed__
struct lysc_node_action * actions

first of actions nodes (linked list)

struct lysc_node * child

first child node (linked list)

uint32_t max

max-elements constraint

uint32_t min

min-elements constraint

struct lysc_must * musts

list of must restrictions (sized array)

struct lysc_node_notif * notifs

first of notifications nodes (linked list)

struct lysc_node_leaf *** uniques

list of sized arrays of pointers to the unique nodes (sized array)

struct lysc_when ** when

list of pointers to when statements (sized array)

◆ lysc_node_list.__unnamed113__

union lysc_node_list.__unnamed113__

Definition at line 1895 of file tree_schema.h.

Data Fields
__unnamed113__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_list.__unnamed113__.__unnamed115__

struct lysc_node_list.__unnamed113__.__unnamed115__

Definition at line 1897 of file tree_schema.h.

Data Fields
const char * dsc

description

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

uint8_t hash[4]

schema hash required for LYB printer/parser

struct lys_module * module

module structure

const char * name

node name (mandatory)

struct lysc_node * next

next sibling node (NULL if there is no one)

uint16_t nodetype

LYS_LIST

struct lysc_node * parent

parent node (NULL in case of top level node)

struct lysc_node * prev

pointer to the previous sibling node

Note
Note that this pointer is never NULL. If there is no sibling node, pointer points to the node itself. In case of the first node, this pointer points to the last node in the list.
void * priv

private arbitrary user data, not used by libyang unless LY_CTX_SET_PRIV_PARSED is set

const char * ref

reference

◆ lysc_node_notif

struct lysc_node_notif

Definition at line 1715 of file tree_schema.h.

Data Fields
union lysc_node_notif __unnamed__
struct lysc_node * child

first child node (linked list)

struct lysc_must * musts

list of must restrictions (sized array)

struct lysc_when ** when

list of pointers to when statements (sized array), the notification nodes do not contain the when statement on their own, but they can inherit it from the parent's uses.

◆ lysc_node_notif.__unnamed89__

union lysc_node_notif.__unnamed89__

Definition at line 1716 of file tree_schema.h.

Data Fields
__unnamed89__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_notif.__unnamed89__.__unnamed91__

struct lysc_node_notif.__unnamed89__.__unnamed91__

Definition at line 1718 of file tree_schema.h.

Data Fields
const char * dsc

description

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

uint8_t hash[4]

schema hash required for LYB printer/parser

struct lys_module * module

module structure

const char * name

Notification name (mandatory)

struct lysc_node_notif * next

next sibling node (NULL if there is no one)

uint16_t nodetype

LYS_NOTIF

struct lysc_node * parent

parent node (NULL in case of top level node)

struct lysc_node_notif * prev

pointer to the previous sibling node

Note
Note that this pointer is never NULL. If there is no sibling node, pointer points to the node itself. In case of the first node, this pointer points to the last node in the list.
void * priv
const char * ref

reference

◆ lysc_pattern

struct lysc_pattern

Definition at line 1506 of file tree_schema.h.

Data Fields
pcre2_code * code

compiled regular expression

const char * dsc

description

const char * eapptag

error-app-tag value

const char * emsg

error-message

const char * expr

original, not compiled, regular expression

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint32_t inverted: 1

invert-match flag

const char * ref

reference

uint32_t refcount: 31

reference counter

◆ lysc_prefix

struct lysc_prefix

Compiled prefix data pair mapping of prefixes to modules. In case the format is LY_VALUE_SCHEMA_RESOLVED, the expected prefix data is a sized array of these structures.

Definition at line 1387 of file tree_schema.h.

Data Fields
const struct lys_module * mod

mapping to a module

char * prefix

used prefix

◆ lysc_range

struct lysc_range

Definition at line 1488 of file tree_schema.h.

Data Fields
const char * dsc

description

const char * eapptag

error-app-tag value

const char * emsg

error-message

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lysc_range_part * parts

compiled range expression (sized array)

const char * ref

reference

◆ lysc_revision

struct lysc_revision

Compiled YANG revision statement.

Definition at line 1483 of file tree_schema.h.

Data Fields
char date[11]

revision-date (mandatory)

struct lysc_ext_instance * exts

list of the extension instances (sized array)

◆ lysc_type

struct lysc_type

Definition at line 1528 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lyplg_type * plugin

type's plugin with built-in as well as user functions to canonize or validate the value of the type

uint32_t refcount

reference counter for type sharing

◆ lysc_type_bin

struct lysc_type_bin

Definition at line 1628 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lysc_range * length

Optional length limitation

struct lyplg_type * plugin

type's plugin with built-in as well as user functions to canonize or validate the value of the type

uint32_t refcount

reference counter for type sharing

◆ lysc_type_bitenum_item

struct lysc_type_bitenum_item

Definition at line 1561 of file tree_schema.h.

Data Fields
union lysc_type_bitenum_item __unnamed__
const char * dsc

description

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags - only LYS_STATUS_ and LYS_SET_VALUE values are allowed

const char * name

enumeration identifier

const char * ref

reference

◆ lysc_type_bitenum_item.__unnamed79__

union lysc_type_bitenum_item.__unnamed79__

Definition at line 1566 of file tree_schema.h.

Data Fields
uint32_t position

non-negative integer value associated with the bit

int32_t value

integer value associated with the enumeration

◆ lysc_type_bits

struct lysc_type_bits

Definition at line 1582 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

struct lysc_type_bitenum_item * bits

bits list (sized array), mandatory (at least 1 item), the items are ordered by their position value.

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lyplg_type * plugin

type's plugin with built-in as well as user functions to canonize or validate the value of the type

uint32_t refcount

reference counter for type sharing

◆ lysc_type_dec

struct lysc_type_dec

Definition at line 1543 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint8_t fraction_digits

fraction digits specification

struct lyplg_type * plugin

type's plugin with built-in as well as user functions to canonize or validate the value of the type

struct lysc_range * range

Optional range limitation

uint32_t refcount

reference counter for type sharing

◆ lysc_type_enum

struct lysc_type_enum

Definition at line 1574 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

struct lysc_type_bitenum_item * enums

enumerations list (sized array), mandatory (at least 1 item)

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lyplg_type * plugin

type's plugin with built-in as well as user functions to canonize or validate the value of the type

uint32_t refcount

reference counter for type sharing

◆ lysc_type_identityref

struct lysc_type_identityref

Definition at line 1603 of file tree_schema.h.

Data Fields
struct lysc_ident ** bases

list of pointers to the base identities (sized array), mandatory (at least 1 item)

LY_DATA_TYPE basetype

Base type of the type

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lyplg_type * plugin

type's plugin with built-in as well as user functions to canonize or validate the value of the type

uint32_t refcount

reference counter for type sharing

◆ lysc_type_instanceid

struct lysc_type_instanceid

Definition at line 1612 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lyplg_type * plugin

type's plugin with built-in as well as user functions to canonize or validate the value of the type

uint32_t refcount

reference counter for type sharing

uint8_t require_instance

require-instance flag

◆ lysc_type_leafref

struct lysc_type_leafref

Definition at line 1591 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

const struct lys_module * cur_mod

current module for the leafref (path)

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lyxp_expr * path

parsed target path, compiled path cannot be stored because of type sharing

struct lyplg_type * plugin

type's plugin with built-in as well as user functions to canonize or validate the value of the type

struct lysc_prefix * prefixes

resolved prefixes used in the path

struct lysc_type * realtype

pointer to the real (first non-leafref in possible leafrefs chain) type.

uint32_t refcount

reference counter for type sharing

uint8_t require_instance

require-instance flag

◆ lysc_type_num

struct lysc_type_num

Definition at line 1535 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lyplg_type * plugin

type's plugin with built-in as well as user functions to canonize or validate the value of the type

struct lysc_range * range

Optional range limitation

uint32_t refcount

reference counter for type sharing

◆ lysc_type_str

struct lysc_type_str

Definition at line 1552 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lysc_range * length

Optional length limitation

struct lysc_pattern ** patterns

Optional list of pointers to pattern limitations (sized array)

struct lyplg_type * plugin

type's plugin with built-in as well as user functions to canonize or validate the value of the type

uint32_t refcount

reference counter for type sharing

◆ lysc_type_union

struct lysc_type_union

Definition at line 1620 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lyplg_type * plugin

type's plugin with built-in as well as user functions to canonize or validate the value of the type

uint32_t refcount

reference counter for type sharing

struct lysc_type ** types

list of types in the union (sized array), mandatory (at least 1 item)

◆ lysc_when

struct lysc_when

YANG when-stmt.

Definition at line 1444 of file tree_schema.h.

Data Fields
struct lyxp_expr * cond

XPath when condition

struct lysc_node * context

context node for evaluating the expression, NULL if the context is root node

const char * dsc

description

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags - only LYS_STATUS is allowed

struct lysc_prefix * prefixes

compiled used prefixes in the condition

const char * ref

reference

uint32_t refcount

reference counter since some of the when statements are shared among several nodes

◆ lysp_deviate

struct lysp_deviate

Generic deviate structure to get type and cast to lysp_deviate_* structure.

Definition at line 711 of file tree_schema.h.

Data Fields
struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint8_t mod

type of the deviate modification

struct lysp_deviate * next

next deviate structure in the list

◆ lysp_deviate_add

struct lysp_deviate_add

Definition at line 717 of file tree_schema.h.

Data Fields
struct lysp_qname * dflts

list of default values (sized array)

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

uint32_t max

max-elements constraint, 0 means unbounded

uint32_t min

min-elements constraint

uint8_t mod

type of the deviate modification

struct lysp_restr * musts

list of must restrictions (sized array)

struct lysp_deviate * next

next deviate structure in the list

struct lysp_qname * uniques

list of uniques specifications (sized array)

const char * units

units of the values

◆ lysp_deviate_del

struct lysp_deviate_del

Definition at line 730 of file tree_schema.h.

Data Fields
struct lysp_qname * dflts

list of default values (sized array)

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint8_t mod

type of the deviate modification

struct lysp_restr * musts

list of must restrictions (sized array)

struct lysp_deviate * next

next deviate structure in the list

struct lysp_qname * uniques

list of uniques specifications (sized array)

const char * units

units of the values

◆ lysp_deviate_rpl

struct lysp_deviate_rpl

Definition at line 740 of file tree_schema.h.

Data Fields
struct lysp_qname dflt

default value

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

uint32_t max

max-elements constraint, 0 means unbounded

uint32_t min

min-elements constraint

uint8_t mod

type of the deviate modification

struct lysp_deviate * next

next deviate structure in the list

struct lysp_type * type

type of the node

const char * units

units of the values

◆ lysp_deviation

struct lysp_deviation

Definition at line 752 of file tree_schema.h.

Data Fields
struct lysp_deviate * deviates

list of deviate specifications (linked list)

const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

const char * nodeid

target absolute schema nodeid (mandatory)

const char * ref

reference statement

◆ lysp_ext

struct lysp_ext

YANG extension-stmt.

Definition at line 489 of file tree_schema.h.

Data Fields
const char * argname

argument name, NULL if not specified

struct lysc_ext * compiled

pointer to the compiled extension definition. The extension definition is compiled only if there is compiled extension instance, otherwise this pointer remains NULL. The compiled extension definition is shared among all extension instances.

const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

LYS_STATUS_* and LYS_YINELEM_* values (Schema nodes flags)

const char * name

extension name

const char * ref

reference statement

◆ lysp_ext_instance

struct lysp_ext_instance

YANG extension instance.

Definition at line 523 of file tree_schema.h.

Data Fields
const char * argument

optional value of the extension's argument

struct lysp_stmt * child

list of the extension's substatements (linked list)

uint16_t flags

LYS_INTERNAL value (Schema nodes flags)

LY_VALUE_FORMAT format

prefix format of the extension name/argument (LY_VALUE_XML is YIN format)

const char * name

extension identifier, including possible prefix

void * parent

pointer to the parent element holding the extension instance(s), use lysp_ext_instance::parent_stmt to access the schema element

enum ly_stmt parent_stmt

value identifying placement of the extension instance

uint64_t parent_stmt_index

in case the instance is in a substatement, this identifies the index of that substatement in its sized array (if any)

struct lysp_node * parsed

Simply parsed (unresolved) YANG schema tree serving as a cache. Only lys_compile_extension_instance() can set this.

void * prefix_data

Format-specific data for prefix resolution (see ly_resolve_prefix())

◆ lysp_feature

struct lysp_feature

YANG feature-stmt.

Definition at line 545 of file tree_schema.h.

Data Fields
struct lysp_feature ** depfeatures

list of pointers to other features depending on this one (sized array)

const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags - only LYS_STATUS_* values and LYS_FENABLED are allowed

struct lysp_qname * iffeatures

list of if-feature expressions (sized array)

struct lysc_iffeature * iffeatures_c

compiled if-features

const char * name

feature name (mandatory)

const char * ref

reference statement

◆ lysp_ident

struct lysp_ident

YANG identity-stmt.

Definition at line 578 of file tree_schema.h.

Data Fields
const char ** bases

list of base identifiers (sized array)

const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags - only LYS_STATUS_ values are allowed

struct lysp_qname * iffeatures

list of if-feature expressions (sized array)

const char * name

identity name (mandatory), including possible prefix

const char * ref

reference statement

◆ lysp_import

struct lysp_import

YANG import-stmt.

Definition at line 458 of file tree_schema.h.

Data Fields
const char * dsc

description

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

LYS_INTERNAL value (Schema nodes flags)

struct lys_module * module

pointer to the imported module (mandatory, but resolved when the referring module is completely parsed)

const char * name

name of the imported module (mandatory)

const char * prefix

prefix for the data from the imported schema (mandatory)

const char * ref

reference

char rev[11]

revision-date of the imported module

◆ lysp_include

struct lysp_include

YANG include-stmt.

Definition at line 473 of file tree_schema.h.

Data Fields
const char * dsc

description

struct lysp_ext_instance * exts

list of the extension instances (sized array)

ly_bool injected

flag to mark includes copied into main module from submodules, only for backward compatibility with YANG 1.0, which does not require the main module to include all submodules.

const char * name

name of the included submodule (mandatory)

const char * ref

reference

char rev[11]

revision-date of the included submodule

struct lysp_submodule * submodule

pointer to the parsed submodule structure (mandatory, but resolved when the referring module is completely parsed)

◆ lysp_module

struct lysp_module

Printable YANG schema tree structure representing YANG module.

Simple structure corresponding to the YANG format. The schema is only syntactically validated.

Definition at line 1315 of file tree_schema.h.

Data Fields
struct lysp_node_augment * augments

list of augments (linked list)

struct lysp_node * data

list of module's top-level data nodes (linked list)

struct lysp_deviation * deviations

list of deviations (sized array)

struct lysp_ext * extensions

list of extension statements (sized array)

struct lysp_ext_instance * exts

list of the extension instances (sized array)

struct lysp_feature * features

list of feature definitions (sized array)

struct lysp_node_grp * groupings

list of groupings (linked list)

struct lysp_ident * identities

list of identities (sized array)

struct lysp_import * imports

list of imported modules (sized array)

struct lysp_include * includes

list of included submodules (sized array)

uint8_t is_submod: 1

always 0

struct lys_module * mod

covering module structure

struct lysp_node_notif * notifs

list of notifications (linked list)

uint8_t parsing: 1

flag for circular check

struct lysp_revision * revs

list of the module revisions (sized array), the first revision in the list is always the last (newest) revision of the module

struct lysp_node_action * rpcs

list of RPCs (linked list)

struct lysp_tpdf * typedefs

list of typedefs (sized array)

uint8_t version

yang-version (LYS_VERSION values)

◆ lysp_node

struct lysp_node

Generic YANG data node.

Definition at line 960 of file tree_schema.h.

Data Fields
const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

struct lysp_qname * iffeatures

list of if-feature expressions (sized array), must be qname because of refines

const char * name

node name (mandatory)

struct lysp_node * next

next sibling node (NULL if there is no one)

uint16_t nodetype

type of the node (mandatory)

struct lysp_node * parent

parent node (NULL if this is a top-level node)

const char * ref

reference statement

◆ lysp_node_action

struct lysp_node_action

YANG rpc-stmt and action-stmt.

Definition at line 1199 of file tree_schema.h.

Data Fields
union lysp_node_action __unnamed__

common part corresponding to lysp_node

struct lysp_node_grp * groupings

list of groupings (linked list)

struct lysp_node_action_inout input

RPC's/Action's input

struct lysp_node_action_inout output

RPC's/Action's output

struct lysp_tpdf * typedefs

list of typedefs (sized array)

◆ lysp_node_action.__unnamed59__

union lysp_node_action.__unnamed59__

Definition at line 1200 of file tree_schema.h.

Data Fields
__unnamed59__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_action.__unnamed59__.__unnamed61__

struct lysp_node_action.__unnamed59__.__unnamed61__

Definition at line 1202 of file tree_schema.h.

Data Fields
const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

struct lysp_qname * iffeatures

list of if-feature expressions (sized array)

const char * name

grouping name reference (mandatory)

struct lysp_node_action * next

pointer to the next action (NULL if there is no one)

uint16_t nodetype

LYS_RPC or LYS_ACTION

struct lysp_node * parent

parent node (NULL if this is a top-level node)

const char * ref

reference statement

◆ lysp_node_action_inout

struct lysp_node_action_inout

YANG input-stmt and output-stmt.

Definition at line 1173 of file tree_schema.h.

Data Fields
union lysp_node_action_inout __unnamed__

common part corresponding to lysp_node

struct lysp_node * child

list of data nodes (linked list)

struct lysp_node_grp * groupings

list of groupings (linked list)

struct lysp_restr * musts

list of must restrictions (sized array)

struct lysp_tpdf * typedefs

list of typedefs (sized array)

◆ lysp_node_action_inout.__unnamed55__

union lysp_node_action_inout.__unnamed55__

Definition at line 1174 of file tree_schema.h.

Data Fields
__unnamed55__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_action_inout.__unnamed55__.__unnamed57__

struct lysp_node_action_inout.__unnamed55__.__unnamed57__

Definition at line 1176 of file tree_schema.h.

Data Fields
const char * dsc

ALWAYS NULL, compatibility member with lysp_node

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

struct lysp_qname * iffeatures

ALWAYS NULL, compatibility member with lysp_node

const char * name

empty string

struct lysp_node * next

NULL

uint16_t nodetype

LYS_INPUT or LYS_OUTPUT

struct lysp_node * parent

parent node (NULL if this is a top-level node)

const char * ref

ALWAYS NULL, compatibility member with lysp_node

◆ lysp_node_anydata

struct lysp_node_anydata

Definition at line 1127 of file tree_schema.h.

Data Fields
union lysp_node_anydata __unnamed__

common part corresponding to lysp_node

struct lysp_restr * musts

list of must restrictions (sized array)

struct lysp_when * when

when statement

◆ lysp_node_anydata.__unnamed47__

union lysp_node_anydata.__unnamed47__

Definition at line 1128 of file tree_schema.h.

Data Fields
__unnamed47__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_anydata.__unnamed47__.__unnamed49__

struct lysp_node_anydata.__unnamed47__.__unnamed49__

Definition at line 1130 of file tree_schema.h.

Data Fields
const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

struct lysp_qname * iffeatures

list of if-feature expressions (sized array)

const char * name

node name (mandatory)

struct lysp_node * next

pointer to the next sibling node (NULL if there is no one)

uint16_t nodetype

LYS_ANYXML or LYS_ANYDATA

struct lysp_node * parent

parent node (NULL if this is a top-level node)

const char * ref

reference statement

◆ lysp_node_augment

struct lysp_node_augment

YANG uses-augment-stmt and augment-stmt (compatible with struct lysp_node )

Definition at line 1279 of file tree_schema.h.

Data Fields
union lysp_node_augment __unnamed__

common part corresponding to lysp_node

struct lysp_node_action * actions

list of actions (linked list)

struct lysp_node * child

list of data nodes (linked list)

struct lysp_node_notif * notifs

list of notifications (linked list)

struct lysp_when * when

when statement

◆ lysp_node_augment.__unnamed71__

union lysp_node_augment.__unnamed71__

Definition at line 1280 of file tree_schema.h.

Data Fields
__unnamed71__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_augment.__unnamed71__.__unnamed73__

struct lysp_node_augment.__unnamed71__.__unnamed73__

Definition at line 1282 of file tree_schema.h.

Data Fields
const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags - only LYS_STATUS_* values are allowed

struct lysp_qname * iffeatures

list of if-feature expressions (sized array)

struct lysp_node_augment * next

pointer to the next augment (NULL if there is no one)

const char * nodeid

target schema nodeid (mandatory) - absolute for global augments, descendant for uses's augments

uint16_t nodetype

LYS_AUGMENT

struct lysp_node * parent

parent node (NULL if this is a top-level augment)

const char * ref

reference statement

◆ lysp_node_case

struct lysp_node_case

Definition at line 1106 of file tree_schema.h.

Data Fields
union lysp_node_case __unnamed__

common part corresponding to lysp_node

struct lysp_node * child

list of data nodes (linked list)

struct lysp_when * when

when statement

◆ lysp_node_case.__unnamed43__

union lysp_node_case.__unnamed43__

Definition at line 1107 of file tree_schema.h.

Data Fields
__unnamed43__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_case.__unnamed43__.__unnamed45__

struct lysp_node_case.__unnamed43__.__unnamed45__

Definition at line 1109 of file tree_schema.h.

Data Fields
const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

struct lysp_qname * iffeatures

list of if-feature expressions (sized array)

const char * name

node name (mandatory)

struct lysp_node * next

pointer to the next sibling node (NULL if there is no one)

uint16_t nodetype

LYS_CASE

struct lysp_node * parent

parent node (NULL if this is a top-level node)

const char * ref

reference statement

◆ lysp_node_choice

struct lysp_node_choice

Definition at line 1084 of file tree_schema.h.

Data Fields
union lysp_node_choice __unnamed__

common part corresponding to lysp_node

struct lysp_node * child

list of data nodes (linked list)

struct lysp_qname dflt

default case

struct lysp_when * when

when statement

◆ lysp_node_choice.__unnamed39__

union lysp_node_choice.__unnamed39__

Definition at line 1085 of file tree_schema.h.

Data Fields
__unnamed39__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_choice.__unnamed39__.__unnamed41__

struct lysp_node_choice.__unnamed39__.__unnamed41__

Definition at line 1087 of file tree_schema.h.

Data Fields
const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

struct lysp_qname * iffeatures

list of if-feature expressions (sized array)

const char * name

node name (mandatory)

struct lysp_node * next

pointer to the next sibling node (NULL if there is no one)

uint16_t nodetype

LYS_CHOICE

struct lysp_node * parent

parent node (NULL if this is a top-level node)

const char * ref

reference statement

◆ lysp_node_container

struct lysp_node_container

Extension structure of the lysp_node for YANG container.

Definition at line 976 of file tree_schema.h.

Data Fields
union lysp_node_container __unnamed__

common part corresponding to lysp_node

struct lysp_node_action * actions

list of actions (linked list)

struct lysp_node * child

list of data nodes (linked list)

struct lysp_node_grp * groupings

list of groupings (linked list)

struct lysp_restr * musts

list of must restrictions (sized array)

struct lysp_node_notif * notifs

list of notifications (linked list)

const char * presence

presence description

struct lysp_tpdf * typedefs

list of typedefs (sized array)

struct lysp_when * when

when statement

◆ lysp_node_container.__unnamed23__

union lysp_node_container.__unnamed23__

Definition at line 977 of file tree_schema.h.

Data Fields
__unnamed23__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_container.__unnamed23__.__unnamed25__

struct lysp_node_container.__unnamed23__.__unnamed25__

Definition at line 979 of file tree_schema.h.

Data Fields
const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

struct lysp_qname * iffeatures

list of if-feature expressions (sized array)

const char * name

node name (mandatory)

struct lysp_node * next

pointer to the next sibling node (NULL if there is no one)

uint16_t nodetype

LYS_CONTAINER

struct lysp_node * parent

parent node (NULL if this is a top-level node)

const char * ref

reference statement

◆ lysp_node_grp

struct lysp_node_grp

YANG grouping-stmt.

Definition at line 1252 of file tree_schema.h.

Data Fields
union lysp_node_grp __unnamed__

common part corresponding to lysp_node

struct lysp_node_action * actions

list of actions (linked list)

struct lysp_node * child

list of data nodes (linked list)

struct lysp_node_grp * groupings

list of groupings (linked list)

struct lysp_node_notif * notifs

list of notifications (linked list)

struct lysp_tpdf * typedefs

list of typedefs (sized array)

◆ lysp_node_grp.__unnamed67__

union lysp_node_grp.__unnamed67__

Definition at line 1253 of file tree_schema.h.

Data Fields
__unnamed67__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_grp.__unnamed67__.__unnamed69__

struct lysp_node_grp.__unnamed67__.__unnamed69__

Definition at line 1255 of file tree_schema.h.

Data Fields
const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags - only LYS_STATUS_* values are allowed

struct lysp_qname * iffeatures

ALWAYS NULL, compatibility member with lysp_node

const char * name

grouping name (mandatory)

struct lysp_node_grp * next

pointer to the next grouping (NULL if there is no one)

uint16_t nodetype

LYS_GROUPING

struct lysp_node * parent

parent node (NULL if this is a top-level grouping)

const char * ref

reference statement

◆ lysp_node_leaf

struct lysp_node_leaf

Definition at line 1003 of file tree_schema.h.

Data Fields
union lysp_node_leaf __unnamed__

common part corresponding to lysp_node

struct lysp_qname dflt

default value, it may or may not be a qualified name

struct lysp_restr * musts

list of must restrictions (sized array)

struct lysp_type type

type of the leaf node (mandatory)

const char * units

units of the leaf's type

struct lysp_when * when

when statement

◆ lysp_node_leaf.__unnamed27__

union lysp_node_leaf.__unnamed27__

Definition at line 1004 of file tree_schema.h.

Data Fields
__unnamed27__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_leaf.__unnamed27__.__unnamed29__

struct lysp_node_leaf.__unnamed27__.__unnamed29__

Definition at line 1006 of file tree_schema.h.

Data Fields
const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

struct lysp_qname * iffeatures

list of if-feature expressions (sized array)

const char * name

node name (mandatory)

struct lysp_node * next

pointer to the next sibling node (NULL if there is no one)

uint16_t nodetype

LYS_LEAF

struct lysp_node * parent

parent node (NULL if this is a top-level node)

const char * ref

reference statement

◆ lysp_node_leaflist

struct lysp_node_leaflist

Definition at line 1027 of file tree_schema.h.

Data Fields
union lysp_node_leaflist __unnamed__

common part corresponding to lysp_node

struct lysp_qname * dflts

list of default values (sized array), they may or may not be qualified names

uint32_t max

max-elements constraint, 0 means unbounded

uint32_t min

min-elements constraint

struct lysp_restr * musts

list of must restrictions (sized array)

struct lysp_type type

type of the leaf node (mandatory)

const char * units

units of the leaf's type

struct lysp_when * when

when statement

◆ lysp_node_leaflist.__unnamed31__

union lysp_node_leaflist.__unnamed31__

Definition at line 1028 of file tree_schema.h.

Data Fields
__unnamed31__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_leaflist.__unnamed31__.__unnamed33__

struct lysp_node_leaflist.__unnamed31__.__unnamed33__

Definition at line 1030 of file tree_schema.h.

Data Fields
const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

struct lysp_qname * iffeatures

list of if-feature expressions (sized array)

const char * name

node name (mandatory)

struct lysp_node * next

pointer to the next sibling node (NULL if there is no one)

uint16_t nodetype

LYS_LEAFLIST

struct lysp_node * parent

parent node (NULL if this is a top-level node)

const char * ref

reference statement

◆ lysp_node_list

struct lysp_node_list

Definition at line 1054 of file tree_schema.h.

Data Fields
union lysp_node_list __unnamed__

common part corresponding to lysp_node

struct lysp_node_action * actions

list of actions (linked list)

struct lysp_node * child

list of data nodes (linked list)

struct lysp_node_grp * groupings

list of groupings (linked list)

const char * key

keys specification

uint32_t max

max-elements constraint, 0 means unbounded

uint32_t min

min-elements constraint

struct lysp_restr * musts

list of must restrictions (sized array)

struct lysp_node_notif * notifs

list of notifications (linked list)

struct lysp_tpdf * typedefs

list of typedefs (sized array)

struct lysp_qname * uniques

list of unique specifications (sized array)

struct lysp_when * when

when statement

◆ lysp_node_list.__unnamed35__

union lysp_node_list.__unnamed35__

Definition at line 1055 of file tree_schema.h.

Data Fields
__unnamed35__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_list.__unnamed35__.__unnamed37__

struct lysp_node_list.__unnamed35__.__unnamed37__

Definition at line 1057 of file tree_schema.h.

Data Fields
const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

struct lysp_qname * iffeatures

list of if-feature expressions (sized array)

const char * name

node name (mandatory)

struct lysp_node * next

pointer to the next sibling node (NULL if there is no one)

uint16_t nodetype

LYS_LIST

struct lysp_node * parent

parent node (NULL if this is a top-level node)

const char * ref

reference statement

◆ lysp_node_notif

struct lysp_node_notif

YANG notification-stmt.

Definition at line 1226 of file tree_schema.h.

Data Fields
union lysp_node_notif __unnamed__

common part corresponding to lysp_node

struct lysp_node * child

list of data nodes (linked list)

struct lysp_node_grp * groupings

list of groupings (linked list)

struct lysp_restr * musts

list of must restrictions (sized array)

struct lysp_tpdf * typedefs

list of typedefs (sized array)

◆ lysp_node_notif.__unnamed63__

union lysp_node_notif.__unnamed63__

Definition at line 1227 of file tree_schema.h.

Data Fields
__unnamed63__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_notif.__unnamed63__.__unnamed65__

struct lysp_node_notif.__unnamed63__.__unnamed65__

Definition at line 1229 of file tree_schema.h.

Data Fields
const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags - only LYS_STATUS_* values are allowed

struct lysp_qname * iffeatures

list of if-feature expressions (sized array)

const char * name

grouping name reference (mandatory)

struct lysp_node_notif * next

pointer to the next notification (NULL if there is no one)

uint16_t nodetype

LYS_NOTIF

struct lysp_node * parent

parent node (NULL if this is a top-level node)

const char * ref

reference statement

◆ lysp_node_uses

struct lysp_node_uses

Definition at line 1148 of file tree_schema.h.

Data Fields
union lysp_node_uses __unnamed__

common part corresponding to lysp_node

struct lysp_node_augment * augments

list of augments (linked list)

struct lysp_refine * refines

list of uses's refines (sized array)

struct lysp_when * when

when statement

◆ lysp_node_uses.__unnamed51__

union lysp_node_uses.__unnamed51__

Definition at line 1149 of file tree_schema.h.

Data Fields
__unnamed51__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_uses.__unnamed51__.__unnamed53__

struct lysp_node_uses.__unnamed51__.__unnamed53__

Definition at line 1151 of file tree_schema.h.

Data Fields
const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

struct lysp_qname * iffeatures

list of if-feature expressions (sized array)

const char * name

grouping name reference (mandatory)

struct lysp_node * next

pointer to the next sibling node (NULL if there is no one)

uint16_t nodetype

LYS_USES

struct lysp_node * parent

parent node (NULL if this is a top-level node)

const char * ref

reference statement

◆ lysp_qname

struct lysp_qname

Qualified name (optional prefix followed by an identifier).

Definition at line 569 of file tree_schema.h.

Data Fields
const struct lysp_module * mod

module to resolve any prefixes found in the string, it must be stored explicitly because of deviations/refines

const char * str

qualified name string

◆ lysp_refine

struct lysp_refine

YANG refine-stmt.

Definition at line 680 of file tree_schema.h.

Data Fields
struct lysp_qname * dflts

list of default values (sized array)

const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

struct lysp_qname * iffeatures

list of if-feature expressions (sized array)

uint32_t max

max-elements constraint, 0 means unbounded

uint32_t min

min-elements constraint

struct lysp_restr * musts

list of must restrictions (sized array)

const char * nodeid

target descendant schema nodeid (mandatory)

const char * presence

presence description

const char * ref

reference statement

◆ lysp_restr

struct lysp_restr

Covers restrictions: range, length, pattern, must.

Definition at line 591 of file tree_schema.h.

Data Fields
struct lysp_qname arg

The restriction expression/value (mandatory); in case of pattern restriction, the first byte has a special meaning: 0x06 (ACK) for regular match and 0x15 (NACK) for invert-match

const char * dsc

description

const char * eapptag

error-app-tag value

const char * emsg

error-message

struct lysp_ext_instance * exts

list of the extension instances (sized array)

const char * ref

reference

◆ lysp_revision

struct lysp_revision

YANG revision-stmt.

Definition at line 607 of file tree_schema.h.

Data Fields
char date[11]

revision date (madatory)

const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

const char * ref

reference statement

◆ lysp_stmt

struct lysp_stmt

Helper structure for generic storage of the extension instances content.

Definition at line 506 of file tree_schema.h.

Data Fields
const char * arg

statement's argument

struct lysp_stmt * child

list of the statement's substatements (linked list)

uint16_t flags

statement flags, can be set to LYS_YIN_ATTR

LY_VALUE_FORMAT format

prefix format of the identifier/argument (LY_VALUE_XML is YIN format)

enum ly_stmt kw

numeric respresentation of the stmt value

struct lysp_stmt * next

link to the next statement

void * prefix_data

Format-specific data for prefix resolution (see ly_resolve_prefix())

const char * stmt

identifier of the statement

◆ lysp_submodule

struct lysp_submodule

Definition at line 1339 of file tree_schema.h.

Data Fields
struct lysp_node_augment * augments

list of augments (linked list)

const char * contact

contact information for the module

struct lysp_node * data

list of module's top-level data nodes (linked list)

struct lysp_deviation * deviations

list of deviations (sized array)

const char * dsc

description of the module

struct lysp_ext * extensions

list of extension statements (sized array)

struct lysp_ext_instance * exts

list of the extension instances (sized array)

struct lysp_feature * features

list of feature definitions (sized array)

const char * filepath

path, if the schema was read from a file, NULL in case of reading from memory

struct lysp_node_grp * groupings

list of groupings (linked list)

struct lysp_ident * identities

list of identities (sized array)

struct lysp_import * imports

list of imported modules (sized array)

struct lysp_include * includes

list of included submodules (sized array)

uint8_t is_submod: 1

always 1

uint8_t latest_revision: 2

flag to mark the latest available revision: 1 - the latest revision in searchdirs was not searched yet and this is the latest revision in the current context 2 - searchdirs were searched and this is the latest available revision

struct lys_module * mod

belongs to parent module (submodule - mandatory)

const char * name

name of the module (mandatory)

struct lysp_node_notif * notifs

list of notifications (linked list)

const char * org

party/company responsible for the module

uint8_t parsing: 1

flag for circular check

const char * prefix

submodule belongsto prefix of main module (mandatory)

const char * ref

cross-reference for the module

struct lysp_revision * revs

list of the module revisions (sized array), the first revision in the list is always the last (newest) revision of the module

struct lysp_node_action * rpcs

list of RPCs (linked list)

struct lysp_tpdf * typedefs

list of typedefs (sized array)

uint8_t version

yang-version (LYS_VERSION values)

◆ lysp_tpdf

struct lysp_tpdf

YANG typedef-stmt.

Definition at line 656 of file tree_schema.h.

Data Fields
struct lysp_qname dflt

default value of the newly defined type, it may or may not be a qualified name

const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

const char * name

name of the newly defined type (mandatory)

const char * ref

reference statement

struct lysp_type type

base type from which the typedef is derived (mandatory)

const char * units

units of the newly defined type

◆ lysp_type

struct lysp_type

YANG type-stmt.

Some of the items in the structure may be mandatory, but it is necessary to resolve the type's base type first

Definition at line 633 of file tree_schema.h.

Data Fields
const char ** bases

list of base identifiers (sized array) - identityref

struct lysp_type_enum * bits

list of bit-stmts (sized array) - bits

struct lysc_type * compiled

pointer to the compiled type

struct lysp_type_enum * enums

list of enum-stmts (sized array) - enum

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags

uint8_t fraction_digits

number of fraction digits - decimal64

struct lysp_restr * length

allowed length of the value - string, binary

const char * name

name of the type (mandatory)

struct lyxp_expr * path

parsed path - leafref

struct lysp_restr * patterns

list of patterns (sized array) - string

const struct lysp_module * pmod

(sub)module where the type is defined (needed for deviations)

struct lysp_restr * range

allowed values range - numerical, decimal64

uint8_t require_instance

require-instance flag - leafref, instance

struct lysp_type * types

list of sub-types (sized array) - union

◆ lysp_type_enum

struct lysp_type_enum

Enumeration/Bit value definition.

Definition at line 617 of file tree_schema.h.

Data Fields
const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

schema node flags - only LYS_STATUS_ and LYS_SET_VALUE values are allowed

struct lysp_qname * iffeatures

list of if-feature expressions (sized array)

const char * name

name (mandatory)

const char * ref

reference statement

int64_t value

enum's value or bit's position

◆ lysp_when

struct lysp_when

YANG when-stmt.

Definition at line 670 of file tree_schema.h.

Data Fields
const char * cond

specified condition (mandatory)

const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

const char * ref

reference statement

Macro Definition Documentation

◆ _LYSC_TREE_DFS_NEXT

#define _LYSC_TREE_DFS_NEXT (   START,
  ELEM,
  NEXT 
)
Value:
if ((ELEM) == (struct lysc_node *)(START)) { \
/* we are done, no next element to process */ \
break; \
} \
(NEXT) = (ELEM)->next;
Compiled YANG data node.
Definition: tree_schema.h:1644

Helper macro for LYSC_TREE_DFS_END, should not be used directly!

Definition at line 220 of file tree_schema.h.

◆ LY_REV_SIZE

#define LY_REV_SIZE   11

revision data string length (including terminating NULL byte)

Definition at line 229 of file tree_schema.h.

◆ LY_STMT_IS_DATA_NODE

#define LY_STMT_IS_DATA_NODE (   STMT)    (((STMT) >= LY_STMT_ANYDATA) && ((STMT) <= LY_STMT_LIST))

Generic test for schema data nodes.

This macro matches a subset of schema nodes that maps to common lysc_node or lysp_node structures. To match all such nodes, use LY_STMT_IS_NODE()

This macro matches anydata, anyxml, augment, case, choice, container, grouping, leaf, leaf-list, list and uses. Note that the list of statements that can appear in parsed or compiled schema trees differs (e.g. no uses in compiled tree).

Definition at line 278 of file tree_schema.h.

◆ LY_STMT_IS_NODE

#define LY_STMT_IS_NODE (   STMT)    (((STMT) >= LY_STMT_NOTIFICATION) && ((STMT) <= LY_STMT_LIST))

Generic test for any schema node that maps to common lysc_node or lysp_node structures.

Note that the list of statements that can appear in parsed or compiled schema trees differs (e.g. no uses in compiled tree).

To check for some of the subsets of this test, try LY_STMT_IS_DATA_NODE() or LY_STMT_IS_OP().

This macro matches action, anydata, anyxml, augment, case, choice, container, grouping, input, leaf, leaf-list, list, notification, output, RPC and uses.

Definition at line 290 of file tree_schema.h.

◆ LY_STMT_IS_OP

#define LY_STMT_IS_OP (   STMT)    (((STMT) == LY_STMT_ACTION) || ((STMT) == LY_STMT_RPC))

Generic test for operation statements.

This macro matches a subset of schema nodes that maps to common lysc_node or lysp_node structures. To match all such nodes, use LY_STMT_IS_NODE()

This macro matches action and RPC.

Definition at line 267 of file tree_schema.h.

◆ LYS_NODE_HASH_COUNT

#define LYS_NODE_HASH_COUNT   4

Maximum number of hashes stored in a schema node.

Definition at line 1639 of file tree_schema.h.

◆ LYS_YIN

#define LYS_YIN   0x1

used to specify input format of extension instance

Definition at line 518 of file tree_schema.h.

◆ lysc_is_dup_inst_list

#define lysc_is_dup_inst_list (   lysc_node)
Value:
#define LYS_LEAFLIST
Definition: tree_schema.h:240
#define LYS_LIST
Definition: tree_schema.h:241
uint16_t nodetype
Definition: tree_schema.h:1645
uint16_t flags
Definition: tree_schema.h:1646
#define LYS_CONFIG_W
Definition: tree_schema.h:882
#define LYS_KEYLESS
Definition: tree_schema.h:903

Examine whether a node is a key-less list or a non-configuration leaf-list.

Parameters
[in]lysc_nodeSchema node to examine.
Returns
Boolean value whether the node is a list with duplicate instances allowed.

Definition at line 2001 of file tree_schema.h.

◆ lysc_is_key

#define lysc_is_key (   lysc_node)     ((!lysc_node || (lysc_node->nodetype != LYS_LEAF) || !(lysc_node->flags & LYS_KEY)) ? 0 : 1)

Examine whether a node is a list's key.

Parameters
[in]lysc_nodeSchema node to examine.
Returns
Boolean value whether the node is a key or not.

Definition at line 1983 of file tree_schema.h.

◆ lysc_is_np_cont

#define lysc_is_np_cont (   lysc_node)     ((!lysc_node || (lysc_node->nodetype != LYS_CONTAINER) || (lysc_node->flags & LYS_PRESENCE)) ? 0 : 1)

Examine whether a node is a non-presence container.

Parameters
[in]lysc_nodeSchema node to examine.
Returns
Boolean value whether the node is a NP container or not.

Definition at line 1992 of file tree_schema.h.

◆ lysc_is_userordered

#define lysc_is_userordered (   lysc_node)     ((!lysc_node || !(lysc_node->nodetype & (LYS_LEAFLIST | LYS_LIST)) || !(lysc_node->flags & LYS_ORDBY_USER)) ? 0 : 1)

Examine whether a node is user-ordered list or leaf-list.

Parameters
[in]lysc_nodeSchema node to examine.
Returns
Boolean value whether the node is user-ordered or not.

Definition at line 1974 of file tree_schema.h.

◆ LYSC_TREE_DFS_BEGIN

#define LYSC_TREE_DFS_BEGIN (   START,
  ELEM 
)
Value:
{ ly_bool LYSC_TREE_DFS_continue = 0; struct lysc_node *LYSC_TREE_DFS_next; \
for ((ELEM) = (LYSC_TREE_DFS_next) = (struct lysc_node *)(START); \
(ELEM); \
(ELEM) = (LYSC_TREE_DFS_next), LYSC_TREE_DFS_continue = 0)
uint8_t ly_bool
Type to indicate boolean value.
Definition: log.h:25

Macro to iterate via all elements in a schema (sub)tree including input and output. Note that actions and notifications of traversed nodes are ignored! To traverse on all the nodes including those, use lysc_tree_dfs_full() instead.

This is the opening part to the LYSC_TREE_DFS_END - they always have to be used together.

The function follows deep-first search algorithm:

    1
   / \
  2   4
 /   / \
3   5   6

Use the same parameters for LYSC_TREE_DFS_BEGIN and LYSC_TREE_DFS_END. While START can be any of the lysc_node* types (including lysc_node_action and lysc_node_notif), ELEM variable must be of the struct lysc_node* type.

To skip a particular subtree, instead of the continue statement, set LYSC_TREE_DFS_continue variable to non-zero value.

Use with opening curly bracket '{' after the macro.

Parameters
STARTPointer to the starting element processed first.
ELEMIterator intended for use in the block.

Definition at line 181 of file tree_schema.h.

◆ LYSC_TREE_DFS_END

#define LYSC_TREE_DFS_END (   START,
  ELEM 
)
Value:
/* select element for the next run - children first */ \
if (LYSC_TREE_DFS_continue) { \
(LYSC_TREE_DFS_next) = NULL; \
} else { \
(LYSC_TREE_DFS_next) = (struct lysc_node *)lysc_node_child(ELEM); \
} \
if (!(LYSC_TREE_DFS_next)) { \
/* no children, try siblings */ \
_LYSC_TREE_DFS_NEXT(START, ELEM, LYSC_TREE_DFS_next); \
} \
while (!(LYSC_TREE_DFS_next)) { \
/* parent is already processed, go to its sibling */ \
(ELEM) = (ELEM)->parent; \
_LYSC_TREE_DFS_NEXT(START, ELEM, LYSC_TREE_DFS_next); \
} }
const struct lysc_node * lysc_node_child(const struct lysc_node *node)
Get the children linked list of the given (compiled) schema node.

Macro to iterate via all elements in a (sub)tree. This is the closing part to the LYSC_TREE_DFS_BEGIN - they always have to be used together.

Use the same parameters for LYSC_TREE_DFS_BEGIN and LYSC_TREE_DFS_END. While START can be a pointer to any of the lysc_node* types (including lysc_node_action and lysc_node_notif), ELEM variable must be pointer to the lysc_node type.

Use with closing curly bracket '}' after the macro.

Parameters
STARTPointer to the starting element processed first.
ELEMIterator intended for use in the block.

Definition at line 200 of file tree_schema.h.

◆ LYSP_MODULE_NAME

#define LYSP_MODULE_NAME (   PMOD)    (PMOD->is_submod ? ((struct lysp_submodule *)PMOD)->name : ((struct lysp_module *)PMOD)->mod->name)

Get the parsed module or submodule name.

Parameters
[in]PMODParsed module or submodule.
Returns
Module or submodule name.

Definition at line 1381 of file tree_schema.h.

Typedef Documentation

◆ LYS_VERSION

typedef enum LYS_VERSION LYS_VERSION

supported YANG schema version values

◆ lysc_dfs_clb

typedef LY_ERR(* lysc_dfs_clb) (struct lysc_node *node, void *data, ly_bool *dfs_continue)

Callback to be called for every schema node in a DFS traversal.

Parameters
[in]nodeCurrent node.
[in]dataArbitrary user data.
[out]dfs_continueSet to true if the current subtree should be skipped and continue with siblings instead.
Returns
LY_SUCCESS on success,
LY_ERR value to terminate DFS and return this value.

Definition at line 2112 of file tree_schema.h.

Enumeration Type Documentation

◆ ly_stmt

enum ly_stmt

List of YANG statements.

Enumerator
LY_STMT_NONE 
LY_STMT_NOTIFICATION 

in lysc_ext_substmt.storage stored as a pointer to linked list of struct lysc_node_notif *. The RPCs/Actions and Notifications are expected in a separated lists than the rest of data definition nodes as it is done in generic structures of libyang.

LY_STMT_INPUT 
LY_STMT_OUTPUT 
LY_STMT_ACTION 

in lysc_ext_substmt.storage stored as a pointer to linked list of struct lysc_node_action *. The RPCs/Actions and Notifications are expected in a separated lists than the rest of data definition nodes as it is done in generic structures of libyang.

LY_STMT_RPC 

in lysc_ext_substmt.storage stored as a pointer to linked list of struct lysc_node_action *. The RPCs/Actions and Notifications are expected in a separated lists than the rest of data definition nodes as it is done in generic structures of libyang.

LY_STMT_ANYDATA 

in lysc_ext_substmt.storage stored as a pointer to linked list of struct lysc_node *. Note that due to lysc_node compatibility the anydata is expected to be actually mixed in the linked list with other lysc_node based nodes. The RPCs/Actions and Notifications are expected in a separated lists as it is done in generic structures of libyang.

LY_STMT_ANYXML 

in lysc_ext_substmt.storage stored as a pointer to linked list of struct lysc_node *. Note that due to lysc_node compatibility the anyxml is expected to be actually mixed in the linked list with other lysc_node based nodes. The RPCs/Actions and Notifications are expected in a separated lists as it is done in generic structures of libyang.

LY_STMT_AUGMENT 
LY_STMT_CASE 

TODO is it possible to compile cases without the parent choice?

LY_STMT_CHOICE 

in lysc_ext_substmt.storage stored as a pointer to linked list of struct lysc_node *. Note that due to lysc_node compatibility the choice is expected to be actually mixed in the linked list with other lysc_node based nodes. The RPCs/Actions and Notifications are expected in a separated lists as it is done in generic structures of libyang.

LY_STMT_CONTAINER 

in lysc_ext_substmt.storage stored as a pointer to linked list of struct lysc_node *. Note that due to lysc_node compatibility the container is expected to be actually mixed in the linked list with other lysc_node based nodes. The RPCs/Actions and Notifications are expected in a separated lists as it is done in generic structures of libyang.

LY_STMT_GROUPING 
LY_STMT_LEAF 

in lysc_ext_substmt.storage stored as a pointer to linked list of struct lysc_node *. Note that due to lysc_node compatibility the leaf is expected to be actually mixed in the linked list with other lysc_node based nodes. The RPCs/Actions and Notifications are expected in a separated lists as it is done in generic structures of libyang.

LY_STMT_LEAF_LIST 

in lysc_ext_substmt.storage stored as a pointer to linked list of struct lysc_node *. Note that due to lysc_node compatibility the leaf-list is expected to be actually mixed in the linked list with other lysc_node based nodes. The RPCs/Actions and Notifications are expected in a separated lists as it is done in generic structures of libyang.

LY_STMT_LIST 

in lysc_ext_substmt.storage stored as a pointer to linked list of struct lysc_node *. Note that due to lysc_node compatibility the list is expected to be actually mixed in the linked list with other lysc_node based nodes. The RPCs/Actions and Notifications are expected in a separated lists as it is done in generic structures of libyang.

LY_STMT_USES 
LY_STMT_ARGUMENT 
LY_STMT_BASE 
LY_STMT_BELONGS_TO 
LY_STMT_BIT 
LY_STMT_CONFIG 

in lysc_ext_substmt.storage stored as a pointer to uint16_t, only cardinality < LY_STMT_CARD_SOME is allowed

LY_STMT_CONTACT 
LY_STMT_DEFAULT 
LY_STMT_DESCRIPTION 

in lysc_ext_substmt.storage stored as a pointer to const char * (cardinality < LY_STMT_CARD_SOME) or as a pointer to a sized array const char **

LY_STMT_DEVIATE 
LY_STMT_DEVIATION 
LY_STMT_ENUM 
LY_STMT_ERROR_APP_TAG 
LY_STMT_ERROR_MESSAGE 
LY_STMT_EXTENSION 
LY_STMT_EXTENSION_INSTANCE 
LY_STMT_FEATURE 
LY_STMT_FRACTION_DIGITS 
LY_STMT_IDENTITY 
LY_STMT_IF_FEATURE 

if-feature statements are not compiled, they are evaluated and the parent statement is preserved only in case the evaluation of all the if-feature statements is true. Therefore there is no storage expected.

LY_STMT_IMPORT 
LY_STMT_INCLUDE 
LY_STMT_KEY 
LY_STMT_LENGTH 
LY_STMT_MANDATORY 

in lysc_ext_substmt.storage stored as a pointer to uint16_t, only cardinality < LY_STMT_CARD_SOME is allowed

LY_STMT_MAX_ELEMENTS 
LY_STMT_MIN_ELEMENTS 
LY_STMT_MODIFIER 
LY_STMT_MODULE 
LY_STMT_MUST 
LY_STMT_NAMESPACE 
LY_STMT_ORDERED_BY 
LY_STMT_ORGANIZATION 
LY_STMT_PATH 
LY_STMT_PATTERN 
LY_STMT_POSITION 
LY_STMT_PREFIX 
LY_STMT_PRESENCE 
LY_STMT_RANGE 
LY_STMT_REFERENCE 

in lysc_ext_substmt.storage stored as a pointer to const char * (cardinality < LY_STMT_CARD_SOME) or as a pointer to a sized array const char **

LY_STMT_REFINE 
LY_STMT_REQUIRE_INSTANCE 
LY_STMT_REVISION 
LY_STMT_REVISION_DATE 
LY_STMT_STATUS 

in lysc_ext_substmt.storage stored as a pointer to uint16_t, only cardinality < LY_STMT_CARD_SOME is allowed

LY_STMT_SUBMODULE 
LY_STMT_TYPE 

in lysc_ext_substmt.storage stored as a pointer to struct lysc_type * (cardinality < LY_STMT_CARD_SOME) or as a pointer to a sized array struct lysc_type **

LY_STMT_TYPEDEF 
LY_STMT_UNIQUE 
LY_STMT_UNITS 

in lysc_ext_substmt.storage stored as a pointer to const char * (cardinality < LY_STMT_CARD_SOME) or as a pointer to a sized array const char **

LY_STMT_VALUE 
LY_STMT_WHEN 
LY_STMT_YANG_VERSION 
LY_STMT_YIN_ELEMENT 
LY_STMT_SYNTAX_SEMICOLON 
LY_STMT_SYNTAX_LEFT_BRACE 
LY_STMT_SYNTAX_RIGHT_BRACE 
LY_STMT_ARG_TEXT 
LY_STMT_ARG_VALUE 

Definition at line 295 of file tree_schema.h.

◆ ly_stmt_cardinality

Possible cardinalities of the YANG statements.

Used in extensions plugins to define cardinalities of the extension instance substatements.

Enumerator
LY_STMT_CARD_OPT 
LY_STMT_CARD_MAND 
LY_STMT_CARD_SOME 
LY_STMT_CARD_ANY 

Definition at line 448 of file tree_schema.h.

◆ LYS_INFORMAT

Schema input formats accepted by libyang parser functions.

Enumerator
LYS_IN_UNKNOWN 

unknown format, used as return value in case of error

LYS_IN_YANG 

YANG schema input format

LYS_IN_YIN 

YIN schema input format

Definition at line 89 of file parser_schema.h.

◆ LYS_OUTFORMAT

Schema output formats accepted by libyang printer functions.

Enumerator
LYS_OUT_UNKNOWN 

unknown format, used as return value in case of error

LYS_OUT_YANG 

YANG schema output format

LYS_OUT_YANG_COMPILED 

YANG schema output format of the compiled schema tree

LYS_OUT_YIN 

YIN schema output format

LYS_OUT_TREE 

Tree schema output format

Definition at line 108 of file printer_schema.h.

◆ LYS_VERSION

supported YANG schema version values

Enumerator
LYS_VERSION_UNDEF 

no specific version, YANG 1.0 as default

LYS_VERSION_1_0 

YANG 1 (1.0)

LYS_VERSION_1_1 

YANG 1.1

Definition at line 1304 of file tree_schema.h.

◆ LYSC_PATH_TYPE

Types of the different schema paths.

Enumerator
LYSC_PATH_LOG 

Descriptive path format used in log messages

LYSC_PATH_DATA 

Similar to LYSC_PATH_LOG except that schema-only nodes (choice, case) are skipped

Definition at line 2274 of file tree_schema.h.

Function Documentation

◆ ly_stmt2str()

const char* ly_stmt2str ( enum ly_stmt  stmt)

Stringify statement identifier.

Parameters
[in]stmtThe statement identifier to stringify.
Returns
Constant string representation of the given stmt.

◆ lys_feature_value()

LY_ERR lys_feature_value ( const struct lys_module module,
const char *  feature 
)

Get the current real status of the specified feature in the module.

If the feature is enabled, but some of its if-features are false, the feature is considered disabled.

Parameters
[in]moduleModule where the feature is defined.
[in]featureName of the feature to inspect.
Returns
LY_SUCCESS if the feature is enabled,
LY_ENOT if the feature is disabled,
LY_ENOTFOUND if the feature was not found.

◆ lys_find_child()

const struct lysc_node* lys_find_child ( const struct lysc_node parent,
const struct lys_module module,
const char *  name,
size_t  name_len,
uint16_t  nodetype,
uint32_t  options 
)

Get child node according to the specified criteria.

Parameters
[in]parentOptional parent of the node to find. If not specified, the module's top-level nodes are searched.
[in]modulemodule of the node to find. It is also limitation for the children node of the given parent.
[in]nameName of the node to find.
[in]name_lenOptional length of the name in case it is not NULL-terminated string.
[in]nodetypeOptional criteria (to speedup) specifying nodetype(s) of the node to find. Used as a bitmask, so multiple nodetypes can be specified.
[in]optionsORed options.
Returns
Found node if any.

◆ lys_find_expr_atoms()

LY_ERR lys_find_expr_atoms ( const struct lysc_node ctx_node,
const struct lys_module cur_mod,
const struct lyxp_expr *  expr,
const struct lysc_prefix prefixes,
uint32_t  options,
struct ly_set **  set 
)

Get all the schema nodes that are required for expr to be evaluated (atoms).

Parameters
[in]ctx_nodeXPath schema context node. Use NULL for the root node.
[in]cur_modCurrent module for the expression (where it was "instantiated").
[in]exprParsed expression to use.
[in]prefixesSized array of compiled prefixes.
[in]optionsWhether to apply some node access restrictions, see Atomize XPath options.
[out]setSet of found atoms (schema nodes).
Returns
LY_SUCCESS on success, set is returned.
LY_ERR value on error.

◆ lys_find_lypath_atoms()

LY_ERR lys_find_lypath_atoms ( const struct ly_path *  path,
struct ly_set **  set 
)

Get all the schema nodes that are required for path to be evaluated (atoms).

Parameters
[in]pathCompiled path to use.
[out]setSet of found atoms (schema nodes).
Returns
LY_SUCCESS on success, set is returned.
LY_ERR value on error.

◆ lys_find_path()

const struct lysc_node* lys_find_path ( const struct ly_ctx ctx,
const struct lysc_node ctx_node,
const char *  path,
ly_bool  output 
)

Get a schema node based on the given data path (JSON format, see XPath Addressing).

Parameters
[in]ctxlibyang context to use for absolute path. May be NULL if ctx_node is set.
[in]ctx_nodeXPath schema context node for relative path. Use NULL for the root node.
[in]pathJSON path of the node to get.
[in]outputSearch operation output instead of input.
Returns
Found schema node or NULL.

◆ lys_find_path_atoms()

LY_ERR lys_find_path_atoms ( const struct ly_ctx ctx,
const struct lysc_node ctx_node,
const char *  path,
ly_bool  output,
struct ly_set **  set 
)

Get all the schema nodes that are required for path to be evaluated (atoms).

Parameters
[in]ctxlibyang context to use for absolute path. May be NULL if ctx_node is set.
[in]ctx_nodeXPath schema context node for relative path. Use NULL for the root node.
[in]pathJSON path to examine.
[in]outputSearch operation output instead of input.
[out]setSet of found atoms (schema nodes).
Returns
LY_ERR value on error.

◆ lys_find_xpath()

LY_ERR lys_find_xpath ( const struct ly_ctx ctx,
const struct lysc_node ctx_node,
const char *  xpath,
uint32_t  options,
struct ly_set **  set 
)

Evaluate an xpath expression on schema nodes.

Parameters
[in]ctxlibyang context to use for absolute xpath. May be NULL if ctx_node is set.
[in]ctx_nodeXPath schema context node for relative xpath. Use NULL for the root node.
[in]xpathData XPath expression filtering the matching nodes. LY_VALUE_JSON prefix format is expected.
[in]optionsWhether to apply some node access restrictions, see Atomize XPath options.
[out]setSet of found schema nodes.
Returns
LY_SUCCESS on success, set is returned.
LY_ERR value if an error occurred.

◆ lys_find_xpath_atoms()

LY_ERR lys_find_xpath_atoms ( const struct ly_ctx ctx,
const struct lysc_node ctx_node,
const char *  xpath,
uint32_t  options,
struct ly_set **  set 
)

Get all the schema nodes that are required for xpath to be evaluated (atoms).

Parameters
[in]ctxlibyang context to use. May be NULL if ctx_node is set.
[in]ctx_nodeXPath schema context node. Use NULL for the root node.
[in]xpathData XPath expression filtering the matching nodes. LY_VALUE_JSON prefix format is expected.
[in]optionsWhether to apply some node access restrictions, see Atomize XPath options.
[out]setSet of found atoms (schema nodes).
Returns
LY_SUCCESS on success, set is returned.
LY_ERR value on error.

◆ lys_getnext()

const struct lysc_node* lys_getnext ( const struct lysc_node last,
const struct lysc_node parent,
const struct lysc_module module,
uint32_t  options 
)

Get next schema tree (sibling) node element that can be instantiated in a data tree. Returned node can be from an augment.

lys_getnext() is supposed to be called sequentially. In the first call, the last parameter is usually NULL and function starts returning i) the first parent's child or ii) the first top level element of the module. Consequent calls suppose to provide the previously returned node as the last parameter and still the same parent and module parameters.

Without options, the function is used to traverse only the schema nodes that can be paired with corresponding data nodes in a data tree. By setting some options the behavior can be modified to the extent that all the schema nodes are iteratively returned.

Parameters
[in]lastPreviously returned schema tree node, or NULL in case of the first call.
[in]parentParent of the subtree where the function starts processing.
[in]moduleIn case of iterating on top level elements, the parent is NULL and module must be specified.
[in]optionsORed options.
Returns
Next schema tree node that can be instantiated in a data tree, NULL in case there is no such element.

◆ lys_getnext_ext()

const struct lysc_node* lys_getnext_ext ( const struct lysc_node last,
const struct lysc_node parent,
const struct lysc_ext_instance ext,
uint32_t  options 
)

Get next schema tree (sibling) node element that can be instantiated in a data tree.

In contrast to lys_getnext(), lys_getnext_ext() is limited by the given ext instance as a schema tree root. If the extension does not contain any schema node, NULL is returned. If the parent is provided, the functionality is completely the same as lys_getnext().

lys_getnext_ext() is supposed to be called sequentially. In the first call, the last parameter is usually NULL and function starts returning i) the first parent's child or ii) the first top level element of the given ext instance. Consequent calls suppose to provide the previously returned node as the last parameter and still the same parent and ext parameters.

Without options, the function is used to traverse only the schema nodes that can be paired with corresponding data nodes in a data tree. By setting some options the behavior can be modified to the extent that all the schema nodes are iteratively returned.

Parameters
[in]lastPreviously returned schema tree node, or NULL in case of the first call.
[in]parentParent of the subtree where the function starts processing.
[in]extThe extension instance to provide a separate schema tree. To consider the top level elements in the tree, the parent must be NULL. anyway, at least one of parent and ext parameters must be specified.
[in]optionsORed options.
Returns
Next schema tree node that can be instantiated in a data tree, NULL in case there is no such element.

◆ lys_nodetype2stmt()

enum ly_stmt lys_nodetype2stmt ( uint16_t  nodetype)

Convert nodetype to statement identifier.

Parameters
[in]nodetypeNodetype to convert.
Returns
Statement identifier representing the given nodetype.

◆ lys_nodetype2str()

const char* lys_nodetype2str ( uint16_t  nodetype)

Stringify schema nodetype.

Parameters
[in]nodetypeNodetype to stringify.
Returns
Constant string with the name of the node's type.

◆ lys_parse()

LY_ERR lys_parse ( struct ly_ctx ctx,
struct ly_in in,
LYS_INFORMAT  format,
const char **  features,
const struct lys_module **  module 
)

Load a schema into the specified context.

Parameters
[in]ctxlibyang context where to process the data model.
[in]inThe input handle to provide the dumped data model in the specified format.
[in]formatFormat of the schema to parse. Can be 0 to try to detect format from the input handler.
[in]featuresArray of features to enable ended with NULL. If NULL, no features are enabled.
[out]moduleOptional parsed module.
Returns
LY_ERR value.

◆ lys_parse_fd()

LY_ERR lys_parse_fd ( struct ly_ctx ctx,
int  fd,
LYS_INFORMAT  format,
const struct lys_module **  module 
)

Read a schema from file descriptor into the specified context.

Note
Current implementation supports only reading data from standard (disk) file, not from sockets, pipes, etc.

This function is comsidered for a simple use, if you have a complex usecase, consider use of lys_parse() with a standalone input handler.

Parameters
[in]ctxlibyang context where to process the data model.
[in]fdFile descriptor of a regular file (e.g. sockets are not supported) containing the schema in the specified format.
[in]formatFormat of the schema to parse. Can be 0 to try to detect format from the input handler.
[out]moduleOptional parsed module.
Returns
LY_ERR value.

◆ lys_parse_mem()

LY_ERR lys_parse_mem ( struct ly_ctx ctx,
const char *  data,
LYS_INFORMAT  format,
const struct lys_module **  module 
)

Load a schema into the specified context.

This function is comsidered for a simple use, if you have a complex usecase, consider use of lys_parse() with a standalone input handler.

Parameters
[in]ctxlibyang context where to process the data model.
[in]dataThe string containing the dumped data model in the specified format.
[in]formatFormat of the schema to parse. Can be 0 to try to detect format from the input handler.
[out]moduleOptional parsed module.
Returns
LY_ERR value.

◆ lys_parse_path()

LY_ERR lys_parse_path ( struct ly_ctx ctx,
const char *  path,
LYS_INFORMAT  format,
const struct lys_module **  module 
)

Load a schema into the specified context from a file.

This function is comsidered for a simple use, if you have a complex usecase, consider use of lys_parse() with a standalone input handler.

Parameters
[in]ctxlibyang context where to process the data model.
[in]pathPath to the file with the model in the specified format.
[in]formatFormat of the schema to parse. Can be 0 to try to detect format from the input handler.
[out]moduleOptional parsed module.
Returns
LY_ERR value.

◆ lys_print_clb()

LY_ERR lys_print_clb ( ly_write_clb  writeclb,
void *  user_data,
const struct lys_module module,
LYS_OUTFORMAT  format,
uint32_t  options 
)

Print schema tree in the specified format using a provided callback.

This is just a wrapper around lys_print_module() for simple use cases. In case of a complex use cases, use lys_print with ly_out output handler.

Parameters
[in]moduleSchema tree to print.
[in]writeclbCallback function to write the data (see write(1)).
[in]user_dataOptional caller-specific argument to be passed to the writeclb callback.
[in]formatSchema output format.
[in]optionsSchema output options (see Schema output options).
Returns
LY_ERR value.

◆ lys_print_fd()

LY_ERR lys_print_fd ( int  fd,
const struct lys_module module,
LYS_OUTFORMAT  format,
uint32_t  options 
)

Print schema tree in the specified format into a file descriptor.

This is just a wrapper around lys_print_module() for simple use cases. In case of a complex use cases, use lys_print with ly_out output handler.

Parameters
[in]fdFile descriptor where to print the data.
[in]moduleSchema tree to print.
[in]formatSchema output format.
[in]optionsSchema output options (see Schema output options).
Returns
LY_ERR value.

◆ lys_print_file()

LY_ERR lys_print_file ( FILE *  f,
const struct lys_module module,
LYS_OUTFORMAT  format,
uint32_t  options 
)

Print schema tree in the specified format into a file stream.

This is just a wrapper around lys_print_module() for simple use cases. In case of a complex use cases, use lys_print with ly_out output handler.

Parameters
[in]moduleSchema tree to print.
[in]fFile stream where to print the schema.
[in]formatSchema output format.
[in]optionsSchema output options (see Schema output options).
Returns
LY_ERR value.

◆ lys_print_mem()

LY_ERR lys_print_mem ( char **  strp,
const struct lys_module module,
LYS_OUTFORMAT  format,
uint32_t  options 
)

Print schema tree in the specified format into a memory block. It is up to caller to free the returned string by free().

This is just a wrapper around lys_print_module() for simple use cases. In case of a complex use cases, use lys_print with ly_out output handler.

Parameters
[out]strpPointer to store the resulting dump.
[in]moduleSchema tree to print.
[in]formatSchema output format.
[in]optionsSchema output options (see Schema output options).
Returns
LY_ERR value.

◆ lys_print_module()

LY_ERR lys_print_module ( struct ly_out out,
const struct lys_module module,
LYS_OUTFORMAT  format,
size_t  line_length,
uint32_t  options 
)

Schema module printer.

Parameters
[in]outPrinter handler for a specific output. Use ly_out_*() functions to create and free the handler.
[in]moduleMain module with the parsed schema to print.
[in]formatOutput format.
[in]line_lengthMaximum characters to be printed on a line, 0 for unlimited. Only for LYS_OUT_TREE printer.
[in]optionsSchema output options (see Schema output options).
Returns
LY_ERR value.

◆ lys_print_node()

LY_ERR lys_print_node ( struct ly_out out,
const struct lysc_node node,
LYS_OUTFORMAT  format,
size_t  line_length,
uint32_t  options 
)

Schema node printer.

Parameters
[in]outPrinter handler for a specific output. Use ly_out_*() functions to create and free the handler.
[in]nodeSchema node to print.
[in]formatOutput format.
[in]line_lengthMaximum characters to be printed on a line, 0 for unlimited. Only for LYS_OUT_TREE printer.
[in]optionsSchema output options (see Schema output options).
Returns
LY_ERR value.

◆ lys_print_path()

LY_ERR lys_print_path ( const char *  path,
const struct lys_module module,
LYS_OUTFORMAT  format,
uint32_t  options 
)

Print schema tree in the specified format into a file.

This is just a wrapper around lys_print_module() for simple use cases. In case of a complex use cases, use lys_print with ly_out output handler.

Parameters
[in]pathFile where to print the schema.
[in]moduleSchema tree to print.
[in]formatSchema output format.
[in]optionsSchema output options (see Schema output options).
Returns
LY_ERR value.

◆ lys_print_submodule()

LY_ERR lys_print_submodule ( struct ly_out out,
const struct lysp_submodule submodule,
LYS_OUTFORMAT  format,
size_t  line_length,
uint32_t  options 
)

Schema submodule printer.

Parameters
[in]outPrinter handler for a specific output. Use ly_out_*() functions to create and free the handler.
[in]submoduleParsed submodule to print.
[in]formatOutput format (LYS_OUT_YANG_COMPILED is not supported).
[in]line_lengthMaximum characters to be printed on a line, 0 for unlimited. Only for LYS_OUT_TREE printer.
[in]optionsSchema output options (see Schema output options).
Returns
LY_ERR value.

◆ lys_search_localfile()

LY_ERR lys_search_localfile ( const char *const *  searchpaths,
ly_bool  cwd,
const char *  name,
const char *  revision,
char **  localfile,
LYS_INFORMAT format 
)

Search for the schema file in the specified searchpaths.

Parameters
[in]searchpathsNULL-terminated array of paths to be searched (recursively). Current working directory is searched automatically (but non-recursively if not in the provided list). Caller can use result of the ly_ctx_get_searchdirs().
[in]cwdFlag to implicitly search also in the current working directory (non-recursively).
[in]nameName of the schema to find.
[in]revisionRevision of the schema to find. If NULL, the newest found schema filepath is returned.
[out]localfileMandatory output variable containing absolute path of the found schema. If no schema complying the provided restriction is found, NULL is set.
[out]formatOptional output variable containing expected format of the schema document according to the file suffix.
Returns
LY_ERR value (LY_SUCCESS is returned even if the file is not found, then the *localfile is NULL).

◆ lys_set_implemented()

LY_ERR lys_set_implemented ( struct lys_module mod,
const char **  features 
)

Make the specific module implemented.

If the module is already implemented but with a different set of features, the whole context is recompiled.

Parameters
[in]modModule to make implemented. It is not an error to provide already implemented module, it just does nothing.
[in]featuresOptional array specifying the enabled features terminated with NULL overriding any previous feature setting. The feature string '*' enables all the features and array of length 1 with only the terminating NULL explicitly disables all the features. In case the parameter is NULL, the features are untouched - left disabled in a newly implemented module or with the current features settings in case the module is already implemented.
Returns
LY_SUCCESS on success.
LY_EDENIED in case the context contains some other revision of the same module which is already implemented.
LY_ERR on other errors during module compilation.

◆ lysc_ext_substmt()

LY_ERR lysc_ext_substmt ( const struct lysc_ext_instance ext,
enum ly_stmt  substmt,
void **  instance_p,
enum ly_stmt_cardinality cardinality_p 
)

Get pointer to the storage of the specified substatement in the given extension instance.

The function simplifies access into the lysc_ext_instance.substmts sized array.

Parameters
[in]extCompiled extension instance to process.
[in]substmtExtension substatement to search for.
[out]instance_pPointer where the storage of the substmt will be provided. The specific type returned depends on the substmt and can be found in the documentation of each ly_stmt value. Also note that some of the substatements (lysc_node based or flags) can share the storage with other substatements. In case the pointer is NULL, still the return code can be used to at least know if the substatement is allowed for the extension.
[out]cardinality_pPointer to provide allowed cardinality of the substatements in the extension. Note that in some cases, the type of the storage depends also on the cardinality of the substatement.
Returns
LY_SUCCESS if the substmt found.
LY_ENOT in case the ext is not able to store (does not allow) the specified substmt.

◆ lysc_has_when()

const struct lysc_when* lysc_has_when ( const struct lysc_node node)

Check whether the schema node data instance existence depends on any when conditions. This node and any direct parent choice and case schema nodes are also examined for when conditions.

Be careful, this function is not recursive and checks only conditions that apply to this node directly. Meaning if there are any conditions associated with any data parent instance of node, they are not returned.

Parameters
[in]nodeSchema node to examine.
Returns
When condition associated with the node data instance, NULL if there is none.

◆ lysc_iffeature_value()

LY_ERR lysc_iffeature_value ( const struct lysc_iffeature iff)

Get how the if-feature statement currently evaluates.

Parameters
[in]iffCompiled if-feature statement to evaluate.
Returns
LY_SUCCESS if the statement evaluates to true,
LY_ENOT if it evaluates to false,
LY_ERR on error.

◆ lysc_module_dfs_full()

LY_ERR lysc_module_dfs_full ( const struct lys_module mod,
lysc_dfs_clb  dfs_clb,
void *  data 
)

DFS traversal of all the schema nodes in a module including RPCs and notifications.

For more details, see lysc_tree_dfs_full().

Parameters
[in]modModule to fully traverse.
[in]dfs_clbCallback to call for each node.
[in]dataArbitrary user data passed to dfs_clb.
Returns
LY_SUCCESS on success,
LY_ERR value returned by dfs_clb.

◆ lysc_node_actions()

const struct lysc_node_action* lysc_node_actions ( const struct lysc_node node)

Get the actions/RPCs linked list of the given (compiled) schema node. Decides the node's type and in case it has a actions/RPCs array, returns it.

Parameters
[in]nodeNode to examine.
Returns
The node's actions/RPCs linked list if any, NULL otherwise.

◆ lysc_node_child()

const struct lysc_node* lysc_node_child ( const struct lysc_node node)

Get the children linked list of the given (compiled) schema node.

Note that LYS_CHOICE has only LYS_CASE children. Also, LYS_RPC and LYS_ACTION have the first child LYS_INPUT, its sibling is LYS_OUTPUT.

Parameters
[in]nodeNode to examine.
Returns
Children linked list if any,
NULL otherwise.

◆ lysc_node_musts()

struct lysc_must* lysc_node_musts ( const struct lysc_node node)

Get the must statements list if present in the node.

Parameters
[in]nodeNode to examine.
Returns
Pointer to the list of must restrictions (sized array)
NULL if there is no must statement in the node, no matter if it is not even allowed or just present

◆ lysc_node_notifs()

const struct lysc_node_notif* lysc_node_notifs ( const struct lysc_node node)

Get the Notifications linked list of the given (compiled) schema node. Decides the node's type and in case it has a Notifications array, returns it.

Parameters
[in]nodeNode to examine.
Returns
The node's Notifications linked list if any, NULL otherwise.

◆ lysc_node_when()

struct lysc_when** lysc_node_when ( const struct lysc_node node)

Get the when statements list if present in the node.

Parameters
[in]nodeNode to examine.
Returns
Pointer to the list of pointers to when statements (sized array)
NULL if there is no when statement in the node, no matter if it is not even allowed or just present

◆ lysc_path()

char* lysc_path ( const struct lysc_node node,
LYSC_PATH_TYPE  pathtype,
char *  buffer,
size_t  buflen 
)

Generate path of the given node in the requested format.

Parameters
[in]nodeSchema path of this node will be generated.
[in]pathtypeFormat of the path to generate.
[in,out]bufferPrepared buffer of the buflen length to store the generated path. If NULL, memory for the complete path is allocated.
[in]buflenSize of the provided buffer.
Returns
NULL in case of memory allocation error, path of the node otherwise. In case the buffer is NULL, the returned string is dynamically allocated and caller is responsible to free it.

◆ lysc_tree_dfs_full()

LY_ERR lysc_tree_dfs_full ( const struct lysc_node root,
lysc_dfs_clb  dfs_clb,
void *  data 
)

DFS traversal of all the schema nodes in a (sub)tree including any actions and nested notifications.

Node with children, actions, and notifications is traversed in this order: 1) each child subtree; 2) each action subtree; 3) each notification subtree.

For algorithm illustration or traversal with actions and notifications skipped, see LYSC_TREE_DFS_BEGIN.

Parameters
[in]rootSchema root to fully traverse.
[in]dfs_clbCallback to call for each node.
[in]dataArbitrary user data passed to dfs_clb.
Returns
LY_SUCCESS on success,
LY_ERR value returned by dfs_clb.

◆ lysp_feature_next()

struct lysp_feature* lysp_feature_next ( const struct lysp_feature last,
const struct lysp_module pmod,
uint32_t *  idx 
)

Get the next feature in the module or submodules.

Parameters
[in]lastLast returned feature.
[in]pmodParsed module and submodoules whose features to iterate over.
[in,out]idxSubmodule index, set to 0 on first call.
Returns
Next found feature, NULL if the last has already been returned.

◆ lysp_node_actions()

const struct lysp_node_action* lysp_node_actions ( const struct lysp_node node)

Get the actions/RPCs linked list of the given (parsed) schema node. Decides the node's type and in case it has a actions/RPCs array, returns it.

Parameters
[in]nodeNode to examine.
Returns
The node's actions/RPCs linked list if any, NULL otherwise.

◆ lysp_node_child()

const struct lysp_node* lysp_node_child ( const struct lysp_node node)

Get the children linked list of the given (parsed) schema node. Decides the node's type and in case it has a children list, returns it.

Parameters
[in]nodeNode to examine.
Returns
The node's children linked list if any, NULL otherwise.

◆ lysp_node_groupings()

const struct lysp_node_grp* lysp_node_groupings ( const struct lysp_node node)

Get the groupings linked list of the given (parsed) schema node. Decides the node's type and in case it has a groupings array, returns it.

Parameters
[in]nodeNode to examine.
Returns
The node's groupings linked list if any, NULL otherwise.

◆ lysp_node_notifs()

const struct lysp_node_notif* lysp_node_notifs ( const struct lysp_node node)

Get the Notifications linked list of the given (parsed) schema node. Decides the node's type and in case it has a Notifications array, returns it.

Parameters
[in]nodeNode to examine.
Returns
The node's Notifications linked list if any, NULL otherwise.

◆ lysp_node_typedefs()

const struct lysp_tpdf* lysp_node_typedefs ( const struct lysp_node node)

Get the typedefs sized array of the given (parsed) schema node. Decides the node's type and in case it has a typedefs array, returns it.

Parameters
[in]nodeNode to examine.
Returns
The node's typedefs sized array if any, NULL otherwise.

◆ lyxp_get_expr()

const char* lyxp_get_expr ( const struct lyxp_expr *  path)

Getter for original XPath expression from a parsed expression.

Parameters
[in]pathParsed expression.
Returns
Original string expression.