libnetconf  0.10.0-146_trunk
NETCONF Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
datastore.h
Go to the documentation of this file.
1 
40 #ifndef NC_DATASTORE_H_
41 #define NC_DATASTORE_H_
42 
43 #include "netconf.h"
44 #include "error.h"
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
54 typedef enum {
59 } NCDS_TYPE;
60 
68 typedef int ncds_id;
69 
75 #define NCDS_INTERNAL_ID 0
76 
81 struct ncds_ds;
82 
89 extern char error_area;
90 #define NCDS_RPC_NOT_APPLICABLE ((void*)(&error_area))
91 
303 int ncds_model_info(const char* path, char **name, char **version, char **ns, char **prefix, char ***rpcs, char ***notifs);
304 
323 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));
324 
340 struct ncds_ds* ncds_new_transapi(NCDS_TYPE type, const char* model_path, const char* callbacks_path);
341 
355 int ncds_add_augment_transapi(const char* model_path, const char* callbacks_path);
356 
373 int ncds_set_validation(struct ncds_ds* ds, int enable, const char* relaxng, const char* schematron);
374 
396 int ncds_file_set_path(struct ncds_ds* datastore, const char* path);
397 
413 ncds_id ncds_init(struct ncds_ds* datastore);
414 
427 int ncds_device_init(ncds_id * id, struct nc_cpblts* cpblts, int force);
428 
437 void ncds_free(struct ncds_ds* datastore);
438 
447 void ncds_free2(ncds_id datastore_id);
448 
471 nc_reply* ncds_apply_rpc2all(struct nc_session* session, const nc_rpc* rpc, ncds_id* ids[]);
472 
479 int ncds_rollback(ncds_id id);
480 
487 void ncds_break_locks(const struct nc_session* session);
488 
502 char* ncds_get_model(ncds_id id, int base);
503 
513 const char* ncds_get_model_path(ncds_id id);
514 
515 
525 int ncds_add_models_path(const char* path);
526 
535 int ncds_add_model(const char* path);
536 
547 int ncds_feature_enable(const char* module, const char* feature);
548 
559 int ncds_feature_disable(const char* module, const char* feature);
560 
571 int ncds_features_enableall(const char* module);
572 
583 int ncds_features_disableall(const char* module);
584 
594 int ncds_feature_isenabled(const char* module, const char* feature);
595 
604 int ncds_consolidate(void);
605 
606 #ifdef __cplusplus
607 }
608 #endif
609 
610 #endif /* NC_DATASTORE_H_ */
int ncds_feature_isenabled(const char *module, const char *feature)
Check if the feature of the specified module is currently enabled or disabled.
char error_area
int ncds_rollback(ncds_id id)
Undo the last change performed on the specified datastore.
void ncds_free2(ncds_id datastore_id)
Close specified datastore and free all the resources.
ncds_id ncds_init(struct ncds_ds *datastore)
Activate datastore structure for use.
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...
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.
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.
struct nc_msg nc_reply
reply message.
Definition: netconf.h:62
Definition: datastore.h:55
char * ncds_get_model(ncds_id id, int base)
Return a serialized XML containing the data model in the YIN format.
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.
const char * ncds_get_model_path(ncds_id id)
Return path to the file containing the datastore datamodel.
NETCONF error handling functions.
int ncds_file_set_path(struct ncds_ds *datastore, const char *path)
Assign the path of the datastore file into the datastore structure.
struct nc_msg nc_rpc
rpc message.
Definition: netconf.h:56
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.
NCDS_TYPE
Datastore implementation types provided by libnetconf.
Definition: datastore.h:54
nc_reply * ncds_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 nc...
int ncds_add_augment_transapi(const char *model_path, const char *callbacks_path)
Extend datastore(s) with an augment model and its transAPI callbacks.
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.
Definition: datastore.h:57
int ncds_features_disableall(const char *module)
Disable usage of all features defined in the specified module. By default, all features are disabled...
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.
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...
void ncds_free(struct ncds_ds *datastore)
Close the specified datastore and free all the resources.
int ncds_id
Datastore ID.
Definition: datastore.h:68
void ncds_break_locks(const struct nc_session *session)
Remove all the locks that the given session is holding.
Definition: datastore.h:58
int ncds_features_enableall(const char *module)
Enable usage of all features defined in the specified module. By default, all features are disabled...
libnetconf's general public functions and structures definitions.
Definition: datastore.h:56
int ncds_consolidate(void)
Consolidate all internal structures of created data stores and all data models. This function especia...
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...