Loading...
Searching...
No Matches
Schema Tree
Trees
Collaboration diagram for Schema Tree:

## Topics

| Atomize XPath options
| Compiled schema nodes flags
| Deviate types
| Options for lys_getnext() and lys_getnext_ext().
| Options for lys_module.latest_revision.
| 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_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.__unnamed0__
struct | lysc_node_action.__unnamed0__.__unnamed0__
struct | lysc_node_action_inout
union | lysc_node_action_inout.__unnamed0__
struct | lysc_node_action_inout.__unnamed0__.__unnamed0__
struct | lysc_node_anydata
union | lysc_node_anydata.__unnamed0__
struct | lysc_node_anydata.__unnamed0__.__unnamed0__
struct | lysc_node_case
union | lysc_node_case.__unnamed0__
struct | lysc_node_case.__unnamed0__.__unnamed0__
struct | lysc_node_choice
union | lysc_node_choice.__unnamed0__
struct | lysc_node_choice.__unnamed0__.__unnamed0__
struct | lysc_node_container
union | lysc_node_container.__unnamed0__
struct | lysc_node_container.__unnamed0__.__unnamed0__
struct | lysc_node_leaf
union | lysc_node_leaf.__unnamed0__
struct | lysc_node_leaf.__unnamed0__.__unnamed0__
struct | lysc_node_leaflist
union | lysc_node_leaflist.__unnamed0__
struct | lysc_node_leaflist.__unnamed0__.__unnamed0__
struct | lysc_node_list
union | lysc_node_list.__unnamed0__
struct | lysc_node_list.__unnamed0__.__unnamed0__
struct | lysc_node_notif
union | lysc_node_notif.__unnamed0__
struct | lysc_node_notif.__unnamed0__.__unnamed0__
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.__unnamed0__
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_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.__unnamed0__
struct | lysp_node_action.__unnamed0__.__unnamed0__
struct | lysp_node_action_inout
| YANG input-stmt and output-stmt. More...
union | lysp_node_action_inout.__unnamed0__
struct | lysp_node_action_inout.__unnamed0__.__unnamed0__
struct | lysp_node_anydata
union | lysp_node_anydata.__unnamed0__
struct | lysp_node_anydata.__unnamed0__.__unnamed0__
struct | lysp_node_augment
| YANG uses-augment-stmt and augment-stmt (compatible with struct lysp_node ). More...
union | lysp_node_augment.__unnamed0__
struct | lysp_node_augment.__unnamed0__.__unnamed0__
struct | lysp_node_case
union | lysp_node_case.__unnamed0__
struct | lysp_node_case.__unnamed0__.__unnamed0__
struct | lysp_node_choice
union | lysp_node_choice.__unnamed0__
struct | lysp_node_choice.__unnamed0__.__unnamed0__
struct | lysp_node_container
| Extension structure of the lysp_node for YANG container. More...
union | lysp_node_container.__unnamed0__
struct | lysp_node_container.__unnamed0__.__unnamed0__
struct | lysp_node_grp
| YANG grouping-stmt. More...
union | lysp_node_grp.__unnamed0__
struct | lysp_node_grp.__unnamed0__.__unnamed0__
struct | lysp_node_leaf
union | lysp_node_leaf.__unnamed0__
struct | lysp_node_leaf.__unnamed0__.__unnamed0__
struct | lysp_node_leaflist
union | lysp_node_leaflist.__unnamed0__
struct | lysp_node_leaflist.__unnamed0__.__unnamed0__
struct | lysp_node_list
union | lysp_node_list.__unnamed0__
struct | lysp_node_list.__unnamed0__.__unnamed0__
struct | lysp_node_notif
| YANG notification-stmt. More...
union | lysp_node_notif.__unnamed0__
struct | lysp_node_notif.__unnamed0__.__unnamed0__
struct | lysp_node_uses
union | lysp_node_uses.__unnamed0__
struct | lysp_node_uses.__unnamed0__.__unnamed0__
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_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!
#define | LY_REV_SIZE 11
#define | LYS_NODE_HASH_COUNT 4
| Maximum number of hashes stored in a schema node.
#define | lysc_data_parent(SCHEMA)
| Same as lysc_data_node() but never returns the node itself.
#define | lysc_is_dup_inst_list(lysc_node)
| Examine whether a node is a key-less list or a non-configuration leaf-list.
#define | lysc_is_key(lysc_node)
| Examine whether a node is a list's key.
#define | lysc_is_np_cont(lysc_node)
| Examine whether a node is a non-presence container.
#define | lysc_is_userordered(lysc_node)
| Examine whether a node is user-ordered list or leaf-list.
#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.
#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.
#define | LYSP_MODULE_NAME(PMOD)
| Get the parsed module or submodule name.

## Typedefs

typedef enum LYS_VERSION | LYS_VERSION
| supported YANG schema version values
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.

## Enumerations

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 , LYSC_PATH_DATA_PATTERN }
| Types of the different schema paths. More...

## Functions

