6b941cd7502bb79eacfea6867d0def9e9968a9c8
[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 #include "ptopcodes.h"
26
27 const PRSUCCESS=0;
28
29 const PR_MAXNAMELEN=64;
30 const PR_MAXGROUPS=5000;
31 const PR_MAXLIST=5000;
32 const PRSIZE=10;
33 const COSIZE=39;
34
35 struct prdebugentry {
36         afs_int32 flags;
37         afs_int32 id;
38         afs_int32 cellid;
39         afs_int32 next;
40         afs_int32 reserved[5];
41         afs_int32 entries[PRSIZE];
42         afs_int32 nextID;
43         afs_int32 nextname;
44         afs_int32 owner;
45         afs_int32 creator;
46         afs_int32 ngroups;
47         afs_int32 nusers;
48         afs_int32 count;
49         afs_int32 instance;
50         afs_int32 owned;
51         afs_int32 nextOwned;
52         afs_int32 parent;
53         afs_int32 sibling;
54         afs_int32 child;
55         char name[PR_MAXNAMELEN];
56 };
57
58 struct prcheckentry {
59         afs_int32 flags;
60         afs_int32 id;
61         afs_int32 owner;
62         afs_int32 creator;
63         afs_int32 ngroups;
64         afs_int32 nusers;
65         afs_int32 count;
66         afs_int32 reserved[5];
67         char name[PR_MAXNAMELEN];
68 };      
69
70 struct prlistentries {
71         afs_int32 flags;
72         afs_int32 id;
73         afs_int32 owner;
74         afs_int32 creator;
75         afs_int32 ngroups;
76         afs_int32 nusers;
77         afs_int32 count;
78         afs_int32 reserved[5];
79         char name[PR_MAXNAMELEN];
80 };      
81
82 struct PrUpdateEntry {
83         afs_uint32 Mask;
84         afs_int32 flags;
85         afs_int32 id;
86         afs_int32 owner;
87         afs_int32 creator;
88         afs_int32 ngroups;
89         afs_int32 nusers;
90         afs_int32 count;
91         afs_int32 reserved[5];
92         char name[PR_MAXNAMELEN];
93 };      
94
95 /* struct VldbUpdateEntry Mask bit values */
96 const   PRUPDATE_NAME   =       0x0001;
97 const   PRUPDATE_ID     =       0x0002;
98 const   PRUPDATE_FLAGS  =       0x0004;
99 const   PRUPDATE_NAMEHASH=      0x0008;
100 const   PRUPDATE_IDHASH =       0x0010;
101
102 /* These bits are used when calling SetFieldsEntry. */
103 %#define PR_SF_ALLBITS   0xff           /* set all access bits */
104 %#define PR_SF_NGROUPS (1<<31)          /* set field limiting group creation */
105 %#define PR_SF_NUSERS  (1<<30)          /*  "  "  foreign users  "  */
106
107 typedef char prname[PR_MAXNAMELEN];
108 typedef prname namelist<>;
109 typedef afs_int32 idlist<>;
110 typedef afs_int32 prlist<>;
111 typedef prlistentries prentries<>;
112
113 INewEntry(
114   IN string name<PR_MAXNAMELEN>,
115   IN afs_int32 id,
116   IN afs_int32 oid
117 ) = PRINEWUSER;
118
119 WhereIsIt(
120   IN afs_int32 id,
121   OUT afs_int32 *ps
122 ) = PRWHEREISIT;
123
124 DumpEntry(
125   IN afs_int32 pos,
126   OUT struct prdebugentry *entry
127 ) = PRDUMPENTRY;
128
129 AddToGroup(
130   IN afs_int32 uid,
131   IN afs_int32 gid
132 )=PRADDTOGROUP;
133
134 NameToID(
135   IN namelist *nlist,
136   OUT idlist *ilist
137 )=PRNAMETOID;
138
139 IDToName(
140   IN idlist *ilist,
141   OUT namelist *nlist
142 ) =PRIDTONAME;
143
144 Delete(
145   IN afs_int32 id
146 )=PRDELETE;
147
148 RemoveFromGroup(
149   IN afs_int32 id,
150   IN afs_int32 gid
151 )=PRREMOVEFROMGROUP;
152
153 GetCPS(
154   IN afs_int32 id,
155   OUT prlist *elist,
156   OUT afs_int32 *over
157 )=PRGETCPS;
158
159 NewEntry(
160   IN string name<PR_MAXNAMELEN>,
161   afs_int32 flag,
162   afs_int32 oid,
163   OUT afs_int32 *id
164 )=PRNEWENTRY;
165
166 ListMax(
167   OUT afs_int32 *uid,
168   afs_int32 *gid
169 )=PRLISTMAX;
170
171 SetMax(
172   IN afs_int32 id,
173   afs_int32 gflag
174 )=PRSETMAX;
175
176 ListEntry(
177   IN afs_int32 id,
178   OUT struct prcheckentry *entry
179 ) = PRLISTENTRY;
180
181 ChangeEntry(
182   IN afs_int32 id,
183   IN string name<PR_MAXNAMELEN>,
184   IN afs_int32 oid,
185   IN afs_int32 newid
186 ) = PRCHANGEENTRY;
187
188 ListElements(
189   IN afs_int32 id,
190   OUT prlist *elist,
191   OUT afs_int32 *over
192 )=PRLISTELEMENTS;
193
194 IsAMemberOf(
195   IN afs_int32 uid,
196   IN afs_int32 gid,
197   OUT afs_int32 *flag
198 )=PRISAMEMBEROF;
199
200 SetFieldsEntry(
201   IN afs_int32 id,
202   IN afs_int32 mask,
203   IN afs_int32 flags,
204   IN afs_int32 ngroups,
205   IN afs_int32 nusers,
206   IN afs_int32 spare1,
207   IN afs_int32 spare2
208 ) = PRSETFIELDSENTRY;
209
210 ListOwned(
211   IN afs_int32 id,
212   OUT prlist *elist,
213   INOUT afs_int32 *lastp
214 ) = PRLISTOWNED;
215
216 GetCPS2(
217   IN afs_int32 id,
218   IN afs_int32 host,
219   OUT prlist *elist,
220   OUT afs_int32 *over
221 )=PRGETCPS2;
222
223 GetHostCPS(
224   IN afs_int32 host,
225   OUT prlist *elist,
226   OUT afs_int32 *over
227 )=PRGETHOSTCPS;
228
229 UpdateEntry(
230   IN afs_int32 id,
231   IN string name<PR_MAXNAMELEN>,
232   IN PrUpdateEntry *uentry
233 ) = PRUPDATEENTRY;
234
235 ListEntries(
236   IN afs_int32      flags,
237   IN afs_int32      startindex,
238   OUT prentries *bulkentries,
239   OUT afs_int32     *nextstartindex
240 ) = PRLISTENTRIES;
241
242 #if defined(SUPERGROUPS)
243 /*
244  *
245  * Dummy stubs for "reserved to Transarc" opcodes; just so
246  * that ptint.ss.c uses nicer function table.
247  */
248 %#define PR_Pr523(call) (RXGEN_OPCODE)
249 %#define PR_Pr524(call) (RXGEN_OPCODE)
250 %#define PR_Pr525(call) (RXGEN_OPCODE)
251 %#define PR_Pr526(call) (RXGEN_OPCODE)
252 %#define PR_Pr527(call) (RXGEN_OPCODE)
253 %#define PR_Pr528(call) (RXGEN_OPCODE)
254 %#define PR_Pr529(call) (RXGEN_OPCODE)
255 Pr523()=523;
256 Pr524()=524;
257 Pr525()=525;
258 Pr526()=526;
259 Pr527()=527;
260 Pr528()=528;
261 Pr529()=529;
262
263 ListSuperGroups(
264   IN long id,
265   OUT prlist *elist,
266   OUT long *over
267 ) = PRLISTSUPERGROUPS;
268
269 #endif