Import Upstream version 1.8.5
[hcoop/debian/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 OPENAFS_PTS_ADMIN_H
11 #define OPENAFS_PTS_ADMIN_H
12
13 #include <afs/param.h>
14 #include <afs/afs_Admin.h>
15
16 #define PTS_MAX_NAME_LEN 64 /* must equal PR_MAXNAMELEN */
17 #define PTS_MAX_GROUPS 5000 /* must equal PR_MAXGROUPS */
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(const void *cellHandle,
81 const char *userName,
82 const char *groupName,
83 afs_status_p st);
84
85 extern int ADMINAPI pts_GroupOwnerChange(const void *cellHandle,
86 const char *targetGroup,
87 const char *newOwner,
88 afs_status_p st);
89
90 extern int ADMINAPI pts_GroupCreate(const void *cellHandle,
91 char *newGroup,
92 char *newOwner, int *newGroupId,
93 afs_status_p st);
94
95 extern int ADMINAPI pts_GroupGet(const void *cellHandle,
96 const char *groupName,
97 pts_GroupEntry_p groupP, afs_status_p st);
98
99 extern int ADMINAPI pts_GroupDelete(const void *cellHandle,
100 const char *groupName, afs_status_p st);
101
102 extern int ADMINAPI pts_GroupMaxGet(const void *cellHandle, int *maxGroupId,
103 afs_status_p st);
104
105 extern int ADMINAPI pts_GroupMaxSet(const void *cellHandle, int maxGroupId,
106 afs_status_p st);
107
108 extern int ADMINAPI pts_GroupMemberListBegin(const void *cellHandle,
109 const char *groupName,
110 void **iterationIdP,
111 afs_status_p st);
112
113 extern int ADMINAPI pts_GroupMemberListNext(const void *iterationId,
114 char *memberName,
115 afs_status_p st);
116
117 extern int ADMINAPI pts_GroupMemberListDone(const void *iterationId,
118 afs_status_p st);
119
120 extern int ADMINAPI pts_GroupMemberRemove(const void *cellHandle,
121 const char *userName,
122 const char *groupName,
123 afs_status_p st);
124
125 extern int ADMINAPI pts_GroupRename(const void *cellHandle,
126 const char *oldName, char *newName,
127 afs_status_p st);
128
129 extern int ADMINAPI pts_GroupModify(const void *cellHandle,
130 const char *groupName,
131 const pts_GroupUpdateEntry_p newEntryP,
132 afs_status_p st);
133
134 extern int ADMINAPI pts_UserCreate(const void *cellHandle,
135 char *userName, int *newUserId,
136 afs_status_p st);
137
138 extern int ADMINAPI pts_UserDelete(const void *cellHandle,
139 const char *userName, afs_status_p st);
140
141 extern int ADMINAPI pts_UserGet(const void *cellHandle, const char *userName,
142 pts_UserEntry_p userP, afs_status_p st);
143
144 extern int ADMINAPI pts_UserRename(const void *cellHandle,
145 const char *oldName, char *newName,
146 afs_status_p st);
147
148 extern int ADMINAPI pts_UserModify(const void *cellHandle,
149 const char *userName,
150 const pts_UserUpdateEntry_p newEntryP,
151 afs_status_p st);
152
153 extern int ADMINAPI pts_UserMaxGet(const void *cellHandle, int *maxUserId,
154 afs_status_p st);
155
156 extern int ADMINAPI pts_UserMaxSet(const void *cellHandle, int maxUserId,
157 afs_status_p st);
158
159 extern int ADMINAPI pts_UserMemberListBegin(const void *cellHandle,
160 const char *userName,
161 void **iterationIdP,
162 afs_status_p st);
163
164 extern int ADMINAPI pts_UserMemberListNext(const void *iterationId,
165 char *userName, afs_status_p st);
166
167 extern int ADMINAPI pts_UserMemberListDone(const void *iterationId,
168 afs_status_p st);
169
170 extern int ADMINAPI pts_OwnedGroupListBegin(const void *cellHandle,
171 const char *userName,
172 void **iterationIdP,
173 afs_status_p st);
174
175 extern int ADMINAPI pts_OwnedGroupListNext(const void *iterationId,
176 char *groupName, afs_status_p st);
177
178 extern int ADMINAPI pts_OwnedGroupListDone(const void *iterationId,
179 afs_status_p st);
180
181 extern int ADMINAPI pts_UserListBegin(const void *cellHandle,
182 void **iterationIdP, afs_status_p st);
183
184 extern int ADMINAPI pts_UserListNext(const void *iterationId, char *userName,
185 afs_status_p st);
186
187 extern int ADMINAPI pts_UserListDone(const void *iterationId,
188 afs_status_p st);
189
190 extern int ADMINAPI pts_GroupListBegin(const void *cellHandle,
191 void **iterationIdP, afs_status_p st);
192
193 extern int ADMINAPI pts_GroupListNext(const void *iterationId,
194 char *groupName, afs_status_p st);
195
196 extern int ADMINAPI pts_GroupListDone(const void *iterationId,
197 afs_status_p st);
198
199 #endif /* OPENAFS_PTS_ADMIN_H */