libyang  1.0.253
YANG data modeling language library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Data parser options
Collaboration diagram for Data parser options:

Macros

#define LYD_OPT_DATA   0x00
 
#define LYD_OPT_CONFIG   0x01
 
#define LYD_OPT_GET   0x02
 
#define LYD_OPT_GETCONFIG   0x04
 
#define LYD_OPT_EDIT   0x08
 
#define LYD_OPT_RPC   0x10
 
#define LYD_OPT_RPCREPLY   0x20
 
#define LYD_OPT_NOTIF   0x40
 
#define LYD_OPT_NOTIF_FILTER   0x80
 
#define LYD_OPT_TYPEMASK   0x10000ff
 
#define LYD_OPT_STRICT   0x0200
 
#define LYD_OPT_DESTRUCT   0x0400
 
#define LYD_OPT_OBSOLETE   0x0800
 
#define LYD_OPT_NOSIBLINGS   0x1000
 
#define LYD_OPT_TRUSTED   0x2000
 
#define LYD_OPT_WHENAUTODEL   0x4000
 
#define LYD_OPT_NOEXTDEPS   0x8000
 
#define LYD_OPT_DATA_NO_YANGLIB   0x10000
 
#define LYD_OPT_DATA_ADD_YANGLIB   0x20000
 
#define LYD_OPT_VAL_DIFF   0x40000
 
#define LYD_OPT_LYB_MOD_UPDATE   0x80000
 
#define LYD_OPT_DATA_TEMPLATE   0x1000000
 
#define LYD_OPT_MULTI_ERRORS   0x2000000
 

Detailed Description

Various options to change the data tree parsers behavior.

Default behavior:

Macro Definition Documentation

#define LYD_OPT_DATA   0x00

Default type of data - complete datastore content with configuration as well as state data. To handle possibly missing (but by default required) ietf-yang-library data, use LYD_OPT_DATA_NO_YANGLIB or LYD_OPT_DATA_ADD_YANGLIB options.

Definition at line 496 of file tree_data.h.

#define LYD_OPT_CONFIG   0x01

A configuration datastore - complete datastore without state data. Validation modifications:

  • status data are not allowed

Definition at line 501 of file tree_data.h.

#define LYD_OPT_GET   0x02

Data content from a NETCONF reply message to the NETCONF <get> operation. Validation modifications:

  • mandatory nodes can be omitted
  • leafrefs and instance-identifier resolution is allowed to fail
  • list's keys/unique nodes are not required (so duplication is not checked)
  • must and when evaluation skipped

Definition at line 506 of file tree_data.h.

#define LYD_OPT_GETCONFIG   0x04

Data content from a NETCONF reply message to the NETCONF <get-config> operation Validation modifications:

  • mandatory nodes can be omitted
  • leafrefs and instance-identifier resolution is allowed to fail
  • list's keys/unique nodes are not required (so duplication is not checked)
  • must and when evaluation skipped
  • status data are not allowed

Definition at line 517 of file tree_data.h.

#define LYD_OPT_EDIT   0x08

Content of the NETCONF <edit-config>'s config element. Validation modifications:

  • mandatory nodes can be omitted
  • leafrefs and instance-identifier resolution is allowed to fail
  • must and when evaluation skipped
  • status data are not allowed

Definition at line 530 of file tree_data.h.

#define LYD_OPT_RPC   0x10

Data represents RPC or action input parameters. In case of an action, only the parent nodes are expected (RFC ref). For validation an additional data tree with the references should be provided.

Definition at line 541 of file tree_data.h.

#define LYD_OPT_RPCREPLY   0x20

Data represents RPC or action output parameters (maps to NETCONF <rpc-reply> data).

Definition at line 546 of file tree_data.h.

#define LYD_OPT_NOTIF   0x40

Data represents an event notification data. In case of a nested notification, only the parent nodes are expected (RFC ref). For validation an additional data tree with the references should be provided.

Definition at line 547 of file tree_data.h.

#define LYD_OPT_NOTIF_FILTER   0x80

Data represents a filtered event notification data. Validation modification:

  • the only requirement is that the data tree matches the schema tree

Definition at line 552 of file tree_data.h.

#define LYD_OPT_TYPEMASK   0x10000ff

Mask to filter data type options. Always only a single data type option (only single bit from the lower 8 bits) can be set.

Definition at line 557 of file tree_data.h.

#define LYD_OPT_STRICT   0x0200

Instead of silent ignoring data without schema definition, raise an error.

Definition at line 562 of file tree_data.h.

#define LYD_OPT_DESTRUCT   0x0400

Free the provided XML tree during parsing the data. With this option, the provided XML tree is affected and all successfully parsed data are freed. This option is applicable only to lyd_parse_xml() function.

Definition at line 563 of file tree_data.h.

#define LYD_OPT_OBSOLETE   0x0800

Raise an error when an obsolete statement (status set to obsolete) is used.

Definition at line 568 of file tree_data.h.

#define LYD_OPT_NOSIBLINGS   0x1000

Parse only a single XML tree from the input. This option applies only to XML input data.

Definition at line 569 of file tree_data.h.

#define LYD_OPT_TRUSTED   0x2000

Data comes from a trusted source and it is not needed to validate them. Data are connected with the schema, but the most validation checks (mandatory nodes, list instance uniqueness, etc.) are not performed. This option does not make sense for lyd_validate() so it is ignored by this function.

Definition at line 572 of file tree_data.h.

#define LYD_OPT_WHENAUTODEL   0x4000

Automatically delete subtrees with false when-stmt condition. The flag is applicable only in combination with LYD_OPT_DATA and LYD_OPT_CONFIG flags. If used, libyang will not generate a validation error.

Definition at line 579 of file tree_data.h.

#define LYD_OPT_NOEXTDEPS   0x8000

Allow external dependencies (external leafrefs, instance-identifiers, must, and when) to not be resolved/satisfied during validation.

Definition at line 584 of file tree_data.h.

#define LYD_OPT_DATA_NO_YANGLIB   0x10000

Ignore (possibly) missing ietf-yang-library data. Applicable only with LYD_OPT_DATA.

Definition at line 587 of file tree_data.h.

#define LYD_OPT_DATA_ADD_YANGLIB   0x20000

Add missing ietf-yang-library data into the validated data tree. Applicable only with LYD_OPT_DATA. If some ietf-yang-library data are present, they are preserved and option is ignored.

Definition at line 588 of file tree_data.h.

#define LYD_OPT_VAL_DIFF   0x40000

Flag only for validation, store all the data node changes performed by the validation in a diff structure.

Definition at line 593 of file tree_data.h.

#define LYD_OPT_LYB_MOD_UPDATE   0x80000

Allow to parse data using an updated revision of a module, relevant only for LYB format.

Definition at line 596 of file tree_data.h.

#define LYD_OPT_DATA_TEMPLATE   0x1000000

Data represents YANG data template.

Definition at line 597 of file tree_data.h.

#define LYD_OPT_MULTI_ERRORS   0x2000000

Report all validation errors instead of the first one. Applicable only in combination with LYD_OPT_DATA and LYD_OPT_CONFIG flags. And, the logopts need support storing multiple error messages. NOTE: Only some kinds of validation error are supported: must, unique, unresolved union and unresolved instance-identifier.

Definition at line 598 of file tree_data.h.