libnetconf  0.10.0-146_trunk
NETCONF Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
datastore.h File Reference

NETCONF datastore handling function prototypes and structures. More...

#include "netconf.h"
#include "error.h"
Include dependency graph for datastore.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define NCDS_INTERNAL_ID   0
 Datastore ID to access libnetconf's internal datastores such as notifications, monitoring, etc. More...
 
#define NCDS_RPC_NOT_APPLICABLE   ((void*)(&error_area))
 Return value of ncds_apply_rpc2all() when the requested operation is not applicable to the datastore. More...
 

Typedefs

typedef int ncds_id
 Datastore ID. More...
 

Enumerations

enum  NCDS_TYPE { NCDS_TYPE_ERROR = -1, NCDS_TYPE_EMPTY, NCDS_TYPE_FILE, NCDS_TYPE_CUSTOM }
 Datastore implementation types provided by libnetconf. 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_model (const char *path)
 Add an configuration data model to the internal list of models. Such model is used to resolve imports, includes and uses statements in base models. More...
 
int ncds_add_models_path (const char *path)
 Specify a directory path to the location where the required (imported or included) data models can be found. This function can be called repeatedly to specify multiple locations. More...
 
nc_replyncds_apply_rpc2all (struct nc_session *session, const nc_rpc *rpc, ncds_id *ids[])
 Perform the requested RPC operation on the all datastores controlled by the libnetconf (created by ncdsd_new() and ncds_init()). More...
 
void ncds_break_locks (const struct nc_session *session)
 Remove all the locks that the given session is holding. More...
 
int ncds_consolidate (void)
 Consolidate all internal structures of created data stores and all data models. This function especially solves all YANG's uses and augment statements. More...
 
int ncds_device_init (ncds_id *id, struct nc_cpblts *cpblts, int force)
 Initialize transAPI module(s) (if present) and copy startup configuration to running. More...
 
int ncds_feature_disable (const char *module, const char *feature)
 Disable usage of the specified feature defined in the specified module By default, all features are disabled. More...
 
int ncds_feature_enable (const char *module, const char *feature)
 Enable usage of the specified feature defined in the specified module. By default, all features are disabled. More...
 
int ncds_feature_isenabled (const char *module, const char *feature)
 Check if the feature of the specified module is currently enabled or disabled. More...
 
int ncds_features_disableall (const char *module)
 Disable usage of all features defined in the specified module. By default, all features are disabled. To disable only the specific feature(s), use ncds_feature_disable(). More...
 
int ncds_features_enableall (const char *module)
 Enable usage of all features defined in the specified module. By default, all features are disabled. To enable only the specific feature(s), use ncds_feature_enable(). More...
 
int ncds_file_set_path (struct ncds_ds *datastore, const char *path)
 Assign the path of the datastore file into the datastore structure. More...
 
void ncds_free (struct ncds_ds *datastore)
 Close the specified datastore and free all the resources. More...
 
void ncds_free2 (ncds_id datastore_id)
 Close specified datastore and free all the resources. More...
 
char * ncds_get_model (ncds_id id, int base)
 Return a serialized XML containing the data model in the YIN format. More...
 
const char * ncds_get_model_path (ncds_id id)
 Return path to the file containing the datastore datamodel. More...
 
ncds_id ncds_init (struct ncds_ds *datastore)
 Activate datastore structure for use. More...
 
int ncds_model_info (const char *path, char **name, char **version, char **ns, char **prefix, char ***rpcs, char ***notifs)
 Informational function to get basic information about configuration data model in the given file. More...
 
struct ncds_ds * ncds_new (NCDS_TYPE type, const char *model_path, char *(*get_state)(const char *model, const char *running, struct nc_err **e))
 Create a new datastore structure of the specified implementation type. 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...
 
int ncds_rollback (ncds_id id)
 Undo the last change performed on the specified datastore. More...
 
int ncds_set_validation (struct ncds_ds *ds, int enable, const char *relaxng, const char *schematron)
 Set validators (or disable validation) on the specified datastore. More...
 

Variables

char error_area
 

Detailed Description

NETCONF datastore handling function prototypes and structures.

Author
Radek Krejci rkrej.nosp@m.ci@c.nosp@m.esnet.nosp@m..cz Copyright (c) 2012-2014 CESNET, z.s.p.o.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the Company nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

ALTERNATIVELY, provided that this notice is retained in full, this product may be distributed under the terms of the GNU General Public License (GPL) version 2 or later, in which case the provisions of the GPL apply INSTEAD OF those given above.

This software is provided ``as is, and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the company or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.

Function Documentation

int ncds_device_init ( ncds_id id,
struct nc_cpblts *  cpblts,
int  force 
)

Initialize transAPI module(s) (if present) and copy startup configuration to running.

Parameters
idPointer to ncds_id of device to initialize, if NULL all found transapi-capable devices will be initialized
cpbltsServer's NETCONF capabilities. If NULL, default capabilities from libnetconf are used.
forceForce fresh configuration of device from STARTUP datastore.
Returns
EXIT_SUCCESS or EXIT_FAILURE

Variable Documentation

char error_area