40 #ifndef NC_DATASTORE_H_
41 #define NC_DATASTORE_H_
75 #define NCDS_INTERNAL_ID 0
90 #define NCDS_RPC_NOT_APPLICABLE ((void*)(&error_area))
303 int ncds_model_info(
const char* path,
char **name,
char **version,
char **ns,
char **prefix,
char ***rpcs,
char ***notifs);
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));
373 int ncds_set_validation(
struct ncds_ds* ds,
int enable,
const char* relaxng,
const char* schematron);
413 ncds_id
ncds_init(
struct ncds_ds* datastore);
437 void ncds_free(
struct ncds_ds* datastore);
int ncds_feature_isenabled(const char *module, const char *feature)
Check if the feature of the specified module is currently enabled or disabled.
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...