LIBYANG_API_DECL 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.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL 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).
LIBYANG_API_DECL 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).
LIBYANG_API_DECL 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).
LIBYANG_API_DECL 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).
LIBYANG_API_DECL 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.
LIBYANG_API_DECL 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).
LIBYANG_API_DECL 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 (sibling) node element in the schema order that can be instantiated in a data tree. Returned node may be from an augment.
LIBYANG_API_DECL 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 (sibling) node element in the schema order of an extension that can be instantiated in a data tree.
LIBYANG_API_DECL LY_ERR | lys_identity_iffeature_value (const struct lysc_ident *ident)
| Get how the if-feature statement is evaluated for certain identity.
LIBYANG_API_DECL const char * | lys_nodetype2str (uint16_t nodetype)
| Stringify schema nodetype.
LIBYANG_API_DECL LY_ERR | lys_parse (struct ly_ctx *ctx, struct ly_in *in, LYS_INFORMAT format, const char **features, struct lys_module **module)
| Load a schema into the specified context.
LIBYANG_API_DECL LY_ERR | lys_parse_fd (struct ly_ctx *ctx, int fd, LYS_INFORMAT format, struct lys_module **module)
| Read a schema from file descriptor into the specified context.
LIBYANG_API_DECL LY_ERR | lys_parse_mem (struct ly_ctx *ctx, const char *data, LYS_INFORMAT format, struct lys_module **module)
| Load a schema into the specified context.
LIBYANG_API_DECL LY_ERR | lys_parse_path (struct ly_ctx *ctx, const char *path, LYS_INFORMAT format, struct lys_module **module)
| Load a schema into the specified context from a file.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL 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().
LIBYANG_API_DECL 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.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL LY_ERR | lys_set_implemented (struct lys_module *mod, const char **features)
| Make the specific module implemented.
LIBYANG_API_DECL const struct lysc_node * | lysc_data_node (const struct lysc_node *schema)
| Get nearest `schema` parent (including the node itself) that can be instantiated in data.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL LY_ERR | lysc_iffeature_value (const struct lysc_iffeature *iff)
| Get how the if-feature statement currently evaluates.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL const struct lysc_node * | lysc_node_child (const struct lysc_node *node)
| Get the children linked list of the given (compiled) schema node.
LIBYANG_API_DECL LY_ERR | lysc_node_lref_backlinks (const struct ly_ctx *ctx, const struct lysc_node *node, ly_bool match_ancestors, struct ly_set **set)
| Get all the leafref (or union with leafrefs) nodes that target a specific node.
LIBYANG_API_DECL const struct lysc_node * | lysc_node_lref_target (const struct lysc_node *node)
| Get the target node of a leafref node. Function lysc_node_lref_targets() should be used instead to get all the leafref targets even for a union node.
LIBYANG_API_DECL LY_ERR | lysc_node_lref_targets (const struct lysc_node *node, struct ly_set **set)
| Get the target node(s) of a leafref node or union node with leafrefs.
LIBYANG_API_DECL struct lysc_must * | lysc_node_musts (const struct lysc_node *node)
| Get the must statements list if present in the `node`.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL struct lysc_when ** | lysc_node_when (const struct lysc_node *node)
| Get the when statements list if present in the `node`.
LIBYANG_API_DECL const struct lys_module * | lysc_owner_module (const struct lysc_node *node)
| Get the owner module of the schema node. It is the module of the top-level node. Generally, in case of augments it is the target module, recursively, otherwise it is the module where the node is defined.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL const char * | lyxp_get_expr (const struct lyxp_expr *path)
| Getter for original XPath expression from a parsed expression.

## 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 2137 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) also contains the disabled identities when their if-feature(s) are evaluated to "false", and also the list is filled even if the module is not implemented. The list is located here because it 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, see latest_revision options.
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 1186 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

## lysc_ident

struct lysc_ident

YANG identity-stmt.

Definition at line 1212 of file tree_schema.h.

Data Fields
struct lysc_ident ** | derived | list of (pointers to the) derived identities (sized array) It also contains references to identities located in unimplemented modules.
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, no prefix)
const char * | ref | reference

## lysc_iffeature

struct lysc_iffeature

Compiled YANG if-feature-stmt.

Definition at line 329 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 1744 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 1273 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 1421 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 1463 of file tree_schema.h.

Data Fields
union lysc_node_action.__unnamed0__ | __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.__unnamed0__

union lysc_node_action.__unnamed0__

Definition at line 1464 of file tree_schema.h.

Data Fields
struct lysc_node_action.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysc_node | node | implicit cast for the members compatible with lysc_node

## lysc_node_action.__unnamed0__.__unnamed0__

struct lysc_node_action.__unnamed0__.__unnamed0__

Definition at line 1467 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 1439 of file tree_schema.h.

Data Fields
union lysc_node_action_inout.__unnamed0__ | __unnamed__ |
struct lysc_node * | child | first child node (linked list)
struct lysc_must * | musts | list of must restrictions (sized array)

## lysc_node_action_inout.__unnamed0__

union lysc_node_action_inout.__unnamed0__

Definition at line 1440 of file tree_schema.h.

Data Fields
struct lysc_node_action_inout.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysc_node | node | implicit cast for the members compatible with lysc_node

## lysc_node_action_inout.__unnamed0__.__unnamed0__

struct lysc_node_action_inout.__unnamed0__.__unnamed0__

Definition at line 1443 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 1711 of file tree_schema.h.

Data Fields
union lysc_node_anydata.__unnamed0__ | __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.__unnamed0__

union lysc_node_anydata.__unnamed0__

Definition at line 1712 of file tree_schema.h.

Data Fields
struct lysc_node_anydata.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysc_node | node | implicit cast for the members compatible with lysc_node

## lysc_node_anydata.__unnamed0__.__unnamed0__

struct lysc_node_anydata.__unnamed0__.__unnamed0__

Definition at line 1715 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 1554 of file tree_schema.h.

Data Fields
union lysc_node_case.__unnamed0__ | __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.__unnamed0__

union lysc_node_case.__unnamed0__

Definition at line 1555 of file tree_schema.h.

Data Fields
struct lysc_node_case.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysc_node | node | implicit cast for the members compatible with lysc_node

## lysc_node_case.__unnamed0__.__unnamed0__

struct lysc_node_case.__unnamed0__.__unnamed0__

Definition at line 1558 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 1582 of file tree_schema.h.

Data Fields
union lysc_node_choice.__unnamed0__ | __unnamed__ |
struct lysc_node_case * | cases | list of all the cases (linked list)
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.__unnamed0__

union lysc_node_choice.__unnamed0__

