create-inline-bulkstatus-rpc-and-server-stub-20010925
[openafs.git] / src / fsint / afsint.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  * afsint.xg:
12  *      Definition of the AFS File Server RPC interface.
13  */
14
15 #include "common.xg"                    /*Common structures & definitions*/
16
17 %#define VICECONNBAD    1234
18 %#define VICETOKENDEAD  1235
19 %#define AFS_LOCKWAIT   (5*60)
20
21 customized struct CBS {
22     afs_int32 SeqLen;
23     char *SeqBody;
24 };
25
26 customized struct BBS {
27     afs_int32 MaxSeqLen;
28     afs_int32 SeqLen;
29     char *SeqBody;
30 };
31
32 customized struct AFSAccessList {
33     afs_int32 MaxSeqLen;
34     afs_int32 SeqLen;
35     char *SeqBody;
36 };
37
38 typedef AFSFid ViceFid;
39
40 typedef afs_int32 ViceDataType;
41
42 %#define Invalid 0
43 %#define File 1 
44 %#define Directory 2 
45 %#define SymbolicLink 3 
46
47 %#ifdef KERNEL
48 %#define        xdr_array(a,b,c,d,e,f)  xdr_arrayN(a,b,c,d,e,f)
49 %#endif
50
51 struct BD {
52     afs_int32 host;
53     afs_int32 portal;
54     afs_int32 session;
55 };
56
57 struct AFSVolSync {
58     afs_uint32 spare1;
59     afs_uint32 spare2;
60     afs_uint32 spare3;
61     afs_uint32 spare4;
62     afs_uint32 spare5;
63     afs_uint32 spare6;
64 };
65
66 struct AFSOldFetchStatus {
67     afs_uint32 InterfaceVersion;
68     afs_uint32 FileType;
69     afs_uint32 LinkCount;
70     afs_uint32 Length;
71     afs_uint32 DataVersion;
72     afs_uint32 Author;
73     afs_uint32 Owner;
74     afs_uint32 CallerAccess;
75     afs_uint32 AnonymousAccess;
76     afs_uint32 UnixModeBits;
77     afs_uint32 ParentVnode;
78     afs_uint32 ParentUnique;
79     afs_uint32 SegSize;
80     afs_uint32 ClientModTime;
81     afs_uint32 ServerModTime;
82     afs_uint32 Group;
83 };
84
85 struct AFSFetchStatus {
86     afs_uint32 InterfaceVersion;
87     afs_uint32 FileType;
88     afs_uint32 LinkCount;
89     afs_uint32 Length;
90     afs_uint32 DataVersion;
91     afs_uint32 Author;
92     afs_uint32 Owner;
93     afs_uint32 CallerAccess;
94     afs_uint32 AnonymousAccess;
95     afs_uint32 UnixModeBits;
96     afs_uint32 ParentVnode;
97     afs_uint32 ParentUnique;
98     afs_uint32 SegSize;
99     afs_uint32 ClientModTime;
100     afs_uint32 ServerModTime;
101     afs_uint32 Group;
102     afs_uint32 SyncCounter;
103     afs_uint32 dataVersionHigh; /* For AFS/DFS translator, hi bits of dvn */
104     afs_uint32 lockCount;
105     afs_uint32 spare3;
106     afs_uint32 errorCode;
107 };
108
109 struct AFSStoreStatus {
110     afs_uint32 Mask;    
111     afs_uint32 ClientModTime;
112     afs_uint32 Owner;
113     afs_uint32 Group;
114     afs_uint32 UnixModeBits;
115     afs_uint32 SegSize;
116 };
117
118 %#define        AFS_SETMODTIME  1
119 %#define        AFS_SETOWNER    2
120 %#define        AFS_SETGROUP            4
121 %#define        AFS_SETMODE             8
122 %#define        AFS_SETSEGSIZE  16
123 %#define        AFS_FSYNC       1024
124
125 typedef afs_int32 ViceVolumeType;
126
127 %#define ReadOnly 0
128 %#define ReadWrite 1
129
130
131 struct ViceDisk {
132     afs_int32   BlocksAvailable;
133     afs_int32   TotalBlocks;
134     DiskName    Name;
135 };
136
137 struct ViceStatistics {
138     afs_uint32 CurrentMsgNumber;
139     afs_uint32 OldestMsgNumber;
140     afs_uint32 CurrentTime;
141     afs_uint32 BootTime;
142     afs_uint32 StartTime;
143     afs_int32     CurrentConnections;
144     afs_uint32 TotalViceCalls;
145     afs_uint32 TotalFetchs;
146     afs_uint32 FetchDatas;
147     afs_uint32 FetchedBytes;
148     afs_int32     FetchDataRate;
149     afs_uint32 TotalStores;
150     afs_uint32 StoreDatas;
151     afs_uint32 StoredBytes;
152     afs_int32     StoreDataRate;
153     afs_uint32 TotalRPCBytesSent;
154     afs_uint32 TotalRPCBytesReceived;
155     afs_uint32 TotalRPCPacketsSent;
156     afs_uint32 TotalRPCPacketsReceived;
157     afs_uint32 TotalRPCPacketsLost;
158     afs_uint32 TotalRPCBogusPackets;
159     afs_int32     SystemCPU;
160     afs_int32     UserCPU;
161     afs_int32     NiceCPU;
162     afs_int32     IdleCPU;
163     afs_int32     TotalIO;
164     afs_int32     ActiveVM;
165     afs_int32     TotalVM;
166     afs_int32     EtherNetTotalErrors;
167     afs_int32     EtherNetTotalWrites;
168     afs_int32     EtherNetTotalInterupts;
169     afs_int32     EtherNetGoodReads;
170     afs_int32     EtherNetTotalBytesWritten;
171     afs_int32     EtherNetTotalBytesRead;
172     afs_int32     ProcessSize;
173     afs_int32     WorkStations;
174     afs_int32     ActiveWorkStations;
175     afs_int32     Spare1;
176     afs_int32     Spare2;
177     afs_int32     Spare3;
178     afs_int32     Spare4;
179     afs_int32     Spare5;
180     afs_int32     Spare6;
181     afs_int32     Spare7;
182     afs_int32     Spare8;
183     ViceDisk      Disk1;
184     ViceDisk      Disk2;
185     ViceDisk      Disk3;
186     ViceDisk      Disk4;
187     ViceDisk      Disk5;
188     ViceDisk      Disk6;
189     ViceDisk      Disk7;
190     ViceDisk      Disk8;
191     ViceDisk      Disk9;
192     ViceDisk      Disk10;
193 };
194
195 struct VolumeStatus {
196     afs_int32 Vid;
197     afs_int32 ParentId;
198     char Online;
199     char InService;
200     char Blessed;
201     char NeedsSalvage;
202     afs_int32 Type;
203     afs_int32 MinQuota;
204     afs_int32 MaxQuota;
205     afs_int32 BlocksInUse;
206     afs_int32 PartBlocksAvail;
207     afs_int32 PartMaxBlocks;
208 };
209
210 struct AFSFetchVolumeStatus {
211     afs_int32 Vid;
212     afs_int32 ParentId;
213     char Online;
214     char InService;
215     char Blessed;
216     char NeedsSalvage;
217     afs_int32 Type;
218     afs_int32 MinQuota;
219     afs_int32 MaxQuota;
220     afs_int32 BlocksInUse;
221     afs_int32 PartBlocksAvail;
222     afs_int32 PartMaxBlocks;
223 };
224
225 struct AFSStoreVolumeStatus {
226     afs_int32 Mask;
227     afs_int32 MinQuota;
228     afs_int32 MaxQuota;
229 };
230
231 const AFS_SETMINQUOTA = 1;
232 const AFS_SETMAXQUOTA = 2;
233
234 struct AFSVolumeInfo {
235     afs_uint32  Vid;
236     afs_int32      Type;
237     afs_uint32  Type0;
238     afs_uint32  Type1;
239     afs_uint32  Type2;
240     afs_uint32  Type3;
241     afs_uint32  Type4;
242     afs_uint32  ServerCount;
243     afs_uint32  Server0;
244     afs_uint32  Server1;
245     afs_uint32  Server2;
246     afs_uint32  Server3;
247     afs_uint32  Server4;
248     afs_uint32  Server5;
249     afs_uint32  Server6;
250     afs_uint32  Server7;
251     unsigned short Port0;
252     unsigned short Port1;
253     unsigned short Port2;
254     unsigned short Port3;
255     unsigned short Port4;
256     unsigned short Port5;
257     unsigned short Port6;
258     unsigned short Port7;
259 };
260
261 struct VolumeInfo {
262     afs_uint32 Vid;
263     afs_int32     Type;
264     afs_uint32 Type0;
265     afs_uint32 Type1;
266     afs_uint32 Type2;
267     afs_uint32 Type3;
268     afs_uint32 Type4;
269     afs_uint32 ServerCount;
270     afs_uint32 Server0;
271     afs_uint32 Server1;
272     afs_uint32 Server2;
273     afs_uint32 Server3;
274     afs_uint32 Server4;
275     afs_uint32 Server5;
276     afs_uint32 Server6;
277     afs_uint32 Server7;
278 };
279
280 typedef afs_int32 ViceLockType;
281 typedef AFSFetchStatus AFSBulkStats<AFSCBMAX>;
282
283 %#define LockRead               0
284 %#define LockWrite              1
285 %#define LockExtend     2
286 %#define LockRelease    3
287
288 typedef afs_int32 ViceOfflineType;
289
290 %#define NoSalvage 0
291 %#define Salvage 1
292
293 %#ifdef KERNEL
294 %#include "../afs/longc_procs.h"
295 %#endif
296
297 const FLUSHMAX = 10;
298 typedef afs_int32 ViceIds<FLUSHMAX>;
299 typedef afs_int32 IPAddrs<FLUSHMAX>;
300
301 %#define MAXCMDINT64S                           3
302 %#define MAXCMDINT32S                           200
303 %#define MAXCMDCHARS                            256
304
305 struct ResidencyCmdInputs {
306     afs_int32  command;
307     struct AFSFid fid;
308     afs_int64  int64s[MAXCMDINT64S];
309     afs_uint32 int32s[MAXCMDINT32S];
310     char       chars[MAXCMDCHARS];
311 };
312
313 struct ResidencyCmdOutputs {
314     afs_int32  code;
315     struct AFSFetchStatus status;
316     afs_int64  int64s[MAXCMDINT64S];
317     afs_uint32 int32s[MAXCMDINT32S];
318     char       chars[MAXCMDCHARS];
319 }; 
320
321 package RXAFS_
322 prefix S
323 statindex 7
324
325 FetchData(
326   IN  AFSFid *Fid, 
327   afs_int32 Pos, 
328   afs_int32 Length, 
329   OUT AFSFetchStatus *OutStatus, 
330   AFSCallBack *CallBack, 
331   AFSVolSync *Sync
332 ) split = 130;
333
334 FetchACL(
335   IN  AFSFid *Fid, 
336   OUT AFSOpaque *AccessList, 
337   AFSFetchStatus *OutStatus, 
338   AFSVolSync *Sync
339 ) = 131;
340
341 FetchStatus(
342   IN  AFSFid *Fid, 
343   OUT AFSFetchStatus *OutStatus, 
344   AFSCallBack *CallBack, 
345   AFSVolSync *Sync
346 ) = 132;
347
348 StoreData(
349   IN  AFSFid *Fid, 
350   AFSStoreStatus *InStatus, 
351   afs_int32 Pos, 
352   afs_int32 Length, 
353   afs_int32 FileLength, 
354   OUT AFSFetchStatus *OutStatus, 
355   AFSVolSync *Sync
356 ) split = 133;
357
358 StoreACL(
359   IN  AFSFid *Fid, 
360   AFSOpaque *AccessList,  
361   OUT AFSFetchStatus *OutStatus, 
362   AFSVolSync *Sync
363 ) = 134;
364
365 StoreStatus(
366   IN  AFSFid *Fid, 
367   AFSStoreStatus *InStatus, 
368   OUT AFSFetchStatus *OutStatus, 
369   AFSVolSync *Sync
370 ) = 135;
371
372 RemoveFile(
373   IN  AFSFid *DirFid, 
374   string Name<AFSNAMEMAX>, 
375   OUT AFSFetchStatus *OutStatus, 
376   AFSVolSync *Sync
377 ) = 136;
378
379 CreateFile(
380   IN  AFSFid *DirFid, 
381   string Name<AFSNAMEMAX>,  
382   AFSStoreStatus *InStatus, 
383   OUT AFSFid *OutFid, 
384   AFSFetchStatus *OutFidStatus, 
385   AFSFetchStatus *OutDirStatus, 
386   AFSCallBack *CallBack, 
387   AFSVolSync *Sync) = 137;
388
389 Rename(
390   IN  AFSFid *OldDirFid, 
391   string OldName<AFSNAMEMAX>, 
392   AFSFid *NewDirFid, 
393   string NewName<AFSNAMEMAX>, 
394   OUT AFSFetchStatus *OutOldDirStatus, 
395   AFSFetchStatus *OutNewDirStatus, 
396   AFSVolSync *Sync
397 ) = 138;
398
399 Symlink(
400   IN  AFSFid *DirFid, 
401   string Name<AFSNAMEMAX>, 
402   string LinkContents<AFSPATHMAX>, 
403   AFSStoreStatus *InStatus, 
404   OUT AFSFid *OutFid, 
405   AFSFetchStatus *OutFidStatus, 
406   AFSFetchStatus *OutDirStatus, 
407   AFSVolSync *Sync
408 ) = 139;
409
410 Link(
411   IN  AFSFid *DirFid, 
412   string Name<AFSNAMEMAX>, 
413   AFSFid *ExistingFid, 
414   OUT AFSFetchStatus *OutFidStatus, 
415   AFSFetchStatus *OutDirStatus, 
416   AFSVolSync *Sync
417 ) = 140;
418
419 MakeDir(
420   IN  AFSFid *DirFid, 
421   string Name<AFSNAMEMAX>, 
422   AFSStoreStatus *InStatus, 
423   OUT AFSFid *OutFid, 
424   AFSFetchStatus *OutFidStatus, 
425   AFSFetchStatus *OutDirStatus, 
426   AFSCallBack *CallBack, 
427   AFSVolSync *Sync
428 ) = 141;
429
430 RemoveDir(
431   IN  AFSFid *DirFid, 
432   string Name<AFSNAMEMAX>, 
433   OUT AFSFetchStatus *OutDirStatus, 
434   AFSVolSync *Sync
435 ) = 142;
436
437 OldSetLock(
438   IN  AFSFid *Fid, 
439   ViceLockType Type, 
440   AFSVolSync *Sync
441 ) = 143;
442
443 OldExtendLock(
444   IN  AFSFid *Fid, 
445   AFSVolSync *Sync
446 ) = 144;
447
448 OldReleaseLock(
449   IN  AFSFid *Fid, 
450   AFSVolSync *Sync
451 ) = 145;
452
453 GetStatistics(
454   OUT ViceStatistics *Statistics
455 ) = 146;
456
457 GiveUpCallBacks(
458   IN  AFSCBFids *Fids_Array,
459   AFSCBs *CallBacks_Array
460 ) = 147;
461
462 GetVolumeInfo(
463   IN  string VolumeName<AFSNAMEMAX>, 
464   OUT VolumeInfo *Volumeinfo
465 ) = 148;
466
467 GetVolumeStatus(
468   IN  afs_int32 Volumeid, 
469   OUT AFSFetchVolumeStatus *Volumestatus, 
470   string Name<AFSNAMEMAX>,
471   string OfflineMsg<AFSOPAQUEMAX>, 
472   string Motd<AFSOPAQUEMAX>
473 ) = 149;
474
475 SetVolumeStatus(
476   IN  afs_int32 Volumeid, 
477   AFSStoreVolumeStatus *Volumestatus,
478   string Name<AFSNAMEMAX>,
479   string OfflineMsg<AFSOPAQUEMAX>,
480   string Motd<AFSOPAQUEMAX>
481 ) = 150;
482
483 GetRootVolume(
484   OUT string VolumeName<AFSNAMEMAX>
485 ) = 151;
486
487 CheckToken(
488   IN  afs_int32 ViceId,  
489   AFSOpaque *token
490 ) = 152;
491
492 GetTime(
493   OUT afs_uint32 *Seconds, 
494   afs_uint32 *USeconds
495 ) = 153;
496
497 NGetVolumeInfo(
498   IN  string VolumeName<AFSNAMEMAX>,
499   OUT AFSVolumeInfo *stuff
500 ) = 154;
501
502 BulkStatus(
503   IN  AFSCBFids *FidsArray,
504   OUT AFSBulkStats *StatArray,
505   AFSCBs *CBArray,
506   AFSVolSync *Sync
507 ) = 155;
508
509 SetLock(
510   IN  AFSFid *Fid, 
511   ViceLockType Type, 
512   OUT AFSVolSync *Sync
513 ) = 156;
514
515 ExtendLock(
516   IN  AFSFid *Fid, 
517   OUT AFSVolSync *Sync
518 ) = 157;
519
520 ReleaseLock(
521   IN  AFSFid *Fid, 
522   OUT AFSVolSync *Sync
523 ) = 158;
524
525 XStatsVersion(
526   OUT afs_int32 *versionNumberP
527 ) = 159;
528
529 GetXStats(
530   IN  afs_int32 clientVersionNumber,
531   afs_int32 collectionNumber,
532   OUT afs_int32 *srvVersionNumberP,
533   afs_int32 *timeP,
534   AFS_CollData *dataP
535 ) = 160;
536
537 /* This interface is to supported the AFS/DFS Protocol Translator */
538 Lookup(
539   IN  AFSFid *DirFid,
540   string Name<AFSNAMEMAX>,
541   OUT AFSFid *OutFid,
542   AFSFetchStatus *OutFidStatus,
543   AFSFetchStatus *OutDirStatus,
544   AFSCallBack *CallBack,
545   AFSVolSync *Sync
546 ) = 161;
547
548 FlushCPS(
549   IN  ViceIds *IdsArray,
550   IPAddrs *AddrsArray,
551   afs_int32    spare1,
552   OUT afs_int32    *spare2,
553   afs_int32    *spare3
554 ) = 162;
555
556 DFSSymlink(
557   IN  AFSFid *DirFid, 
558   string Name<AFSNAMEMAX>, 
559   string LinkContents<AFSPATHMAX>, 
560   AFSStoreStatus *InStatus, 
561   OUT AFSFid *OutFid, 
562   AFSFetchStatus *OutFidStatus, 
563   AFSFetchStatus *OutDirStatus, 
564   AFSCallBack *CallBack,
565   AFSVolSync *Sync
566 ) = 163;
567
568 ResidencyCmd(
569   IN AFSFid *Fid,
570   IN struct ResidencyCmdInputs *Inputs,
571   OUT struct ResidencyCmdOutputs *Outputs
572 ) = 220; 
573
574 InlineBulkStatus(
575   IN  AFSCBFids *FidsArray,
576   OUT AFSBulkStats *StatArray,
577   AFSCBs *CBArray,
578   AFSVolSync *Sync
579 ) = 65536;