17 #ifndef _SYSREPO_PLUGINS_DATASTORE_H
18 #define _SYSREPO_PLUGINS_DATASTORE_H
21 #include <sys/types.h>
23 #include <libyang/libyang.h>
43 #define SRPLG_DS_API_VERSION 11
61 const char *group, mode_t perm,
void *plg_data);
136 const struct lyd_node *mod_data,
void *plg_data);
165 uint32_t xpath_count,
void *plg_data,
struct lyd_node **mod_data);
193 typedef sr_error_info_t *(*srds_candidate_modified)(
const struct lys_module *mod,
void *plg_data,
int *modified);
203 typedef sr_error_info_t *(*srds_candidate_reset)(
const struct lys_module *mod,
void *plg_data);
218 const char *group, mode_t perm,
void *plg_data);
234 char **group, mode_t *perm);
263 struct timespec *mtime);
316 #define SRPLG_DATASTORE \
317 uint32_t srpds_apiver__ = SRPLG_DS_API_VERSION; \
318 const struct srplg_ds_s srpds__
sr_error_info_t *(* srds_access_check)(const struct lys_module *mod, sr_datastore_t ds, void *plg_data, int *read, int *write)
Check whether the current user has the required access to datastore data.
Datastore plugin structure.
sr_error_info_t *(* srds_init)(const struct lys_module *mod, sr_datastore_t ds, void *plg_data)
Initialize data of a newly installed module.
sr_error_info_t *(* srds_candidate_reset)(const struct lys_module *mod, void *plg_data)
Reset candidate datastore to "no changes" - mirroring running.
sr_datastore_t
Datastores that sysrepo supports. To change which datastore a session operates on, use sr_session_switch_ds.
srds_data_version data_version_cb
sr_error_info_t *(* srds_install)(const struct lys_module *mod, sr_datastore_t ds, const char *owner, const char *group, mode_t perm, void *plg_data)
Setup datastore of a newly installed module.
sr_error_info_t *(* srds_conn_init)(sr_conn_ctx_t *conn, void **plg_data)
Initialize per-connection plugin data.
sr_error_info_t *(* srds_data_version)(const struct lys_module *mod, sr_datastore_t ds, void *plg_data, uint32_t *version)
Get the current datastore data version, optional callback.
srds_last_modif last_modif_cb
srds_access_get access_get_cb
sr_error_info_t *(* srds_last_modif)(const struct lys_module *mod, sr_datastore_t ds, void *plg_data, struct timespec *mtime)
Get the time when the datastore data of the module were last modified or 0 if the datastore data are ...
public sysrepo types header
sr_error_info_t *(* srds_copy)(const struct lys_module *mod, sr_datastore_t trg_ds, sr_datastore_t src_ds, void *plg_data)
Copy data of a module from source datastore to the target datastore.
Detailed sysrepo session error information.
sr_error_info_t *(* srds_access_get)(const struct lys_module *mod, sr_datastore_t ds, void *plg_data, char **owner, char **group, mode_t *perm)
Get access permissions for datastore data of a module. This function is also used for sysrepo access ...
sr_error_info_t *(* srds_load)(const struct lys_module *mod, sr_datastore_t ds, const char **xpaths, uint32_t xpath_count, void *plg_data, struct lyd_node **mod_data)
Load data of a module.
srds_access_set access_set_cb
srds_access_check access_check_cb
struct sr_conn_ctx_s sr_conn_ctx_t
Sysrepo connection.
srds_candidate_modified candidate_modified_cb
void(* srds_recover)(const struct lys_module *mod, sr_datastore_t ds, void *plg_data)
Recover module data when a crash occurred while they were being written.
void(* srds_conn_destroy)(sr_conn_ctx_t *conn, void *plg_data)
Destroy (free) per-connection plugin data.
srds_conn_destroy conn_destroy_cb
srds_candidate_reset candidate_reset_cb
srds_uninstall uninstall_cb
sr_error_info_t *(* srds_store)(const struct lys_module *mod, sr_datastore_t ds, const struct lyd_node *mod_diff, const struct lyd_node *mod_data, void *plg_data)
Store data for a module. Either a diff can be applied manually or full new data tree stored...
sr_error_info_t *(* srds_candidate_modified)(const struct lys_module *mod, void *plg_data, int *modified)
Learn whether the candidate datastore was modified and is different from running. ...
srds_conn_init conn_init_cb
sr_error_info_t *(* srds_access_set)(const struct lys_module *mod, sr_datastore_t ds, const char *owner, const char *group, mode_t perm, void *plg_data)
Set access permissions for datastore data of a module.
sr_error_info_t *(* srds_uninstall)(const struct lys_module *mod, sr_datastore_t ds, void *plg_data)
Destroy data of an uninstalled module.