libnetconf: Transaction API (original) (raw)

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...
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...

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

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.
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_path Path 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_path Path 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_path Path 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] transapi Structure 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] type Datastore implementation type for the new datastore structure.
[in] model_path Base 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_path Path 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] type Datastore implementation type for the new datastore structure.
[in] model_path Base 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] transapi Structure 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.