Definition at line 1583 of file tree_schema.h.

Data Fields
struct lysc_node_choice.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysc_node | node | implicit cast for the members compatible with lysc_node

## lysc_node_choice.__unnamed0__.__unnamed0__

struct lysc_node_choice.__unnamed0__.__unnamed0__

Definition at line 1586 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 1524 of file tree_schema.h.

Data Fields
union lysc_node_container.__unnamed0__ | __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.__unnamed0__

union lysc_node_container.__unnamed0__

Definition at line 1525 of file tree_schema.h.

Data Fields
struct lysc_node_container.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysc_node | node | implicit cast for the members compatible with lysc_node

## lysc_node_container.__unnamed0__.__unnamed0__

struct lysc_node_container.__unnamed0__.__unnamed0__

Definition at line 1528 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 1610 of file tree_schema.h.

Data Fields
union lysc_node_leaf.__unnamed0__ | __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.__unnamed0__

union lysc_node_leaf.__unnamed0__

Definition at line 1611 of file tree_schema.h.

Data Fields
struct lysc_node_leaf.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysc_node | node | implicit cast for the members compatible with lysc_node

## lysc_node_leaf.__unnamed0__.__unnamed0__

struct lysc_node_leaf.__unnamed0__.__unnamed0__

Definition at line 1614 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 1641 of file tree_schema.h.

Data Fields
union lysc_node_leaflist.__unnamed0__ | __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.__unnamed0__

union lysc_node_leaflist.__unnamed0__

Definition at line 1642 of file tree_schema.h.

Data Fields
struct lysc_node_leaflist.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysc_node | node | implicit cast for the members compatible with lysc_node

## lysc_node_leaflist.__unnamed0__.__unnamed0__

struct lysc_node_leaflist.__unnamed0__.__unnamed0__

Definition at line 1645 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 1677 of file tree_schema.h.

Data Fields
union lysc_node_list.__unnamed0__ | __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.__unnamed0__

union lysc_node_list.__unnamed0__

Definition at line 1678 of file tree_schema.h.

Data Fields
struct lysc_node_list.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysc_node | node | implicit cast for the members compatible with lysc_node

## lysc_node_list.__unnamed0__.__unnamed0__

struct lysc_node_list.__unnamed0__.__unnamed0__

Definition at line 1681 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 1494 of file tree_schema.h.

Data Fields
union lysc_node_notif.__unnamed0__ | __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.__unnamed0__

union lysc_node_notif.__unnamed0__

Definition at line 1495 of file tree_schema.h.

Data Fields
struct lysc_node_notif.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysc_node | node | implicit cast for the members compatible with lysc_node

## lysc_node_notif.__unnamed0__.__unnamed0__

struct lysc_node_notif.__unnamed0__.__unnamed0__

Definition at line 1498 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 1261 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 1174 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 1243 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 1238 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 1283 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)
const char * | name | referenced typedef name (without prefix, if any), NULL for built-in types
struct lyplg_type * | plugin | type's manipulation callbacks plugin
uint32_t | refcount | reference counter for type sharing, it may be accessed concurrently when creating/freeing data node values that reference it (instance-identifier)

## lysc_type_bin

struct lysc_type_bin

Definition at line 1403 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
const char * | name | referenced typedef name (without prefix, if any), NULL for built-in types
struct lyplg_type * | plugin | type's manipulation callbacks plugin
uint32_t | refcount | reference counter for type sharing

## lysc_type_bitenum_item

struct lysc_type_bitenum_item

Definition at line 1324 of file tree_schema.h.

Data Fields
union lysc_type_bitenum_item.__unnamed0__ | __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_IS_ENUM values are allowed
const char * | name | enumeration identifier
const char * | ref | reference

## lysc_type_bitenum_item.__unnamed0__

union lysc_type_bitenum_item.__unnamed0__

Definition at line 1330 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 1348 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)
const char * | name | referenced typedef name (without prefix, if any), NULL for built-in types
struct lyplg_type * | plugin | type's manipulation callbacks plugin
uint32_t | refcount | reference counter for type sharing

## lysc_type_dec

struct lysc_type_dec

Definition at line 1302 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
const char * | name | referenced typedef name (without prefix, if any), NULL for built-in types
struct lyplg_type * | plugin | type's manipulation callbacks plugin
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 1338 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)
const char * | name | referenced typedef name (without prefix, if any), NULL for built-in types
struct lyplg_type * | plugin | type's manipulation callbacks plugin
uint32_t | refcount | reference counter for type sharing

## lysc_type_identityref

struct lysc_type_identityref

Definition at line 1372 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)
const char * | name | referenced typedef name (without prefix, if any), NULL for built-in types
struct lyplg_type * | plugin | type's manipulation callbacks plugin
uint32_t | refcount | reference counter for type sharing

## lysc_type_instanceid

struct lysc_type_instanceid

Definition at line 1383 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)
const char * | name | referenced typedef name (without prefix, if any), NULL for built-in types
struct lyplg_type * | plugin | type's manipulation callbacks plugin
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 1359 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)
const char * | name | referenced typedef name (without prefix, if any), NULL for built-in types
struct lyxp_expr * | path | parsed target path, compiled path cannot be stored because of type sharing
struct lyplg_type * | plugin | type's manipulation callbacks plugin
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 1292 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)
const char * | name | referenced typedef name (without prefix, if any), NULL for built-in types
struct lyplg_type * | plugin | type's manipulation callbacks plugin
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 1313 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
const char * | name | referenced typedef name (without prefix, if any), NULL for built-in types
struct lysc_pattern ** | patterns | optional list of pointers to pattern limitations (sized array)
struct lyplg_type * | plugin | type's manipulation callbacks plugin
uint32_t | refcount | reference counter for type sharing

## lysc_type_union

struct lysc_type_union

