|
struct ly_ctx * | ly_ctx_new (const char *search_dir, int options) |
| Create libyang context. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
int | ly_ctx_set_searchdir (struct ly_ctx *ctx, const char *search_dir) |
| Add the search path into libyang context. More...
|
|
void | ly_ctx_unset_searchdirs (struct ly_ctx *ctx, int index) |
| Clean the search path(s) from the libyang context. More...
|
|
const char *const * | ly_ctx_get_searchdirs (const struct ly_ctx *ctx) |
| Get the NULL-terminated list of the search paths in libyang context. More...
|
|
int | ly_ctx_get_options (struct ly_ctx *ctx) |
| Get the currently set context's options. More...
|
|
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()) in searchdirs set via ly_ctx_set_searchdir() functions. Searchdirs are still stored in the context, so by unsetting the option by ly_ctx_unset_disable_searchdirs() searching in all previously searchdirs is restored. More...
|
|
void | ly_ctx_unset_disable_searchdirs (struct ly_ctx *ctx) |
| Reverse function to ly_ctx_set_disable_searchdirs(). More...
|
|
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_load_module()) in current working directory. This flag can be unset by ly_ctx_unset_disable_searchdir_cwd(). More...
|
|
void | ly_ctx_unset_disable_searchdir_cwd (struct ly_ctx *ctx) |
| Reverse function to ly_ctx_set_disable_searchdir_cwd(). More...
|
|
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_module_imp_clb()). More...
|
|
void | ly_ctx_unset_prefer_searchdirs (struct ly_ctx *ctx) |
| Reverse function to ly_ctx_set_prefer_searchdirs(). More...
|
|
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 not used in leafref's path, augment or deviation, it is imported and its data tree is not taken into account. More...
|
|
void | ly_ctx_unset_allimplemented (struct ly_ctx *ctx) |
| Reverse function to ly_ctx_set_allimplemented(). More...
|
|
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 validation checks to improve performance. Note that parsing invalid schemas this way may lead to an undefined behavior later, e.g. when working with data trees. More...
|
|
void | ly_ctx_unset_trusted (struct ly_ctx *ctx) |
| Reverse function to ly_ctx_set_trusted(). More...
|
|
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() result. More...
|
|
struct lyd_node * | ly_ctx_info (struct ly_ctx *ctx) |
| Get data of an internal ietf-yang-library module. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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 is set, it is used instead. More...
|
|
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 available (such as when downloading modules from a NETCONF server), it should not be required in other cases. More...
|
|
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. More...
|
|
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 their module is not found in the context or is not implemented. More...
|
|
ly_module_data_clb | ly_ctx_get_module_data_clb (const struct ly_ctx *ctx, void **user_data) |
| Get the missing data module calback. More...
|
|
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. More...
|
|
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. More...
|
|
const struct lys_submodule * | ly_ctx_get_submodule2 (const struct lys_module *main_module, const char *submodule) |
| Get submodule of a main module. More...
|
|
const struct lys_node * | ly_ctx_get_node (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). More...
|
|
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). More...
|
|
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. More...
|
|
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 dictionary are kept. More...
|
|
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. More...
|
|
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) to JSON format (node prefixes are module names directly). More...
|
|
char * | ly_path_data2schema (struct ly_ctx *ctx, const char *data_path) |
| Transform a data path into schema path (see XPath Addressing). More...
|
|
struct ly_set * | ly_set_new (void) |
| Create and initiate new ly_set structure. More...
|
|
struct ly_set * | ly_set_dup (const struct ly_set *set) |
| Duplicate the existing set. More...
|
|
int | ly_set_add (struct ly_set *set, void *node, int options) |
| Add a ::lyd_node or ::lys_node object into the set. More...
|
|
int | ly_set_merge (struct ly_set *trg, struct ly_set *src, int options) |
| Add all objects from src to trg . More...
|
|
int | ly_set_contains (const struct ly_set *set, void *node) |
| Get know if the set contains the specified object. More...
|
|
int | ly_set_clean (struct ly_set *set) |
| Remove all objects from the set, but keep the set container for further use. More...
|
|
int | ly_set_rm (struct ly_set *set, void *node) |
| Remove a ::lyd_node or ::lys_node object from the set. More...
|
|
int | ly_set_rm_index (struct ly_set *set, unsigned int index) |
| Remove a ::lyd_node or ::lys_node object from the set index. More...
|
|
void | ly_set_free (struct ly_set *set) |
| Free the ly_set data. Frees only the set structure content, not the referred data. More...
|
|
LY_LOG_LEVEL | ly_verb (LY_LOG_LEVEL level) |
| Set logger verbosity level. More...
|
|
int | ly_log_options (int opts) |
| Set additional logger options. Default is LY_LOLOG | LY_LOSTORE_LAST. More...
|
|
void | ly_verb_dbg (int dbg_groups) |
| Enable specific debugging messages (independent of log level). More...
|
|
void | ly_set_log_clb (void(*clb)(LY_LOG_LEVEL level, const char *msg, const char *path), int path) |
| Set logger callback. More...
|
|
LY_VECODE | ly_vecode (const struct ly_ctx *ctx) |
| Get the last (thread, context-specific) validation error code. More...
|
|
const char * | ly_errmsg (const struct ly_ctx *ctx) |
| Get the last (thread, context-specific) error message. If the corresponding module defined a specific error message, it will be used instead the default one. More...
|
|
const char * | ly_errpath (const struct ly_ctx *ctx) |
| Get the last (thread, context-specific) path of the element where was an error. More...
|
|
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 module for the last error. More...
|
|
struct ly_err_item * | ly_err_first (const struct ly_ctx *ctx) |
| Get the first (thread, context-specific) generated error structure. More...
|
|
void | ly_err_print (struct ly_err_item *eitem) |
| Print the error structure as if just generated. More...
|
|
void | ly_err_clean (struct ly_ctx *ctx, struct ly_err_item *eitem) |
| Free error structures from a context. More...
|
|
The main libyang public header.
- Author
- Radek Krejci rkrej.nosp@m.ci@c.nosp@m.esnet.nosp@m..cz Copyright (c) 2015 - 2018 CESNET, z.s.p.o.
This source code is licensed under BSD 3-Clause License (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at
https://opensource.org/licenses/BSD-3-Clause
Definition in file libyang.h.