fsrvp: split out srv_fss structs into a separate header
authorDavid Disseldorp <ddiss@samba.org>
Fri, 31 Aug 2012 09:34:20 +0000 (11:34 +0200)
committerDavid Disseldorp <ddiss@samba.org>
Mon, 15 Apr 2013 16:15:20 +0000 (18:15 +0200)
In preperation for adding server state storage functionality.

source3/rpc_server/fss/srv_fss_agent.c
source3/rpc_server/fss/srv_fss_private.h [new file with mode: 0644]

index 535c19171e81c240032ba55cbda8e1601f2bfe1c..bb3f75b7381d4f0b909bef78565a3ac01bd1f61c 100644 (file)
@@ -22,6 +22,7 @@
 #include "includes.h"
 #include "ntdomain.h"
 #include "include/messages.h"
+#include "include/auth.h"
 #include "../libcli/security/security.h"
 #include "../lib/tsocket/tsocket.h"
 #include "../lib/util/tevent_ntstatus.h"
 #include "smbd/proto.h"
 #include "lib/smbconf/smbconf_init.h"
 #include "librpc/gen_ndr/srv_fsrvp.h"
+#include "srv_fss_private.h"
 #include "srv_fss_agent.h"
-#include "auth.h"
 
-struct fss_sc_smap {
-       struct fss_sc_smap *next, *prev;
-       int snum;
-       char *share_name;               /* name of the file share */
-       char *sc_share_name;            /* share exposing the shadow copy */
-       char *sc_share_comment;
-       bool is_exposed;                /* whether shadow copy is exposed */
-};
-
-struct fss_sc {
-       struct fss_sc *next, *prev;
-       struct tevent_req *vfs_req;     /* vfs shadow copy send request */
-       struct GUID id;                 /* GUID of the shadow copy */
-       char *id_str;
-       char *volume_name;              /* name uniquely identifying on the
-                                        * server object store on which this
-                                        * shadow copy is created. */
-       char *sc_path;                  /* path exposing the shadow copy */
-       time_t create_ts;               /* timestamp of client initiation */
-       struct fss_sc_smap *smaps;      /* shares mapped to this shadow copy */
-       uint32_t smaps_count;
-       struct fss_sc_set *sc_set;      /* parent shadow copy set */
-};
-
-enum fss_sc_state {
-       FSS_SC_STARTED,
-       FSS_SC_ADDED,
-       FSS_SC_CREATING,
-       FSS_SC_COMMITED,
-       FSS_SC_EXPOSED,
-       FSS_SC_RECOVERED,
-};
-struct fss_sc_set {
-       struct fss_sc_set *next, *prev;
-       struct tevent_req *commit_req;  /* valid while state = commiting */
-       struct GUID id;                 /* GUID of the shadow copy set. */
-       char *id_str;
-       enum fss_sc_state state;        /* status of the shadow copy set */
-       uint32_t context;               /* attributes used for set creation */
-       struct fss_sc *scs;             /* list of ShadowCopy objects */
-       uint32_t scs_count;
-       /* XXX Timeout? */
-};
-
-struct fss_global {
-       uint32_t min_vers;
-       uint32_t max_vers;
-       uint32_t cur_ctx;
-       struct fss_sc_set *sc_sets;
-       uint32_t sc_sets_count;
-};
 static struct fss_global fss_global;
 
 /* errmap NTSTATUS->fsrvp */
diff --git a/source3/rpc_server/fss/srv_fss_private.h b/source3/rpc_server/fss/srv_fss_private.h
new file mode 100644 (file)
index 0000000..d8985f0
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Unix SMB/CIFS implementation.
+ *
+ * File Server Shadow-Copy service for the FSRVP pipe
+ *
+ * Copyright (C) David Disseldorp      2012
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _SRV_FSS_PRIVATE_H_
+#define _SRV_FSS_PRIVATE_H_
+
+struct fss_sc_smap {
+       struct fss_sc_smap *next, *prev;
+       int snum;
+       char *share_name;               /* name of the file share */
+       char *sc_share_name;            /* share exposing the shadow copy */
+       char *sc_share_comment;
+       bool is_exposed;                /* whether shadow copy is exposed */
+};
+
+struct fss_sc {
+       struct fss_sc *next, *prev;
+       struct tevent_req *vfs_req;     /* vfs shadow copy send request */
+       struct GUID id;                 /* GUID of the shadow copy */
+       char *id_str;
+       char *volume_name;              /* name uniquely identifying on the
+                                        * server object store on which this
+                                        * shadow copy is created. */
+       char *sc_path;                  /* path exposing the shadow copy */
+       time_t create_ts;               /* timestamp of client initiation */
+       struct fss_sc_smap *smaps;      /* shares mapped to this shadow copy */
+       uint32_t smaps_count;
+       struct fss_sc_set *sc_set;      /* parent shadow copy set */
+};
+
+enum fss_sc_state {
+       FSS_SC_STARTED,
+       FSS_SC_ADDED,
+       FSS_SC_CREATING,
+       FSS_SC_COMMITED,
+       FSS_SC_EXPOSED,
+       FSS_SC_RECOVERED,
+};
+struct fss_sc_set {
+       struct fss_sc_set *next, *prev;
+       struct tevent_req *commit_req;  /* valid while state = commiting */
+       struct GUID id;                 /* GUID of the shadow copy set. */
+       char *id_str;
+       enum fss_sc_state state;        /* status of the shadow copy set */
+       uint32_t context;               /* attributes used for set creation */
+       struct fss_sc *scs;             /* list of ShadowCopy objects */
+       uint32_t scs_count;
+       /* XXX Timeout? */
+};
+
+struct fss_global {
+       uint32_t min_vers;
+       uint32_t max_vers;
+       uint32_t cur_ctx;
+       struct fss_sc_set *sc_sets;
+       uint32_t sc_sets_count;
+};
+
+#endif /*_SRV_FSS_PRIVATE_H_ */