23#include "Internal.hpp"
51 const char *
name() {
return module->name;};
53 const char *
prefix() {
return module->prefix;};
55 const char *
dsc() {
return module->dsc;};
57 const char *
ref() {
return module->ref;};
59 const char *
org() {
return module->org;};
61 const char *
contact() {
return module->contact;};
63 const char *
filepath() {
return module->filepath;};
65 uint8_t
type() {
return module->type;};
67 uint8_t
version() {
return module->version;};
95 const char *
ns() {
return module->ns;};
136 const
char *
name() {
return submodule->name;};
138 const char *
prefix() {
return submodule->prefix;};
140 const char *
dsc() {
return submodule->dsc;};
142 const char *
ref() {
return submodule->ref;};
144 const char *
org() {
return submodule->org;};
146 const char *
contact() {
return submodule->contact;};
148 const char *
filepath() {
return submodule->filepath;};
150 uint8_t
type() {
return submodule->type;};
152 uint8_t
version() {
return submodule->version;};
212 const char *
name() {
return info_bit->name;};
214 const char *
dsc() {
return info_bit->dsc;};
216 const char *
ref() {
return info_bit->ref;};
218 uint16_t
flags() {
return info_bit->flags;};
224 uint32_t
pos() {
return info_bit->pos;};
226 std::vector<S_Ext_Instance> ext();
228 std::vector<S_Iffeature> iffeature();
242 std::vector<S_Type_Bit>
bit();
244 unsigned int count() {
return info_bits->count;};
260 uint8_t
dig() {
return info_dec64->dig;}
262 uint8_t
div() {
return info_dec64->div;}
276 const char *
name() {
return info_enum->name;};
278 const char *
dsc() {
return info_enum->dsc;};
280 const char *
ref() {
return info_enum->ref;};
282 uint16_t
flags() {
return info_enum->flags;};
288 int32_t
value() {
return info_enum->value;};
290 std::vector<S_Ext_Instance> ext();
292 std::vector<S_Iffeature> iffeature();
306 std::vector<S_Type_Enum>
enm();
308 unsigned int count() {
return info_enums->count;};
322 std::vector<S_Ident>
ref();
324 int count() {
return info_ident->count;};
338 int8_t
req() {
return info_inst->req;};
366 const char *
path() {
return info_lref->path;};
368 S_Schema_Node_Leaf target();
370 int8_t
req() {
return info_lref->req;};
402 std::vector<S_Type>
types();
404 int count() {
return info_union->count;};
420 S_Type_Info_Binary
binary();
422 S_Type_Info_Bits
bits();
424 S_Type_Info_Dec64
dec64();
426 S_Type_Info_Enums
enums();
428 S_Type_Info_Ident
ident();
430 S_Type_Info_Inst
inst();
432 S_Type_Info_Num
num();
434 S_Type_Info_Lref
lref();
436 S_Type_Info_Str
str();
438 S_Type_Info_Union
uni();
458 std::vector<S_Ext_Instance> ext();
477 uint8_t *
expr() {
return iffeature->expr;};
481 std::vector<S_Ext_Instance> ext();
498 const char *
arg_value() {
return ext_instance->arg_value;};
500 uint16_t
flags() {
return ext_instance->flags;};
502 uint8_t
ext_size() {
return ext_instance->ext_size;};
510 uint8_t
ext_type() {
return ext_instance->ext_type;};
512 std::vector<S_Ext_Instance> ext();
516 void *
priv() {
return ext_instance->priv;};
533 const char *
name() {
return node->name;};
535 const char *
dsc() {
return node->dsc;};
537 const char *
ref() {
return node->ref;};
539 uint16_t
flags() {
return node->flags;};
545 std::vector<S_Ext_Instance> ext();
553 virtual S_Schema_Node parent();
555 virtual S_Schema_Node child();
557 virtual S_Schema_Node next();
559 virtual S_Schema_Node prev();
562 std::string path(
int options = 0);
566 std::vector<S_Schema_Node> child_instantiables(
int options);
568 S_Set find_path(
const char *path);
570 S_Set xpath_atomize(
enum lyxp_node_type ctx_node_type,
const char *expr,
int options);
572 S_Set xpath_atomize(
int options);
577 std::vector<S_Schema_Node> tree_for();
579 std::vector<S_Schema_Node> tree_dfs();
614 deleter(derived->deleter)
617 throw std::invalid_argument(
"Type must be LYS_CONTAINER");
647 deleter(derived->deleter)
650 throw std::invalid_argument(
"Type must be LYS_CHOICE");
663 S_Schema_Node dflt();
676 deleter(derived->deleter)
678 if (derived->node->nodetype !=
LYS_LEAF) {
679 throw std::invalid_argument(
"Type must be LYS_LEAF");
697 S_Schema_Node
child()
override {
return nullptr;};
699 S_Schema_Node_List is_key();
712 deleter(derived->deleter)
715 throw std::invalid_argument(
"Type must be LYS_LEAFLIST");
732 std::vector<S_Restr> must();
738 std::vector<std::string> dflt();
743 S_Schema_Node
child()
override {
return nullptr;};
756 deleter(derived->deleter)
758 if (derived->node->nodetype !=
LYS_LIST) {
759 throw std::invalid_argument(
"Type must be LYS_LIST");
780 std::vector<S_Restr> must();
782 std::vector<S_Tpdf> tpdf();
784 std::vector<S_Schema_Node_Leaf> keys();
786 std::vector<S_Unique> unique();
805 deleter(derived->deleter)
808 throw std::invalid_argument(
"Type must be LYS_ANYDATA or LYS_ANYXML");
823 std::vector<S_Restr> must();
836 deleter(derived->deleter)
838 if (derived->node->nodetype !=
LYS_USES) {
839 throw std::invalid_argument(
"Type must be LYS_USES");
854 std::vector<S_Refine> refine();
856 std::vector<S_Schema_Node_Augment> augment();
858 S_Schema_Node_Grp grp();
871 deleter(derived->deleter)
874 throw std::invalid_argument(
"Type must be LYS_GROUPING");
887 std::vector<S_Tpdf> tpdf();
900 deleter(derived->deleter)
902 if (derived->node->nodetype !=
LYS_CASE) {
903 throw std::invalid_argument(
"Type must be LYS_CASE");
927 deleter(derived->deleter)
930 throw std::invalid_argument(
"Type must be LYS_INOUT or LYS_OUTPUT");
945 std::vector<S_Tpdf> tpdf();
947 std::vector<S_Restr> must();
960 deleter(derived->deleter)
962 if (derived->node->nodetype !=
LYS_NOTIF) {
963 throw std::invalid_argument(
"Type must be LYS_NOTIF");
978 std::vector<S_Tpdf> tpdf();
980 std::vector<S_Restr> must();
993 deleter(derived->deleter)
995 if (derived->node->nodetype !=
LYS_ACTION && derived->node->nodetype !=
LYS_RPC) {
996 throw std::invalid_argument(
"Type must be LYS_ACTION or LYS_RPC");
1009 std::vector<S_Tpdf> tpdf();
1021 node(derived->node),
1022 deleter(derived->deleter)
1025 throw std::invalid_argument(
"Type must be LYS_AUGMENT");
1069 const char *
name() {
return ext->name;};
1071 const char *
dsc() {
return ext->dsc;};
1073 const char *
ref() {
return ext->ref;};
1079 std::vector<S_Ext_Instance> ext_instance();
1097 uint32_t
min() {
return list->min;};
1099 uint32_t
max() {
return list->max;};
1115 S_Refine_Mod_List list();
1119 uint16_t target_type;
1132 const char *
dsc() {
return refine->dsc;};
1134 const char *
ref() {
return refine->ref;};
1136 uint16_t
flags() {
return refine->flags;};
1148 std::vector<S_Ext_Instance> ext();
1154 std::vector<S_Restr>
must();
1174 uint8_t
flags() {
return deviate->flags;};
1188 uint32_t
min() {
return deviate->min;};
1190 uint32_t
max() {
return deviate->max;};
1198 const char *
units() {
return deviate->units;};
1202 std::vector<S_Ext_Instance>
ext();
1218 const char *
dsc() {
return deviation->dsc;};
1220 const char *
ref() {
return deviation->ref;};
1222 S_Schema_Node orig_node();
1228 std::vector<S_Deviate> deviate();
1230 std::vector<S_Ext_Instance> ext();
1246 const
char *
prefix() {
return import->prefix;};
1248 char *
rev() {
return &
import->rev[0];};
1254 const
char *
dsc() {
return import->dsc;};
1256 const char *
ref() {
return import->ref;};
1272 char *
rev() {
return &include->rev[0];};
1278 const
char *
dsc() {
return include->dsc;};
1280 const char *
ref() {
return include->ref;};
1294 char *
date() {
return &revision->date[0];};
1298 const char *
dsc() {
return revision->dsc;};
1300 const char *
ref() {
return revision->ref;};
1314 const char *
name() {
return tpdf->name;};
1316 const char *
dsc() {
return tpdf->dsc;};
1318 const char *
ref() {
return tpdf->ref;};
1330 const
char *
units() {
return tpdf->units;};
1336 const
char *
dflt() {
return tpdf->dflt;};
1368 const char *
name() {
return feature->name;};
1370 const char *
dsc() {
return feature->dsc;};
1372 const char *
ref() {
return feature->ref;};
1374 uint16_t
flags() {
return feature->flags;};
1400 const char *
expr() {
return restr->expr;};
1402 const char *
dsc() {
return restr->dsc;};
1404 const char *
ref() {
return restr->ref;};
1408 const char *
emsg() {
return restr->emsg;};
1423 When(
struct lys_when *when, S_Deleter deleter =
nullptr);
1426 const char *
cond() {
return when->cond;};
1428 const char *
dsc() {
return when->dsc;};
1430 const char *
ref() {
return when->ref;};
1432 std::vector<S_Ext_Instance> ext();
1448 const char *
name() {
return ident->name;};
1450 const char *
dsc() {
return ident->dsc;};
1452 const char *
ref() {
return ident->ref;};
1454 uint16_t
flags() {
return ident->flags;};
1468 std::vector<S_Ident>
base();
Class implementation for libyang C header libyang.h.
class for wrapping ly_ctx.
std::vector< std::string > dflt()
std::vector< S_Ext_Instance > ext()
Deviate(struct lys_deviate *deviate, S_Deleter deleter)
Deviation(struct lys_deviation *deviation, S_Deleter deleter)
const char * target_name()
Ext_Instance(lys_ext_instance *ext_instance, S_Deleter deleter)
uint8_t insubstmt_index()
Ext(struct lys_ext *ext, S_Deleter deleter)
Feature(struct lys_feature *feature, S_Deleter)
std::vector< S_Ext_Instance > ext()
std::vector< S_Iffeature > iffeature()
std::vector< S_Ext_Instance > ext()
std::vector< S_Ident > base()
Ident(struct lys_ident *ident, S_Deleter deleter)
std::vector< S_Iffeature > iffeature()
Iffeature(struct lys_iffeature *iffeature, S_Deleter deleter)
std::vector< S_Ext_Instance > ext()
Import(struct lys_import *import, S_Deleter deleter)
std::vector< S_Ext_Instance > ext()
Include(struct lys_include *include, S_Deleter deleter)
classes for wrapping lys_module.
int feature_disable(const char *feature)
std::string print_mem(LYS_OUTFORMAT format, int options)
Module(struct lys_module *module, S_Deleter deleter)
int feature_state(const char *feature)
std::vector< S_Deviation > deviation()
uint8_t extensions_size()
std::vector< S_Schema_Node > data_instantiables(int options)
uint8_t devaiation_size()
int feature_enable(const char *feature)
Refine_Mod_List(struct lys_refine_mod_list *list, S_Deleter deleter)
Refine_Mod(union lys_refine_mod mod, uint16_t target_type, S_Deleter deleter)
std::vector< std::string > dflt()
std::vector< S_Restr > must()
Refine(struct lys_refine *refine, S_Deleter deleter)
std::vector< S_Iffeature > iffeature()
const char * target_name()
std::vector< S_Ext_Instance > ext()
Restr(struct lys_restr *restr, S_Deleter deleter)
Revision(lys_revision *revision, S_Deleter deleter)
Schema_Node_Anydata(struct lys_node *node, S_Deleter deleter)
Schema_Node_Anydata(S_Schema_Node derived)
Schema_Node_Augment(struct lys_node *node, S_Deleter deleter)
Schema_Node_Augment(S_Schema_Node derived)
Schema_Node_Case(struct lys_node *node, S_Deleter deleter)
Schema_Node_Case(S_Schema_Node derived)
Schema_Node_Choice(struct lys_node *node, S_Deleter deleter)
Schema_Node_Choice(S_Schema_Node derived)
Schema_Node_Container(struct lys_node *node, S_Deleter deleter)
Schema_Node_Container(S_Schema_Node derived)
Schema_Node_Grp(struct lys_node *node, S_Deleter deleter)
Schema_Node_Grp(S_Schema_Node derived)
Schema_Node_Inout(struct lys_node *node, S_Deleter deleter)
Schema_Node_Inout(S_Schema_Node derived)
S_Schema_Node child() override
Schema_Node_Leaf(struct lys_node *node, S_Deleter deleter)
Schema_Node_Leaf(S_Schema_Node derived)
S_Schema_Node child() override
Schema_Node_Leaflist(struct lys_node *node, S_Deleter deleter)
Schema_Node_Leaflist(S_Schema_Node derived)
Schema_Node_List(S_Schema_Node derived)
Schema_Node_List(struct lys_node *node, S_Deleter deleter)
Schema_Node_Notif(S_Schema_Node derived)
Schema_Node_Notif(struct lys_node *node, S_Deleter deleter)
Schema_Node_Rpc_Action(S_Schema_Node derived)
Schema_Node_Rpc_Action(struct lys_node *node, S_Deleter deleter)
Schema_Node_Uses(struct lys_node *node, S_Deleter deleter)
Schema_Node_Uses(S_Schema_Node derived)
friend Schema_Node_Action
friend Schema_Node_Leaflist
friend Schema_Node_Augment
friend Schema_Node_Rpc_Action
friend Schema_Node_Anydata
friend Schema_Node_Container
int validate_value(const char *value)
friend Schema_Node_Choice
std::vector< S_Iffeature > iffeature()
struct lys_node * swig_node()
Schema_Node(lys_node *node, S_Deleter deleter)
class for wrapping ly_set.
classes for wrapping lys_submodule.
uint8_t extensions_size()
Submodule(struct lys_submodule *submodule, S_Deleter deleter)
LY_STMT_CARD cardinality()
Substmt(struct lyext_substmt *substmt, S_Deleter deleter)
std::vector< S_Ext_Instance > ext()
uint8_t padding_iffsize()
uint8_t has_union_leafref()
Tpdf(struct lys_tpdf *tpdf, S_Deleter deleter)
Type_Bit(struct lys_type_bit *info_bit, S_Deleter deleter)
Type_Enum(struct lys_type_enum *info_enum, S_Deleter deleter)
Type_Info_Binary(struct lys_type_info_binary *info_binary, S_Deleter deleter)
Type_Info_Bits(struct lys_type_info_bits *info_bits, S_Deleter deleter)
std::vector< S_Type_Bit > bit()
Type_Info_Dec64(struct lys_type_info_dec64 *info_dec64, S_Deleter deleter)
std::vector< S_Type_Enum > enm()
Type_Info_Enums(struct lys_type_info_enums *info_enums, S_Deleter deleter)
Type_Info_Ident(struct lys_type_info_ident *info_ident, S_Deleter deleter)
std::vector< S_Ident > ref()
Type_Info_Inst(struct lys_type_info_inst *info_inst, S_Deleter deleter)
Type_Info_Lref(struct lys_type_info_lref *info_lref, S_Deleter deleter)
Type_Info_Num(struct lys_type_info_num *info_num, S_Deleter deleter)
Type_Info_Str(struct lys_type_info_str *info_str, S_Deleter deleter)
Type_Info_Union(struct lys_type_info_union *info_union, S_Deleter deleter)
std::vector< S_Type > types()
S_Type_Info_Binary binary()
S_Type_Info_Enums enums()
Type_Info(union lys_type_info info, LY_DATA_TYPE *type, uint8_t flags, S_Deleter deleter)
S_Type_Info_Ident ident()
S_Type_Info_Dec64 dec64()
Type(struct lys_type *type, S_Deleter deleter)
std::vector< std::string > expr()
Unique(struct lys_unique *unique, S_Deleter deleter)
When(struct lys_when *when, S_Deleter deleter=nullptr)
int lyd_validate_value(struct lys_node *node, const char *value)
Check restrictions applicable to the particular leaf/leaf-list on the given string value.
LY_STMT_CARD
Possible cardinalities of the YANG statements.
LY_STMT
List of YANG statements.
Description of the extension instance substatement.
YANG extension definition.
Generic extension instance structure.
LY_DATA_TYPE
YANG built-in types.
lyxp_node_type
Types of context nodes, LYXP_NODE_ROOT_CONFIG used only in when or must conditions.
LYS_OUTFORMAT
Schema output formats accepted by libyang printer functions.
enum lys_deviate_type LYS_DEVIATE_TYPE
Possible deviation modifications, see RFC 6020 sec. 7.18.3.2.
enum lys_nodetype LYS_NODE
YANG schema node types.
YANG deviate statement structure, see RFC 6020 sec. 7.18.3.2.
YANG deviation statement structure, see RFC 6020 sec. 7.18.3.
YANG feature definition structure.
Structure to hold information about identity, see RFC 6020 sec. 7.16.
Compiled if-feature expression structure.
YANG import structure used to reference other schemas (modules).
YANG include structure used to reference submodules.
Main schema node structure representing YANG module.
Common structure representing single YANG data statement describing.
YANG augment structure (covering both possibilities - uses's substatement as well as (sub)module's su...
Schema container node structure.
Schema grouping node structure.
RPC input and output node structure.
Schema leaf node structure.
Schema leaf-list node structure.
Schema list node structure.
Schema notification node structure.
Schema rpc/action node structure.
Schema uses node structure.
YANG uses's refine substatement structure, see RFC 6020 sec. 7.12.2.
Container for list modifications in lys_refine_mod.
YANG validity restriction (must, length, etc.) structure providing information from the schema.
YANG revision statement for (sub)modules.
Submodule schema node structure that can be included into a YANG module.
YANG typedef structure providing information from the schema.
YANG type structure providing information from the schema.
Single bit value specification for lys_type_info_bits.
Single enumeration value specification for lys_type_info_enums.
Container for information about bits types (LY_TYPE_BINARY), used in lys_type_info.
Container for information about decimal64 types (LY_TYPE_DEC64), used in lys_type_info.
Container for information about enumeration types (LY_TYPE_ENUM), used in lys_type_info.
Container for information about identity types (LY_TYPE_IDENT), used in lys_type_info.
Container for information about instance-identifier types (LY_TYPE_INST), used in lys_type_info.
Container for information about leafref types (LY_TYPE_LEAFREF), used in lys_type_info.
Container for information about integer types, used in lys_type_info.
Container for information about string types (LY_TYPE_STRING), used in lys_type_info.
Container for information about union types (LY_TYPE_UNION), used in lys_type_info.
YANG list's unique statement structure, see RFC 6020 sec. 7.8.3.
YANG when restriction, see RFC 6020 sec. 7.19.5.
Union to hold target modification in lys_refine.
Union for holding type-specific information in lys_type.
The main libyang public header.
libyang representation of data model trees.