libyang  1.0.101
YANG data modeling language library
libyang.h
Go to the documentation of this file.
1 
15 #ifndef LY_LIBYANG_H_
16 #define LY_LIBYANG_H_
17 
18 #include <stdio.h>
19 
23 #define LY_ENABLED_CACHE
24 
28 #define LY_ENABLED_LATEST_REVISIONS
29 
33 #define LY_ENABLED_LYD_PRIV
34 
38 #define _PACKED __attribute__((__packed__))
39 
40 #include "tree_schema.h"
41 #include "tree_data.h"
42 #include "xml.h"
43 #include "dict.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 #define LY_VERSION_MAJOR 1
50 #define LY_VERSION_MINOR 4
51 #define LY_VERSION_MICRO 1
52 #define LY_VERSION "1.4.1"
1118 struct ly_ctx;
1119 
1128 #define LY_CTX_ALLIMPLEMENTED 0x01
1129 #define LY_CTX_TRUSTED 0x02
1132 #define LY_CTX_NOYANGLIBRARY 0x04
1138 #define LY_CTX_DISABLE_SEARCHDIRS 0x08
1142 #define LY_CTX_DISABLE_SEARCHDIR_CWD 0x10
1145 #define LY_CTX_PREFER_SEARCHDIRS 0x20
1169 struct ly_ctx *ly_ctx_new(const char *search_dir, int options);
1170 
1197 struct ly_ctx *ly_ctx_new_ylpath(const char *search_dir, const char *path, LYD_FORMAT format, int options);
1198 
1225 struct ly_ctx *ly_ctx_new_ylmem(const char *search_dir, const char *data, LYD_FORMAT format, int options);
1226 
1232 unsigned int ly_ctx_internal_modules_count(struct ly_ctx *ctx);
1233 
1244 int ly_ctx_set_searchdir(struct ly_ctx *ctx, const char *search_dir);
1245 
1253 void ly_ctx_unset_searchdirs(struct ly_ctx *ctx, int index);
1254 
1261 const char * const *ly_ctx_get_searchdirs(const struct ly_ctx *ctx);
1262 
1269 int ly_ctx_get_options(struct ly_ctx *ctx);
1270 
1281 void ly_ctx_set_disable_searchdirs(struct ly_ctx *ctx);
1282 
1288 void ly_ctx_unset_disable_searchdirs(struct ly_ctx *ctx);
1289 
1299 void ly_ctx_set_disable_searchdir_cwd(struct ly_ctx *ctx);
1300 
1306 void ly_ctx_unset_disable_searchdir_cwd(struct ly_ctx *ctx);
1307 
1316 void ly_ctx_set_prefer_searchdirs(struct ly_ctx *ctx);
1317 
1323 void ly_ctx_unset_prefer_searchdirs(struct ly_ctx *ctx);
1324 
1338 void ly_ctx_set_allimplemented(struct ly_ctx *ctx);
1339 
1345 void ly_ctx_unset_allimplemented(struct ly_ctx *ctx);
1346 
1359 void ly_ctx_set_trusted(struct ly_ctx *ctx);
1360 
1366 void ly_ctx_unset_trusted(struct ly_ctx *ctx);
1367 
1375 uint16_t ly_ctx_get_module_set_id(const struct ly_ctx *ctx);
1376 
1384 struct lyd_node *ly_ctx_info(struct ly_ctx *ctx);
1385 
1393 const struct lys_module *ly_ctx_get_module_iter(const struct ly_ctx *ctx, uint32_t *idx);
1394 
1402 const struct lys_module *ly_ctx_get_disabled_module_iter(const struct ly_ctx *ctx, uint32_t *idx);
1403 
1416 const struct lys_module *ly_ctx_get_module(const struct ly_ctx *ctx, const char *name, const char *revision, int implemented);
1417 
1435 const struct lys_module *ly_ctx_get_module_older(const struct ly_ctx *ctx, const struct lys_module *module);
1436 
1451 const struct lys_module *ly_ctx_load_module(struct ly_ctx *ctx, const char *name, const char *revision);
1452 
1469 typedef const char *(*ly_module_imp_clb)(const char *mod_name, const char *mod_rev, const char *submod_name, const char *sub_rev,
1470  void *user_data, LYS_INFORMAT *format, void (**free_module_data)(void *model_data, void *user_data));
1471 
1481 void ly_ctx_set_module_imp_clb(struct ly_ctx *ctx, ly_module_imp_clb clb, void *user_data);
1482 
1490 ly_module_imp_clb ly_ctx_get_module_imp_clb(const struct ly_ctx *ctx, void **user_data);
1491 
1504 typedef const struct lys_module *(*ly_module_data_clb)(struct ly_ctx *ctx, const char *name, const char *ns,
1505  int options, void *user_data);
1506 
1507 /* Module is in the context, but is not implemented, so to continue with the data operation, it must be implemented. */
1508 #define LY_MODCLB_NOT_IMPLEMENTED 0x01
1509 
1518 void ly_ctx_set_module_data_clb(struct ly_ctx *ctx, ly_module_data_clb clb, void *user_data);
1519 
1527 ly_module_data_clb ly_ctx_get_module_data_clb(const struct ly_ctx *ctx, void **user_data);
1528 
1529 #ifdef LY_ENABLED_LYD_PRIV
1530 
1531 void ly_ctx_set_priv_dup_clb(struct ly_ctx *ctx, void *(*priv_dup_clb)(const void *priv));
1532 
1533 #endif
1534 
1547 const struct lys_module *ly_ctx_get_module_by_ns(const struct ly_ctx *ctx, const char *ns, const char *revision, int implemented);
1548 
1563 const struct lys_submodule *ly_ctx_get_submodule(const struct ly_ctx *ctx, const char *module, const char *revision,
1564  const char *submodule, const char *sub_revision);
1565 
1576 const struct lys_submodule *ly_ctx_get_submodule2(const struct lys_module *main_module, const char *submodule);
1577 
1593 const struct lys_node *ly_ctx_get_node(const struct ly_ctx *ctx, const struct lys_node *start, const char *data_path, int output);
1594 
1606 struct ly_set *ly_ctx_find_path(struct ly_ctx *ctx, const char *path);
1607 
1621 int ly_ctx_remove_module(const struct lys_module *module,
1622  void (*private_destructor)(const struct lys_node *node, void *priv));
1623 
1632 void ly_ctx_clean(struct ly_ctx *ctx, void (*private_destructor)(const struct lys_node *node, void *priv));
1633 
1650 void ly_ctx_destroy(struct ly_ctx *ctx, void (*private_destructor)(const struct lys_node *node, void *priv));
1651 
1661 char *ly_path_xml2json(struct ly_ctx *ctx, const char *xml_path, struct lyxml_elem *xml);
1662 
1674 char *ly_path_data2schema(struct ly_ctx *ctx, const char *data_path);
1675 
1691 union ly_set_set {
1692  struct lys_node **s;
1693  struct lyd_node **d;
1694  void **g;
1695 };
1696 
1708 struct ly_set {
1709  unsigned int size;
1710  unsigned int number;
1711  union ly_set_set set;
1712 };
1713 
1718 #define LY_SET_OPT_USEASLIST 0x01
1719 
1725 struct ly_set *ly_set_new(void);
1726 
1733 struct ly_set *ly_set_dup(const struct ly_set *set);
1734 
1748 int ly_set_add(struct ly_set *set, void *node, int options);
1749 
1762 int ly_set_merge(struct ly_set *trg, struct ly_set *src, int options);
1763 
1770 int ly_set_contains(const struct ly_set *set, void *node);
1771 
1778 int ly_set_clean(struct ly_set *set);
1779 
1790 int ly_set_rm(struct ly_set *set, void *node);
1791 
1802 int ly_set_rm_index(struct ly_set *set, unsigned int index);
1803 
1809 void ly_set_free(struct ly_set *set);
1810 
1821 #define LYP_WITHSIBLINGS 0x01
1822 #define LYP_FORMAT 0x02
1823 #define LYP_KEEPEMPTYCONT 0x04
1824 #define LYP_WD_MASK 0xF0
1825 #define LYP_WD_EXPLICIT 0x00
1827 #define LYP_WD_TRIM 0x10
1828 #define LYP_WD_ALL 0x20
1829 #define LYP_WD_ALL_TAG 0x40
1834 #define LYP_WD_IMPL_TAG 0x80
1838 #define LYP_NETCONF 0x100
1860 typedef enum {
1861  LY_LLERR = 0,
1862  LY_LLWRN = 1,
1863  LY_LLVRB = 2,
1866 } LY_LOG_LEVEL;
1867 
1874 
1883 #define LY_LOLOG 0x01
1885 #define LY_LOSTORE 0x02
1887 #define LY_LOSTORE_LAST 0x06
1900 int ly_log_options(int opts);
1901 
1902 #ifndef NDEBUG
1903 
1913 #define LY_LDGDICT 0x01
1914 #define LY_LDGYANG 0x02
1915 #define LY_LDGYIN 0x04
1916 #define LY_LDGXPATH 0x08
1917 #define LY_LDGDIFF 0x10
1918 #define LY_LDGAPI 0x20
1919 #define LY_LDGHASH 0x40
1929 void ly_verb_dbg(int dbg_groups);
1930 
1931 #endif
1932 
1947 void ly_set_log_clb(void (*clb)(LY_LOG_LEVEL level, const char *msg, const char *path), int path);
1948 
1953 void (*ly_get_log_clb(void))(LY_LOG_LEVEL, const char *, const char *);
1954 
1960 typedef enum {
1968 } LY_ERR;
1969 
1976 typedef enum {
1985  /* */
1991  /* */
2000  /* */
2001  /* */
2005  /* */
2006  /* */
2008  /* */
2025  /* */
2028  /* */
2051  /* */
2070 } LY_VECODE;
2071 
2076 LY_ERR *ly_errno_glob_address(void);
2077 
2082 #define ly_errno (*ly_errno_glob_address())
2083 
2092 LY_VECODE ly_vecode(const struct ly_ctx *ctx);
2093 
2104 const char *ly_errmsg(const struct ly_ctx *ctx);
2105 
2119 const char *ly_errpath(const struct ly_ctx *ctx);
2120 
2131 const char *ly_errapptag(const struct ly_ctx *ctx);
2132 
2136 struct ly_err_item {
2140  char *msg;
2141  char *path;
2142  char *apptag;
2144  struct ly_err_item *prev; /* first item's prev points to the last item */
2145 };
2146 
2153 struct ly_err_item *ly_err_first(const struct ly_ctx *ctx);
2154 
2160 void ly_err_print(struct ly_err_item *eitem);
2161 
2170 void ly_err_clean(struct ly_ctx *ctx, struct ly_err_item *eitem);
2171 
2176 #ifdef __cplusplus
2177 }
2178 #endif
2179 
2180 #endif /* LY_LIBYANG_H_ */
ly_err_item::msg
char * msg
Definition: libyang.h:2140
ly_ctx_get_submodule
const struct lys_submodule * ly_ctx_get_submodule(const struct ly_ctx *ctx, const char *module, const char *revision, const char *submodule, const char *sub_revision)
Get submodule of a main module.
LYVE_ENUM_INNAME
@ LYVE_ENUM_INNAME
Definition: libyang.h:1999
LYVE_MISSELEM
@ LYVE_MISSELEM
Definition: libyang.h:2029
ly_errpath
const char * ly_errpath(const struct ly_ctx *ctx)
Get the last (thread, context-specific) path of the element where was an error.
LYS_INFORMAT
LYS_INFORMAT
Schema input formats accepted by libyang parser functions.
Definition: tree_schema.h:195
ly_ctx_set_disable_searchdir_cwd
void ly_ctx_set_disable_searchdir_cwd(struct ly_ctx *ctx)
Make context to stop implicitly searching for schemas (imported, included or requested via ly_ctx_loa...
ly_ctx_get_searchdirs
const char *const * ly_ctx_get_searchdirs(const struct ly_ctx *ctx)
Get the NULL-terminated list of the search paths in libyang context.
LYVE_SUCCESS
@ LYVE_SUCCESS
Definition: libyang.h:1977
LYVE_INORDER
@ LYVE_INORDER
Definition: libyang.h:2040
ly_ctx_unset_allimplemented
void ly_ctx_unset_allimplemented(struct ly_ctx *ctx)
Reverse function to ly_ctx_set_allimplemented().
LYVE_XPATH_INMOD
@ LYVE_XPATH_INMOD
Definition: libyang.h:2053
ly_set_set::g
void ** g
Definition: libyang.h:1694
ly_ctx_destroy
void ly_ctx_destroy(struct ly_ctx *ctx, void(*private_destructor)(const struct lys_node *node, void *priv))
Free all internal structures of the specified context.
LYVE_PATH_INNODE
@ LYVE_PATH_INNODE
Definition: libyang.h:2063
ly_set_add
int ly_set_add(struct ly_set *set, void *node, int options)
Add a lyd_node or lys_node object into the set.
LYVE_INVAL
@ LYVE_INVAL
Definition: libyang.h:2030
ly_ctx_set_trusted
void ly_ctx_set_trusted(struct ly_ctx *ctx)
Change the schema parser behavior when parsing new schemas forcing it to skip some of the schema vali...
LYVE_NOCONSTR
@ LYVE_NOCONSTR
Definition: libyang.h:2034
LYVE_ENUM_WS
@ LYVE_ENUM_WS
Definition: libyang.h:2002
LYVE_INMOD
@ LYVE_INMOD
Definition: libyang.h:2007
ly_ctx_set_module_imp_clb
void ly_ctx_set_module_imp_clb(struct ly_ctx *ctx, ly_module_imp_clb clb, void *user_data)
Set missing include or import module callback. It is meant to be used when the models are not locally...
ly_ctx_set_priv_dup_clb
void ly_ctx_set_priv_dup_clb(struct ly_ctx *ctx, void *(*priv_dup_clb)(const void *priv))
LYVE_INARG
@ LYVE_INARG
Definition: libyang.h:1989
LY_ERR
LY_ERR
libyang's error codes available via ly_errno extern variable.
Definition: libyang.h:1960
LYVE_XPATH_INOP
@ LYVE_XPATH_INOP
Definition: libyang.h:2050
ly_err_item::path
char * path
Definition: libyang.h:2141
LYVE_INSTATUS
@ LYVE_INSTATUS
Definition: libyang.h:2016
ly_ctx_unset_searchdirs
void ly_ctx_unset_searchdirs(struct ly_ctx *ctx, int index)
Clean the search path(s) from the libyang context.
ly_set_set::s
struct lys_node ** s
Definition: libyang.h:1692
LY_ESYS
@ LY_ESYS
Definition: libyang.h:1963
LYVE_BITS_INNAME
@ LYVE_BITS_INNAME
Definition: libyang.h:2004
LYVE_MISSSTMT
@ LYVE_MISSSTMT
Definition: libyang.h:1990
LYVE_INRESOLV
@ LYVE_INRESOLV
Definition: libyang.h:2015
LYVE_CIRC_FEATURES
@ LYVE_CIRC_FEATURES
Definition: libyang.h:2018
ly_err_item::vecode
LY_VECODE vecode
Definition: libyang.h:2139
LYVE_SUBMODULE
@ LYVE_SUBMODULE
Definition: libyang.h:2022
LYVE_EOF
@ LYVE_EOF
Definition: libyang.h:1983
LY_LLVRB
@ LY_LLVRB
Definition: libyang.h:1863
ly_set_dup
struct ly_set * ly_set_dup(const struct ly_set *set)
Duplicate the existing set.
lys_module
Main schema node structure representing YANG module.
Definition: tree_schema.h:674
ly_err_item::no
LY_ERR no
Definition: libyang.h:2138
LYVE_DUPLEAFLIST
@ LYVE_DUPLEAFLIST
Definition: libyang.h:1995
ly_set_rm
int ly_set_rm(struct ly_set *set, void *node)
Remove a lyd_node or lys_node object from the set.
LYVE_INWHEN
@ LYVE_INWHEN
Definition: libyang.h:2041
lys_module::name
const char * name
Definition: tree_schema.h:676
LYVE_XPATH_INFUNC
@ LYVE_XPATH_INFUNC
Definition: libyang.h:2054
LYVE_CIRC_IMPORTS
@ LYVE_CIRC_IMPORTS
Definition: libyang.h:2019
ly_ctx_get_module_older
const struct lys_module * ly_ctx_get_module_older(const struct ly_ctx *ctx, const struct lys_module *module)
Get pointer to the older schema tree to the specified one in the provided context.
ly_set_set
set array of ly_set It is kept in union to keep ly_set generic for data as well as schema trees
Definition: libyang.h:1691
lyxml_elem
Structure describing an element in an XML tree.
Definition: xml.h:91
LYVE_DUPLIST
@ LYVE_DUPLIST
Definition: libyang.h:1996
LY_EINT
@ LY_EINT
Definition: libyang.h:1965
ly_set_clean
int ly_set_clean(struct ly_set *set)
Remove all objects from the set, but keep the set container for further use.
lys_module::ctx
struct ly_ctx * ctx
Definition: tree_schema.h:675
ly_ctx_new_ylpath
struct ly_ctx * ly_ctx_new_ylpath(const char *search_dir, const char *path, LYD_FORMAT format, int options)
Create libyang context according to the content of the given yang-library data.
ly_ctx_get_module_imp_clb
ly_module_imp_clb ly_ctx_get_module_imp_clb(const struct ly_ctx *ctx, void **user_data)
Get the custom callback for missing import/include module retrieval.
LYVE_INREGEX
@ LYVE_INREGEX
Definition: libyang.h:2014
ly_err_item::apptag
char * apptag
Definition: libyang.h:2142
LYVE_INMETA
@ LYVE_INMETA
Definition: libyang.h:2031
LYVE_INELEM
@ LYVE_INELEM
Definition: libyang.h:2027
ly_path_xml2json
char * ly_path_xml2json(struct ly_ctx *ctx, const char *xml_path, struct lyxml_elem *xml)
Transform a data path in XML format (node prefixes are XML namespace prefixes of module namespaces) t...
LYVE_XPATH_EOF
@ LYVE_XPATH_EOF
Definition: libyang.h:2049
ly_ctx_load_module
const struct lys_module * ly_ctx_load_module(struct ly_ctx *ctx, const char *name, const char *revision)
Try to find the model in the searchpath of ctx and load it into it. If custom missing module callback...
ly_set_contains
int ly_set_contains(const struct ly_set *set, void *node)
Get know if the set contains the specified object.
ly_err_item::level
LY_LOG_LEVEL level
Definition: libyang.h:2137
xml.h
Public API of libyang XML parser.
LYVE_KEY_TYPE
@ LYVE_KEY_TYPE
Definition: libyang.h:2010
ly_path_data2schema
char * ly_path_data2schema(struct ly_ctx *ctx, const char *data_path)
Transform a data path into schema path (see XPath Addressing).
LYVE_INATTR
@ LYVE_INATTR
Definition: libyang.h:2032
LYVE_PATH_INCHAR
@ LYVE_PATH_INCHAR
Definition: libyang.h:2060
ly_ctx_get_submodule2
const struct lys_submodule * ly_ctx_get_submodule2(const struct lys_module *main_module, const char *submodule)
Get submodule of a main module.
ly_set_set::d
struct lyd_node ** d
Definition: libyang.h:1693
LYVE_PATH_EXISTS
@ LYVE_PATH_EXISTS
Definition: libyang.h:2067
LYVE_MISSATTR
@ LYVE_MISSATTR
Definition: libyang.h:2033
ly_ctx_get_module_data_clb
ly_module_data_clb ly_ctx_get_module_data_clb(const struct ly_ctx *ctx, void **user_data)
Get the missing data module calback.
ly_set::number
unsigned int number
Definition: libyang.h:1710
ly_ctx_set_prefer_searchdirs
void ly_ctx_set_prefer_searchdirs(struct ly_ctx *ctx)
Prefer context's searchdirs before the user callback (ly_module_imp_clb) provided via ly_ctx_set_modu...
LYVE_KEY_CONFIG
@ LYVE_KEY_CONFIG
Definition: libyang.h:2011
ly_errmsg
const char * ly_errmsg(const struct ly_ctx *ctx)
Get the last (thread, context-specific) error message. If the corresponding module defined a specific...
ly_ctx_get_module_set_id
uint16_t ly_ctx_get_module_set_id(const struct ly_ctx *ctx)
Get current ID of the modules set. The value is available also as module-set-id in ly_ctx_info() resu...
ly_set_log_clb
void ly_set_log_clb(void(*clb)(LY_LOG_LEVEL level, const char *msg, const char *path), int path)
Set logger callback.
lyd_node
Generic structure for a data node, directly applicable to the data nodes defined as LYS_CONTAINER,...
Definition: tree_data.h:178
ly_ctx_set_allimplemented
void ly_ctx_set_allimplemented(struct ly_ctx *ctx)
Make context to set all the imported modules to be implemented. By default, if the imported module is...
ly_ctx_unset_disable_searchdirs
void ly_ctx_unset_disable_searchdirs(struct ly_ctx *ctx)
Reverse function to ly_ctx_set_disable_searchdirs().
tree_data.h
libyang representation of data trees.
LYVE_PATH_INKEY
@ LYVE_PATH_INKEY
Definition: libyang.h:2064
ly_err_item::next
struct ly_err_item * next
Definition: libyang.h:2143
LYVE_OBSDATA
@ LYVE_OBSDATA
Definition: libyang.h:2024
ly_ctx
libyang context handler.
ly_set::size
unsigned int size
Definition: libyang.h:1709
LYVE_TOOMANY
@ LYVE_TOOMANY
Definition: libyang.h:1993
LYVE_CIRC_INCLUDES
@ LYVE_CIRC_INCLUDES
Definition: libyang.h:2020
ly_err_clean
void ly_err_clean(struct ly_ctx *ctx, struct ly_err_item *eitem)
Free error structures from a context.
ly_err_item::prev
struct ly_err_item * prev
Definition: libyang.h:2144
LYVE_NOMIN
@ LYVE_NOMIN
Definition: libyang.h:2042
LYD_FORMAT
LYD_FORMAT
Data input/output formats supported by libyang parser and printer functions.
Definition: tree_data.h:40
LYVE_NOWHEN
@ LYVE_NOWHEN
Definition: libyang.h:2039
ly_ctx_set_disable_searchdirs
void ly_ctx_set_disable_searchdirs(struct ly_ctx *ctx)
Make context to stop searching for schemas (imported, included or requested via ly_ctx_load_module())...
LY_LOG_LEVEL
LY_LOG_LEVEL
Verbosity levels of the libyang logger.
Definition: libyang.h:1860
lys_module::ns
const char * ns
Definition: tree_schema.h:727
LYVE_INVER
@ LYVE_INVER
Definition: libyang.h:2021
ly_set
Structure to hold a set of (not necessary somehow connected) lyd_node or lys_node objects....
Definition: libyang.h:1708
ly_ctx_clean
void ly_ctx_clean(struct ly_ctx *ctx, void(*private_destructor)(const struct lys_node *node, void *priv))
Remove all the modules from the context except the internal modules. Also the addition data in dictio...
LYVE_PATH_MISSKEY
@ LYVE_PATH_MISSKEY
Definition: libyang.h:2065
LYVE_PATH_PREDTOOMANY
@ LYVE_PATH_PREDTOOMANY
Definition: libyang.h:2069
LYVE_DUPID
@ LYVE_DUPID
Definition: libyang.h:1994
ly_ctx_info
struct lyd_node * ly_ctx_info(struct ly_ctx *ctx)
Get data of an internal ietf-yang-library module.
LY_SUCCESS
@ LY_SUCCESS
Definition: libyang.h:1961
ly_ctx_unset_trusted
void ly_ctx_unset_trusted(struct ly_ctx *ctx)
Reverse function to ly_ctx_set_trusted().
LYVE_XPATH_INCTX
@ LYVE_XPATH_INCTX
Definition: libyang.h:2052
ly_set_new
struct ly_set * ly_set_new(void)
Create and initiate new ly_set structure.
ly_ctx_get_node
const struct lys_node * ly_ctx_get_node(const struct ly_ctx *ctx, const struct lys_node *start, const char *data_path, int output)
Get schema node according to the given data path (JSON format, see XPath Addressing).
LY_EMEM
@ LY_EMEM
Definition: libyang.h:1962
ly_ctx_internal_modules_count
unsigned int ly_ctx_internal_modules_count(struct ly_ctx *ctx)
Number of internal modules, which are in the context and cannot be removed nor disabled.
LYVE_BITS_INVAL
@ LYVE_BITS_INVAL
Definition: libyang.h:2003
LYVE_XPATH_DUMMY
@ LYVE_XPATH_DUMMY
Definition: libyang.h:2057
LYVE_INSTMT
@ LYVE_INSTMT
Definition: libyang.h:1984
LYVE_XPATH_INARGTYPE
@ LYVE_XPATH_INARGTYPE
Definition: libyang.h:2056
LYVE_INDATE
@ LYVE_INDATE
Definition: libyang.h:1988
ly_vecode
LY_VECODE ly_vecode(const struct ly_ctx *ctx)
Get the last (thread, context-specific) validation error code.
lys_submodule
Submodule schema node structure that can be included into a YANG module.
Definition: tree_schema.h:737
LYVE_XML_INVAL
@ LYVE_XML_INVAL
Definition: libyang.h:1980
ly_set::set
union ly_set_set set
Definition: libyang.h:1711
LYVE_NOMUST
@ LYVE_NOMUST
Definition: libyang.h:2038
LYVE_NOUNIQ
@ LYVE_NOUNIQ
Definition: libyang.h:1997
LYVE_ENUM_INVAL
@ LYVE_ENUM_INVAL
Definition: libyang.h:1998
lys_node
Common structure representing single YANG data statement describing.
Definition: tree_schema.h:1217
LY_VECODE
LY_VECODE
libyang's codes of validation error. Whenever ly_errno is set to LY_EVALID, the ly_vecode is also set...
Definition: libyang.h:1976
LYVE_PATH_INMOD
@ LYVE_PATH_INMOD
Definition: libyang.h:2061
LYVE_MISSARG
@ LYVE_MISSARG
Definition: libyang.h:1992
ly_ctx_remove_module
int ly_ctx_remove_module(const struct lys_module *module, void(*private_destructor)(const struct lys_node *node, void *priv))
Remove the specified module from its context.
LYVE_PATH_MISSPAR
@ LYVE_PATH_MISSPAR
Definition: libyang.h:2068
LYVE_XPATH_NOEND
@ LYVE_XPATH_NOEND
Definition: libyang.h:2058
LYVE_INCHAR
@ LYVE_INCHAR
Definition: libyang.h:2035
LYVE_NOLEAFREF
@ LYVE_NOLEAFREF
Definition: libyang.h:2045
tree_schema.h
libyang representation of data model trees.
ly_err_print
void ly_err_print(struct ly_err_item *eitem)
Print the error structure as if just generated.
LY_LLWRN
@ LY_LLWRN
Definition: libyang.h:1862
ly_ctx_new_ylmem
struct ly_ctx * ly_ctx_new_ylmem(const char *search_dir, const char *data, LYD_FORMAT format, int options)
Create libyang context according to the content of the given yang-library data.
ly_ctx_set_module_data_clb
void ly_ctx_set_module_data_clb(struct ly_ctx *ctx, ly_module_data_clb clb, void *user_data)
Set the missing data module callback. It will be called when some data is parsed or searched for and ...
LY_LLERR
@ LY_LLERR
Definition: libyang.h:1861
ly_err_item
Libyang full error structure.
Definition: libyang.h:2136
LYVE_XPATH_INTOK
@ LYVE_XPATH_INTOK
Definition: libyang.h:2048
LYVE_INPAR
@ LYVE_INPAR
Definition: libyang.h:1986
LYVE_INID
@ LYVE_INID
Definition: libyang.h:1987
LYVE_XPATH_INARGCOUNT
@ LYVE_XPATH_INARGCOUNT
Definition: libyang.h:2055
ly_err_first
struct ly_err_item * ly_err_first(const struct ly_ctx *ctx)
Get the first (thread, context-specific) generated error structure.
LYVE_NOMANDCHOICE
@ LYVE_NOMANDCHOICE
Definition: libyang.h:2046
dict.h
libyang dictionary
LYVE_PATH_INIDENTREF
@ LYVE_PATH_INIDENTREF
Definition: libyang.h:2066
LYVE_KEY_DUP
@ LYVE_KEY_DUP
Definition: libyang.h:2013
ly_set_merge
int ly_set_merge(struct ly_set *trg, struct ly_set *src, int options)
Add all objects from src to trg.
ly_verb
LY_LOG_LEVEL ly_verb(LY_LOG_LEVEL level)
Set logger verbosity level.
ly_ctx_set_searchdir
int ly_ctx_set_searchdir(struct ly_ctx *ctx, const char *search_dir)
Add the search path into libyang context.
LYVE_CIRC_LEAFREFS
@ LYVE_CIRC_LEAFREFS
Definition: libyang.h:2017
LY_EPLUGIN
@ LY_EPLUGIN
Definition: libyang.h:1967
ly_ctx_find_path
struct ly_set * ly_ctx_find_path(struct ly_ctx *ctx, const char *path)
Get schema node according to the given schema path (see XPath Addressing).
LY_LLDBG
@ LY_LLDBG
Definition: libyang.h:1864
ly_ctx_get_module_iter
const struct lys_module * ly_ctx_get_module_iter(const struct ly_ctx *ctx, uint32_t *idx)
Iterate over all (enabled) modules in a context.
LY_EINVAL
@ LY_EINVAL
Definition: libyang.h:1964
ly_get_log_clb
void(*)(LY_LOG_LEVEL, const char *, const char *) ly_get_log_clb(void)
Get logger callback.
Definition: libyang.h:1953
ly_module_imp_clb
const typedef char *(* ly_module_imp_clb)(const char *mod_name, const char *mod_rev, const char *submod_name, const char *sub_rev, void *user_data, LYS_INFORMAT *format, void(**free_module_data)(void *model_data, void *user_data))
Callback for retrieving missing included or imported models in a custom way.
Definition: libyang.h:1469
LYVE_XML_MISS
@ LYVE_XML_MISS
Definition: libyang.h:1979
lys_module::implemented
uint8_t implemented
Definition: tree_schema.h:693
ly_ctx_get_disabled_module_iter
const struct lys_module * ly_ctx_get_disabled_module_iter(const struct ly_ctx *ctx, uint32_t *idx)
Iterate over the disabled modules in a context.
LYVE_NORESOLV
@ LYVE_NORESOLV
Definition: libyang.h:2026
LYVE_KEY_MISS
@ LYVE_KEY_MISS
Definition: libyang.h:2012
ly_ctx_get_options
int ly_ctx_get_options(struct ly_ctx *ctx)
Get the currently set context's options.
LYVE_NOREQINS
@ LYVE_NOREQINS
Definition: libyang.h:2044
ly_ctx_unset_prefer_searchdirs
void ly_ctx_unset_prefer_searchdirs(struct ly_ctx *ctx)
Reverse function to ly_ctx_set_prefer_searchdirs().
LYVE_XML_INCHAR
@ LYVE_XML_INCHAR
Definition: libyang.h:1981
ly_ctx_get_module_by_ns
const struct lys_module * ly_ctx_get_module_by_ns(const struct ly_ctx *ctx, const char *ns, const char *revision, int implemented)
Get pointer to the schema tree of the module of the specified namespace.
LYVE_INPRED
@ LYVE_INPRED
Definition: libyang.h:2036
ly_set_rm_index
int ly_set_rm_index(struct ly_set *set, unsigned int index)
Remove a lyd_node or lys_node object from the set index.
LYVE_KEY_NLEAF
@ LYVE_KEY_NLEAF
Definition: libyang.h:2009
LY_EVALID
@ LY_EVALID
Definition: libyang.h:1966
LYVE_NOMAX
@ LYVE_NOMAX
Definition: libyang.h:2043
LYVE_MCASEDATA
@ LYVE_MCASEDATA
Definition: libyang.h:2037
ly_set_free
void ly_set_free(struct ly_set *set)
Free the ly_set data. Frees only the set structure content, not the referred data.
ly_module_data_clb
const struct lys_module *(* ly_module_data_clb)(struct ly_ctx *ctx, const char *name, const char *ns, int options, void *user_data)
Callback for retrieving missing modules in the context, for which some data was found.
Definition: libyang.h:1504
ly_ctx_unset_disable_searchdir_cwd
void ly_ctx_unset_disable_searchdir_cwd(struct ly_ctx *ctx)
Reverse function to ly_ctx_set_disable_searchdir_cwd().
LYVE_PATH_MISSMOD
@ LYVE_PATH_MISSMOD
Definition: libyang.h:2062
ly_ctx_get_module
const struct lys_module * ly_ctx_get_module(const struct ly_ctx *ctx, const char *name, const char *revision, int implemented)
Get pointer to the schema tree of the module of the specified name.
ly_errapptag
const char * ly_errapptag(const struct ly_ctx *ctx)
Get the last (thread, context-specific) error-app-tag if there was a specific one defined in the modu...