example: Remove outdated config files from tridge
[Samba.git] / source3 / rpc_server / fss / srv_fss_private.h
blob4db9f983db1cf70e587667e7b2e886adeb646078
1 /*
2 * File Server Remote VSS Protocol (FSRVP) server state
4 * Copyright (C) David Disseldorp 2012-2015
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _SRV_FSS_PRIVATE_H_
21 #define _SRV_FSS_PRIVATE_H_
23 #define FSS_DB_NAME "srv_fss.tdb"
25 struct fss_sc_smap {
26 struct fss_sc_smap *next, *prev;
27 char *share_name; /* name of the base file share */
28 char *sc_share_name; /* share exposing the shadow copy */
29 char *sc_share_comment;
30 bool is_exposed; /* whether shadow copy is exposed */
33 struct fss_sc {
34 struct fss_sc *next, *prev;
35 struct GUID id; /* GUID of the shadow copy */
36 char *id_str;
37 char *volume_name; /* name uniquely identifying on the
38 * server object store on which this
39 * shadow copy is created. */
40 char *sc_path; /* path exposing the shadow copy */
41 time_t create_ts; /* timestamp of client initiation */
42 struct fss_sc_smap *smaps; /* shares mapped to this shadow copy */
43 uint32_t smaps_count;
44 struct fss_sc_set *sc_set; /* parent shadow copy set */
48 * 3.1.1.2: Per ShadowCopySet
49 * The status of the shadow copy set. This MUST be one of "Started", "Added",
50 * "CreationInProgress", "Committed", "Exposed", or "Recovered".
52 enum fss_sc_state {
53 FSS_SC_STARTED,
54 FSS_SC_ADDED,
55 FSS_SC_CREATING,
56 FSS_SC_COMMITED,
57 FSS_SC_EXPOSED,
58 FSS_SC_RECOVERED,
60 struct fss_sc_set {
61 struct fss_sc_set *next, *prev;
62 struct GUID id; /* GUID of the shadow copy set. */
63 char *id_str;
64 enum fss_sc_state state; /* status of the shadow copy set */
65 uint32_t context; /* attributes used for set creation */
66 struct fss_sc *scs; /* list of ShadowCopy objects */
67 uint32_t scs_count;
70 struct fss_global {
71 TALLOC_CTX *mem_ctx; /* parent mem ctx for sc sets */
72 char *db_path;
73 uint32_t min_vers;
74 uint32_t max_vers;
75 bool ctx_set; /* whether client has set context */
76 uint32_t cur_ctx;
77 struct fss_sc_set *sc_sets;
78 uint32_t sc_sets_count;
79 struct tevent_timer *seq_tmr; /* time to wait between client reqs */
82 NTSTATUS fss_state_store(TALLOC_CTX *mem_ctx,
83 struct fss_sc_set *sc_sets,
84 uint32_t sc_sets_count,
85 const char *db_path);
87 NTSTATUS fss_state_retrieve(TALLOC_CTX *mem_ctx,
88 struct fss_sc_set **sc_sets,
89 uint32_t *sc_sets_count,
90 const char *db_path);
92 #endif /*_SRV_FSS_PRIVATE_H_ */