23 #include "Internal.hpp" 55 const char *
dsc() {
return module->
dsc;};
57 const char *
ref() {
return module->
ref;};
59 const char *
org() {
return module->
org;};
93 const char *
ns() {
return module->
ns;};
127 const
char *
name() {
return submodule->name;};
131 const char *
dsc() {
return submodule->
dsc;};
133 const char *
ref() {
return submodule->
ref;};
135 const char *
org() {
return submodule->
org;};
205 const char *
dsc() {
return info_bit->
dsc;};
207 const char *
ref() {
return info_bit->
ref;};
217 std::vector<S_Ext_Instance> ext();
219 std::vector<S_Iffeature> iffeature();
233 std::vector<S_Type_Bit> bit();
269 const char *
dsc() {
return info_enum->
dsc;};
271 const char *
ref() {
return info_enum->
ref;};
281 std::vector<S_Ext_Instance> ext();
283 std::vector<S_Iffeature> iffeature();
297 std::vector<S_Type_Enum> enm();
313 std::vector<S_Ident>
ref();
359 S_Schema_Node_Leaf target();
393 std::vector<S_Type> types();
411 S_Type_Info_Binary binary();
413 S_Type_Info_Bits bits();
415 S_Type_Info_Dec64 dec64();
417 S_Type_Info_Enums enums();
419 S_Type_Info_Ident ident();
421 S_Type_Info_Inst inst();
423 S_Type_Info_Num num();
425 S_Type_Info_Lref lref();
427 S_Type_Info_Str str();
429 S_Type_Info_Union uni();
449 std::vector<S_Ext_Instance> ext();
472 std::vector<S_Feature> features();
474 std::vector<S_Ext_Instance> ext();
503 std::vector<S_Ext_Instance> ext();
505 S_Ext
def() LY_NEW(ext_instance, def,
Ext);
507 void *priv() {
return ext_instance->priv;};
511 LYS_NODE nodetype() {
return ext_instance->nodetype;};
536 std::vector<S_Ext_Instance> ext();
544 virtual S_Schema_Node parent();
546 virtual S_Schema_Node child();
548 virtual S_Schema_Node next();
550 virtual S_Schema_Node prev();
553 std::string path(
int options = 0);
557 std::vector<S_Schema_Node> child_instantiables(
int options);
559 S_Set find_path(
const char *path);
561 S_Set xpath_atomize(
enum lyxp_node_type ctx_node_type,
const char *expr,
int options);
563 S_Set xpath_atomize(
int options);
568 std::vector<S_Schema_Node> tree_for();
570 std::vector<S_Schema_Node> tree_dfs();
605 deleter(derived->deleter)
608 throw std::invalid_argument(
"Type must be LYS_CONTAINER");
638 deleter(derived->deleter)
641 throw std::invalid_argument(
"Type must be LYS_CHOICE");
654 S_Schema_Node dflt();
667 deleter(derived->deleter)
669 if (derived->node->nodetype !=
LYS_LEAF) {
670 throw std::invalid_argument(
"Type must be LYS_LEAF");
690 S_Schema_Node
child()
override {
return nullptr;};
692 S_Schema_Node_List is_key();
705 deleter(derived->deleter)
708 throw std::invalid_argument(
"Type must be LYS_LEAFLIST");
727 std::vector<S_Restr> must();
733 std::vector<std::string> dflt();
738 S_Schema_Node
child()
override {
return nullptr;};
751 deleter(derived->deleter)
753 if (derived->node->nodetype !=
LYS_LIST) {
754 throw std::invalid_argument(
"Type must be LYS_LIST");
775 std::vector<S_Restr> must();
777 std::vector<S_Tpdf> tpdf();
779 std::vector<S_Schema_Node_Leaf> keys();
781 std::vector<S_Unique> unique();
800 deleter(derived->deleter)
803 throw std::invalid_argument(
"Type must be LYS_ANYDATA or LYS_ANYXML");
818 std::vector<S_Restr> must();
831 deleter(derived->deleter)
833 if (derived->node->nodetype !=
LYS_USES) {
834 throw std::invalid_argument(
"Type must be LYS_USES");
849 std::vector<S_Refine> refine();
851 std::vector<S_Schema_Node_Augment> augment();
853 S_Schema_Node_Grp grp();
866 deleter(derived->deleter)
869 throw std::invalid_argument(
"Type must be LYS_GROUPING");
882 std::vector<S_Tpdf> tpdf();
895 deleter(derived->deleter)
897 if (derived->node->nodetype !=
LYS_CASE) {
898 throw std::invalid_argument(
"Type must be LYS_CASE");
922 deleter(derived->deleter)
925 throw std::invalid_argument(
"Type must be LYS_INOUT or LYS_OUTPUT");
940 std::vector<S_Tpdf> tpdf();
942 std::vector<S_Restr> must();
955 deleter(derived->deleter)
957 if (derived->node->nodetype !=
LYS_NOTIF) {
958 throw std::invalid_argument(
"Type must be LYS_NOTIF");
973 std::vector<S_Tpdf> tpdf();
975 std::vector<S_Restr> must();
988 deleter(derived->deleter)
990 if (derived->node->nodetype !=
LYS_ACTION && derived->node->nodetype !=
LYS_RPC) {
991 throw std::invalid_argument(
"Type must be LYS_ACTION or LYS_RPC");
1004 std::vector<S_Tpdf> tpdf();
1016 node(derived->node),
1017 deleter(derived->deleter)
1020 throw std::invalid_argument(
"Type must be LYS_AUGMENT");
1074 std::vector<S_Ext_Instance> ext_instance();
1110 S_Refine_Mod_List list();
1114 uint16_t target_type;
1143 std::vector<S_Ext_Instance> ext();
1149 std::vector<S_Restr> must();
1151 std::vector<std::
string> dflt() LY_NEW_STRING_LIST(refine, dflt, dflt_size);
1195 std::vector<std::string>
dflt() LY_NEW_STRING_LIST(deviate, dflt, dflt_size);
1197 std::vector<S_Ext_Instance> ext();
1217 S_Schema_Node orig_node();
1223 std::vector<S_Deviate> deviate();
1225 std::vector<S_Ext_Instance> ext();
1241 const
char *
prefix() {
return import->prefix;};
1243 char *
rev() {
return &
import->rev[0];};
1249 const
char *
dsc() {
return import->dsc;};
1251 const char *
ref() {
return import->ref;};
1267 char *
rev() {
return &include->rev[0];};
1273 const
char *
dsc() {
return include->dsc;};
1325 const
char *units() {
return tpdf->units;};
1331 const
char *dflt() {
return tpdf->dflt;};
1345 std::vector<std::string>
expr() LY_NEW_STRING_LIST(unique, expr, expr_size);
1347 uint8_t expr_size() {
return unique->expr_size;};
1377 std::vector<S_Iffeature> iffeature() LY_NEW_LIST(feature, iffeature, iffeature_size,
Iffeature);
1379 S_Module module() LY_NEW(feature, module,
Module);
1381 S_Set depfeatures() LY_NEW(feature, depfeatures,
Set);
1418 When(
struct lys_when *when, S_Deleter deleter =
nullptr);
1427 std::vector<S_Ext_Instance> ext();
1459 std::vector<S_Iffeature> iffeature() LY_NEW_LIST(ident, iffeature, iffeature_size,
Iffeature);
1461 S_Module module() LY_NEW(ident, module,
Module);
1463 std::vector<S_Ident> base();
1465 S_Set der() LY_NEW(ident, der,
Set);
Common structure representing single YANG data statement describing.
Schema_Node_Leaflist(S_Schema_Node derived)
std::vector< S_Ext_Instance > ext()
LY_STMT_CARD
Possible cardinalities of the YANG statements.
Schema leaf node structure.
Schema grouping node structure.
std::vector< S_Ext_Instance > ext()
Schema_Node_Container(struct lys_node *node, S_Deleter deleter)
Schema_Node_Case(S_Schema_Node derived)
Submodule schema node structure that can be included into a YANG module.
friend Schema_Node_Anydata
Module(struct lys_module *module, S_Deleter deleter)
friend Schema_Node_Container
std::vector< S_Iffeature > iffeature()
Schema_Node_Uses(struct lys_node *node, S_Deleter deleter)
const char * target_name()
YANG uses's refine substatement structure, see RFC 6020 sec. 7.12.2
Schema_Node_Rpc_Action(S_Schema_Node derived)
YANG import structure used to reference other schemas (modules).
std::vector< S_Schema_Node > data_instantiables(int options)
Container for list modifications in lys_refine_mod.
Container for information about string types (LY_TYPE_STRING), used in lys_type_info.
std::vector< std::string > expr()
std::vector< std::string > dflt()
libyang representation of data model trees.
classes for wrapping lys_submodule.
uint8_t extensions_size()
YANG typedef structure providing information from the schema.
std::vector< S_Ext_Instance > ext()
lyxp_node_type
Types of context nodes, LYXP_NODE_ROOT_CONFIG used only in when or must conditions.
friend Schema_Node_Augment
const char * target_name()
Schema_Node_Inout(struct lys_node *node, S_Deleter deleter)
std::vector< S_Iffeature > iffeature()
Single enumeration value specification for lys_type_info_enums.
Schema_Node_Rpc_Action(struct lys_node *node, S_Deleter deleter)
Union for holding type-specific information in lys_type.
int validate_value(const char *value)
Container for information about leafref types (LY_TYPE_LEAFREF), used in lys_type_info.
class for wrapping ly_ctx.
Schema_Node_Anydata(S_Schema_Node derived)
Compiled if-feature expression structure.
Schema_Node_Grp(S_Schema_Node derived)
uint8_t insubstmt_index()
S_Schema_Node child() override
std::vector< S_Ext_Instance > ext()
Schema leaf-list node structure.
Schema_Node_List(S_Schema_Node derived)
YANG augment structure (covering both possibilities - uses's substatement as well as (sub)module's su...
LYS_OUTFORMAT
Schema output formats accepted by libyang printer functions.
uint8_t has_union_leafref()
Container for information about enumeration types (LY_TYPE_ENUM), used in lys_type_info.
Container for information about integer types, used in lys_type_info.
The main libyang public header.
std::vector< S_Ext_Instance > ext()
Union to hold target modification in lys_refine.
Container for information about decimal64 types (LY_TYPE_DEC64), used in lys_type_info.
struct lys_ext_instance ** ext
uint8_t has_union_leafref
std::vector< S_Ext_Instance > ext()
Schema_Node_Leaflist(struct lys_node *node, S_Deleter deleter)
std::vector< S_Deviation > deviation()
Schema_Node_Choice(S_Schema_Node derived)
Schema_Node_Choice(struct lys_node *node, S_Deleter deleter)
Container for information about identity types (LY_TYPE_IDENT), used in lys_type_info.
uint8_t padding_iffsize()
YANG when restriction, see RFC 6020 sec. 7.19.5
Container for information about bits types (LY_TYPE_BINARY), used in lys_type_info.
friend Schema_Node_Action
Schema_Node_List(struct lys_node *node, S_Deleter deleter)
classes for wrapping lyd_node.
Schema list node structure.
LY_STMT_CARD cardinality()
friend Schema_Node_Choice
Container for information about instance-identifier types (LY_TYPE_INST), used in lys_type_info.
Main schema node structure representing YANG module.
S_Schema_Node child() override
uint8_t devaiation_size()
Schema_Node_Augment(struct lys_node *node, S_Deleter deleter)
Schema_Node_Grp(struct lys_node *node, S_Deleter deleter)
Class implementation for libyang C header libyang.h.
RPC input and output node structure.
LY_DATA_TYPE
YANG built-in types.
Schema_Node_Leaf(struct lys_node *node, S_Deleter deleter)
std::string print_mem(LYS_OUTFORMAT format, int options)
YANG type structure providing information from the schema.
YANG list's unique statement structure, see RFC 6020 sec. 7.8.3
struct lys_node * swig_node()
Structure to hold information about identity, see RFC 6020 sec. 7.16
Schema_Node_Augment(S_Schema_Node derived)
Description of the extension instance substatement.
Schema_Node_Container(S_Schema_Node derived)
uint8_t extensions_size()
YANG deviate statement structure, see RFC 6020 sec. 7.18.3.2
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.
Schema uses node structure.
Schema_Node_Notif(S_Schema_Node derived)
Schema notification node structure.
Schema_Node_Leaf(S_Schema_Node derived)
LY_STMT
List of YANG statements.
YANG validity restriction (must, length, etc.) structure providing information from the schema.
class for wrapping ly_set.
Schema_Node_Inout(S_Schema_Node derived)
enum lys_deviate_type LYS_DEVIATE_TYPE
Possible deviation modifications, see RFC 6020 sec. 7.18.3.2
Schema rpc/action node structure.
Generic extension instance structure.
Container for information about union types (LY_TYPE_UNION), used in lys_type_info.
Schema_Node_Notif(struct lys_node *node, S_Deleter deleter)
YANG extension definition.
YANG revision statement for (sub)modules.
YANG include structure used to reference submodules.
YANG feature definition structure.
friend Schema_Node_Leaflist
enum lys_nodetype LYS_NODE
YANG schema node types.
Schema_Node_Uses(S_Schema_Node derived)
Single bit value specification for lys_type_info_bits.
classes for wrapping lys_module.
friend Schema_Node_Rpc_Action
Schema_Node_Anydata(struct lys_node *node, S_Deleter deleter)
Schema_Node_Case(struct lys_node *node, S_Deleter deleter)
Schema container node structure.
YANG deviation statement structure, see RFC 6020 sec. 7.18.3