libnetconf  0.10.0-146_trunk
NETCONF Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Transaction API

libnetconf's implementation of transaction-based partial device reconfiguration. More...

Data Structures

struct  clbk
 Structure describing callback - path + function. More...
 
struct  transapi
 Structure to describe transAPI module and connect it statically with libnetconf using ncds_new_transapi_static(). More...
 
struct  transapi_data_callbacks
 Same as transapi_data_callbacks. Using libxml2 structures for callbacks parameters. More...
 
struct  transapi_file_callbacks
 Functions to call if the specified file is modified. More...
 
struct  transapi_rpc_callbacks
 Same as transapi_rpc_callbacks. Using libxml2 structures for callbacks parameters. More...
 

Enumerations

enum  XMLDIFF_OP {
  XMLDIFF_ERR = -1, XMLDIFF_NONE = 0, XMLDIFF_ADD = 1, XMLDIFF_REM = 2,
  XMLDIFF_MOD = 4, XMLDIFF_CHAIN = 8, XMLDIFF_SIBLING = 16, XMLDIFF_REORDER = 32
}
 Enum specifying states of node in document. More...
 

Functions

int ncds_add_augment_transapi (const char *model_path, const char *callbacks_path)
 Extend datastore(s) with an augment model and its transAPI callbacks. More...
 
int ncds_add_augment_transapi_static (const char *model_path, const struct transapi *transapi)
 Extend datastore(s) with an augment model and its transAPI callbacks. More...
 
struct ncds_ds * ncds_new_transapi (NCDS_TYPE type, const char *model_path, const char *callbacks_path)
 Create new datastore structure with transaction API support. More...
 
struct ncds_ds * ncds_new_transapi_static (NCDS_TYPE type, const char *model_path, const struct transapi *transapi)
 Create new datastore structure with transaction API support. More...
 

Detailed Description

libnetconf's implementation of transaction-based partial device reconfiguration.

Enumeration Type Documentation

enum XMLDIFF_OP

Enum specifying states of node in document.

Enumerator
XMLDIFF_ERR 

Error while creating XML difftree.

XMLDIFF_NONE 

Last operation did not cause any change in configuration.

XMLDIFF_ADD 

Element was added to configuration.

XMLDIFF_REM 

Element was removed from configuration.

XMLDIFF_MOD 

Element was modified.

XMLDIFF_CHAIN 

Some of children of element was modified/added/removed.

XMLDIFF_SIBLING 

Some sibling nodes were added/removed/changed position. Only for LEAF and LEAF-LIST.

XMLDIFF_REORDER 

Some of the children nodes changed theirs position. None was added/removed. Only for LEAF and LEAF-LIST.

Function Documentation

int ncds_add_augment_transapi ( const char *  model_path,
const char *  callbacks_path 
)

Extend datastore(s) with an augment model and its transAPI callbacks.

The function must be called before ncds_consolidate().

Parameters
[in]model_pathPath of the file containing augment data model in the YIN format. libnetconf accepts data model augmenting multiple base data models linked with the datastores using ncds_new_transapi() function.
[in]callbacks_pathPath to shared library with callbacks and other functions for transaction API.
Returns
EXIT_SUCCESS or EXIT_FAILURE
int ncds_add_augment_transapi_static ( const char *  model_path,
const struct transapi transapi 
)

Extend datastore(s) with an augment model and its transAPI callbacks.

To make this function available, you have to include libnetconf_xml.h.

The function must be called before ncds_consolidate().

Parameters
[in]model_pathPath of the file containing augment data model in the YIN format. libnetconf accepts data model augmenting multiple base data models linked with the datastores using ncds_new_transapi() function.
[in]transapiStructure describing transAPI module. This way the module can be connected with the libnetconf library statically. The structure itself can be freed after the call, but the structure contains only pointers to other structures and variables that will be accessed directly from the subsequent functions using the returned datastore structure. These objects must not be freed during the existence of the returned datastore structure. However, these transAPI variables/structures are not freed by libnetconf.
Returns
EXIT_SUCCESS or EXIT_FAILURE
struct ncds_ds* ncds_new_transapi ( NCDS_TYPE  type,
const char *  model_path,
const char *  callbacks_path 
)

Create new datastore structure with transaction API support.

Parameters
[in]typeDatastore implementation type for the new datastore structure.
[in]model_pathBase name of the configuration data model files. libnetconf expects model_path.yin as a data model, model_path.rng for grammar and data types validation, model_path.dsrl for default values validation and model_path.sch for semantic validation.
[in]callbacks_pathPath to shared library with callbacks and other functions for transaction API.
Returns
Prepared (not configured) datastore structure. To configure the structure, caller must use the parameter setters of the specific datastore implementation type. Then, the datastore can be initiated (ncds_init()) and used to access the configuration data.
struct ncds_ds* ncds_new_transapi_static ( NCDS_TYPE  type,
const char *  model_path,
const struct transapi transapi 
)

Create new datastore structure with transaction API support.

To make this function available, you have to include libnetconf_xml.h.

Parameters
[in]typeDatastore implementation type for the new datastore structure.
[in]model_pathBase name of the configuration data model files. libnetconf expects model_path.yin as a data model, model_path.rng for grammar and data types validation, model_path.dsrl for default values validation and model_path.sch for semantic validation.
[in]transapiStructure describing transAPI module. This way the module can be connected with the libnetconf library statically. The structure itself can be freed after the call, but the structure contains only pointers to other structures and variables that will be accessed directly from the subsequent functions using the returned datastore structure. These objects must not be freed during the existence of the returned datastore structure. After ncds_free(), these transAPI variables/structures are not freed.
Returns
Prepared (not configured) datastore structure. To configure the structure, caller must use the parameter setters of the specific datastore implementation type. Then, the datastore can be initiated (ncds_init()) and used to access the configuration data.