libyang 2.1.148
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
Loading...
Searching...
No Matches
Schema Tree
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.__unnamed85__
 
struct  lysc_node_action.__unnamed85__.__unnamed87__
 
struct  lysc_node_action_inout
 
union  lysc_node_action_inout.__unnamed81__
 
struct  lysc_node_action_inout.__unnamed81__.__unnamed83__
 
struct  lysc_node_anydata
 
union  lysc_node_anydata.__unnamed117__
 
struct  lysc_node_anydata.__unnamed117__.__unnamed119__
 
struct  lysc_node_case
 
union  lysc_node_case.__unnamed97__
 
struct  lysc_node_case.__unnamed97__.__unnamed99__
 
struct  lysc_node_choice
 
union  lysc_node_choice.__unnamed101__
 
struct  lysc_node_choice.__unnamed101__.__unnamed103__
 
struct  lysc_node_container
 
union  lysc_node_container.__unnamed93__
 
struct  lysc_node_container.__unnamed93__.__unnamed95__
 
struct  lysc_node_leaf
 
union  lysc_node_leaf.__unnamed105__
 
struct  lysc_node_leaf.__unnamed105__.__unnamed107__
 
struct  lysc_node_leaflist
 
union  lysc_node_leaflist.__unnamed109__
 
struct  lysc_node_leaflist.__unnamed109__.__unnamed111__
 
struct  lysc_node_list
 
union  lysc_node_list.__unnamed113__
 
struct  lysc_node_list.__unnamed113__.__unnamed115__
 
struct  lysc_node_notif
 
union  lysc_node_notif.__unnamed89__
 
struct  lysc_node_notif.__unnamed89__.__unnamed91__
 
struct  lysc_pattern
 
struct  lysc_prefix
 Compiled prefix data pair mapping of prefixes to modules. In case the format is LY_VALUE_SCHEMA_RESOLVED, the expected prefix data is a sized array of these structures. More...
 
struct  lysc_range
 
struct  lysc_revision
 Compiled YANG revision statement. More...
 
struct  lysc_type
 
struct  lysc_type_bin
 
struct  lysc_type_bitenum_item
 
union  lysc_type_bitenum_item.__unnamed79__
 
struct  lysc_type_bits
 
struct  lysc_type_dec
 
struct  lysc_type_enum
 
struct  lysc_type_identityref
 
struct  lysc_type_instanceid
 
struct  lysc_type_leafref
 
struct  lysc_type_num
 
struct  lysc_type_str
 
struct  lysc_type_union
 
struct  lysc_when
 YANG when-stmt. More...
 
struct  lysp_deviate
 Generic deviate structure to get type and cast to lysp_deviate_* structure. More...
 
struct  lysp_deviate_add
 
struct  lysp_deviate_del
 
struct  lysp_deviate_rpl
 
struct  lysp_deviation
 
struct  lysp_ext
 YANG extension-stmt. More...
 
struct  lysp_feature
 YANG feature-stmt. More...
 
struct  lysp_ident
 YANG identity-stmt. More...
 
struct  lysp_import
 YANG import-stmt. More...
 
struct  lysp_include
 YANG include-stmt. More...
 
struct  lysp_module
 Printable YANG schema tree structure representing YANG module. More...
 
struct  lysp_node
 Generic YANG data node. More...
 
struct  lysp_node_action
 YANG rpc-stmt and action-stmt. More...
 
union  lysp_node_action.__unnamed59__
 
struct  lysp_node_action.__unnamed59__.__unnamed61__
 
struct  lysp_node_action_inout
 YANG input-stmt and output-stmt. More...
 
union  lysp_node_action_inout.__unnamed55__
 
struct  lysp_node_action_inout.__unnamed55__.__unnamed57__
 
struct  lysp_node_anydata
 
union  lysp_node_anydata.__unnamed47__
 
struct  lysp_node_anydata.__unnamed47__.__unnamed49__
 
struct  lysp_node_augment
 YANG uses-augment-stmt and augment-stmt (compatible with struct lysp_node ) More...
 
union  lysp_node_augment.__unnamed71__
 
struct  lysp_node_augment.__unnamed71__.__unnamed73__
 
struct  lysp_node_case
 
union  lysp_node_case.__unnamed43__
 
struct  lysp_node_case.__unnamed43__.__unnamed45__
 
struct  lysp_node_choice
 
union  lysp_node_choice.__unnamed39__
 
struct  lysp_node_choice.__unnamed39__.__unnamed41__
 
struct  lysp_node_container
 Extension structure of the lysp_node for YANG container. More...
 
union  lysp_node_container.__unnamed23__
 
