venus: Remove dedebug
[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 /* Deprecated - CVE-2018-7168 */
314 OldStoreACL(
315   IN  AFSFid *Fid,
316   AFSOpaque *AccessList,
317   OUT AFSFetchStatus *OutStatus,
318   AFSVolSync *Sync
319 ) = 134;
320
321 StoreStatus(
322   IN  AFSFid *Fid,
323   AFSStoreStatus *InStatus,
324   OUT AFSFetchStatus *OutStatus,
325   AFSVolSync *Sync
326 ) = 135;
327
328 RemoveFile(
329   IN  AFSFid *DirFid,
330   string Name<AFSNAMEMAX>,
331   OUT AFSFetchStatus *OutStatus,
332   AFSVolSync *Sync
333 ) = 136;
334
335 CreateFile(
336   IN  AFSFid *DirFid,
337   string Name<AFSNAMEMAX>,
338   AFSStoreStatus *InStatus,
339   OUT AFSFid *OutFid,
340   AFSFetchStatus *OutFidStatus,
341   AFSFetchStatus *OutDirStatus,
342   AFSCallBack *CallBack,
343   AFSVolSync *Sync) = 137;
344
345 Rename(
346   IN  AFSFid *OldDirFid,
347   string OldName<AFSNAMEMAX>,
348   AFSFid *NewDirFid,
349   string NewName<AFSNAMEMAX>,
350   OUT AFSFetchStatus *OutOldDirStatus,
351   AFSFetchStatus *OutNewDirStatus,
352   AFSVolSync *Sync
353 ) = 138;
354
355 Symlink(
356   IN  AFSFid *DirFid,
357   string Name<AFSNAMEMAX>,
358   string LinkContents<AFSPATHMAX>,
359   AFSStoreStatus *InStatus,
360   OUT AFSFid *OutFid,
361   AFSFetchStatus *OutFidStatus,
362   AFSFetchStatus *OutDirStatus,
363   AFSVolSync *Sync
364 ) = 139;
365
366 Link(
367   IN  AFSFid *DirFid,
368   string Name<AFSNAMEMAX>,
369   AFSFid *ExistingFid,
370   OUT AFSFetchStatus *OutFidStatus,
371   AFSFetchStatus *OutDirStatus,
372   AFSVolSync *Sync
373 ) = 140;
374
375 MakeDir(
376   IN  AFSFid *DirFid,
377   string Name<AFSNAMEMAX>,
378   AFSStoreStatus *InStatus,
379   OUT AFSFid *OutFid,
380   AFSFetchStatus *OutFidStatus,
381   AFSFetchStatus *OutDirStatus,
382   AFSCallBack *CallBack,
383   AFSVolSync *Sync
384 ) = 141;
385
386 RemoveDir(
387   IN  AFSFid *DirFid,
388   string Name<AFSNAMEMAX>,
389   OUT AFSFetchStatus *OutDirStatus,
390   AFSVolSync *Sync
391 ) = 142;
392
393 OldSetLock(
394   IN  AFSFid *Fid,
395   ViceLockType Type,
396   AFSVolSync *Sync
397 ) = 143;
398
399 OldExtendLock(
400   IN  AFSFid *Fid,
401   AFSVolSync *Sync
402 ) = 144;
403
404 OldReleaseLock(
405   IN  AFSFid *Fid,
406   AFSVolSync *Sync
407 ) = 145;
408
409 GetStatistics(
410   OUT ViceStatistics *Statistics
411 ) = 146;
412
413 GiveUpCallBacks(
414   IN  AFSCBFids *Fids_Array,
415   AFSCBs *CallBacks_Array
416 ) = 147;
417
418 GetVolumeInfo(
419   IN  string VolumeName<AFSNAMEMAX>,
420   OUT VolumeInfo *Volumeinfo
421 ) = 148;
422
423 GetVolumeStatus(
424   IN  afs_int32 Volumeid,
425   OUT AFSFetchVolumeStatus *Volumestatus,
426   string Name<AFSNAMEMAX>,
427   string OfflineMsg<AFSOPAQUEMAX>,
428   string Motd<AFSOPAQUEMAX>
429 ) = 149;
430
431 SetVolumeStatus(
432   IN  afs_int32 Volumeid,
433   AFSStoreVolumeStatus *Volumestatus,
434   string Name<AFSNAMEMAX>,
435   string OfflineMsg<AFSOPAQUEMAX>,
436   string Motd<AFSOPAQUEMAX>
437 ) = 150;
438
439 GetRootVolume(
440   OUT string VolumeName<AFSNAMEMAX>
441 ) = 151;
442
443 CheckToken(
444   IN  afs_int32 ViceId,
445   AFSOpaque *token
446 ) = 152;
447
448 GetTime(
449   OUT afs_uint32 *Seconds,
450   afs_uint32 *USeconds
451 ) multi = 153;
452
453 NGetVolumeInfo(
454   IN  string VolumeName<AFSNAMEMAX>,
455   OUT AFSVolumeInfo *stuff
456 ) = 154;
457
458 BulkStatus(
459   IN  AFSCBFids *FidsArray,
460   OUT AFSBulkStats *StatArray,
461   AFSCBs *CBArray,
462   AFSVolSync *Sync
463 ) = 155;
464
465 SetLock(
466   IN  AFSFid *Fid,
467   ViceLockType Type,
468   OUT AFSVolSync *Sync
469 ) = 156;
470
471 ExtendLock(
472   IN  AFSFid *Fid,
473   OUT AFSVolSync *Sync
474 ) = 157;
475
476 ReleaseLock(
477   IN  AFSFid *Fid,
478   OUT AFSVolSync *Sync
479 ) = 158;
480
481 XStatsVersion(
482   OUT afs_int32 *versionNumberP
483 ) = 159;
484
485 GetXStats(
486   IN  afs_int32 clientVersionNumber,
487   afs_int32 collectionNumber,
488   OUT afs_int32 *srvVersionNumberP,
489   afs_int32 *timeP,
490   AFS_CollData *dataP
491 ) = 160;
492
493 /* This interface is to supported the AFS/DFS Protocol Translator */
494 Lookup(
495   IN  AFSFid *DirFid,
496   string Name<AFSNAMEMAX>,
497   OUT AFSFid *OutFid,
498   AFSFetchStatus *OutFidStatus,
499   AFSFetchStatus *OutDirStatus,
500   AFSCallBack *CallBack,
501   AFSVolSync *Sync
502 ) = 161;
503
504 FlushCPS(
505   IN  ViceIds *IdsArray,
506   IPAddrs *AddrsArray,
507   afs_int32    spare1,
508   OUT afs_int32    *spare2,
509   afs_int32    *spare3
510 ) = 162;
511
512 DFSSymlink(
513   IN  AFSFid *DirFid,
514   string Name<AFSNAMEMAX>,
515   string LinkContents<AFSPATHMAX>,
516   AFSStoreStatus *InStatus,
517   OUT AFSFid *OutFid,
518   AFSFetchStatus *OutFidStatus,
519   AFSFetchStatus *OutDirStatus,
520   AFSCallBack *CallBack,
521   AFSVolSync *Sync
522 ) = 163;
523
524 StoreACL(
525   IN  AFSFid *Fid,
526   AFSOpaque *AccessList,
527   OUT AFSFetchStatus *OutStatus,
528   AFSVolSync *Sync
529 ) = 164;
530
531 FsCmd(
532   IN AFSFid *Fid,
533   IN struct FsCmdInputs *Inputs,
534   OUT struct FsCmdOutputs *Outputs
535 ) = 220;
536
537 #ifdef RPC_CLIENT
538 %int RXAFS_ResidencyCmd(struct rx_connection *z_conn, AFSFid *Fid, struct FsCmdInputs *Inputs, struct FsCmdOutputs *Outputs);
539 %int RXAFS_ResidencyCmd(struct rx_connection *z_conn, AFSFid *Fid, struct FsCmdInputs *Inputs, struct FsCmdOutputs *Outputs)
540 %{
541 %  return RXAFS_FsCmd(z_conn, Fid, Inputs, Outputs);
542 %}
543 #endif
544
545 InlineBulkStatus(
546   IN  AFSCBFids *FidsArray,
547   OUT AFSBulkStats *StatArray,
548   AFSCBs *CBArray,
549   AFSVolSync *Sync
550 ) = 65536;
551
552 FetchData64(
553   IN  AFSFid *Fid,
554   afs_int64 Pos,
555   afs_int64 Length,
556   OUT AFSFetchStatus *OutStatus,
557   AFSCallBack *CallBack,
558   AFSVolSync *Sync
559 ) split = 65537;
560
561 StoreData64(
562   IN  AFSFid *Fid,
563   AFSStoreStatus *InStatus,
564   afs_uint64 Pos,
565   afs_uint64 Length,
566   afs_uint64 FileLength,
567   OUT AFSFetchStatus *OutStatus,
568   AFSVolSync *Sync
569 ) split = 65538;
570
571 GiveUpAllCallBacks(
572 ) multi = 65539;
573
574 GetCapabilities(
575   Capabilities *capabilities
576 ) multi = 65540;
577
578 CallBackRxConnAddr(
579   IN afs_int32 *addr
580 ) = 65541;
581
582 %#define STATS64_CURRENTTIME 0
583 %#define STATS64_BOOTTIME 1
584 %#define STATS64_STARTTIME 2
585 %#define STATS64_CURRENTCONNECTIONS 3
586 %#define STATS64_TOTALFETCHES 4
587 %#define STATS64_FETCHDATAS 5
588 %#define STATS64_FETCHEDBYTES 6
589 %#define STATS64_FETCHDATARATE 7
590 %#define STATS64_TOTALSTORES 8
591 %#define STATS64_STOREDATAS 9
592 %#define STATS64_STOREDBYTES 10
593 %#define STATS64_STOREDATARATE 11
594 %#define STATS64_TOTALVICECALLS 12
595 %#define STATS64_WORKSTATIONS 13
596 %#define STATS64_ACTIVEWORKSTATIONS 14
597 %#define STATS64_PROCESSSIZE 15
598
599 const STATS64_VERSION = 16;
600 typedef afs_uint64 ViceStatistics64<STATS64_VERSION>;
601
602 /* the "version" is a number representing the number of
603    array elements to return, from 0 to N-1 */
604
605 GetStatistics64(
606     IN afs_int32 statsVersion,
607     OUT ViceStatistics64 *Statistics
608 ) = 65542;
609
610 /* rx osd. put here now to hold version numbers.
611 ServerPath(
612   IN  AFSFid *Fid,
613   afs_int32 writing,
614   OUT FilePath *NameiInfo,
615   AFSFetchStatus *OutStatus,
616   AFSCallBack *CallBack
617 ) = 65551;
618
619 PerfTest(
620   IN  afs_int32 type,
621   afs_int64 bytes,
622   afs_int32 bufsize
623 ) split = 65552;
624
625 GetOSDlocation(
626   IN AFSFid *Fid,
627   afs_uint64 offset,
628   afs_uint64 length,
629   afs_int32 flag,
630   afsUUID uuid,
631   OUT AFSFetchStatus *OutStatus,
632   AFSCallBack *CallBack,
633   struct osd_file *osd
634 ) = 65557;
635
636 InverseLookup(
637   IN AFSFid *Fid,
638   afs_uint32 parent,
639   OUT struct afs_filename *file,
640   afs_uint32 *nextparent
641 ) = 65558;
642
643 CheckOSDconns() = 65559;
644
645 OsdPolicy(IN AFSFid *Fid,
646   afs_uint64 length,
647   OUT afs_uint32 *protocol
648 ) = 65560;
649
650 SetOsdFileReady(
651   IN AFSFid *Fid
652 ) = 65561;
653
654 GetOsdMetadata(
655   IN AFSFid *Fid
656 ) split = 65562;
657 */