bec524996cc56ea70067a3ae8eae0958ce26e505
[openafs.git] / src / libadmin / pts / afs_ptsAdmin.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 TRANSARC_AFS_PTS_ADMIN_H
11 #define TRANSARC_AFS_PTS_ADMIN_H
12
13 #include <afs/param.h>
14 #include <afs/afs_Admin.h>
15
16 #define PTS_MAX_NAME_LEN 64
17 #define PTS_MAX_GROUPS 5000
18
19 typedef enum {
20   PTS_USER_OWNER_ACCESS,
21   PTS_USER_ANYUSER_ACCESS
22 } pts_userAccess_t, *pts_userAccess_p;
23
24 typedef enum {
25   PTS_GROUP_OWNER_ACCESS = 10,
26   PTS_GROUP_ACCESS,
27   PTS_GROUP_ANYUSER_ACCESS
28 } pts_groupAccess_t, *pts_groupAccess_p;
29
30 typedef struct pts_UserEntry {
31     int groupCreationQuota;
32     int groupMembershipCount;
33     int nameUid;
34     int ownerUid;
35     int creatorUid;
36     pts_userAccess_t listStatus;
37     pts_userAccess_t listGroupsOwned;
38     pts_userAccess_t listMembership;
39     char name[PTS_MAX_NAME_LEN];
40     char owner[PTS_MAX_NAME_LEN];
41     char creator[PTS_MAX_NAME_LEN];
42 } pts_UserEntry_t, *pts_UserEntry_p;
43
44 typedef enum {
45   PTS_USER_UPDATE_GROUP_CREATE_QUOTA = 0x1,
46   PTS_USER_UPDATE_PERMISSIONS = 0x2
47 } pts_UserUpdateFlag_t, *pts_UserUpdateFlag_p;
48
49 typedef struct pts_UserUpdateEntry {
50     pts_UserUpdateFlag_t flag;
51     int groupCreationQuota;
52     pts_userAccess_t listStatus;
53     pts_userAccess_t listGroupsOwned;
54     pts_userAccess_t listMembership;
55 } pts_UserUpdateEntry_t, *pts_UserUpdateEntry_p;
56
57 typedef struct pts_GroupEntry {
58     int membershipCount;
59     int nameUid;
60     int ownerUid;
61     int creatorUid;
62     pts_groupAccess_t listStatus;
63     pts_groupAccess_t listGroupsOwned;
64     pts_groupAccess_t listMembership;
65     pts_groupAccess_t listAdd;
66     pts_groupAccess_t listDelete;
67     char name[PTS_MAX_NAME_LEN];
68     char owner[PTS_MAX_NAME_LEN];
69     char creator[PTS_MAX_NAME_LEN];
70 } pts_GroupEntry_t, *pts_GroupEntry_p;
71
72 typedef struct pts_GroupUpdateEntry {
73     pts_groupAccess_t listStatus;
74     pts_groupAccess_t listGroupsOwned;
75     pts_groupAccess_t listMembership;
76     pts_groupAccess_t listAdd;
77     pts_groupAccess_t listDelete;
78 } pts_GroupUpdateEntry_t, *pts_GroupUpdateEntry_p;
79
80 extern int ADMINAPI pts_GroupMemberAdd(
81   const void *cellHandle,
82   const char *userName,
83   const char *groupName,
84   afs_status_p st
85 );
86
87 extern int ADMINAPI pts_GroupOwnerChange(
88   const void *cellHandle,
89   const char *targetGroup,
90   const char *newOwner,
91   afs_status_p st
92 );
93
94 extern int ADMINAPI pts_GroupCreate(
95   const void *cellHandle,
96   const char *newGroup,
97   const char *newOwner,
98   int *newGroupId,
99   afs_status_p st
100 );
101
102 extern int ADMINAPI pts_GroupGet(
103   const void *cellHandle,
104   const char *groupName,
105   pts_GroupEntry_p groupP,
106   afs_status_p st
107 );
108
109 extern int ADMINAPI pts_GroupDelete(
110   const void *cellHandle,
111   const char *groupName,
112   afs_status_p st
113 );
114
115 extern int ADMINAPI pts_GroupMaxGet(
116   const void *cellHandle,
117   int *maxGroupId,
118   afs_status_p st
119 );
120
121 extern int ADMINAPI pts_GroupMaxSet(
122   const void *cellHandle,
123   int maxGroupId,
124   afs_status_p st
125 );
126
127 extern int ADMINAPI pts_GroupMemberListBegin(
128   const void *cellHandle,
129   const char *groupName,
130   void **iterationIdP,
131   afs_status_p st
132 );
133
134 extern int ADMINAPI pts_GroupMemberListNext(
135   const void *iterationId,
136   char *memberName,
137   afs_status_p st
138 );
139
140 extern int ADMINAPI pts_GroupMemberListDone(
141   const void *iterationId,
142   afs_status_p st
143 );
144
145 extern int ADMINAPI pts_GroupMemberRemove(
146   const void *cellHandle,
147   const char *userName,
148   const char *groupName,
149   afs_status_p st
150 );
151
152 extern int ADMINAPI pts_GroupRename(
153   const void *cellHandle,
154   const char *oldName,
155   const char *newName,
156   afs_status_p st
157 );
158
159 extern int ADMINAPI pts_GroupModify(
160   const void *cellHandle,
161   const char *groupName,
162   const pts_GroupUpdateEntry_p newEntryP,
163   afs_status_p st
164 );
165
166 extern int ADMINAPI pts_UserCreate(
167   const void *cellHandle,
168   const char *userName,
169   int *newUserId,
170   afs_status_p st
171 );
172
173 extern int ADMINAPI pts_UserDelete(
174   const void *cellHandle,
175   const char *userName,
176   afs_status_p st
177 );
178
179 extern int ADMINAPI pts_UserGet(
180   const void *cellHandle,
181   const char *userName,
182   pts_UserEntry_p userP,
183   afs_status_p st
184 );
185
186 extern int ADMINAPI pts_UserRename(
187   const void *cellHandle,
188   const char *oldName,
189   const char *newName,
190   afs_status_p st
191 );
192
193 extern int ADMINAPI pts_UserModify(
194   const void *cellHandle,
195   const char *userName,
196   const pts_UserUpdateEntry_p newEntryP,
197   afs_status_p st
198 );
199
200 extern int ADMINAPI pts_UserMaxGet(
201   const void *cellHandle,
202   int *maxUserId,
203   afs_status_p st
204 );
205
206 extern int ADMINAPI pts_UserMaxSet(
207   const void *cellHandle,
208   int maxUserId,
209   afs_status_p st
210 );
211
212 extern int ADMINAPI pts_UserMemberListBegin(
213   const void *cellHandle,
214   const char *userName,
215   void **iterationIdP,
216   afs_status_p st
217 );
218
219 extern int ADMINAPI pts_UserMemberListNext(
220   const void *iterationId,
221   char *userName,
222   afs_status_p st
223 );
224
225 extern int ADMINAPI pts_UserMemberListDone(
226   const void *iterationId,
227   afs_status_p st
228 );
229
230 extern int ADMINAPI pts_OwnedGroupListBegin(
231   const void *cellHandle,
232   const char *userName,
233   void **iterationIdP,
234   afs_status_p st
235 );
236
237 extern int ADMINAPI pts_OwnedGroupListNext(
238   const void *iterationId,
239   char *groupName,
240   afs_status_p st
241 );
242
243 extern int ADMINAPI pts_OwnedGroupListDone(
244   const void *iterationId,
245   afs_status_p st
246 );
247
248 extern int ADMINAPI pts_UserListBegin(
249   const void *cellHandle,
250   void **iterationIdP,
251   afs_status_p st
252 );
253
254 extern int ADMINAPI pts_UserListNext(
255   const void *iterationId,
256   char *userName,
257   afs_status_p st
258 );
259
260 extern int ADMINAPI pts_UserListDone(
261   const void *iterationId,
262   afs_status_p st
263 );
264
265 extern int ADMINAPI pts_GroupListBegin(
266   const void *cellHandle,
267   void **iterationIdP,
268   afs_status_p st
269 );
270
271 extern int ADMINAPI pts_GroupListNext(
272   const void *iterationId,
273   char *groupName,
274   afs_status_p st
275 );
276
277 extern int ADMINAPI pts_GroupListDone(
278   const void *iterationId,
279   afs_status_p st
280 );
281
282 #endif /* TRANSARC_AFS_PTS_ADMIN_H */