struct  lysp_node_container.__unnamed23__.__unnamed25__
 
struct  lysp_node_grp
 YANG grouping-stmt. More...
 
union  lysp_node_grp.__unnamed67__
 
struct  lysp_node_grp.__unnamed67__.__unnamed69__
 
struct  lysp_node_leaf
 
union  lysp_node_leaf.__unnamed27__
 
struct  lysp_node_leaf.__unnamed27__.__unnamed29__
 
struct  lysp_node_leaflist
 
union  lysp_node_leaflist.__unnamed31__
 
struct  lysp_node_leaflist.__unnamed31__.__unnamed33__
 
struct  lysp_node_list
 
union  lysp_node_list.__unnamed35__
 
struct  lysp_node_list.__unnamed35__.__unnamed37__
 
struct  lysp_node_notif
 YANG notification-stmt. More...
 
union  lysp_node_notif.__unnamed63__
 
struct  lysp_node_notif.__unnamed63__.__unnamed65__
 
struct  lysp_node_uses
 
union  lysp_node_uses.__unnamed51__
 
struct  lysp_node_uses.__unnamed51__.__unnamed53__
 
struct  lysp_qname
 Qualified name (optional prefix followed by an identifier). More...
 
struct  lysp_refine
 YANG refine-stmt. More...
 
struct  lysp_restr
 Covers restrictions: range, length, pattern, must. More...
 
struct  lysp_revision
 YANG revision-stmt. More...
 