Definition at line 1393 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)
const char * | name | referenced typedef name (without prefix, if any), NULL for built-in types
struct lyplg_type * | plugin | type's manipulation callbacks plugin
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 1198 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 481 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 487 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 500 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 510 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 522 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 296 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_feature

struct lysp_feature

YANG feature-stmt.

Definition at line 313 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 348 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 265 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 280 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 1102 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 734 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 982 of file tree_schema.h.

Data Fields
union lysp_node_action.__unnamed0__ | __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.__unnamed0__

union lysp_node_action.__unnamed0__

Definition at line 983 of file tree_schema.h.

Data Fields
struct lysp_node_action.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysp_node | node | implicit cast for the members compatible with lysp_node

## lysp_node_action.__unnamed0__.__unnamed0__

struct lysp_node_action.__unnamed0__.__unnamed0__

Definition at line 986 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 955 of file tree_schema.h.

Data Fields
union lysp_node_action_inout.__unnamed0__ | __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.__unnamed0__

union lysp_node_action_inout.__unnamed0__

Definition at line 956 of file tree_schema.h.

Data Fields
struct lysp_node_action_inout.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysp_node | node | implicit cast for the members compatible with lysp_node

## lysp_node_action_inout.__unnamed0__.__unnamed0__

struct lysp_node_action_inout.__unnamed0__.__unnamed0__

Definition at line 959 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 907 of file tree_schema.h.

Data Fields
union lysp_node_anydata.__unnamed0__ | __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.__unnamed0__

union lysp_node_anydata.__unnamed0__

Definition at line 908 of file tree_schema.h.

Data Fields
struct lysp_node_anydata.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysp_node | node | implicit cast for the members compatible with lysp_node

## lysp_node_anydata.__unnamed0__.__unnamed0__

struct lysp_node_anydata.__unnamed0__.__unnamed0__

Definition at line 911 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 1065 of file tree_schema.h.

Data Fields
union lysp_node_augment.__unnamed0__ | __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.__unnamed0__

union lysp_node_augment.__unnamed0__

Definition at line 1066 of file tree_schema.h.

Data Fields
struct lysp_node_augment.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysp_node | node | implicit cast for the members compatible with lysp_node

## lysp_node_augment.__unnamed0__.__unnamed0__

struct lysp_node_augment.__unnamed0__.__unnamed0__

Definition at line 1069 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 885 of file tree_schema.h.

Data Fields
union lysp_node_case.__unnamed0__ | __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.__unnamed0__

union lysp_node_case.__unnamed0__

Definition at line 886 of file tree_schema.h.

Data Fields
struct lysp_node_case.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysp_node | node | implicit cast for the members compatible with lysp_node

## lysp_node_case.__unnamed0__.__unnamed0__

struct lysp_node_case.__unnamed0__.__unnamed0__

Definition at line 889 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 862 of file tree_schema.h.

Data Fields
union lysp_node_choice.__unnamed0__ | __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.__unnamed0__

union lysp_node_choice.__unnamed0__

Definition at line 863 of file tree_schema.h.

Data Fields
struct lysp_node_choice.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysp_node | node | implicit cast for the members compatible with lysp_node

## lysp_node_choice.__unnamed0__.__unnamed0__

struct lysp_node_choice.__unnamed0__.__unnamed0__

Definition at line 866 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 750 of file tree_schema.h.

Data Fields
union lysp_node_container.__unnamed0__ | __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.__unnamed0__

union lysp_node_container.__unnamed0__

Definition at line 751 of file tree_schema.h.

Data Fields
struct lysp_node_container.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysp_node | node | implicit cast for the members compatible with lysp_node

## lysp_node_container.__unnamed0__.__unnamed0__

struct lysp_node_container.__unnamed0__.__unnamed0__

Definition at line 754 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 1037 of file tree_schema.h.

Data Fields
union lysp_node_grp.__unnamed0__ | __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.__unnamed0__

union lysp_node_grp.__unnamed0__

Definition at line 1038 of file tree_schema.h.

Data Fields
struct lysp_node_grp.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysp_node | node | implicit cast for the members compatible with lysp_node

## lysp_node_grp.__unnamed0__.__unnamed0__

struct lysp_node_grp.__unnamed0__.__unnamed0__

Definition at line 1041 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 778 of file tree_schema.h.

Data Fields
union lysp_node_leaf.__unnamed0__ | __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.__unnamed0__

union lysp_node_leaf.__unnamed0__

Definition at line 779 of file tree_schema.h.

Data Fields
struct lysp_node_leaf.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysp_node | node | implicit cast for the members compatible with lysp_node

## lysp_node_leaf.__unnamed0__.__unnamed0__

struct lysp_node_leaf.__unnamed0__.__unnamed0__

Definition at line 782 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 803 of file tree_schema.h.

Data Fields
union lysp_node_leaflist.__unnamed0__ | __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.__unnamed0__

union lysp_node_leaflist.__unnamed0__

Definition at line 804 of file tree_schema.h.

Data Fields
struct lysp_node_leaflist.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysp_node | node | implicit cast for the members compatible with lysp_node

## lysp_node_leaflist.__unnamed0__.__unnamed0__

struct lysp_node_leaflist.__unnamed0__.__unnamed0__

Definition at line 807 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 831 of file tree_schema.h.

Data Fields
union lysp_node_list.__unnamed0__ | __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.__unnamed0__

union lysp_node_list.__unnamed0__

Definition at line 832 of file tree_schema.h.

Data Fields
struct lysp_node_list.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysp_node | node | implicit cast for the members compatible with lysp_node

## lysp_node_list.__unnamed0__.__unnamed0__

struct lysp_node_list.__unnamed0__.__unnamed0__

Definition at line 835 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 1010 of file tree_schema.h.

