winnt-create-missing-clean-target-20010910
[openafs.git] / src / WINNT / afsclass / c_set.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #ifndef AFSCLASS_FILESET_H
11 #define AFSCLASS_FILESET_H
12
13
14 /*
15  * FILESET CLASS ______________________________________________________________
16  *
17  */
18
19 #define fsNORMAL        0x00000000
20 #define fsSALVAGE       0x00000001
21 #define fsNO_VNODE      0x00000002
22 #define fsNO_VOL        0x00000004
23 #define fsNO_SERVICE    0x00000008
24 #define fsOFFLINE       0x00000010
25 #define fsDISK_FULL     0x00000020
26 #define fsOVER_QUOTA    0x00000040
27 #define fsBUSY          0x00000080
28 #define fsMOVED         0x00000100
29 #define fsLOCKED        0x00010000
30 #define fsMASK_VLDB     0xFFFF0000
31 typedef DWORD FILESETSTATE;
32
33 typedef enum
34    {
35    ftREADWRITE,
36    ftREPLICA,
37    ftCLONE
38    } FILESETTYPE;
39
40 typedef struct
41    {
42    VOLUMEID id;
43    VOLUMEID idReadWrite;
44    VOLUMEID idReplica;
45    VOLUMEID idClone;
46    SYSTEMTIME timeCreation;
47    SYSTEMTIME timeLastUpdate;
48    SYSTEMTIME timeLastAccess;
49    SYSTEMTIME timeLastBackup;
50    SYSTEMTIME timeCopyCreation;
51    ULONG nFiles;
52    size_t ckQuota;
53    size_t ckUsed;
54    FILESETTYPE Type;
55    FILESETSTATE State;
56    } FILESETSTATUS, *LPFILESETSTATUS;
57
58 class FILESET
59    {
60    friend class CELL;
61    friend class SERVER;
62    friend class AGGREGATE;
63    friend class IDENT;
64
65    public:
66       void Close (void);
67       void Invalidate (void);
68       BOOL RefreshStatus (BOOL fNotify = TRUE, ULONG *pStatus = NULL);  // does nothing if not invalidated
69       BOOL RefreshStatus_VLDB (BOOL fNotify = TRUE, ULONG *pStatus = NULL);     // does nothing if not invalidated
70
71       LPCELL OpenCell (ULONG *pStatus = NULL);
72       LPSERVER OpenServer (ULONG *pStatus = NULL);
73       LPAGGREGATE OpenAggregate (ULONG *pStatus = NULL);
74
75       // Fileset properties
76       //
77       LPIDENT GetIdentifier (void);
78       LPIDENT GetReadWriteIdentifier (ULONG *pStatus = NULL);
79       LPIDENT GetReadOnlyIdentifier (LPIDENT lpiParent, ULONG *pStatus = NULL);
80       LPIDENT GetCloneIdentifier (ULONG *pStatus = NULL);
81       void GetName (LPTSTR pszName);
82       void GetID (LPVOLUMEID pvid);
83
84       BOOL GetStatus (LPFILESETSTATUS lpfs, BOOL fNotify = TRUE, ULONG *pStatus = NULL);
85       short GetGhostStatus (void);      // returns GHOST_*
86
87       PVOID GetUserParam (void);
88       void SetUserParam (PVOID pUserParam);
89
90    private:
91       FILESET (LPAGGREGATE lpAggregateParent, LPVOLUMEID pvid, LPTSTR pszName);
92       ~FILESET (void);
93       void SendDeleteNotifications (void);
94
95       BOOL ProbablyReplica (void);
96       void SetStatusFromVOS (PVOID /* vos_volumeEntry_p */ pEntry);
97
98    private:
99       LPIDENT m_lpiCell;
100       LPIDENT m_lpiServer;
101       LPIDENT m_lpiAggregate;
102       LPIDENT m_lpiThis;
103       LPIDENT m_lpiThisRW;
104       LPIDENT m_lpiThisBK;
105       VOLUMEID m_idVolume;
106
107       TCHAR m_szName[ cchNAME ];
108       short m_wGhost;
109
110       BOOL m_fStatusOutOfDate;
111       FILESETSTATUS m_fs;
112    };
113
114
115 #endif // AFSCLASS_FILESET_H
116