struct  lysp_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_nodelys_find_child (const struct lysc_node *parent, const struct lys_module *module, const char *name, size_t name_len, uint16_t nodetype, uint32_t options)
 Get child node according to the specified criteria.
 
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_nodelys_find_path (const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *path, ly_bool output)
 Get a schema node based on the given data path (JSON format, see XPath Addressing).
 
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_nodelys_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_nodelys_getnext_ext (const struct lysc_node *last, const struct lysc_node *parent, const struct lysc_ext_instance *ext, uint32_t options)
 Get next schema (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_nodelysc_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_whenlysc_has_when (const struct lysc_node *node)
 Check whether the schema node data instance existence depends on any when conditions. This node and any direct parent choice and case schema nodes are also examined for when conditions.
 
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_actionlysc_node_actions (const struct lysc_node *node)
 Get the actions/RPCs linked list of the given (compiled) schema node. Decides the node's type and in case it has a actions/RPCs array, returns it.
 
LIBYANG_API_DECL const struct lysc_nodelysc_node_child (const struct lysc_node *node)
 Get the children linked list of the given (compiled) schema node.
 
LIBYANG_API_DECL const struct lysc_nodelysc_node_lref_target (const struct lysc_node *node)
 Get the target node of a leafref node.
 
LIBYANG_API_DECL struct lysc_mustlysc_node_musts (const struct lysc_node *node)
 Get the must statements list if present in the node.
 
LIBYANG_API_DECL const struct lysc_node_notiflysc_node_notifs (const struct lysc_node *node)
 Get the Notifications linked list of the given (compiled) schema node. Decides the node's type and in case it has a Notifications array, returns it.
 
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_modulelysc_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_featurelysp_feature_next (const struct lysp_feature *last, const struct lysp_module *pmod, uint32_t *idx)
 Get the next feature in the module or submodules.
 
LIBYANG_API_DECL const struct lysp_node_actionlysp_node_actions (const struct lysp_node *node)
 Get the actions/RPCs linked list of the given (parsed) schema node. Decides the node's type and in case it has a actions/RPCs array, returns it.
 
LIBYANG_API_DECL const struct lysp_nodelysp_node_child (const struct lysp_node *node)
 Get the children linked list of the given (parsed) schema node. Decides the node's type and in case it has a children list, returns it.
 
LIBYANG_API_DECL const struct lysp_node_grplysp_node_groupings (const struct lysp_node *node)
 Get the groupings linked list of the given (parsed) schema node. Decides the node's type and in case it has a groupings array, returns it.
 
LIBYANG_API_DECL const struct lysp_node_notiflysp_node_notifs (const struct lysp_node *node)
 Get the Notifications linked list of the given (parsed) schema node. Decides the node's type and in case it has a Notifications array, returns it.
 
LIBYANG_API_DECL const struct lysp_tpdflysp_node_typedefs (const struct lysp_node *node)
 Get the typedefs sized array of the given (parsed) schema node. Decides the node's type and in case it has a typedefs array, returns it.
 
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 2088 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 1182 of file tree_schema.h.

Data Fields
const char * argname

argument name, NULL if not specified

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint16_t flags

LYS_STATUS_* value (Schema nodes flags)

struct lys_module * module

module structure

const char * name

extension name

struct lyplg_ext * plugin

Plugin implementing the specific extension

uint32_t refcount

unused, always 1

◆ lysc_ident

struct lysc_ident

YANG identity-stmt.

Definition at line 1209 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 1721 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 1270 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 1398 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 1440 of file tree_schema.h.

Data Fields
union lysc_node_action.__unnamed85__ __unnamed__
struct lysc_node_action_inout input

RPC's/action's input

struct lysc_node_action_inout output

RPC's/action's output

struct lysc_when ** when

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

◆ lysc_node_action.__unnamed85__

union lysc_node_action.__unnamed85__

Definition at line 1441 of file tree_schema.h.

Data Fields
struct lysc_node_action.__unnamed85__.__unnamed87__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_action.__unnamed85__.__unnamed87__

struct lysc_node_action.__unnamed85__.__unnamed87__

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

Data Fields
union lysc_node_action_inout.__unnamed81__ __unnamed__
struct lysc_node * child

first child node (linked list)

struct lysc_must * musts

list of must restrictions (sized array)

◆ lysc_node_action_inout.__unnamed81__

union lysc_node_action_inout.__unnamed81__

Definition at line 1417 of file tree_schema.h.

Data Fields
struct lysc_node_action_inout.__unnamed81__.__unnamed83__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_action_inout.__unnamed81__.__unnamed83__

struct lysc_node_action_inout.__unnamed81__.__unnamed83__

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

Data Fields
union lysc_node_anydata.__unnamed117__ __unnamed__
struct lysc_must * musts

list of must restrictions (sized array)

struct lysc_when ** when

list of pointers to when statements (sized array)

◆ lysc_node_anydata.__unnamed117__

union lysc_node_anydata.__unnamed117__

Definition at line 1689 of file tree_schema.h.

Data Fields
struct lysc_node_anydata.__unnamed117__.__unnamed119__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_anydata.__unnamed117__.__unnamed119__

struct lysc_node_anydata.__unnamed117__.__unnamed119__

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

Data Fields
union lysc_node_case.__unnamed97__ __unnamed__
struct lysc_node * child

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

struct lysc_when ** when

list of pointers to when statements (sized array)

◆ lysc_node_case.__unnamed97__

union lysc_node_case.__unnamed97__

Definition at line 1532 of file tree_schema.h.

Data Fields
struct lysc_node_case.__unnamed97__.__unnamed99__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_case.__unnamed97__.__unnamed99__

struct lysc_node_case.__unnamed97__.__unnamed99__

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

Data Fields
union lysc_node_choice.__unnamed101__ __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.__unnamed101__

union lysc_node_choice.__unnamed101__

Definition at line 1560 of file tree_schema.h.

Data Fields
struct lysc_node_choice.__unnamed101__.__unnamed103__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_choice.__unnamed101__.__unnamed103__

struct lysc_node_choice.__unnamed101__.__unnamed103__

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

Data Fields
union lysc_node_container.__unnamed93__ __unnamed__
struct lysc_node_action * actions

first of actions nodes (linked list)

struct lysc_node * child

first child node (linked list)

struct lysc_must * musts

list of must restrictions (sized array)

struct lysc_node_notif * notifs

first of notifications nodes (linked list)

struct lysc_when ** when

list of pointers to when statements (sized array)

◆ lysc_node_container.__unnamed93__

union lysc_node_container.__unnamed93__

Definition at line 1502 of file tree_schema.h.

Data Fields
struct lysc_node_container.__unnamed93__.__unnamed95__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_container.__unnamed93__.__unnamed95__

struct lysc_node_container.__unnamed93__.__unnamed95__

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

Data Fields
union lysc_node_leaf.__unnamed105__ __unnamed__
struct lyd_value * dflt

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

struct lysc_must * musts

list of must restrictions (sized array)

struct lysc_type * type

type of the leaf node (mandatory)

const char * units

units of the leaf's type

struct lysc_when ** when

list of pointers to when statements (sized array)

◆ lysc_node_leaf.__unnamed105__

union lysc_node_leaf.__unnamed105__

Definition at line 1588 of file tree_schema.h.

Data Fields
struct lysc_node_leaf.__unnamed105__.__unnamed107__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_leaf.__unnamed105__.__unnamed107__

struct lysc_node_leaf.__unnamed105__.__unnamed107__

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

Data Fields
union lysc_node_leaflist.__unnamed109__ __unnamed__
struct lyd_value ** dflts

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

uint32_t max

max-elements constraint

uint32_t min

min-elements constraint

struct lysc_must * musts

list of must restrictions (sized array)

struct lysc_type * type

type of the leaf node (mandatory)

const char * units

units of the leaf's type

struct lysc_when ** when

list of pointers to when statements (sized array)

◆ lysc_node_leaflist.__unnamed109__

union lysc_node_leaflist.__unnamed109__

Definition at line 1619 of file tree_schema.h.

Data Fields
struct lysc_node_leaflist.__unnamed109__.__unnamed111__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_leaflist.__unnamed109__.__unnamed111__

struct lysc_node_leaflist.__unnamed109__.__unnamed111__

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

Data Fields
union lysc_node_list.__unnamed113__ __unnamed__
struct lysc_node_action * actions

first of actions nodes (linked list)

struct lysc_node * child

first child node (linked list)

uint32_t max

max-elements constraint

uint32_t min

min-elements constraint

struct lysc_must * musts

list of must restrictions (sized array)

struct lysc_node_notif * notifs

first of notifications nodes (linked list)

struct lysc_node_leaf *** uniques

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

struct lysc_when ** when

list of pointers to when statements (sized array)

◆ lysc_node_list.__unnamed113__

union lysc_node_list.__unnamed113__

Definition at line 1655 of file tree_schema.h.

Data Fields
struct lysc_node_list.__unnamed113__.__unnamed115__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_list.__unnamed113__.__unnamed115__

struct lysc_node_list.__unnamed113__.__unnamed115__

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

Data Fields
union lysc_node_notif.__unnamed89__ __unnamed__
struct lysc_node * child

first child node (linked list)

struct lysc_must * musts

list of must restrictions (sized array)

struct lysc_when ** when

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

◆ lysc_node_notif.__unnamed89__

union lysc_node_notif.__unnamed89__

Definition at line 1472 of file tree_schema.h.

Data Fields
struct lysc_node_notif.__unnamed89__.__unnamed91__ __unnamed__
struct lysc_node node

implicit cast for the members compatible with lysc_node

◆ lysc_node_notif.__unnamed89__.__unnamed91__

struct lysc_node_notif.__unnamed89__.__unnamed91__

Definition at line 1475 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 1258 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 1170 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 1240 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 1235 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 1280 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lyplg_type * plugin

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

uint32_t refcount

reference counter for type sharing, 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 1382 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lysc_range * length

Optional length limitation

struct lyplg_type * plugin

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

uint32_t refcount

reference counter for type sharing

◆ lysc_type_bitenum_item

struct lysc_type_bitenum_item

Definition at line 1314 of file tree_schema.h.

Data Fields
union lysc_type_bitenum_item.__unnamed79__ __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.__unnamed79__

union lysc_type_bitenum_item.__unnamed79__

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

Data Fields
LY_DATA_TYPE basetype

Base type of the type

struct lysc_type_bitenum_item * bits

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

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lyplg_type * plugin

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

uint32_t refcount

reference counter for type sharing

◆ lysc_type_dec

struct lysc_type_dec

Definition at line 1296 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

struct lysc_ext_instance * exts

list of the extension instances (sized array)

uint8_t fraction_digits

fraction digits specification

struct lyplg_type * plugin

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

struct lysc_range * range

Optional range limitation

uint32_t refcount

reference counter for type sharing

◆ lysc_type_enum

struct lysc_type_enum

Definition at line 1328 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

struct lysc_type_bitenum_item * enums

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

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lyplg_type * plugin

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

uint32_t refcount

reference counter for type sharing

◆ lysc_type_identityref

struct lysc_type_identityref

Definition at line 1357 of file tree_schema.h.

Data Fields
struct lysc_ident ** bases

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

LY_DATA_TYPE basetype

Base type of the type

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lyplg_type * plugin

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

uint32_t refcount

reference counter for type sharing

◆ lysc_type_instanceid

struct lysc_type_instanceid

Definition at line 1366 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lyplg_type * plugin

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

uint32_t refcount

reference counter for type sharing

uint8_t require_instance

require-instance flag

◆ lysc_type_leafref

struct lysc_type_leafref

Definition at line 1345 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

const struct lys_module * cur_mod

unused, not needed

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lyxp_expr * path

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

struct lyplg_type * plugin

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

struct lysc_prefix * prefixes

resolved prefixes used in the path

struct lysc_type * realtype

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

uint32_t refcount

reference counter for type sharing

uint8_t require_instance

require-instance flag

◆ lysc_type_num

struct lysc_type_num

Definition at line 1288 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lyplg_type * plugin

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

struct lysc_range * range

Optional range limitation

uint32_t refcount

reference counter for type sharing

◆ lysc_type_str

struct lysc_type_str

Definition at line 1305 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lysc_range * length

Optional length limitation

struct lysc_pattern ** patterns

Optional list of pointers to pattern limitations (sized array)

struct lyplg_type * plugin

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

uint32_t refcount

reference counter for type sharing

◆ lysc_type_union

struct lysc_type_union

Definition at line 1374 of file tree_schema.h.

Data Fields
LY_DATA_TYPE basetype

Base type of the type

struct lysc_ext_instance * exts

list of the extension instances (sized array)

struct lyplg_type * plugin

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

uint32_t refcount

reference counter for type sharing

struct lysc_type ** types

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

◆ lysc_when

struct lysc_when

YANG when-stmt.

Definition at line 1195 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 479 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 485 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 498 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 508 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 520 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 346 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 1098 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 730 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 978 of file tree_schema.h.

Data Fields
union lysp_node_action.__unnamed59__ __unnamed__

common part corresponding to lysp_node

struct lysp_node_grp * groupings

list of groupings (linked list)

struct lysp_node_action_inout input

RPC's/Action's input

struct lysp_node_action_inout output

RPC's/Action's output

struct lysp_tpdf * typedefs

list of typedefs (sized array)

◆ lysp_node_action.__unnamed59__

union lysp_node_action.__unnamed59__

Definition at line 979 of file tree_schema.h.

Data Fields
struct lysp_node_action.__unnamed59__.__unnamed61__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_action.__unnamed59__.__unnamed61__

struct lysp_node_action.__unnamed59__.__unnamed61__

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

Data Fields
union lysp_node_action_inout.__unnamed55__ __unnamed__

common part corresponding to lysp_node

struct lysp_node * child

list of data nodes (linked list)

struct lysp_node_grp * groupings

list of groupings (linked list)

struct lysp_restr * musts

list of must restrictions (sized array)

struct lysp_tpdf * typedefs

list of typedefs (sized array)

◆ lysp_node_action_inout.__unnamed55__

union lysp_node_action_inout.__unnamed55__

Definition at line 952 of file tree_schema.h.

Data Fields
struct lysp_node_action_inout.__unnamed55__.__unnamed57__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_action_inout.__unnamed55__.__unnamed57__

struct lysp_node_action_inout.__unnamed55__.__unnamed57__

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

Data Fields
union lysp_node_anydata.__unnamed47__ __unnamed__

common part corresponding to lysp_node

struct lysp_restr * musts

list of must restrictions (sized array)

struct lysp_when * when

when statement

◆ lysp_node_anydata.__unnamed47__

union lysp_node_anydata.__unnamed47__

Definition at line 904 of file tree_schema.h.

Data Fields
struct lysp_node_anydata.__unnamed47__.__unnamed49__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_anydata.__unnamed47__.__unnamed49__

struct lysp_node_anydata.__unnamed47__.__unnamed49__

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

Data Fields
union lysp_node_augment.__unnamed71__ __unnamed__

common part corresponding to lysp_node

struct lysp_node_action * actions

list of actions (linked list)

struct lysp_node * child

list of data nodes (linked list)

struct lysp_node_notif * notifs

list of notifications (linked list)

struct lysp_when * when

when statement

◆ lysp_node_augment.__unnamed71__

union lysp_node_augment.__unnamed71__

Definition at line 1062 of file tree_schema.h.

Data Fields
struct lysp_node_augment.__unnamed71__.__unnamed73__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_augment.__unnamed71__.__unnamed73__

struct lysp_node_augment.__unnamed71__.__unnamed73__

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

Data Fields
union lysp_node_case.__unnamed43__ __unnamed__

common part corresponding to lysp_node

struct lysp_node * child

list of data nodes (linked list)

struct lysp_when * when

when statement

◆ lysp_node_case.__unnamed43__

union lysp_node_case.__unnamed43__

Definition at line 882 of file tree_schema.h.

Data Fields
struct lysp_node_case.__unnamed43__.__unnamed45__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_case.__unnamed43__.__unnamed45__

struct lysp_node_case.__unnamed43__.__unnamed45__

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

Data Fields
union lysp_node_choice.__unnamed39__ __unnamed__

common part corresponding to lysp_node

struct lysp_node * child

list of data nodes (linked list)

struct lysp_qname dflt

default case

struct lysp_when * when

when statement

◆ lysp_node_choice.__unnamed39__

union lysp_node_choice.__unnamed39__

Definition at line 859 of file tree_schema.h.

Data Fields
struct lysp_node_choice.__unnamed39__.__unnamed41__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_choice.__unnamed39__.__unnamed41__

struct lysp_node_choice.__unnamed39__.__unnamed41__

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

Data Fields
union lysp_node_container.__unnamed23__ __unnamed__

common part corresponding to lysp_node

struct lysp_node_action * actions

list of actions (linked list)

struct lysp_node * child

list of data nodes (linked list)

struct lysp_node_grp * groupings

list of groupings (linked list)

struct lysp_restr * musts

list of must restrictions (sized array)

struct lysp_node_notif * notifs

list of notifications (linked list)

const char * presence

presence description

struct lysp_tpdf * typedefs

list of typedefs (sized array)

struct lysp_when * when

when statement

◆ lysp_node_container.__unnamed23__

union lysp_node_container.__unnamed23__

Definition at line 747 of file tree_schema.h.

Data Fields
struct lysp_node_container.__unnamed23__.__unnamed25__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_container.__unnamed23__.__unnamed25__

struct lysp_node_container.__unnamed23__.__unnamed25__

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

Data Fields
union lysp_node_grp.__unnamed67__ __unnamed__

common part corresponding to lysp_node

struct lysp_node_action * actions

list of actions (linked list)

struct lysp_node * child

list of data nodes (linked list)

struct lysp_node_grp * groupings

list of groupings (linked list)

struct lysp_node_notif * notifs

list of notifications (linked list)

struct lysp_tpdf * typedefs

list of typedefs (sized array)

◆ lysp_node_grp.__unnamed67__

union lysp_node_grp.__unnamed67__

Definition at line 1034 of file tree_schema.h.

Data Fields
struct lysp_node_grp.__unnamed67__.__unnamed69__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_grp.__unnamed67__.__unnamed69__

struct lysp_node_grp.__unnamed67__.__unnamed69__

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

Data Fields
union lysp_node_leaf.__unnamed27__ __unnamed__

common part corresponding to lysp_node

struct lysp_qname dflt

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

struct lysp_restr * musts

list of must restrictions (sized array)

struct lysp_type type

type of the leaf node (mandatory)

const char * units

units of the leaf's type

struct lysp_when * when

when statement

◆ lysp_node_leaf.__unnamed27__

union lysp_node_leaf.__unnamed27__

Definition at line 775 of file tree_schema.h.

Data Fields
struct lysp_node_leaf.__unnamed27__.__unnamed29__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_leaf.__unnamed27__.__unnamed29__

struct lysp_node_leaf.__unnamed27__.__unnamed29__

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

Data Fields
union lysp_node_leaflist.__unnamed31__ __unnamed__

common part corresponding to lysp_node

struct lysp_qname * dflts

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

uint32_t max

max-elements constraint, 0 means unbounded

uint32_t min

min-elements constraint

struct lysp_restr * musts

list of must restrictions (sized array)

struct lysp_type type

type of the leaf node (mandatory)

const char * units

units of the leaf's type

struct lysp_when * when

when statement

◆ lysp_node_leaflist.__unnamed31__

union lysp_node_leaflist.__unnamed31__

Definition at line 800 of file tree_schema.h.

Data Fields
struct lysp_node_leaflist.__unnamed31__.__unnamed33__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_leaflist.__unnamed31__.__unnamed33__

struct lysp_node_leaflist.__unnamed31__.__unnamed33__

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

Data Fields
union lysp_node_list.__unnamed35__ __unnamed__

common part corresponding to lysp_node

struct lysp_node_action * actions

list of actions (linked list)

struct lysp_node * child

list of data nodes (linked list)

struct lysp_node_grp * groupings

list of groupings (linked list)

const char * key

keys specification

uint32_t max

max-elements constraint, 0 means unbounded

uint32_t min

min-elements constraint

struct lysp_restr * musts

list of must restrictions (sized array)

struct lysp_node_notif * notifs

list of notifications (linked list)

struct lysp_tpdf * typedefs

list of typedefs (sized array)

struct lysp_qname * uniques

list of unique specifications (sized array)

struct lysp_when * when

when statement

◆ lysp_node_list.__unnamed35__

union lysp_node_list.__unnamed35__

Definition at line 828 of file tree_schema.h.

Data Fields
struct lysp_node_list.__unnamed35__.__unnamed37__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_list.__unnamed35__.__unnamed37__

struct lysp_node_list.__unnamed35__.__unnamed37__

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

Data Fields
union lysp_node_notif.__unnamed63__ __unnamed__

common part corresponding to lysp_node

struct lysp_node * child

list of data nodes (linked list)

struct lysp_node_grp * groupings

list of groupings (linked list)

struct lysp_restr * musts

list of must restrictions (sized array)

struct lysp_tpdf * typedefs

list of typedefs (sized array)

◆ lysp_node_notif.__unnamed63__

union lysp_node_notif.__unnamed63__

Definition at line 1007 of file tree_schema.h.

Data Fields
struct lysp_node_notif.__unnamed63__.__unnamed65__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_notif.__unnamed63__.__unnamed65__

struct lysp_node_notif.__unnamed63__.__unnamed65__

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

Data Fields
union lysp_node_uses.__unnamed51__ __unnamed__

common part corresponding to lysp_node

struct lysp_node_augment * augments

list of augments (linked list)

struct lysp_refine * refines

list of uses's refines (sized array)

struct lysp_when * when

when statement

◆ lysp_node_uses.__unnamed51__

union lysp_node_uses.__unnamed51__

Definition at line 926 of file tree_schema.h.

Data Fields
struct lysp_node_uses.__unnamed51__.__unnamed53__ __unnamed__
struct lysp_node node

implicit cast for the members compatible with lysp_node

◆ lysp_node_uses.__unnamed51__.__unnamed53__

struct lysp_node_uses.__unnamed51__.__unnamed53__

Definition at line 929 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
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 448 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 359 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 375 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 1122 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 424 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 401 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 385 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 438 of file tree_schema.h.

Data Fields
const char * cond

specified condition (mandatory)

const char * dsc

description statement

struct lysp_ext_instance * exts

list of the extension instances (sized array)

const char * ref

reference statement

Macro Definition Documentation

◆ _LYSC_TREE_DFS_NEXT

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

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

◆ lysc_data_parent

#define lysc_data_parent ( SCHEMA)
Value:
lysc_data_node((SCHEMA) ? (SCHEMA)->parent : NULL)
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 1778 of file tree_schema.h.

◆ lysc_is_dup_inst_list

#define lysc_is_dup_inst_list ( lysc_node)
Value:
#define LYS_LEAFLIST
#define LYS_LIST
uint16_t nodetype
uint16_t flags
#define LYS_CONFIG_W
#define LYS_KEYLESS

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

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

Definition at line 1763 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)
#define LYS_LEAF
#define LYS_KEY