Data Fields
union lysp_node_notif.__unnamed0__ | __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.__unnamed0__

union lysp_node_notif.__unnamed0__

Definition at line 1011 of file tree_schema.h.

Data Fields
struct lysp_node_notif.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysp_node | node | implicit cast for the members compatible with lysp_node

## lysp_node_notif.__unnamed0__.__unnamed0__

struct lysp_node_notif.__unnamed0__.__unnamed0__

Definition at line 1014 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 929 of file tree_schema.h.

Data Fields
union lysp_node_uses.__unnamed0__ | __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.__unnamed0__

union lysp_node_uses.__unnamed0__

Definition at line 930 of file tree_schema.h.

Data Fields
struct lysp_node_uses.__unnamed0__.__unnamed0__ | __unnamed__ |
struct lysp_node | node | implicit cast for the members compatible with lysp_node

## lysp_node_uses.__unnamed0__.__unnamed0__

struct lysp_node_uses.__unnamed0__.__unnamed0__

Definition at line 933 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 337 of file tree_schema.h.

Data Fields
uint16_t | flags | schema node flags - only LYS_SINGLEQUOTED and LYS_DOUBLEQUOTED values allowed
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 450 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 361 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 377 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_submodule

struct lysp_submodule

Definition at line 1126 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 426 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 403 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 custom type, not used for built-in types
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 387 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 440 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;
lysc_node
Compiled YANG data node.
Definition tree_schema.h:1421

Helper macro for LYSC_TREE_DFS_END, should not be used directly!

Definition at line 223 of file tree_schema.h.

## LY_REV_SIZE

#define LY_REV_SIZE 11

revision data string length (including terminating NULL byte)

Definition at line 232 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 1416 of file tree_schema.h.

## lysc_data_parent

#define lysc_data_parent | ( |  | SCHEMA | ) |

Value:
lysc_data_node((SCHEMA) ? (SCHEMA)->parent : NULL)
lysc_data_node
LIBYANG_API_DECL const struct lysc_node * lysc_data_node(const struct lysc_node *schema)
Get nearest schema parent (including the node itself) that can be instantiated in data.

Same as lysc_data_node() but never returns the node itself.

Definition at line 1801 of file tree_schema.h.

## lysc_is_dup_inst_list

#define lysc_is_dup_inst_list | ( |  | lysc_node | ) |

Value:
((lysc_node && (((lysc_node->nodetype == LYS_LIST) && (lysc_node->flags & LYS_KEYLESS)) || \
((lysc_node->nodetype == LYS_LEAFLIST) && !(lysc_node->flags & LYS_CONFIG_W)))) ? 1 : 0)
LYS_LEAFLIST
#define LYS_LEAFLIST
Definition tree_schema.h:243
LYS_LIST
#define LYS_LIST
Definition tree_schema.h:244
lysc_node::nodetype
uint16_t nodetype
Definition tree_schema.h:1422
lysc_node::flags
uint16_t flags
Definition tree_schema.h:1423
LYS_CONFIG_W
#define LYS_CONFIG_W
Definition tree_schema.h:653
LYS_KEYLESS
#define LYS_KEYLESS
Definition tree_schema.h:674

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

Parameters

  [in] | lysc_node | Schema node to examine.

Returns
  Boolean value whether the `node` is a list with duplicate instances allowed.

Definition at line 1786 of file tree_schema.h.

## lysc_is_key

#define lysc_is_key | ( |  | lysc_node | ) |

Value:
((!lysc_node || (lysc_node->nodetype != LYS_LEAF) || !(lysc_node->flags & LYS_KEY)) ? 0 : 1)
LYS_LEAF
#define LYS_LEAF
Definition tree_schema.h:242
LYS_KEY
#define LYS_KEY
Definition tree_schema.h:673

Examine whether a node is a list's key.

Parameters

  [in] | lysc_node | Schema node to examine.

Returns
  Boolean value whether the `node` is a key or not.

Definition at line 1768 of file tree_schema.h.

## lysc_is_np_cont

#define lysc_is_np_cont | ( |  | lysc_node | ) |

Value:
((!lysc_node || (lysc_node->nodetype != LYS_CONTAINER) || (lysc_node->flags & LYS_PRESENCE)) ? 0 : 1)
LYS_CONTAINER
#define LYS_CONTAINER
Definition tree_schema.h:240
LYS_PRESENCE
#define LYS_PRESENCE
Definition tree_schema.h:669

Examine whether a node is a non-presence container.

Parameters

  [in] | lysc_node | Schema node to examine.

Returns
  Boolean value whether the `node` is a NP container or not.

Definition at line 1777 of file tree_schema.h.

## lysc_is_userordered

#define lysc_is_userordered | ( |  | lysc_node | ) |

Value:
((!lysc_node || !(lysc_node->nodetype & (LYS_LEAFLIST | LYS_LIST)) || !(lysc_node->flags & LYS_ORDBY_USER)) ? 0 : 1)
LYS_ORDBY_USER
#define LYS_ORDBY_USER
Definition tree_schema.h:679

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

Parameters

  [in] | lysc_node | Schema node to examine.

Returns
  Boolean value whether the `node` is user-ordered or not.

Definition at line 1759 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)
ly_bool
uint8_t ly_bool
Type to indicate boolean value.
Definition log.h:35

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

  START | Pointer to the starting element processed first.
  ELEM | Iterator intended for use in the block.

Definition at line 184 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); \
} }
lysc_node_child
LIBYANG_API_DECL 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

  START | Pointer to the starting element processed first.
  ELEM | Iterator intended for use in the block.

Definition at line 203 of file tree_schema.h.

## LYSP_MODULE_NAME

#define LYSP_MODULE_NAME | ( |  | PMOD | ) |

