20 #include "Internal.hpp"
37 std::vector<S_Deviation>
Module::deviation() LY_NEW_LIST(module, deviation, deviation_size,
Deviation);
44 deleter(module->deleter)
46 if (module->type() != 1) {
47 throw std::invalid_argument(
"Attempted to cast a YANG module into a YANG submodule");
51 std::vector<S_Schema_Node> s_vector;
55 s_vector.push_back(std::make_shared<Schema_Node>(iter, deleter));
70 std::string s_strp = strp;
84 std::string s_strp = strp;
99 std::vector<S_Deviation>
Submodule::deviation() LY_NEW_LIST(submodule, deviation, deviation_size,
Deviation);
102 info_binary(info_binary),
117 info_bits(info_bits),
124 info_dec64(info_dec64),
131 info_enum(info_enum),
139 info_enums(info_enums),
146 info_ident(info_ident),
153 info_inst(info_inst),
166 info_lref(info_lref),
181 info_union(info_union),
202 return std::make_shared<Type_Info_Num>(&info->
num, deleter);
217 S_Tpdf
Type::der() {
return type->
der ? std::make_shared<Tpdf>(type->der, deleter) :
nullptr;};
232 ext_instance(ext_instance),
256 char *path =
nullptr;
263 std::string s_path = path;
268 std::vector<S_Schema_Node> s_vector;
272 s_vector.push_back(std::make_shared<Schema_Node>(iter, deleter));
284 S_Deleter new_deleter = std::make_shared<Deleter>(
set, deleter);
285 return std::make_shared<Set>(
set, new_deleter);
295 return std::make_shared<Set>(
set, deleter);
304 return std::make_shared<Set>(
set, deleter);
307 std::vector<S_Schema_Node> s_vector;
311 s_vector.push_back(std::make_shared<Schema_Node>(elem, deleter));
317 std::vector<S_Schema_Node> s_vector;
321 s_vector.push_back(std::make_shared<Schema_Node>(elem, deleter));
332 return node_container->
must ? std::make_shared<Restr>(node_container->
must, deleter) :
nullptr;
336 return node_container->
tpdf ? std::make_shared<Tpdf>(node_container->
tpdf, deleter) :
nullptr;
343 return node_choice->
dflt ? std::make_shared<Schema_Node>(node_choice->
dflt, deleter) :
nullptr;
353 return list ? std::make_shared<Schema_Node_List>((
struct lys_node *) list, deleter) :
nullptr;
372 std::vector<S_Schema_Node_Leaf> s_vector;
374 for (uint8_t i = 0; i < list->keys_size; i++) {
375 s_vector.push_back(std::make_shared<Schema_Node_Leaf>((
struct lys_node *) list->keys[i], deleter));
392 std::vector<S_Schema_Node_Augment> s_vector;
394 for (uint8_t i = 0; i < uses->augment_size; i++) {
395 s_vector.push_back(std::make_shared<Schema_Node_Augment>((
struct lys_node *) &uses->augment[i], deleter));
402 return uses->grp ? std::make_shared<Schema_Node_Grp>(node, deleter) :
nullptr;
454 target_type(target_type),
477 S_Restr
Deviate::must() {
return deviate->
must ? std::make_shared<Restr>(deviate->must, deleter) :
nullptr;};
482 deviation(deviation),
487 std::vector<S_Deviate>
Deviation::deviate() LY_NEW_LIST(deviation, deviate, deviate_size,
Deviate);
Class implementation for libyang C header libyang.h.
Class implementation for libyang C header tree_schema.h.
std::vector< S_Ext_Instance > ext()
Deviate(struct lys_deviate *deviate, S_Deleter deleter)
Deviation(struct lys_deviation *deviation, S_Deleter deleter)
S_Schema_Node orig_node()
std::vector< S_Ext_Instance > ext()
Ext_Instance(lys_ext_instance *ext_instance, S_Deleter deleter)
std::vector< S_Ext_Instance > ext_instance()
Ext(struct lys_ext *ext, S_Deleter deleter)
Feature(struct lys_feature *feature, S_Deleter)
std::vector< S_Ident > base()
Ident(struct lys_ident *ident, S_Deleter deleter)
std::vector< S_Ext_Instance > ext()
Iffeature(struct lys_iffeature *iffeature, S_Deleter deleter)
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_Schema_Node > data_instantiables(int options)
int feature_enable(const char *feature)
Refine_Mod(union lys_refine_mod mod, uint16_t target_type, S_Deleter deleter)
std::vector< S_Ext_Instance > ext()
Refine(struct lys_refine *refine, S_Deleter deleter)
Restr(struct lys_restr *restr, S_Deleter deleter)
std::vector< S_Tpdf > tpdf()
std::vector< S_Tpdf > tpdf()
S_Schema_Node_List is_key()
std::vector< S_Restr > must()
std::vector< S_Unique > unique()
std::vector< S_Tpdf > tpdf()
std::vector< S_Tpdf > tpdf()
std::vector< S_Schema_Node > tree_dfs()
std::vector< S_Ext_Instance > ext()
std::vector< S_Schema_Node > child_instantiables(int options)
std::vector< S_Schema_Node > tree_for()
std::string path(int options=0)
S_Set xpath_atomize(enum lyxp_node_type ctx_node_type, const char *expr, int options)
S_Set find_path(const char *path)
virtual S_Schema_Node next()
Schema_Node(lys_node *node, S_Deleter deleter)
classes for wrapping lys_submodule.
Submodule(struct lys_submodule *submodule, S_Deleter deleter)
Tpdf(struct lys_tpdf *tpdf, S_Deleter deleter)
std::vector< S_Ext_Instance > ext()
Type_Bit(struct lys_type_bit *info_bit, S_Deleter deleter)
std::vector< S_Ext_Instance > ext()
Type_Enum(struct lys_type_enum *info_enum, S_Deleter deleter)
std::vector< S_Type_Bit > bit()
std::vector< S_Type_Enum > enm()
std::vector< S_Ident > ref()
Type_Info_Lref(struct lys_type_info_lref *info_lref, S_Deleter deleter)
S_Schema_Node_Leaf target()
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()
S_Type_Info_Ident ident()
S_Type_Info_Dec64 dec64()
std::vector< S_Ext_Instance > ext()
Type(struct lys_type *type, S_Deleter deleter)
Unique(struct lys_unique *unique, S_Deleter deleter)
std::vector< S_Ext_Instance > ext()
#define LY_TREE_DFS_BEGIN(START, NEXT, ELEM)
Macro to iterate via all elements in a tree. This is the opening part to the LY_TREE_DFS_END - they a...
#define LY_TREE_FOR(START, ELEM)
Macro to iterate via all sibling elements without affecting the list itself.
Description of the extension instance substatement.
YANG extension definition.
Generic extension instance structure.
Structure to hold a set of (not necessary somehow connected) lyd_node or lys_node objects....
struct lys_module * module
struct lys_type_info_lref lref
struct lys_type_info_union uni
struct lys_type_info_num num
struct lys_type_info_ident ident
struct lys_refine_mod_list list
struct lys_type_info_dec64 dec64
struct lys_ext_instance ** ext
struct lys_node_leaf * target
struct lys_refine * refine
struct lys_type_info_str str
struct lys_restr * patterns
struct lys_restr * length
struct lys_unique * unique
struct lys_type_info_enums enums
struct lys_iffeature * iffeature
struct lys_type_info_inst inst
LY_DATA_TYPE _PACKED base
struct lys_type_info_binary binary
struct lys_type_info_bits bits
struct ly_set * lys_xpath_atomize(const struct lys_node *ctx_node, enum lyxp_node_type ctx_node_type, const char *expr, int options)
Get all the partial XPath nodes (atoms) that are required for expr to be evaluated.
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.
struct ly_set * lys_find_path(const struct lys_module *cur_module, const struct lys_node *cur_node, const char *path)
Search for schema nodes matching the provided path.
int lys_features_enable(const struct lys_module *module, const char *feature)
Enable specified feature in the module. In case its if-feature evaluates to false,...
const struct lys_node * lys_getnext(const struct lys_node *last, const struct lys_node *parent, const struct lys_module *module, int options)
Get next schema tree (sibling) node element that can be instantiated in a data tree....
int lys_features_disable(const struct lys_module *module, const char *feature)
Disable specified feature in the module. If it causes some dependant features to be disabled,...
int lys_print_mem(char **strp, const struct lys_module *module, LYS_OUTFORMAT format, const char *target_node, int line_length, int options)
Print schema tree in the specified format into a memory block. It is up to caller to free the returne...
struct ly_set * lys_node_xpath_atomize(const struct lys_node *node, int options)
Call lys_xpath_atomize() on all the when and must expressions of the node. This node must be a descen...
char * lys_path(const struct lys_node *node, int options)
Build schema path (usable as path, see XPath Addressing) of the schema node.
const struct lys_node_list * lys_is_key(const struct lys_node_leaf *node, uint8_t *index)
Check if the schema leaf node is used as a key for a list.
LYS_OUTFORMAT
Schema output formats accepted by libyang printer functions.
int lys_iffeature_value(const struct lys_iffeature *iff)
Learn how the if-feature statement currently evaluates.
int lys_features_state(const struct lys_module *module, const char *feature)
Get the current status of the specified feature in the module. Even if the feature is enabled but som...
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.
Schema anydata (and anyxml) node structure.
YANG augment structure (covering both possibilities - uses's substatement as well as (sub)module's su...
Schema case node structure.
Schema choice node structure.
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.
#define LY_TREE_DFS_END(START, NEXT, ELEM)