Examine whether a node is a list's key.

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

Definition at line 1745 of file tree_schema.h.

◆ lysc_is_np_cont

#define lysc_is_np_cont ( lysc_node)
Value:
#define LYS_CONTAINER
#define LYS_PRESENCE

Examine whether a node is a non-presence container.

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

Definition at line 1754 of file tree_schema.h.

◆ lysc_is_userordered

#define lysc_is_userordered ( lysc_node)
Value:
#define LYS_ORDBY_USER

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

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

Definition at line 1736 of file tree_schema.h.

◆ LYSC_TREE_DFS_BEGIN

#define LYSC_TREE_DFS_BEGIN ( START,
ELEM )
Value:
{ ly_bool LYSC_TREE_DFS_continue = 0; struct lysc_node *LYSC_TREE_DFS_next; \
for ((ELEM) = (LYSC_TREE_DFS_next) = (struct lysc_node *)(START); \
(ELEM); \
(ELEM) = (LYSC_TREE_DFS_next), LYSC_TREE_DFS_continue = 0)
uint8_t ly_bool
Type to indicate boolean value.
Definition log.h: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
STARTPointer to the starting element processed first.
ELEMIterator 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); \
} }
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
STARTPointer to the starting element processed first.
ELEMIterator 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)
Printable YANG schema tree structure representing YANG module.