Value:
(PMOD->is_submod ? ((struct lysp_submodule *)PMOD)->name : ((struct lysp_module *)PMOD)->mod->name)
lysp_module
Printable YANG schema tree structure representing YANG module.
Definition tree_schema.h:1102
lysp_submodule
Definition tree_schema.h:1126

Get the parsed module or submodule name.

Parameters

  [in] | PMOD | Parsed module or submodule.

Returns
  Module or submodule name.

Definition at line 1168 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] | node | Current node.
  [in] | data | Arbitrary user data.
  [out] | dfs_continue | Set 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 1953 of file tree_schema.h.

## Enumeration Type Documentation

## LYS_INFORMAT

enum 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 91 of file parser_schema.h.

## LYS_OUTFORMAT

enum 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 105 of file printer_schema.h.

## LYS_VERSION

enum 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 1091 of file tree_schema.h.

## LYSC_PATH_TYPE

enum 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
LYSC_PATH_DATA_PATTERN | Similar to LYSC_PATH_DATA but there are predicates for all list keys added with "%s" where their values should be so that they can be printed there

Definition at line 2114 of file tree_schema.h.

## Function Documentation

## lys_feature_value()

LIBYANG_API_DECL 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] | module | Module where the feature is defined.
  [in] | feature | Name 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()

LIBYANG_API_DECL 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] | parent | Optional parent of the node to find. If not specified, the module's top-level nodes are searched.
  [in] | module | module of the node to find. It is also limitation for the children node of the given parent.
  [in] | name | Name of the node to find.
  [in] | name_len | Optional length of the name in case it is not NULL-terminated string.
  [in] | nodetype | Optional criteria (to speedup) specifying nodetype(s) of the node to find. Used as a bitmask, so multiple nodetypes can be specified.
  [in] | options | ORed options.

Returns
  Found node if any.

## lys_find_expr_atoms()

LIBYANG_API_DECL 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_node | XPath schema context node. Use NULL for the root node.
  [in] | cur_mod | Current module for the expression (where it was "instantiated").
  [in] | expr | Parsed expression to use.
  [in] | prefixes | Sized array of compiled prefixes.
  [in] | options | Whether to apply some node access restrictions, see Atomize XPath options.
  [out] | set | Set of found atoms (schema nodes).

Returns
  LY_SUCCESS on success, `set` is returned.
  LY_ERR value on error.

## lys_find_lypath_atoms()

LIBYANG_API_DECL 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] | path | Compiled path to use.
  [out] | set | Set of found atoms (schema nodes).

Returns
  LY_SUCCESS on success, `set` is returned.
  LY_ERR value on error.

## lys_find_path()

LIBYANG_API_DECL 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] | ctx | libyang context to use for absolute `path`. May be NULL if `ctx_node` is set.
  [in] | ctx_node | XPath schema context node for relative `path`. Use NULL for the root node.
  [in] | path | JSON path of the node to get.
  [in] | output | Search operation output instead of input.

Returns
  Found schema node or NULL.

## lys_find_path_atoms()

LIBYANG_API_DECL 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] | ctx | libyang context to use for absolute `path`. May be NULL if `ctx_node` is set.
  [in] | ctx_node | XPath schema context node for relative `path`. Use NULL for the root node.
  [in] | path | JSON path to examine.
  [in] | output | Search operation output instead of input.
  [out] | set | Set of found atoms (schema nodes).

Returns
  LY_ERR value on error.

## lys_find_xpath()

LIBYANG_API_DECL 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] | ctx | libyang context to use for absolute `xpath`. May be NULL if `ctx_node` is set.
  [in] | ctx_node | XPath schema context node for relative `xpath`. Use NULL for the root node.
  [in] | xpath | Data XPath expression filtering the matching nodes. LY_VALUE_JSON prefix format is expected.
  [in] | options | Whether to apply some node access restrictions, see Atomize XPath options.
  [out] | set | Set of found schema nodes.

Returns
  LY_SUCCESS on success, `set` is returned.
  LY_ERR value if an error occurred.

## lys_find_xpath_atoms()

LIBYANG_API_DECL 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] | ctx | libyang context to use. May be NULL if `ctx_node` is set.
  [in] | ctx_node | XPath schema context node. Use NULL for the root node.
  [in] | xpath | Data XPath expression filtering the matching nodes. LY_VALUE_JSON prefix format is expected.
  [in] | options | Whether to apply some node access restrictions, see Atomize XPath options.
  [out] | set | Set of found atoms (schema nodes).

Returns
  LY_SUCCESS on success, `set` is returned.
  LY_ERR value on error.

## lys_getnext()

LIBYANG_API_DECL 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 (sibling) node element in the schema order that can be instantiated in a data tree. Returned node may 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 1) the first `parent` child (if it is set) or 2) the first top level element of `module`. Consequent calls should provide the previously returned node as `last` and 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] | last | Previously returned schema tree node, or NULL in case of the first call.
  [in] | parent | Parent of the subtree to iterate over. If set, `module` is ignored.
  [in] | module | Module of the top level elements to iterate over. If `parent` is NULL, it must be specified.
  [in] | options | ORed options.

Returns
  Next schema tree node, NULL in case there are no more.

## lys_getnext_ext()

LIBYANG_API_DECL 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 (sibling) node element in the schema order of an extension that can be instantiated in a data tree.

It is just lys_getnext() for extensions.

Parameters

  [in] | last | Previously returned schema tree node, or NULL in case of the first call.
  [in] | parent | Parent of the subtree to iterate over. If set, `ext` is ignored.
  [in] | ext | Extension instance with schema nodes to iterate over. If `parent` is NULL, it must be specified.
  [in] | options | ORed options.

Returns
  Next schema tree node, NULL in case there are no more.

## lys_identity_iffeature_value()

LIBYANG_API_DECL LY_ERR lys_identity_iffeature_value | ( | const struct lysc_ident * | ident | ) |

