libnetconf  0.10.0-146_trunk
NETCONF Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
datastore_custom.h
Go to the documentation of this file.
1 
39 #ifndef NC_DATASTORE_CUSTOM_H
40 #define NC_DATASTORE_CUSTOM_H
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 struct ncds_ds;
47 struct nc_err;
48 
74  int (*init)(void *data);
84  void (*free)(void *data);
91  int (*was_changed)(void *data);
98  int (*rollback)(void *data);
108  int (*lock)(void *data, NC_DATASTORE target, const char* session_id, struct nc_err** error);
121  int (*unlock)(void *data, NC_DATASTORE target, const char* session_id, struct nc_err** error);
146  int (*is_locked)(void *data, NC_DATASTORE target, const char** session_id, const char** datetime);
158  char *(*getconfig)(void *data, NC_DATASTORE target, struct nc_err **error);
169  int (*copyconfig)(void *data, NC_DATASTORE target, NC_DATASTORE source, char* config, struct nc_err** error);
178  int (*deleteconfig)(void *data, NC_DATASTORE target, struct nc_err** error);
192  int (*editconfig)(void *data, const nc_rpc* rpc, NC_DATASTORE target, const char *config, NC_EDIT_DEFOP_TYPE defop, NC_EDIT_ERROPT_TYPE errop, struct nc_err **error);
193 };
194 
204 void ncds_custom_set_data(struct ncds_ds* datastore, void *custom_data, const struct ncds_custom_funcs *callbacks);
205 
208 #ifdef __cplusplus
209 }
210 #endif
211 
212 #endif /* NC_DATASTORE_CUSTOM_H */
Public callbacks for the data store.
Definition: datastore_custom.h:64
NC_EDIT_ERROPT_TYPE
Enumeration of edit-config's <error-option> element values.
Definition: netconf.h:308
NC_EDIT_DEFOP_TYPE
Enumeration of edit-config's <default-operation> element values.
Definition: netconf.h:296
NC_DATASTORE
Enumeration of the supported types of datastores defined by NETCONF.
Definition: netconf.h:260
int(* lock)(void *data, NC_DATASTORE target, const char *session_id, struct nc_err **error)
Lock the data store from other processes.
Definition: datastore_custom.h:108
int(* rollback)(void *data)
Revert the last change.
Definition: datastore_custom.h:98
struct nc_msg nc_rpc
rpc message.
Definition: netconf.h:56
int(* deleteconfig)(void *data, NC_DATASTORE target, struct nc_err **error)
Make the given data source empty.
Definition: datastore_custom.h:178
int(* copyconfig)(void *data, NC_DATASTORE target, NC_DATASTORE source, char *config, struct nc_err **error)
Copy config from one data store to another.
Definition: datastore_custom.h:169
int(* editconfig)(void *data, const nc_rpc *rpc, NC_DATASTORE target, const char *config, NC_EDIT_DEFOP_TYPE defop, NC_EDIT_ERROPT_TYPE errop, struct nc_err **error)
Perform the editconfig operation.
Definition: datastore_custom.h:192
void ncds_custom_set_data(struct ncds_ds *datastore, void *custom_data, const struct ncds_custom_funcs *callbacks)
Set custom data stored in custom datastore.
int(* init)(void *data)
Called before the data store is used.
Definition: datastore_custom.h:74
void(* free)(void *data)
Called after the last use of the data store.
Definition: datastore_custom.h:84
int(* is_locked)(void *data, NC_DATASTORE target, const char **session_id, const char **datetime)
Is datastore currently locked?
Definition: datastore_custom.h:146
int(* was_changed)(void *data)
Was the content of data store changed?
Definition: datastore_custom.h:91
int(* unlock)(void *data, NC_DATASTORE target, const char *session_id, struct nc_err **error)
The counter-part of lock.
Definition: datastore_custom.h:121