Get the parsed module or submodule name.

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

Definition at line 1164 of file tree_schema.h.

Typedef Documentation

◆ LYS_VERSION

typedef enum LYS_VERSION LYS_VERSION

supported YANG schema version values

◆ lysc_dfs_clb

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

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

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

Definition at line 1904 of file tree_schema.h.

Enumeration Type Documentation

◆ 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

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

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

◆ LYSC_PATH_TYPE

Types of the different schema paths.

Enumerator
LYSC_PATH_LOG 

Descriptive path format used in log messages

LYSC_PATH_DATA 

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

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 2065 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]moduleModule where the feature is defined.
[in]featureName of the feature to inspect.
Returns
LY_SUCCESS if the feature is enabled,
LY_ENOT if the feature is disabled,
LY_ENOTFOUND if the feature was not found.

◆ lys_find_child()

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

◆ lys_find_expr_atoms()

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

◆ lys_find_lypath_atoms()

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]pathCompiled path to use.
[out]setSet of found atoms (schema nodes).
Returns
LY_SUCCESS on success, set is returned.
LY_ERR value on error.

◆ lys_find_path()

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

◆ lys_find_path_atoms()

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

◆ lys_find_xpath()

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

◆ lys_find_xpath_atoms()

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

◆ lys_getnext()

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]lastPreviously returned schema tree node, or NULL in case of the first call.
[in]parentParent of the subtree to iterate over. If set, module is ignored.
[in]moduleModule of the top level elements to iterate over. If parent is NULL, it must be specified.
[in]optionsORed 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]lastPreviously returned schema tree node, or NULL in case of the first call.
[in]parentParent of the subtree to iterate over. If set, ext is ignored.
[in]extExtension instance with schema nodes to iterate over. If parent is NULL, it must be specified.
[in]optionsORed 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]identCompiled 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]nodetypeNodetype 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]ctxlibyang context where to process the data model.
[in]inThe input handle to provide the dumped data model in the specified format.
[in]formatFormat of the schema to parse. Can be 0 to try to detect format from the input handler.
[in]featuresArray of features to enable ended with NULL. If NULL, no features are enabled.
[out]moduleOptional parsed module.
Returns
LY_ERR value.

