libyang  0.16.105
YANG data modeling language library
extensions.h File Reference

libyang support for YANG extension implementations. More...

#include "libyang.h"
Include dependency graph for extensions.h:

Go to the source code of this file.

Data Structures

struct  lyext_plugin
 
struct  lyext_plugin_complex
 
struct  lyext_plugin_list
 

Macros

#define LYEXT_LOG(ctx, level, plugin, str, args...)   lyext_log(ctx, level, plugin, __func__, str, ##args); \
 Logging macro for extension plugins. More...
 

Typedefs

typedef int(* lyext_check_position_clb) (const void *parent, LYEXT_PAR parent_type, LYEXT_SUBSTMT substmt_type)
 Callback to check that the extension can be instantiated inside the provided node. More...
 
typedef int(* lyext_check_result_clb) (struct lys_ext_instance *ext)
 Callback to check that the extension instance is correct - have the valid argument, cardinality, etc. More...
 
typedef int(* lyext_check_inherit_clb) (struct lys_ext_instance *ext, struct lys_node *node)
 Callback to decide whether the extension will be inherited into the provided schema node. The extension instance is always from some of the node's parents. The inherited extension instances are marked with the LYEXT_OPT_INHERIT flag. More...
 
typedef int(* lyext_valid_data_clb) (struct lys_ext_instance *ext, struct lyd_node *node)
 Callback to decide if data is valid towards to schema. More...
 

Enumerations

enum  LYEXT_PAR {
  LYEXT_PAR_MODULE, LYEXT_PAR_NODE, LYEXT_PAR_TPDF, LYEXT_PAR_TYPE,
  LYEXT_PAR_TYPE_BIT, LYEXT_PAR_TYPE_ENUM, LYEXT_PAR_FEATURE, LYEXT_PAR_RESTR,
  LYEXT_PAR_WHEN, LYEXT_PAR_IDENT, LYEXT_PAR_EXT, LYEXT_PAR_EXTINST,
  LYEXT_PAR_REFINE, LYEXT_PAR_DEVIATION, LYEXT_PAR_DEVIATE, LYEXT_PAR_IMPORT,
  LYEXT_PAR_INCLUDE, LYEXT_PAR_REVISION, LYEXT_PAR_IFFEATURE
}
 Extension instance structure parent enumeration. More...
 
enum  LYEXT_SUBSTMT {
  LYEXT_SUBSTMT_ALL = -1, LYEXT_SUBSTMT_SELF = 0, LYEXT_SUBSTMT_ARGUMENT, LYEXT_SUBSTMT_BASE,
  LYEXT_SUBSTMT_BELONGSTO, LYEXT_SUBSTMT_CONTACT, LYEXT_SUBSTMT_DEFAULT, LYEXT_SUBSTMT_DESCRIPTION,
  LYEXT_SUBSTMT_ERRTAG, LYEXT_SUBSTMT_ERRMSG, LYEXT_SUBSTMT_KEY, LYEXT_SUBSTMT_NAMESPACE,
  LYEXT_SUBSTMT_ORGANIZATION, LYEXT_SUBSTMT_PATH, LYEXT_SUBSTMT_PREFIX, LYEXT_SUBSTMT_PRESENCE,
  LYEXT_SUBSTMT_REFERENCE, LYEXT_SUBSTMT_REVISIONDATE, LYEXT_SUBSTMT_UNITS, LYEXT_SUBSTMT_VALUE,
  LYEXT_SUBSTMT_VERSION, LYEXT_SUBSTMT_MODIFIER, LYEXT_SUBSTMT_REQINSTANCE, LYEXT_SUBSTMT_YINELEM,
  LYEXT_SUBSTMT_CONFIG, LYEXT_SUBSTMT_MANDATORY, LYEXT_SUBSTMT_ORDEREDBY, LYEXT_SUBSTMT_STATUS,
  LYEXT_SUBSTMT_DIGITS, LYEXT_SUBSTMT_MAX, LYEXT_SUBSTMT_MIN, LYEXT_SUBSTMT_POSITION,
  LYEXT_SUBSTMT_UNIQUE
}
 List of substatement without extensions storage. If the module contains extension instances in these substatements, they are stored with the extensions of the parent statement and flag to show to which substatement they belongs to. More...
 

Functions

void lyext_log (const struct ly_ctx *ctx, LY_LOG_LEVEL level, const char *plugin, const char *function, const char *format,...)
 Logging function for extension plugins, use LYEXT_LOG macro instead! More...
 
void lys_iffeature_free (struct ly_ctx *ctx, struct lys_iffeature *iffeature, uint8_t iffeature_size, int shallow, void(*private_destructor)(const struct lys_node *node, void *priv))
 Free iffeature structure. In API only for plugins that want to handle if-feature statements similarly to libyang. More...
 

Detailed Description

libyang support for YANG extension implementations.

Author
Radek Krejci rkrej.nosp@m.ci@c.nosp@m.esnet.nosp@m..cz Copyright (c) 2016 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 extensions.h.