ptserver: move allocation out of put_prentries() into listEntries()
[openafs.git] / src / ptserver / ptint.xg
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 /*
11  *                      Transarc does not currently use opcodes past 520, but
12  *                      they *could* decide at any time to use more opcodes.
13  *                      If they did, then one part of our local mods,
14  *                      ListSupergroups, would break.  I've therefore
15  *                      renumbered it to 530, and put logic in to enable the
16  *                      old opcode to work (for now).
17  *
18  */
19
20
21 package PR_
22 prefix S
23 statindex 8
24
25 const PRSUCCESS=0;
26
27 const PR_MAXNAMELEN=64;
28 const PR_MAXGROUPS=5000;
29 const PR_MAXLIST=5000;
30 const PRSIZE=10;
31 const COSIZE=39;
32
33 struct prdebugentry {
34         afs_int32 flags;
35         afs_int32 id;
36         afs_int32 cellid;
37         afs_int32 next;
38         afs_int32 reserved[5];
39         afs_int32 entries[PRSIZE];
40         afs_int32 nextID;
41         afs_int32 nextname;
42         afs_int32 owner;
43         afs_int32 creator;
44         afs_int32 ngroups;
45         afs_int32 nusers;
46         afs_int32 count;
47         afs_int32 instance;
48         afs_int32 owned;
49         afs_int32 nextOwned;
50         afs_int32 parent;
51         afs_int32 sibling;
52         afs_int32 child;
53         char name[PR_MAXNAMELEN];
54 };
55
56 struct prcheckentry {
57         afs_int32 flags;
58         afs_int32 id;
59         afs_int32 owner;
60         afs_int32 creator;
61         afs_int32 ngroups;
62         afs_int32 nusers;
63         afs_int32 count;
64         afs_int32 reserved[5];
65         char name[PR_MAXNAMELEN];
66 };
67
68 struct prlistentries {
69         afs_int32 flags;
70         afs_int32 id;
71         afs_int32 owner;
72         afs_int32 creator;
73         afs_int32 ngroups;
74         afs_int32 nusers;
75         afs_int32 count;
76         afs_int32 reserved[5];
77         char name[PR_MAXNAMELEN];
78 };
79
80 struct PrUpdateEntry {
81         afs_uint32 Mask;
82         afs_int32 flags;
83         afs_int32 id;
84         afs_int32 owner;
85         afs_int32 creator;
86         afs_int32 ngroups;
87         afs_int32 nusers;
88         afs_int32 count;
89         afs_int32 reserved[5];
90         char name[PR_MAXNAMELEN];
91 };
92
93 /* struct VldbUpdateEntry Mask bit values */
94 const   PRUPDATE_NAME   =       0x0001;
95 const   PRUPDATE_ID     =       0x0002;
96 const   PRUPDATE_FLAGS  =       0x0004;
97 const   PRUPDATE_NAMEHASH=      0x0008;
98 const   PRUPDATE_IDHASH =       0x0010;
99
100 /* These bits are used when calling SetFieldsEntry. */
101 %#define PR_SF_ALLBITS   0xff           /* set all access bits */
102 %#define PR_SF_NGROUPS (1u<<31)         /* set field limiting group creation */
103 %#define PR_SF_NUSERS  (1u<<30)         /*  "  "  foreign users  "  */
104
105 /* OpenAFS implementation limit.  This limit can be modified in future releases
106  * and does not need to match the limits applied by other implementations. */
107 const OPENAFS_MAXPRLIST=500000;
108
109 typedef char prname[PR_MAXNAMELEN];
110 typedef prname namelist<OPENAFS_MAXPRLIST>;
111 typedef afs_int32 idlist<OPENAFS_MAXPRLIST>;
112 typedef afs_int32 prlist<OPENAFS_MAXPRLIST>;
113 typedef prlistentries prentries<OPENAFS_MAXPRLIST>;
114
115 INewEntry(
116   IN string name<PR_MAXNAMELEN>,
117   IN afs_int32 id,
118   IN afs_int32 oid
119 ) = 500;
120
121 WhereIsIt(
122   IN afs_int32 id,
123   OUT afs_int32 *ps
124 ) = 501;
125
126 DumpEntry(
127   IN afs_int32 pos,
128   OUT struct prdebugentry *entry
129 ) = 502;
130
131 AddToGroup(
132   IN afs_int32 uid,
133   IN afs_int32 gid
134 ) = 503;
135
136 NameToID(
137   IN namelist *nlist,
138   OUT idlist *ilist
139 ) = 504;
140
141 IDToName(
142   IN idlist *ilist,
143   OUT namelist *nlist
144 ) = 505;
145
146 Delete(
147   IN afs_int32 id
148 ) = 506;
149
150 RemoveFromGroup(
151   IN afs_int32 id,
152   IN afs_int32 gid
153 ) = 507;
154
155 GetCPS(
156   IN afs_int32 id,
157   OUT prlist *elist,
158   OUT afs_int32 *over
159 ) = 508;
160
161 NewEntry(
162   IN string name<PR_MAXNAMELEN>,
163   afs_int32 flag,
164   afs_int32 oid,
165   OUT afs_int32 *id
166 ) = 509;
167
168 ListMax(
169   OUT afs_int32 *uid,
170   afs_int32 *gid
171 ) = 510;
172
173 SetMax(
174   IN afs_int32 id,
175   afs_int32 gflag
176 ) = 511;
177
178 ListEntry(
179   IN afs_int32 id,
180   OUT struct prcheckentry *entry
181 ) = 512;
182
183 ChangeEntry(
184   IN afs_int32 id,
185   IN string name<PR_MAXNAMELEN>,
186   IN afs_int32 oid,
187   IN afs_int32 newid
188 ) = 513;
189
190 ListElements(
191   IN afs_int32 id,
192   OUT prlist *elist,
193   OUT afs_int32 *over
194 ) = 514;
195
196 IsAMemberOf(
197   IN afs_int32 uid,
198   IN afs_int32 gid,
199   OUT afs_int32 *flag
200 ) = 515;
201
202 SetFieldsEntry(
203   IN afs_int32 id,
204   IN afs_int32 mask,
205   IN afs_int32 flags,
206   IN afs_int32 ngroups,
207   IN afs_int32 nusers,
208   IN afs_int32 spare1,
209   IN afs_int32 spare2
210 ) = 516;
211
212 ListOwned(
213   IN afs_int32 id,
214   OUT prlist *elist,
215   INOUT afs_int32 *lastp
216 ) = 517;
217
218 GetCPS2(
219   IN afs_int32 id,
220   IN afs_int32 host,
221   OUT prlist *elist,
222   OUT afs_int32 *over
223 ) = 518;
224
225 GetHostCPS(
226   IN afs_int32 host,
227   OUT prlist *elist,
228   OUT afs_int32 *over
229 ) = 519;
230
231 UpdateEntry(
232   IN afs_int32 id,
233   IN string name<PR_MAXNAMELEN>,
234   IN PrUpdateEntry *uentry
235 ) = 520;
236
237 ListEntries(
238   IN afs_int32      flags,
239   IN afs_int32      startindex,
240   OUT prentries *bulkentries,
241   OUT afs_int32     *nextstartindex
242 ) = 521;
243
244 /* #if defined(SUPERGROUPS) */
245 ListSuperGroups(
246   IN afs_int32 id,
247   OUT prlist *elist,
248   OUT afs_int32 *over
249 ) = 530;
250 /* #endif */