◆ lys_parse_fd()

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]ctxlibyang context where to process the data model.
[in]fdFile descriptor of a regular file (e.g. sockets are not supported) containing the schema in the specified format.
[in]formatFormat of the schema to parse.
[out]moduleOptional 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]ctxlibyang context where to process the data model.
[in]dataThe string containing the dumped data model in the specified format.
[in]formatFormat of the schema to parse.
[out]moduleOptional 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]ctxlibyang context where to process the data model.
[in]pathPath to the file with the model in the specified format.
[in]formatFormat of the schema to parse.
[out]moduleOptional 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]moduleSchema tree to print.
[in]writeclbCallback function to write the data (see write(1)).
[in]user_dataOptional caller-specific argument to be passed to the writeclb callback.
[in]formatSchema output format.
[in]optionsSchema output options (see Schema output options).
Returns
LY_ERR value.

◆ lys_print_fd()

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]fdFile descriptor where to print the data.
[in]moduleSchema tree to print.
[in]formatSchema output format.
[in]optionsSchema output options (see Schema output options).
Returns
LY_ERR value.

◆ lys_print_file()

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]moduleSchema tree to print.
[in]fFile stream where to print the schema.
[in]formatSchema output format.
[in]optionsSchema output options (see Schema output options).
Returns
LY_ERR value.