Get how the if-feature statement is evaluated for certain identity.

The function can be called even if the identity does not contain if-features, in which case LY_SUCCESS is returned.

Parameters

  [in] | ident | Compiled identity statement to evaluate.

Returns
  LY_SUCCESS if the statement evaluates to true,
  LY_ENOT if it evaluates to false,
  LY_ERR on error.

## lys_nodetype2str()

LIBYANG_API_DECL const char * lys_nodetype2str | ( | uint16_t | nodetype | ) |

Stringify schema nodetype.

Parameters

  [in] | nodetype | Nodetype to stringify.

Returns
  Constant string with the name of the node's type.

## lys_parse()

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

Load a schema into the specified context.

Parameters

  [in] | ctx | libyang context to use.
  [in] | in | Input handle to provide the dumped module in the specified format.
  [in] | format | Format of the schema to parse. Can be 0 to try to detect format from the input handler.
  [in] | features | Array of features to enable ended with NULL. If NULL, no features are enabled.
  [out] | module | Optional parsed module.

Returns
  LY_ERR value.

## lys_parse_fd()

LIBYANG_API_DECL LY_ERR lys_parse_fd | ( | struct ly_ctx * | ctx,
|  | int | fd,
|  | LYS_INFORMAT | format,
|  | 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 considered for a simple use, if you have a complex use-case, consider use of lys_parse() with a standalone input handler.

Parameters

  [in] | ctx | libyang context to use.
  [in] | fd | File descriptor of a regular file (e.g. sockets are not supported) containing the schema in the specified format.
  [in] | format | Format of the schema to parse.
  [out] | module | Optional parsed module.

Returns
  LY_ERR value.

## lys_parse_mem()

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

Load a schema into the specified context.

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

Parameters

  [in] | ctx | libyang context to use.
  [in] | data | String containing the dumped module in the specified format.
  [in] | format | Format of the schema to parse.
  [out] | module | Optional parsed module.

Returns
  LY_ERR value.

## lys_parse_path()

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

Load a schema into the specified context from a file.

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

Parameters

  [in] | ctx | libyang context to use.
  [in] | path | Path to the file with the module in the specified format.
  [in] | format | Format of the schema to parse.
  [out] | module | Optional parsed module.

Returns
  LY_ERR value.

## lys_print_clb()

LIBYANG_API_DECL 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] | module | Schema tree to print.
  [in] | writeclb | Callback function to write the data (see write(1)).
  [in] | user_data | Optional caller-specific argument to be passed to the `writeclb` callback.
  [in] | format | Schema output format.
  [in] | options | Schema output options (see Schema output options).

Returns
  LY_ERR value.

## lys_print_fd()

LIBYANG_API_DECL 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] | fd | File descriptor where to print the data.
  [in] | module | Schema tree to print.
  [in] | format | Schema output format.
  [in] | options | Schema output options (see Schema output options).

Returns
  LY_ERR value.

## lys_print_file()

LIBYANG_API_DECL 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] | module | Schema tree to print.
  [in] | f | File stream where to print the schema.
  [in] | format | Schema output format.
  [in] | options | Schema output options (see Schema output options).

Returns
  LY_ERR value.

## lys_print_mem()

LIBYANG_API_DECL 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] | strp | Pointer to store the resulting dump.
  [in] | module | Schema tree to print.
  [in] | format | Schema output format.
  [in] | options | Schema output options (see Schema output options).

Returns
  LY_ERR value.

## lys_print_module()

LIBYANG_API_DECL 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] | out | Printer handler for a specific output. Use ly_out_*() functions to create and free the handler.
  [in] | module | Main module with the parsed schema to print.
  [in] | format | Output format.
  [in] | line_length | Maximum characters to be printed on a line, 0 for unlimited. Only for LYS_OUT_TREE printer.
  [in] | options | Schema output options (see Schema output options).

Returns
  LY_ERR value.

## lys_print_node()

LIBYANG_API_DECL 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] | out | Printer handler for a specific output. Use ly_out_*() functions to create and free the handler.
  [in] | node | Schema node to print.
  [in] | format | Output format.
  [in] | line_length | Maximum characters to be printed on a line, 0 for unlimited. Only for LYS_OUT_TREE printer.
  [in] | options | Schema output options (see Schema output options).

Returns
  LY_ERR value.

## lys_print_path()

LIBYANG_API_DECL 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] | path | File where to print the schema.
  [in] | module | Schema tree to print.
  [in] | format | Schema output format.
  [in] | options | Schema output options (see Schema output options).

Returns
  LY_ERR value.

## lys_print_submodule()

LIBYANG_API_DECL 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] | out | Printer handler for a specific output. Use ly_out_*() functions to create and free the handler.
  [in] | submodule | Parsed submodule to print.
  [in] | format | Output format (LYS_OUT_YANG_COMPILED is not supported).
  [in] | line_length | Maximum characters to be printed on a line, 0 for unlimited. Only for LYS_OUT_TREE printer.
  [in] | options | Schema output options (see Schema output options).

Returns
  LY_ERR value.

## lys_search_localfile()

LIBYANG_API_DECL 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] | searchpaths | NULL-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] | cwd | Flag to implicitly search also in the current working directory (non-recursively).
  [in] | name | Name of the schema to find.
  [in] | revision | Revision of the schema to find. If NULL, the newest found schema filepath is returned.
  [out] | localfile | Mandatory output variable containing absolute path of the found schema. If no schema complying the provided restriction is found, NULL is set.
  [out] | format | Optional 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()

LIBYANG_API_DECL 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] | mod | Module to make implemented. It is not an error to provide already implemented module, it just does nothing.

  [in]

  features

  Optional 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_data_node()

LIBYANG_API_DECL const struct lysc_node * lysc_data_node | ( | const struct lysc_node * | schema | ) |

