Windows: AFSTearDownExtents may experience active extents
[openafs.git] / src / WINNT / afsadmsvr / ITaAfsAdmSvrTypes.idl
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 import "wtypes.idl";
11 cpp_quote ("#ifndef _WINNT_")
12 typedef WORD LANGID;
13 cpp_quote ("#endif // _WINNT_")
14
15 const int ENCRYPTIONKEYLENGTH = 8;
16
17
18       // ASID - Admin Server ID
19       // ...Type used for unique object identifiers throughout these adm
20       //
21 typedef UINT_PTR ASID, *LPASID;
22
23
24       // ASOBJTYPE - Admin Server Object Type
25       // ...Enumeration used to classify a particular object within a cell.
26       //    The types' values don't overlap, so they can be specified in
27       //    combination during searches.
28       //
29 typedef enum {
30    TYPE_CELL       = 0x00000001,
31    TYPE_SERVER     = 0x00000002,
32    TYPE_SERVICE    = 0x00000004,
33    TYPE_PARTITION  = 0x00000008,
34    TYPE_VOLUME     = 0x00000010,
35    TYPE_USER       = 0x00000020,
36    TYPE_GROUP      = 0x00000040,
37    TYPE_ANY        = 0x0000FFFF
38 } ASOBJTYPE;
39
40
41       // STRING - Default String Definition
42       //
43 cpp_quote ("#ifdef _WINDOWS_")
44 cpp_quote ("typedef char stringchar;")
45 cpp_quote ("#else // _WINDOWS_")
46 typedef char stringchar;
47 cpp_quote ("#endif // _WINDOWS_")
48
49 const int cchSTRING = 256;
50 typedef stringchar STRING [ cchSTRING ];
51
52
53       // VOLUMEID - Volume ID
54       // ...Type used to hold an AFS volume identifier.
55       //
56 cpp_quote ("#ifndef AFSCLASS_H")
57 typedef unsigned int VOLUMEID, *LPVOLUMEID;
58 cpp_quote ("#endif // AFSCLASS_H")
59
60
61       // ACCOUNTACCESS - Indicator of who is allowed to manipulate an object
62       // ...An enumeration used to indicate the security level around an
63       //    object. The admin server does not use this information directly,
64       //    but passes it on to the AFS server processes.
65       //
66 cpp_quote ("#ifndef AFSCLASS_H")
67 typedef enum {
68    aaOWNER_ONLY,
69    aaGROUP_ONLY,
70    aaANYONE,
71 } ACCOUNTACCESS;
72 cpp_quote ("#endif // AFSCLASS_H")
73
74
75       // ASACTIONTYPE - Operation Type Identifier
76       // ...Enumeration used to classify a particular operation in progress
77       //    by its type. Together with the ASACTION structure and ASACTLIST
78       //    structure, this type is used to indicate the operations being
79       //    performed on the admin server
80       //
81 typedef enum {
82    ACTION_REFRESH,      // Refreshing cache for cell or object
83    ACTION_SCOUT,        // Testing for problems in cell
84    ACTION_USER_CHANGE,  // Changing user's properties
85    ACTION_USER_PW_CHANGE,       // Changing user's password
86    ACTION_USER_UNLOCK,  // Unlocking user's account
87    ACTION_USER_CREATE,  // Creating user account
88    ACTION_USER_DELETE,  // Deleting user account
89    ACTION_GROUP_CHANGE, // Changing group's properties
90    ACTION_GROUP_MEMBER_ADD,     // Adding a member to a group
91    ACTION_GROUP_MEMBER_REMOVE,  // Removing a member from a group
92    ACTION_GROUP_RENAME, // Renaming a group
93    ACTION_GROUP_CREATE, // Creating group
94    ACTION_GROUP_DELETE, // Deleting group
95    ACTION_CELL_CHANGE,  // Changing a cell's properties
96 } ASACTIONTYPE;
97
98
99       // ASACTION - Operation Identifier
100       // ...Provides a structure encapsulating all known information about an
101       //    operation currently in progress.
102       //
103 typedef struct {
104    ASID  idScope;       // Scope of refresh (cell or object)
105 } ASACTION_REFRESH;
106
107 typedef struct {
108    ASID  idScope;       // Scope of scout (cell or object)
109 } ASACTION_SCOUT;
110
111 typedef struct {
112    ASID  idUser;        // User whose properties are changing
113 } ASACTION_USER_CHANGE;
114
115 typedef struct {
116    ASID  idUser;        // User whose password is changing
117 } ASACTION_USER_PW_CHANGE;
118
119 typedef struct {
120    ASID  idUser;        // User whose account is being unlocked
121 } ASACTION_USER_UNLOCK;
122
123 typedef struct {
124    STRING szUser;       // Name of new user account
125    STRING szInstance;   // Name of new user account
126 } ASACTION_USER_CREATE;
127
128 typedef struct {
129    ASID  idUser;        // User being deleted
130 } ASACTION_USER_DELETE;
131
132 typedef struct {
133    ASID  idGroup;       // Group whose properties are changing
134 } ASACTION_GROUP_CHANGE;
135
136 typedef struct {
137    ASID  idGroup;       // Group which is changing
138    ASID  idUser;        // User who is being added as a member
139 } ASACTION_GROUP_MEMBER_ADD;
140
141 typedef struct {
142    ASID  idGroup;       // Group which is changing
143    ASID  idUser;        // Member who is being removed
144 } ASACTION_GROUP_MEMBER_REMOVE;
145
146 typedef struct {
147    ASID  idGroup;       // Group which is changing
148    STRING szNewName;    // Member who is being removed
149 } ASACTION_GROUP_RENAME;
150
151 typedef struct {
152    STRING szGroup;      // Name of new PTS group
153 } ASACTION_GROUP_CREATE;
154
155 typedef struct {
156    ASID  idGroup;       // Group being deleted
157 } ASACTION_GROUP_DELETE;
158
159 typedef struct {
160    ASACTIONTYPE Action; // The operation in progress
161    DWORD idAction;      // Unique action identifier
162    UINT_PTR idClient;   // Client which initiated the operation
163    ASID idCell; // Cell in which operation is occurring
164    DWORD csecActive;    // Elapsed active time for operation
165
166    [switch_is(Action)] union {
167       [case(ACTION_REFRESH)]             ASACTION_REFRESH              Refresh;
168       [case(ACTION_SCOUT)]               ASACTION_SCOUT                Scout;
169       [case(ACTION_USER_CHANGE)]         ASACTION_USER_CHANGE          User_Change;
170       [case(ACTION_USER_PW_CHANGE)]      ASACTION_USER_PW_CHANGE       User_Pw_Change;
171       [case(ACTION_USER_UNLOCK)]         ASACTION_USER_UNLOCK          User_Unlock;
172       [case(ACTION_USER_CREATE)]         ASACTION_USER_CREATE          User_Create;
173       [case(ACTION_USER_DELETE)]         ASACTION_USER_DELETE          User_Delete;
174       [case(ACTION_GROUP_CHANGE)]        ASACTION_GROUP_CHANGE         Group_Change;
175       [case(ACTION_GROUP_MEMBER_ADD)]    ASACTION_GROUP_MEMBER_ADD     Group_Member_Add;
176       [case(ACTION_GROUP_MEMBER_REMOVE)] ASACTION_GROUP_MEMBER_REMOVE  Group_Member_Remove;
177       [case(ACTION_GROUP_RENAME)]        ASACTION_GROUP_RENAME         Group_Rename;
178       [case(ACTION_GROUP_CREATE)]        ASACTION_GROUP_CREATE         Group_Create;
179       [case(ACTION_GROUP_DELETE)]        ASACTION_GROUP_DELETE         Group_Delete;
180       [default]                          ;
181    } u;
182 } ASACTION, *LPASACTION;
183
184
185       // ASOBJPROP - Object Properties Structure
186       // ...A union of the different object properties structures, with an
187       //    ASOBJTYPE identifier to indicate which one is valid. Each such
188       //    structure has an associated version; as new information is obtained
189       //    on the server, the internal version number is incremented.
190       //
191 const DWORD verPROP_NO_OBJECT = 0;     // object deleted or otherwise invalid
192 const DWORD verPROP_RUDIMENTARY = 1;   // only asked to obtain name etc
193 const DWORD verPROP_FIRST_SCAN = 2;    // first properties obtained for object
194
195 const DWORD ASOBJPROP_SERVER_MAXADDRESS = 16; // AFS uses <=16 addrs per server
196
197 typedef struct {
198    DWORD idUserMax;
199    DWORD idGroupMax;
200 } ASOBJPROP_CELL, *LPASOBJPROP_CELL;
201
202 typedef struct {
203    ULONG nAddresses;
204    DWORD aAddresses[ ASOBJPROP_SERVER_MAXADDRESS ];
205 } ASOBJPROP_SERVER, *LPASOBJPROP_SERVER;
206
207 cpp_quote ("#ifndef AFSCLASS_H")
208 typedef enum {
209    SERVICETYPE_SIMPLE,
210    SERVICETYPE_FS,
211    SERVICETYPE_CRON
212 } AFSSERVICETYPE;
213 cpp_quote ("#endif // AFSCLASS_H")
214
215 cpp_quote ("#ifndef AFSCLASS_H")
216 typedef enum {
217    SERVICESTATE_RUNNING,
218    SERVICESTATE_STOPPED,
219    SERVICESTATE_STARTING,
220    SERVICESTATE_STOPPING
221 } SERVICESTATE;
222 cpp_quote ("#endif // AFSCLASS_H")
223
224 typedef struct {
225    AFSSERVICETYPE ServiceType;
226    SERVICESTATE ServiceState;
227    STRING szAuxStatus;
228    STRING szParams;
229    STRING szNotifier;
230    SYSTEMTIME timeLastStart;
231    SYSTEMTIME timeLastStop;
232    SYSTEMTIME timeLastFail;
233    ULONG nStarts;
234    ULONG dwErrLast;
235    ULONG dwSigLast;
236 } ASOBJPROP_SERVICE, *LPASOBJPROP_SERVICE;
237
238 typedef struct {
239    ULONG dwID;
240    UINT_PTR ckStorageTotal;
241    UINT_PTR ckStorageFree;
242    UINT_PTR ckStorageAllocated;
243 } ASOBJPROP_PARTITION, *LPASOBJPROP_PARTITION;
244
245 cpp_quote ("#ifndef AFSCLASS_H")
246 typedef enum {
247    ftREADWRITE,
248    ftREPLICA,
249    ftCLONE
250 } FILESETTYPE;
251 cpp_quote ("#endif // AFSCLASS_H")
252
253 typedef struct {
254    VOLUMEID id;
255    VOLUMEID idReadWrite;
256    VOLUMEID idReplica;
257    VOLUMEID idClone;
258    SYSTEMTIME timeCreation;
259    SYSTEMTIME timeLastUpdate;
260    SYSTEMTIME timeLastAccess;
261    SYSTEMTIME timeLastBackup;
262    SYSTEMTIME timeCopyCreation;
263    ULONG nFiles;
264    UINT_PTR ckQuota;
265    UINT_PTR ckUsed;
266    FILESETTYPE FilesetType;
267    DWORD FilesetState;
268 } ASOBJPROP_VOLUME, *LPASOBJPROP_VOLUME;
269
270 const DWORD FILESETSTATE_NORMAL      = 0x00000000;
271 const DWORD FILESETSTATE_SALVAGE     = 0x00000001;
272 const DWORD FILESETSTATE_NO_VNODE    = 0x00000002;
273 const DWORD FILESETSTATE_NO_VOL      = 0x00000004;
274 const DWORD FILESETSTATE_NO_SERVICE  = 0x00000008;
275 const DWORD FILESETSTATE_OFFLINE     = 0x00000010;
276 const DWORD FILESETSTATE_DISK_FULL   = 0x00000020;
277 const DWORD FILESETSTATE_OVER_QUOTA  = 0x00000040;
278 const DWORD FILESETSTATE_BUSY        = 0x00000080;
279 const DWORD FILESETSTATE_MOVED       = 0x00000100;
280 const DWORD FILESETSTATE_LOCKED      = 0x00010000;  // see afsclass/c_set.h
281
282 typedef struct {
283    BOOL fHaveKasInfo;
284    BOOL fHavePtsInfo;
285    STRING szInstance;
286
287    struct
288       {
289       BOOL fIsAdmin;
290       BOOL fCanGetTickets;
291       BOOL fEncrypt;
292       BOOL fCanChangePassword;
293       BOOL fCanReusePasswords;
294       SYSTEMTIME timeExpires;
295       SYSTEMTIME timeLastPwChange;
296       SYSTEMTIME timeLastMod;
297       STRING szUserLastMod;
298       LONG csecTicketLifetime;
299       int keyVersion;
300       BYTE keyData[ENCRYPTIONKEYLENGTH];
301       DWORD dwKeyChecksum;
302       LONG cdayPwExpire;
303       LONG cFailLogin;
304       LONG csecFailLoginLock;
305       } KASINFO;
306
307    struct
308       {
309       LONG cgroupCreationQuota;
310       LONG cgroupMember;
311       int uidName;
312       int uidOwner;
313       int uidCreator;
314       STRING szOwner;
315       STRING szCreator;
316       ACCOUNTACCESS aaListStatus;
317       ACCOUNTACCESS aaGroupsOwned;
318       ACCOUNTACCESS aaMembership;
319       } PTSINFO;
320
321 } ASOBJPROP_USER, *LPASOBJPROP_USER;
322
323 typedef struct {
324    int nMembers;
325    int uidName;
326    int uidOwner;
327    int uidCreator;
328    ACCOUNTACCESS aaListStatus;
329    ACCOUNTACCESS aaListGroupsOwned;
330    ACCOUNTACCESS aaListMembers;
331    ACCOUNTACCESS aaAddMember;
332    ACCOUNTACCESS aaDeleteMember;
333    STRING szOwner;
334    STRING szCreator;
335 } ASOBJPROP_GROUP, *LPASOBJPROP_GROUP;
336
337 typedef struct {
338    ASOBJTYPE Type;
339    ASID idObject;
340    ASID idParentCell;
341    ASID idParentServer;
342    ASID idParentPartition;
343    STRING szName;
344    DWORD verProperties;  // if > verPROP_RUDIMENTARY, union information valid
345    LPARAM lParam;
346
347    [switch_is(Type)] union {
348       [case(TYPE_CELL)]      ASOBJPROP_CELL       CellProperties;
349       [case(TYPE_SERVER)]    ASOBJPROP_SERVER     ServerProperties;
350       [case(TYPE_SERVICE)]   ASOBJPROP_SERVICE    ServiceProperties;
351       [case(TYPE_PARTITION)] ASOBJPROP_PARTITION  PartitionProperties;
352       [case(TYPE_VOLUME)]    ASOBJPROP_VOLUME     VolumeProperties;
353       [case(TYPE_USER)]      ASOBJPROP_USER       UserProperties;
354       [case(TYPE_GROUP)]     ASOBJPROP_GROUP      GroupProperties;
355       [default]              ;
356    } u;
357 } ASOBJPROP, *LPASOBJPROP;
358
359
360       // ASIDLIST - Managed type for lists of cell objects
361       // ...Both the server and client libraries use TaAfsAdmSvrCommon.cpp,
362       //    which contains (among other things) routines for manipulating
363       //    ASIDLIST structures. This structure represents a list of ASIDs--
364       //    that is, references to objects within a specific cell. Different
365       //    APIs which use ASIDLIST structures may have different uses for the
366       //    {ASIDLIST.aEntries[].lParam} parameter.
367       //
368 typedef struct {
369    ULONG cEntries;
370    ULONG cEntriesAllocated;  // (used internally)
371    [size_is(cEntriesAllocated), length_is(cEntriesAllocated)] struct {
372       ASID idObject;
373       LPARAM lParam;
374    } aEntries[*];
375 } ASIDLIST, *LPASIDLIST;
376
377
378       // ASOBJPROPLIST - Managed type for lists of object properties
379       // ...This structure represents a list of ASOBJPROPs.
380       //
381 typedef struct {
382    ULONG cEntries;
383    ULONG cEntriesAllocated;  // (used internally)
384    [size_is(cEntriesAllocated), length_is(cEntriesAllocated)] struct {
385       ASOBJPROP ObjectProperties;
386       LPARAM lParam;
387    } aEntries[*];
388 } ASOBJPROPLIST, *LPASOBJPROPLIST;
389
390
391       // ASACTIONLIST - Managed type for lists of actions in progress
392       // ...This structure represents a list of ASACTION objects.
393       //
394 typedef struct {
395    ULONG cEntries;
396    ULONG cEntriesAllocated;  // (used internally)
397    [size_is(cEntriesAllocated), length_is(cEntriesAllocated)] struct {
398       ASACTION Action;
399    } aEntries[*];
400 } ASACTIONLIST, *LPASACTIONLIST;
401
402
403       // AFSADMSVR_SEARCH_REFRESH - Defines search parameters
404       // ...This structure is used when calling AfsAdmSvr_Search.
405       //
406 typedef enum {
407    SEARCH_KNOWN_OBJECTS,    // test only already-found objects
408    SEARCH_ALL_OBJECTS       // ensure cell scanned for all such objects first
409 } AFSADMSVR_SEARCH_REFRESH;
410
411
412       // AFSADMSVR_GET_TYPE - Defines data retrieval parameters
413       // AFSADMSVR_GET_LEVEL - Defines data retrieval parameters
414       // ...These structures are used when calling AfsAdmSvr_GetObject
415       //
416 typedef enum {
417    RETURN_DATA_ALWAYS,         // only need to return name etc
418    RETURN_IF_OUT_OF_DATE,      // always returns information for all objects
419 } AFSADMSVR_GET_TYPE;
420
421 typedef enum {
422    GET_RUDIMENTARY_DATA,       // only need to return name etc
423    GET_ALL_DATA                // always returns information for all objects
424 } AFSADMSVR_GET_LEVEL;
425
426
427       // AFSADMSVR_CHANGECELL_PARAMS - Parameters for changing a cell
428       //
429 typedef struct {
430    DWORD idUserMax;
431    DWORD idGroupMax;
432 } AFSADMSVR_CHANGECELL_PARAMS, *LPAFSADMSVR_CHANGECELL_PARAMS;
433
434
435       // AFSADMSVR_CHANGEUSER_PARAMS - Parameters for changing users' properties
436       //
437 typedef struct {
438    BOOL fIsAdmin;
439    BOOL fCanGetTickets;
440    BOOL fEncrypt;
441    BOOL fCanChangePassword;
442    BOOL fCanReusePasswords;
443    SYSTEMTIME timeExpires;
444    LONG cdayPwExpire;
445    LONG csecTicketLifetime;
446    LONG cFailLogin;
447    LONG csecFailLoginLock;
448    LONG cgroupCreationQuota;
449    ACCOUNTACCESS aaListStatus;
450    ACCOUNTACCESS aaGroupsOwned;
451    ACCOUNTACCESS aaMembership;
452 } AFSADMSVR_CHANGEUSER_PARAMS, *LPAFSADMSVR_CHANGEUSER_PARAMS;
453
454
455       // AFSADMSVR_CHANGEGROUP_PARAMS - Parameters for changing groups
456       //
457 typedef struct {
458    STRING szOwner;
459    ACCOUNTACCESS aaListStatus;
460    ACCOUNTACCESS aaListGroupsOwned;
461    ACCOUNTACCESS aaListMembers;
462    ACCOUNTACCESS aaAddMember;
463    ACCOUNTACCESS aaDeleteMember;
464 } AFSADMSVR_CHANGEGROUP_PARAMS, *LPAFSADMSVR_CHANGEGROUP_PARAMS;
465
466
467       // AFSADMSVR_CREATEUSER_PARAMS - Parameters for creating user accounts
468       //
469 typedef struct
470    {
471    STRING szName;
472    STRING szInstance;
473    STRING szPassword;
474    UINT_PTR idUser;
475    BOOL fCreateKAS;
476    BOOL fCreatePTS;
477    } AFSADMSVR_CREATEUSER_PARAMS, *LPAFSADMSVR_CREATEUSER_PARAMS;
478
479
480       // AFSADMSVR_CREATEGROUP_PARAMS - Parameters for creating PTS groups
481       //
482 typedef struct
483    {
484    STRING szName;
485    STRING szOwner;
486    int idGroup;
487    } AFSADMSVR_CREATEGROUP_PARAMS, *LPAFSADMSVR_CREATEGROUP_PARAMS;
488
489
490       // AFSADMSVR_DELETEUSER_PARAMS - Parameters for deleting user accounts
491       //
492 typedef struct
493    {
494    BOOL fDeleteKAS;
495    BOOL fDeletePTS;
496    } AFSADMSVR_DELETEUSER_PARAMS, *LPAFSADMSVR_DELETEUSER_PARAMS;
497
498
499       // AFSADMSVR_SEARCH_TYPE - Advanced search types
500       //
501 typedef enum
502    {
503    SEARCH_NO_LIMITATIONS,
504    SEARCH_EXPIRES_BEFORE,
505    SEARCH_PASSWORD_EXPIRES_BEFORE
506    } AFSADMSVR_SEARCH_TYPE;
507
508       // AFSADMSVR_SEARCH_PARAMS - Advanced search parameters
509       //
510 typedef struct
511    {
512    AFSADMSVR_SEARCH_TYPE SearchType;
513    SYSTEMTIME SearchTime;
514    } AFSADMSVR_SEARCH_PARAMS, *LPAFSADMSVR_SEARCH_PARAMS;
515