Remove unused xdr types
[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 %#define Invalid 0
22 %#define File 1
23 %#define Directory 2
24 %#define SymbolicLink 3
25
26 %#ifdef       KERNEL
27 %#define      afs_xdr_array(a,b,c,d,e,f)  afs_xdr_arrayN(a,b,c,d,e,f)
28 %#endif
29
30 struct AFSVolSync {
31     afs_uint32 spare1;
32     afs_uint32 spare2;
33     afs_uint32 spare3;
34     afs_uint32 spare4;
35     afs_uint32 spare5;
36     afs_uint32 spare6;
37 };
38
39 struct AFSFetchStatus {
40     afs_uint32 InterfaceVersion;
41     afs_uint32 FileType;
42     afs_uint32 LinkCount;
43     afs_uint32 Length;
44     afs_uint32 DataVersion;
45     afs_uint32 Author;
46     afs_uint32 Owner;
47     afs_uint32 CallerAccess;
48     afs_uint32 AnonymousAccess;
49     afs_uint32 UnixModeBits;
50     afs_uint32 ParentVnode;
51     afs_uint32 ParentUnique;
52     afs_uint32 ResidencyMask;
53     afs_uint32 ClientModTime;
54     afs_uint32 ServerModTime;
55     afs_uint32 Group;
56     afs_uint32 SyncCounter;
57     afs_uint32 dataVersionHigh; /* For AFS/DFS translator, hi bits of dvn */
58     afs_uint32 lockCount;
59     afs_uint32 Length_hi;
60     afs_uint32 errorCode;
61 };
62
63 struct AFSStoreStatus {
64     afs_uint32 Mask;
65     afs_uint32 ClientModTime;
66     afs_uint32 Owner;
67     afs_uint32 Group;
68     afs_uint32 UnixModeBits;
69     afs_uint32 SegSize;
70 };
71
72 %#define        AFS_SETMODTIME  1
73 %#define        AFS_SETOWNER    2
74 %#define        AFS_SETGROUP            4
75 %#define        AFS_SETMODE             8
76 %#define        AFS_SETSEGSIZE  16
77 %#define        AFS_FSYNC       1024
78
79 %#define ReadOnly 0
80 %#define ReadWrite 1
81
82
83 struct ViceDisk {
84     afs_int32   BlocksAvailable;
85     afs_int32   TotalBlocks;
86     DiskName    Name;
87 };
88
89 struct ViceStatistics {
90     afs_uint32 CurrentMsgNumber;
91     afs_uint32 OldestMsgNumber;
92     afs_uint32 CurrentTime;
93     afs_uint32 BootTime;
94     afs_uint32 StartTime;
95     afs_int32     CurrentConnections;
96     afs_uint32 TotalViceCalls;
97     afs_uint32 TotalFetchs;
98     afs_uint32 FetchDatas;
99     afs_uint32 FetchedBytes;
100     afs_int32     FetchDataRate;
101     afs_uint32 TotalStores;
102     afs_uint32 StoreDatas;
103     afs_uint32 StoredBytes;
104     afs_int32     StoreDataRate;
105     afs_uint32 TotalRPCBytesSent;
106     afs_uint32 TotalRPCBytesReceived;
107     afs_uint32 TotalRPCPacketsSent;
108     afs_uint32 TotalRPCPacketsReceived;
109     afs_uint32 TotalRPCPacketsLost;
110     afs_uint32 TotalRPCBogusPackets;
111     afs_int32     SystemCPU;
112     afs_int32     UserCPU;
113     afs_int32     NiceCPU;
114     afs_int32     IdleCPU;
115     afs_int32     TotalIO;
116     afs_int32     ActiveVM;
117     afs_int32     TotalVM;
118     afs_int32     EtherNetTotalErrors;
119     afs_int32     EtherNetTotalWrites;
120     afs_int32     EtherNetTotalInterupts;
121     afs_int32     EtherNetGoodReads;
122     afs_int32     EtherNetTotalBytesWritten;
123     afs_int32     EtherNetTotalBytesRead;
124     afs_int32     ProcessSize;
125     afs_int32     WorkStations;
126     afs_int32     ActiveWorkStations;
127     afs_int32     Spare1;
128     afs_int32     Spare2;
129     afs_int32     Spare3;
130     afs_int32     Spare4;
131     afs_int32     Spare5;
132     afs_int32     Spare6;
133     afs_int32     Spare7;
134     afs_int32     Spare8;
135     ViceDisk      Disk1;
136     ViceDisk      Disk2;
137     ViceDisk      Disk3;
138     ViceDisk      Disk4;
139     ViceDisk      Disk5;
140     ViceDisk      Disk6;
141     ViceDisk      Disk7;
142     ViceDisk      Disk8;
143     ViceDisk      Disk9;
144     ViceDisk      Disk10;
145 };
146
147 struct VolumeStatus {
148     afs_int32 Vid;
149     afs_int32 ParentId;
150     char Online;
151     char InService;
152     char Blessed;
153     char NeedsSalvage;
154     afs_int32 Type;
155     afs_int32 MinQuota;
156     afs_int32 MaxQuota;
157     afs_int32 BlocksInUse;
158     afs_int32 PartBlocksAvail;
159     afs_int32 PartMaxBlocks;
160 };
161
162 struct AFSFetchVolumeStatus {
163     afs_int32 Vid;
164     afs_int32 ParentId;
165     char Online;
166     char InService;
167     char Blessed;
168     char NeedsSalvage;
169     afs_int32 Type;
170     afs_int32 MinQuota;
171     afs_int32 MaxQuota;
172     afs_int32 BlocksInUse;
173     afs_int32 PartBlocksAvail;
174     afs_int32 PartMaxBlocks;
175 };
176
177 struct AFSStoreVolumeStatus {
178     afs_int32 Mask;
179     afs_int32 MinQuota;
180     afs_int32 MaxQuota;
181 };
182
183 const AFS_SETMINQUOTA = 1;
184 const AFS_SETMAXQUOTA = 2;
185
186 struct AFSVolumeInfo {
187     afs_uint32  Vid;
188     afs_int32      Type;
189     afs_uint32  Type0;
190     afs_uint32  Type1;
191     afs_uint32  Type2;
192     afs_uint32  Type3;
193     afs_uint32  Type4;
194     afs_uint32  ServerCount;
195     afs_uint32  Server0;
196     afs_uint32  Server1;
197     afs_uint32  Server2;
198     afs_uint32  Server3;
199     afs_uint32  Server4;
200     afs_uint32  Server5;
201     afs_uint32  Server6;
202     afs_uint32  Server7;
203     unsigned short Port0;
204     unsigned short Port1;
205     unsigned short Port2;
206     unsigned short Port3;
207     unsigned short Port4;
208     unsigned short Port5;
209     unsigned short Port6;
210     unsigned short Port7;
211 };
212
213 struct VolumeInfo {
214     afs_uint32 Vid;
215     afs_int32     Type;
216     afs_uint32 Type0;
217     afs_uint32 Type1;
218     afs_uint32 Type2;
219     afs_uint32 Type3;
220     afs_uint32 Type4;
221     afs_uint32 ServerCount;
222     afs_uint32 Server0;
223     afs_uint32 Server1;
224     afs_uint32 Server2;
225     afs_uint32 Server3;
226     afs_uint32 Server4;
227     afs_uint32 Server5;
228     afs_uint32 Server6;
229     afs_uint32 Server7;
230 };
231
232 typedef afs_int32 ViceLockType;
233 typedef AFSFetchStatus AFSBulkStats<AFSCBMAX>;
234
235 %#define LockRead               0
236 %#define LockWrite              1
237 %#define LockExtend     2
238 %#define LockRelease    3
239
240 %#define MAXCMDINT64S                           3
241 %#define MAXCMDINT32S                           200
242 %#define MAXCMDCHARS                            256
243 %#define CMD_GETRESIDENCIES                     1
244 %#define CMD_CHANGERESIDENCIES                  2
245 %#define CMD_IMPORTRESIDENCIES                  3
246 %#define CMD_GETEXTVOLATTR                      4
247 %#define CMD_SETEXTVOLATTR                      5
248 %#define CMD_GETACCESSHISTORY                   6
249 %#define CMD_MIGRATEFILE                        7
250 %#define CMD_CHECKHSMMETADATA                   8
251 %#define CMD_FETCHSTATUS                        9
252
253 struct FsCmdInputs {
254     afs_int32  command;
255     struct AFSFid fid;
256     afs_int64  int64s[MAXCMDINT64S];
257     afs_uint32 int32s[MAXCMDINT32S];
258     char       chars[MAXCMDCHARS];
259 };
260
261 struct FsCmdOutputs {
262     afs_int32  code;
263     struct AFSFetchStatus status;
264     afs_int64  int64s[MAXCMDINT64S];
265     afs_uint32 int32s[MAXCMDINT32S];
266     char       chars[MAXCMDCHARS];
267 };
268
269 %#define ResidencyCmdInputs FsCmdInputs
270 %#define ResidencyCmdOutputs FsCmdOutputs
271
272 const FLUSHMAX = 10;
273 typedef afs_int32 ViceIds<FLUSHMAX>;
274 typedef afs_int32 IPAddrs<FLUSHMAX>;
275
276 package RXAFS_
277 prefix S
278 statindex 7
279
280 FetchData(
281   IN  AFSFid *Fid,
282   afs_int32 Pos,
283   afs_int32 Length,
284   OUT AFSFetchStatus *OutStatus,
285   AFSCallBack *CallBack,
286   AFSVolSync *Sync
287 ) split = 130;
288
289 FetchACL(
290   IN  AFSFid *Fid,
291   OUT AFSOpaque *AccessList,
292   AFSFetchStatus *OutStatus,
293   AFSVolSync *Sync
294 ) = 131;
295
296 FetchStatus(
297   IN  AFSFid *Fid,
298   OUT AFSFetchStatus *OutStatus,
299   AFSCallBack *CallBack,
300   AFSVolSync *Sync
301 ) = 132;
302
303 StoreData(
304   IN  AFSFid *Fid,
305   AFSStoreStatus *InStatus,
306   afs_uint32 Pos,
307   afs_uint32 Length,
308   afs_uint32 FileLength,
309   OUT AFSFetchStatus *OutStatus,
310   AFSVolSync *Sync
311 ) split = 133;
312
313 StoreACL(
314   IN  AFSFid *Fid,
315   AFSOpaque *AccessList,
316   OUT AFSFetchStatus *OutStatus,
317   AFSVolSync *Sync
318 ) = 134;
319
320 StoreStatus(
321   IN  AFSFid *Fid,
322   AFSStoreStatus *InStatus,
323   OUT AFSFetchStatus *OutStatus,
324   AFSVolSync *Sync
325 ) = 135;
326
327 RemoveFile(
328   IN  AFSFid *DirFid,
329   string Name<AFSNAMEMAX>,
330   OUT AFSFetchStatus *OutStatus,
331   AFSVolSync *Sync
332 ) = 136;
333
334 CreateFile(
335   IN  AFSFid *DirFid,
336   string Name<AFSNAMEMAX>,
337   AFSStoreStatus *InStatus,
338   OUT AFSFid *OutFid,
339   AFSFetchStatus *OutFidStatus,
340   AFSFetchStatus *OutDirStatus,
341   AFSCallBack *CallBack,
342   AFSVolSync *Sync) = 137;
343
344 Rename(
345   IN  AFSFid *OldDirFid,
346   string OldName<AFSNAMEMAX>,
347   AFSFid *NewDirFid,
348   string NewName<AFSNAMEMAX>,
349   OUT AFSFetchStatus *OutOldDirStatus,
350   AFSFetchStatus *OutNewDirStatus,
351   AFSVolSync *Sync
352 ) = 138;
353
354 Symlink(
355   IN  AFSFid *DirFid,
356   string Name<AFSNAMEMAX>,
357   string LinkContents<AFSPATHMAX>,
358   AFSStoreStatus *InStatus,
359   OUT AFSFid *OutFid,
360   AFSFetchStatus *OutFidStatus,
361   AFSFetchStatus *OutDirStatus,
362   AFSVolSync *Sync
363 ) = 139;
364
365 Link(
366   IN  AFSFid *DirFid,
367   string Name<AFSNAMEMAX>,
368   AFSFid *ExistingFid,
369   OUT AFSFetchStatus *OutFidStatus,
370   AFSFetchStatus *OutDirStatus,
371   AFSVolSync *Sync
372 ) = 140;
373
374 MakeDir(
375   IN  AFSFid *DirFid,
376   string Name<AFSNAMEMAX>,
377   AFSStoreStatus *InStatus,
378   OUT AFSFid *OutFid,
379   AFSFetchStatus *OutFidStatus,
380   AFSFetchStatus *OutDirStatus,
381   AFSCallBack *CallBack,
382   AFSVolSync *Sync
383 ) = 141;
384
385 RemoveDir(
386   IN  AFSFid *DirFid,
387   string Name<AFSNAMEMAX>,
388   OUT AFSFetchStatus *OutDirStatus,
389   AFSVolSync *Sync
390 ) = 142;
391
392 OldSetLock(
393   IN  AFSFid *Fid,
394   ViceLockType Type,
395   AFSVolSync *Sync
396 ) = 143;
397
398 OldExtendLock(
399   IN  AFSFid *Fid,
400   AFSVolSync *Sync
401 ) = 144;
402
403 OldReleaseLock(
404   IN  AFSFid *Fid,
405   AFSVolSync *Sync
406 ) = 145;
407
408 GetStatistics(
409   OUT ViceStatistics *Statistics
410 ) = 146;
411
412 GiveUpCallBacks(
413   IN  AFSCBFids *Fids_Array,
414   AFSCBs *CallBacks_Array
415 ) = 147;
416
417 GetVolumeInfo(
418   IN  string VolumeName<AFSNAMEMAX>,
419   OUT VolumeInfo *Volumeinfo
420 ) = 148;
421
422 GetVolumeStatus(
423   IN  afs_int32 Volumeid,
424   OUT AFSFetchVolumeStatus *Volumestatus,
425   string Name<AFSNAMEMAX>,
426   string OfflineMsg<AFSOPAQUEMAX>,
427   string Motd<AFSOPAQUEMAX>
428 ) = 149;
429
430 SetVolumeStatus(
431   IN  afs_int32 Volumeid,
432   AFSStoreVolumeStatus *Volumestatus,
433   string Name<AFSNAMEMAX>,
434   string OfflineMsg<AFSOPAQUEMAX>,
435   string Motd<AFSOPAQUEMAX>
436 ) = 150;
437
438 GetRootVolume(
439   OUT string VolumeName<AFSNAMEMAX>
440 ) = 151;
441
442 CheckToken(
443   IN  afs_int32 ViceId,
444   AFSOpaque *token
445 ) = 152;
446
447 GetTime(
448   OUT afs_uint32 *Seconds,
449   afs_uint32 *USeconds
450 ) multi = 153;
451
452 NGetVolumeInfo(
453   IN  string VolumeName<AFSNAMEMAX>,
454   OUT AFSVolumeInfo *stuff
455 ) = 154;
456
457 BulkStatus(
458   IN  AFSCBFids *FidsArray,
459   OUT AFSBulkStats *StatArray,
460   AFSCBs *CBArray,
461   AFSVolSync *Sync
462 ) = 155;
463
464 SetLock(
465   IN  AFSFid *Fid,
466   ViceLockType Type,
467   OUT AFSVolSync *Sync
468 ) = 156;
469
470 ExtendLock(
471   IN  AFSFid *Fid,
472   OUT AFSVolSync *Sync
473 ) = 157;
474
475 ReleaseLock(
476   IN  AFSFid *Fid,
477   OUT AFSVolSync *Sync
478 ) = 158;
479
480 XStatsVersion(
481   OUT afs_int32 *versionNumberP
482 ) = 159;
483
484 GetXStats(
485   IN  afs_int32 clientVersionNumber,
486   afs_int32 collectionNumber,
487   OUT afs_int32 *srvVersionNumberP,
488   afs_int32 *timeP,
489   AFS_CollData *dataP
490 ) = 160;
491
492 /* This interface is to supported the AFS/DFS Protocol Translator */
493 Lookup(
494   IN  AFSFid *DirFid,
495   string Name<AFSNAMEMAX>,
496   OUT AFSFid *OutFid,
497   AFSFetchStatus *OutFidStatus,
498   AFSFetchStatus *OutDirStatus,
499   AFSCallBack *CallBack,
500   AFSVolSync *Sync
501 ) = 161;
502
503 FlushCPS(
504   IN  ViceIds *IdsArray,
505   IPAddrs *AddrsArray,
506   afs_int32    spare1,
507   OUT afs_int32    *spare2,
508   afs_int32    *spare3
509 ) = 162;
510
511 DFSSymlink(
512   IN  AFSFid *DirFid,
513   string Name<AFSNAMEMAX>,
514   string LinkContents<AFSPATHMAX>,
515   AFSStoreStatus *InStatus,
516   OUT AFSFid *OutFid,
517   AFSFetchStatus *OutFidStatus,
518   AFSFetchStatus *OutDirStatus,
519   AFSCallBack *CallBack,
520   AFSVolSync *Sync
521 ) = 163;
522
523 FsCmd(
524   IN AFSFid *Fid,
525   IN struct FsCmdInputs *Inputs,
526   OUT struct FsCmdOutputs *Outputs
527 ) = 220;
528
529 #ifdef RPC_CLIENT
530 %int RXAFS_ResidencyCmd(struct rx_connection *z_conn, AFSFid *Fid, struct FsCmdInputs *Inputs, struct FsCmdOutputs *Outputs)
531 %{
532 %  return RXAFS_FsCmd(z_conn, Fid, Inputs, Outputs);
533 %}
534 #endif
535
536 InlineBulkStatus(
537   IN  AFSCBFids *FidsArray,
538   OUT AFSBulkStats *StatArray,
539   AFSCBs *CBArray,
540   AFSVolSync *Sync
541 ) = 65536;
542
543 FetchData64(
544   IN  AFSFid *Fid,
545   afs_int64 Pos,
546   afs_int64 Length,
547   OUT AFSFetchStatus *OutStatus,
548   AFSCallBack *CallBack,
549   AFSVolSync *Sync
550 ) split = 65537;
551
552 StoreData64(
553   IN  AFSFid *Fid,
554   AFSStoreStatus *InStatus,
555   afs_uint64 Pos,
556   afs_uint64 Length,
557   afs_uint64 FileLength,
558   OUT AFSFetchStatus *OutStatus,
559   AFSVolSync *Sync
560 ) split = 65538;
561
562 GiveUpAllCallBacks(
563 ) multi = 65539;
564
565 GetCapabilities(
566   Capabilities *capabilities
567 ) multi = 65540;
568
569 CallBackRxConnAddr(
570   IN afs_int32 *addr
571 ) = 65541;
572
573 %#define STATS64_CURRENTTIME 0
574 %#define STATS64_BOOTTIME 1
575 %#define STATS64_STARTTIME 2
576 %#define STATS64_CURRENTCONNECTIONS 3
577 %#define STATS64_TOTALFETCHES 4
578 %#define STATS64_FETCHDATAS 5
579 %#define STATS64_FETCHEDBYTES 6
580 %#define STATS64_FETCHDATARATE 7
581 %#define STATS64_TOTALSTORES 8
582 %#define STATS64_STOREDATAS 9
583 %#define STATS64_STOREDBYTES 10
584 %#define STATS64_STOREDATARATE 11
585 %#define STATS64_TOTALVICECALLS 12
586 %#define STATS64_WORKSTATIONS 13
587 %#define STATS64_ACTIVEWORKSTATIONS 14
588 %#define STATS64_PROCESSSIZE 15
589
590 const STATS64_VERSION = 16;
591 typedef afs_uint64 ViceStatistics64<STATS64_VERSION>;
592
593 /* the "version" is a number representing the number of
594    array elements to return, from 0 to N-1 */
595
596 GetStatistics64(
597     IN afs_int32 statsVersion,
598     OUT ViceStatistics64 *Statistics
599 ) = 65542;
600
601 /* rx osd. put here now to hold version numbers.
602 ServerPath(
603   IN  AFSFid *Fid,
604   afs_int32 writing,
605   OUT FilePath *NameiInfo,
606   AFSFetchStatus *OutStatus,
607   AFSCallBack *CallBack
608 ) = 65551;
609
610 PerfTest(
611   IN  afs_int32 type,
612   afs_int64 bytes,
613   afs_int32 bufsize
614 ) split = 65552;
615
616 GetOSDlocation(
617   IN AFSFid *Fid,
618   afs_uint64 offset,
619   afs_uint64 length,
620   afs_int32 flag,
621   afsUUID uuid,
622   OUT AFSFetchStatus *OutStatus,
623   AFSCallBack *CallBack,
624   struct osd_file *osd
625 ) = 65557;
626
627 InverseLookup(
628   IN AFSFid *Fid,
629   afs_uint32 parent,
630   OUT struct afs_filename *file,
631   afs_uint32 *nextparent
632 ) = 65558;
633
634 CheckOSDconns() = 65559;
635
636 OsdPolicy(IN AFSFid *Fid,
637   afs_uint64 length,
638   OUT afs_uint32 *protocol
639 ) = 65560;
640
641 SetOsdFileReady(
642   IN AFSFid *Fid
643 ) = 65561;
644
645 GetOsdMetadata(
646   IN AFSFid *Fid
647 ) split = 65562;
648 */