Get nearest `schema` parent (including the node itself) that can be instantiated in data.

Parameters

  [in] | schema | Schema node to get the nearest data node for.

Returns
  Schema data node, NULL if top-level (in data).

## lysc_has_when()

LIBYANG_API_DECL 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] | node | Schema node to examine.

Returns
  When condition associated with the node data instance, NULL if there is none.

## lysc_iffeature_value()

LIBYANG_API_DECL LY_ERR lysc_iffeature_value | ( | const struct lysc_iffeature * | iff | ) |

Get how the if-feature statement currently evaluates.

Parameters

  [in] | iff | Compiled 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()

LIBYANG_API_DECL 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] | mod | Module to fully traverse.
  [in] | dfs_clb | Callback to call for each node.
  [in] | data | Arbitrary user data passed to `dfs_clb`.

Returns
  LY_SUCCESS on success,
  LY_ERR value returned by `dfs_clb`.

## lysc_node_actions()

LIBYANG_API_DECL 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] | node | Node to examine.

Returns
  The node's actions/RPCs linked list if any, NULL otherwise.

## lysc_node_child()

LIBYANG_API_DECL 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] | node | Node to examine.

Returns
  Children linked list if any,
  NULL otherwise.

## lysc_node_lref_backlinks()

LIBYANG_API_DECL LY_ERR lysc_node_lref_backlinks | ( | const struct ly_ctx * | ctx,
|  | const struct lysc_node * | node,
|  | ly_bool | match_ancestors,
|  | struct ly_set ** | set )

Get all the leafref (or union with leafrefs) nodes that target a specific node.

Parameters

  [in] | ctx | Context to use, may not be set if `node` is.
  [in] | node | Leafref target node to use for matching. If not set, all the leafref nodes are just collected.
  [in] | match_ancestors | If set, `node` is considered a match not only when a leafref targets it directly but even when an ancestor (parent) node of `node` is a target of the leafref.
  [out] | set | Set of matching leafref nodes.

Returns
  LY_SUCCESS on success.
  LY_ERR value on error.

## lysc_node_lref_target()

LIBYANG_API_DECL const struct lysc_node * lysc_node_lref_target | ( | const struct lysc_node * | node | ) |

Get the target node of a leafref node. Function lysc_node_lref_targets() should be used instead to get all the leafref targets even for a union node.

Parameters

  [in] | node | Leafref node.

Returns
  Leafref target, NULL on any error.

## lysc_node_lref_targets()

LIBYANG_API_DECL LY_ERR lysc_node_lref_targets | ( | const struct lysc_node * | node,
|  | struct ly_set ** | set )

Get the target node(s) of a leafref node or union node with leafrefs.

Parameters

  [in] | node | Term node to use.
  [out] | set | Set with all the leafref targets, may be empty if the node is a different type or the targets are not found.

Returns
  LY_SUCCESS on success.
  LY_ERR value on error.

## lysc_node_musts()

LIBYANG_API_DECL struct lysc_must * lysc_node_musts | ( | const struct lysc_node * | node | ) |

Get the must statements list if present in the `node`.

Parameters

  [in] | node | Node 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()

LIBYANG_API_DECL 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] | node | Node to examine.

Returns
  The node's Notifications linked list if any, NULL otherwise.

## lysc_node_when()

LIBYANG_API_DECL struct lysc_when ** lysc_node_when | ( | const struct lysc_node * | node | ) |

Get the when statements list if present in the `node`.

Parameters

  [in] | node | Node 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_owner_module()

LIBYANG_API_DECL const struct lys_module * lysc_owner_module | ( | const struct lysc_node * | node | ) |

Get the owner module of the schema node. It is the module of the top-level node. Generally, in case of augments it is the target module, recursively, otherwise it is the module where the node is defined.

Parameters

  [in] | node | Schema node to examine.

Returns
  Module owner of the node.

## lysc_path()

LIBYANG_API_DECL 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] | node | Schema path of this node will be generated.
  [in] | pathtype | Format of the path to generate.
  [in,out] | buffer | Prepared buffer of the `buflen` length to store the generated path. If NULL, memory for the complete path is allocated.
  [in] | buflen | Size 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()

LIBYANG_API_DECL 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] | root | Schema root to fully traverse.
  [in] | dfs_clb | Callback to call for each node.
  [in] | data | Arbitrary user data passed to `dfs_clb`.

Returns
  LY_SUCCESS on success,
  LY_ERR value returned by `dfs_clb`.

## lysp_feature_next()

LIBYANG_API_DECL 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] | last | Last returned feature.
  [in] | pmod | Parsed module and submodules whose features to iterate over.
  [in,out] | idx | Submodule index, set to 0 on first call.

Returns
  Next found feature, NULL if the last has already been returned.

## lysp_node_actions()

LIBYANG_API_DECL 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] | node | Node to examine.

Returns
  The node's actions/RPCs linked list if any, NULL otherwise.

## lysp_node_child()

LIBYANG_API_DECL 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] | node | Node to examine.

Returns
  The node's children linked list if any, NULL otherwise.

## lysp_node_groupings()

LIBYANG_API_DECL 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] | node | Node to examine.

Returns
  The node's groupings linked list if any, NULL otherwise.

## lysp_node_notifs()

LIBYANG_API_DECL 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] | node | Node to examine.

Returns
  The node's Notifications linked list if any, NULL otherwise.

## lysp_node_typedefs()

LIBYANG_API_DECL 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] | node | Node to examine.

Returns
  The node's typedefs sized array if any, NULL otherwise.

## lyxp_get_expr()

LIBYANG_API_DECL const char * lyxp_get_expr | ( | const struct lyxp_expr * | path | ) |

Getter for original XPath expression from a parsed expression.

Parameters

  [in] | path | Parsed expression.

Returns
  Original string expression.