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