2 * Copyright 2000, International Business Machines Corporation and others.
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
11 cpp_quote
("#ifndef _WINNT_")
13 cpp_quote
("#endif // _WINNT_")
15 const int ENCRYPTIONKEYLENGTH
= 8;
18 // ASID - Admin Server ID
19 // ...Type used for unique object identifiers throughout these adm
21 typedef UINT_PTR ASID
, *LPASID
;
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.
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,
41 // STRING - Default String Definition
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_")
49 const int cchSTRING
= 256;
50 typedef stringchar
STRING [ cchSTRING
];
53 // VOLUMEID - Volume ID
54 // ...Type used to hold an AFS volume identifier.
56 cpp_quote
("#ifndef AFSCLASS_H")
57 typedef unsigned int VOLUMEID
, *LPVOLUMEID
;
58 cpp_quote
("#endif // AFSCLASS_H")
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.
66 cpp_quote
("#ifndef AFSCLASS_H")
72 cpp_quote
("#endif // AFSCLASS_H")
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
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
99 // ASACTION - Operation Identifier
100 // ...Provides a structure encapsulating all known information about an
101 // operation currently in progress.
104 ASID idScope
; // Scope of refresh (cell or object)
108 ASID idScope
; // Scope of scout (cell or object)
112 ASID idUser
; // User whose properties are changing
113 } ASACTION_USER_CHANGE
;
116 ASID idUser
; // User whose password is changing
117 } ASACTION_USER_PW_CHANGE
;
120 ASID idUser
; // User whose account is being unlocked
121 } ASACTION_USER_UNLOCK
;
124 STRING szUser
; // Name of new user account
125 STRING szInstance
; // Name of new user account
126 } ASACTION_USER_CREATE
;
129 ASID idUser
; // User being deleted
130 } ASACTION_USER_DELETE
;
133 ASID idGroup
; // Group whose properties are changing
134 } ASACTION_GROUP_CHANGE
;
137 ASID idGroup
; // Group which is changing
138 ASID idUser
; // User who is being added as a member
139 } ASACTION_GROUP_MEMBER_ADD
;
142 ASID idGroup
; // Group which is changing
143 ASID idUser
; // Member who is being removed
144 } ASACTION_GROUP_MEMBER_REMOVE
;
147 ASID idGroup
; // Group which is changing
148 STRING szNewName
; // Member who is being removed
149 } ASACTION_GROUP_RENAME
;
152 STRING szGroup
; // Name of new PTS group
153 } ASACTION_GROUP_CREATE
;
156 ASID idGroup
; // Group being deleted
157 } ASACTION_GROUP_DELETE
;
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
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
;
182 } ASACTION
, *LPASACTION
;
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.
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
195 const DWORD ASOBJPROP_SERVER_MAXADDRESS
= 16; // AFS uses <=16 addrs per server
200 } ASOBJPROP_CELL
, *LPASOBJPROP_CELL
;
204 DWORD aAddresses
[ ASOBJPROP_SERVER_MAXADDRESS
];
205 } ASOBJPROP_SERVER
, *LPASOBJPROP_SERVER
;
207 cpp_quote
("#ifndef AFSCLASS_H")
213 cpp_quote
("#endif // AFSCLASS_H")
215 cpp_quote
("#ifndef AFSCLASS_H")
217 SERVICESTATE_RUNNING
,
218 SERVICESTATE_STOPPED
,
219 SERVICESTATE_STARTING
,
220 SERVICESTATE_STOPPING
222 cpp_quote
("#endif // AFSCLASS_H")
225 AFSSERVICETYPE ServiceType
;
226 SERVICESTATE ServiceState
;
230 SYSTEMTIME timeLastStart
;
231 SYSTEMTIME timeLastStop
;
232 SYSTEMTIME timeLastFail
;
236 } ASOBJPROP_SERVICE
, *LPASOBJPROP_SERVICE
;
240 UINT_PTR ckStorageTotal
;
241 UINT_PTR ckStorageFree
;
242 UINT_PTR ckStorageAllocated
;
243 } ASOBJPROP_PARTITION
, *LPASOBJPROP_PARTITION
;
245 cpp_quote
("#ifndef AFSCLASS_H")
251 cpp_quote
("#endif // AFSCLASS_H")
255 VOLUMEID idReadWrite
;
258 SYSTEMTIME timeCreation
;
259 SYSTEMTIME timeLastUpdate
;
260 SYSTEMTIME timeLastAccess
;
261 SYSTEMTIME timeLastBackup
;
262 SYSTEMTIME timeCopyCreation
;
266 FILESETTYPE FilesetType
;
268 } ASOBJPROP_VOLUME
, *LPASOBJPROP_VOLUME
;
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
292 BOOL fCanChangePassword
;
293 BOOL fCanReusePasswords
;
294 SYSTEMTIME timeExpires
;
295 SYSTEMTIME timeLastPwChange
;
296 SYSTEMTIME timeLastMod
;
297 STRING szUserLastMod
;
298 LONG csecTicketLifetime
;
300 BYTE keyData
[ENCRYPTIONKEYLENGTH
];
304 LONG csecFailLoginLock
;
309 LONG cgroupCreationQuota
;
316 ACCOUNTACCESS aaListStatus
;
317 ACCOUNTACCESS aaGroupsOwned
;
318 ACCOUNTACCESS aaMembership
;
321 } ASOBJPROP_USER
, *LPASOBJPROP_USER
;
328 ACCOUNTACCESS aaListStatus
;
329 ACCOUNTACCESS aaListGroupsOwned
;
330 ACCOUNTACCESS aaListMembers
;
331 ACCOUNTACCESS aaAddMember
;
332 ACCOUNTACCESS aaDeleteMember
;
335 } ASOBJPROP_GROUP
, *LPASOBJPROP_GROUP
;
342 ASID idParentPartition
;
344 DWORD verProperties
; // if > verPROP_RUDIMENTARY, union information valid
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
;
357 } ASOBJPROP
, *LPASOBJPROP
;
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.
370 ULONG cEntriesAllocated
; // (used internally)
371 [size_is(cEntriesAllocated
), length_is(cEntriesAllocated
)] struct {
375 } ASIDLIST
, *LPASIDLIST
;
378 // ASOBJPROPLIST - Managed type for lists of object properties
379 // ...This structure represents a list of ASOBJPROPs.
383 ULONG cEntriesAllocated
; // (used internally)
384 [size_is(cEntriesAllocated
), length_is(cEntriesAllocated
)] struct {
385 ASOBJPROP ObjectProperties
;
388 } ASOBJPROPLIST
, *LPASOBJPROPLIST
;
391 // ASACTIONLIST - Managed type for lists of actions in progress
392 // ...This structure represents a list of ASACTION objects.
396 ULONG cEntriesAllocated
; // (used internally)
397 [size_is(cEntriesAllocated
), length_is(cEntriesAllocated
)] struct {
400 } ASACTIONLIST
, *LPASACTIONLIST
;
403 // AFSADMSVR_SEARCH_REFRESH - Defines search parameters
404 // ...This structure is used when calling AfsAdmSvr_Search.
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
;
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
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
;
422 GET_RUDIMENTARY_DATA
, // only need to return name etc
423 GET_ALL_DATA
// always returns information for all objects
424 } AFSADMSVR_GET_LEVEL
;
427 // AFSADMSVR_CHANGECELL_PARAMS - Parameters for changing a cell
432 } AFSADMSVR_CHANGECELL_PARAMS
, *LPAFSADMSVR_CHANGECELL_PARAMS
;
435 // AFSADMSVR_CHANGEUSER_PARAMS - Parameters for changing users' properties
441 BOOL fCanChangePassword
;
442 BOOL fCanReusePasswords
;
443 SYSTEMTIME timeExpires
;
445 LONG csecTicketLifetime
;
447 LONG csecFailLoginLock
;
448 LONG cgroupCreationQuota
;
449 ACCOUNTACCESS aaListStatus
;
450 ACCOUNTACCESS aaGroupsOwned
;
451 ACCOUNTACCESS aaMembership
;
452 } AFSADMSVR_CHANGEUSER_PARAMS
, *LPAFSADMSVR_CHANGEUSER_PARAMS
;
455 // AFSADMSVR_CHANGEGROUP_PARAMS - Parameters for changing groups
459 ACCOUNTACCESS aaListStatus
;
460 ACCOUNTACCESS aaListGroupsOwned
;
461 ACCOUNTACCESS aaListMembers
;
462 ACCOUNTACCESS aaAddMember
;
463 ACCOUNTACCESS aaDeleteMember
;
464 } AFSADMSVR_CHANGEGROUP_PARAMS
, *LPAFSADMSVR_CHANGEGROUP_PARAMS
;
467 // AFSADMSVR_CREATEUSER_PARAMS - Parameters for creating user accounts
477 } AFSADMSVR_CREATEUSER_PARAMS
, *LPAFSADMSVR_CREATEUSER_PARAMS
;
480 // AFSADMSVR_CREATEGROUP_PARAMS - Parameters for creating PTS groups
487 } AFSADMSVR_CREATEGROUP_PARAMS
, *LPAFSADMSVR_CREATEGROUP_PARAMS
;
490 // AFSADMSVR_DELETEUSER_PARAMS - Parameters for deleting user accounts
496 } AFSADMSVR_DELETEUSER_PARAMS
, *LPAFSADMSVR_DELETEUSER_PARAMS
;
499 // AFSADMSVR_SEARCH_TYPE - Advanced search types
503 SEARCH_NO_LIMITATIONS
,
504 SEARCH_EXPIRES_BEFORE
,
505 SEARCH_PASSWORD_EXPIRES_BEFORE
506 } AFSADMSVR_SEARCH_TYPE
;
508 // AFSADMSVR_SEARCH_PARAMS - Advanced search parameters
512 AFSADMSVR_SEARCH_TYPE SearchType
;
513 SYSTEMTIME SearchTime
;
514 } AFSADMSVR_SEARCH_PARAMS
, *LPAFSADMSVR_SEARCH_PARAMS
;