◆ lys_print_mem()

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]strpPointer to store the resulting dump.
[in]moduleSchema tree to print.
[in]formatSchema output format.
[in]optionsSchema output options (see Schema output options).
Returns
LY_ERR value.

◆ lys_print_module()

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

◆ lys_print_node()

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

◆ lys_print_path()

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]pathFile where to print the schema.
[in]moduleSchema tree to print.
[in]formatSchema output format.
[in]optionsSchema output options (see Schema output options).
Returns
LY_ERR value.

◆ lys_print_submodule()

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

◆ lys_search_localfile()

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

◆ lys_set_implemented()

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

◆ lysc_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]schemaSchema 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]nodeSchema 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]iffCompiled if-feature statement to evaluate.
Returns
LY_SUCCESS if the statement evaluates to true,
LY_ENOT if it evaluates to false,
LY_ERR on error.

◆ lysc_module_dfs_full()

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]modModule to fully traverse.
[in]dfs_clbCallback to call for each node.
[in]dataArbitrary user data passed to dfs_clb.
Returns
LY_SUCCESS on success,
LY_ERR value returned by dfs_clb.

◆ lysc_node_actions()

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]nodeNode 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]nodeNode to examine.
Returns
Children linked list if any,
NULL otherwise.

◆ 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.

Parameters
[in]nodeLeafref node.
Returns
Leafref target, NULL on any 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]nodeNode to examine.
Returns
Pointer to the list of must restrictions (sized array)
NULL if there is no must statement in the node, no matter if it is not even allowed or just present

◆ lysc_node_notifs()

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]nodeNode 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]nodeNode to examine.
Returns
Pointer to the list of pointers to when statements (sized array)
NULL if there is no when statement in the node, no matter if it is not even allowed or just present

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

◆ lysc_tree_dfs_full()

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]rootSchema root to fully traverse.
[in]dfs_clbCallback to call for each node.
[in]dataArbitrary user data passed to dfs_clb.
Returns
LY_SUCCESS on success,
LY_ERR value returned by dfs_clb.

◆ lysp_feature_next()

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]lastLast returned feature.
[in]pmodParsed module and submodules whose features to iterate over.
[in,out]idxSubmodule index, set to 0 on first call.
Returns
Next found feature, NULL if the last has already been returned.

◆ lysp_node_actions()

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]nodeNode 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]nodeNode 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]nodeNode 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]nodeNode 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]nodeNode 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]pathParsed expression.
Returns
Original string expression.