capabilities-20030304
[openafs.git] / src / fsint / common.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  *  common.xg:
12  *      Common values and structures used in the AFS File Server
13  *      and Cache Manager interfaces.
14  */
15
16 %#ifndef FSINT_COMMON_XG
17
18 struct AFSFid {
19     afs_uint32 Volume;
20     afs_uint32 Vnode;
21     afs_uint32 Unique;
22 };
23
24 struct AFSCallBack {
25     afs_uint32 CallBackVersion;
26     afs_uint32 ExpirationTime;
27     afs_uint32 CallBackType;
28 };
29
30 struct AFSDBLockDesc {
31     char waitStates;
32     char exclLocked;
33     short readersReading;
34     short numWaiting;
35     short spare;
36     int pid_last_reader;
37     int pid_writer;
38     int src_indicator;
39 };
40
41 struct AFSDBCacheEntry {
42     afs_int32 addr;
43     afs_int32 cell;                             /*Cell part of the fid*/
44     AFSFid netFid;                      /*Network part of the fid*/
45     afs_int32 Length;
46     afs_int32 DataVersion;
47     struct AFSDBLockDesc lock;
48     afs_int32 callback;
49     afs_int32 cbExpires;
50     short refCount;
51     short opens;
52     short writers;
53     char mvstat;
54     char states;
55 };
56
57 struct AFSDBCacheEntry64 {
58     afs_int32 addr;
59     afs_int32 cell;                             /*Cell part of the fid*/
60     AFSFid netFid;                      /*Network part of the fid*/
61     afs_int64 Length;
62     afs_int32 DataVersion;
63     struct AFSDBLockDesc lock;
64     afs_int32 callback;
65     afs_int32 cbExpires;
66     short refCount;
67     short opens;
68     short writers;
69     char mvstat;
70     char states;
71 };
72
73 struct AFSDBLock {
74     char name[16];
75     struct AFSDBLockDesc lock;
76 };
77
78 /*
79  * Callback types.
80  */
81 const CB_EXCLUSIVE = 1;
82 const CB_SHARED    = 2;
83 const CB_DROPPED   = 3;
84
85 const AFSNAMEMAX =  256;        /*Max size for name*/
86 const AFSPATHMAX = 1024;        /*Max size for pathname*/
87
88 /*
89  * Define the maximum opaque structure to be passed.
90  */
91 const AFSOPAQUEMAX = 1024;
92 typedef opaque AFSOpaque <AFSOPAQUEMAX>;
93
94 /*
95  * Define the maximum arrays for passing callback fids and callbacks
96  * themselves around.
97  */
98 const AFSCBMAX = 50;
99 typedef AFSFid AFSCBFids<AFSCBMAX>;
100 typedef AFSCallBack AFSCBs<AFSCBMAX>;
101
102 /*
103  * Define the version of Cache Manager and File Server extended statistics
104  * being implemented.
105  */
106 const AFSCB_XSTAT_VERSION = 2;
107 const AFS_XSTAT_VERSION = 2;
108
109 /*
110  * Define the maximum arrays for passing extended statistics information
111  * for the Cache Manager and File Server back to our caller.
112  */
113 const AFSCB_MAX_XSTAT_LONGS = 2048;
114 const AFS_MAX_XSTAT_LONGS = 1024;
115
116 typedef afs_int32 AFSCB_CollData<AFSCB_MAX_XSTAT_LONGS>;
117 typedef afs_int32 AFS_CollData<AFS_MAX_XSTAT_LONGS>;
118
119 /*
120  * Define the identifiers for the accessible extended stats data
121  * collections.
122  */
123 const AFSCB_XSTATSCOLL_CALL_INFO = 0;    /*CM call counting & info*/
124 const AFSCB_XSTATSCOLL_PERF_INFO = 1;    /*CM performance info*/
125 const AFSCB_XSTATSCOLL_FULL_PERF_INFO = 2;       /*CM performance info*/
126
127 const AFS_XSTATSCOLL_CALL_INFO = 0;      /*FS call counting & info*/
128 const AFS_XSTATSCOLL_PERF_INFO = 1;      /*FS performance info*/
129 const AFS_XSTATSCOLL_FULL_PERF_INFO = 2; /*Full FS performance info*/
130
131 typedef afs_uint32 VolumeId;
132 typedef afs_uint32 VolId;
133 typedef afs_uint32 VnodeId;
134 typedef afs_uint32 Unique;
135 typedef afs_uint32 UserId;
136 typedef afs_uint32 FileVersion;
137 typedef afs_int32             ErrorCode;
138 typedef afs_int32             Rights;
139
140 const AFS_DISKNAMESIZE = 32;
141 typedef opaque DiskName[AFS_DISKNAMESIZE];
142
143 const CALLBACK_VERSION = 1;
144
145 const AFS_MAX_INTERFACE_ADDR  =  32;
146 struct interfaceAddr {          /* for multihomed clients */
147     int         numberOfInterfaces;
148     afsUUID     uuid;
149     afs_int32   addr_in[AFS_MAX_INTERFACE_ADDR]; /* interface addresses */
150     afs_int32       subnetmask[AFS_MAX_INTERFACE_ADDR]; /* subnet masks in net ord */
151     afs_int32       mtu[AFS_MAX_INTERFACE_ADDR]; /* MTU */
152 };
153
154 const AFSMAXCELLHOSTS = 8;      /*Max VLDB servers per cell*/
155 typedef afs_int32 serverList<AFSMAXCELLHOSTS>;
156
157 typedef afs_uint32 cacheConfig<>;
158
159 const AFSCAPABILITIESMAX = 196;
160 typedef afs_int32 Capabilities<AFSCAPABILITIESMAX>;
161
162 %#endif /* FSINT_COMMON_XG */