Standardize License information
[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 AFSDBLock {
58     char name[16];
59     struct AFSDBLockDesc lock;
60 };
61
62 /*
63  * Callback types.
64  */
65 const CB_EXCLUSIVE = 1;
66 const CB_SHARED    = 2;
67 const CB_DROPPED   = 3;
68
69 const AFSNAMEMAX =  256;        /*Max size for name*/
70 const AFSPATHMAX = 1024;        /*Max size for pathname*/
71
72 /*
73  * Define the maximum opaque structure to be passed.
74  */
75 const AFSOPAQUEMAX = 1024;
76 typedef opaque AFSOpaque <AFSOPAQUEMAX>;
77
78 /*
79  * Define the maximum arrays for passing callback fids and callbacks
80  * themselves around.
81  */
82 const AFSCBMAX = 50;
83 typedef AFSFid AFSCBFids<AFSCBMAX>;
84 typedef AFSCallBack AFSCBs<AFSCBMAX>;
85
86 /*
87  * Define the version of Cache Manager and File Server extended statistics
88  * being implemented.
89  */
90 const AFSCB_XSTAT_VERSION = 2;
91 const AFS_XSTAT_VERSION = 2;
92
93 /*
94  * Define the maximum arrays for passing extended statistics information
95  * for the Cache Manager and File Server back to our caller.
96  */
97 const AFSCB_MAX_XSTAT_LONGS = 2048;
98 const AFS_MAX_XSTAT_LONGS = 1024;
99
100 typedef afs_int32 AFSCB_CollData<AFSCB_MAX_XSTAT_LONGS>;
101 typedef afs_int32 AFS_CollData<AFS_MAX_XSTAT_LONGS>;
102
103 /*
104  * Define the identifiers for the accessible extended stats data
105  * collections.
106  */
107 const AFSCB_XSTATSCOLL_CALL_INFO = 0;    /*CM call counting & info*/
108 const AFSCB_XSTATSCOLL_PERF_INFO = 1;    /*CM performance info*/
109 const AFSCB_XSTATSCOLL_FULL_PERF_INFO = 2;       /*CM performance info*/
110
111 const AFS_XSTATSCOLL_CALL_INFO = 0;      /*FS call counting & info*/
112 const AFS_XSTATSCOLL_PERF_INFO = 1;      /*FS performance info*/
113 const AFS_XSTATSCOLL_FULL_PERF_INFO = 2; /*Full FS performance info*/
114
115 typedef afs_uint32 VolumeId;
116 typedef afs_uint32 VolId;
117 typedef afs_uint32 VnodeId;
118 typedef afs_uint32 Unique;
119 typedef afs_uint32 UserId;
120 typedef afs_uint32 FileVersion;
121 typedef afs_int32             ErrorCode;
122 typedef afs_int32             Rights;
123
124 const AFS_DISKNAMESIZE = 32;
125 typedef opaque DiskName[AFS_DISKNAMESIZE];
126
127 const CALLBACK_VERSION = 1;
128
129 const AFS_MAX_INTERFACE_ADDR  =  32;
130 struct interfaceAddr {          /* for multihomed clients */
131     int         numberOfInterfaces;
132     afsUUID     uuid;
133     afs_int32   addr_in[AFS_MAX_INTERFACE_ADDR]; /* interface addresses */
134     afs_int32       subnetmask[AFS_MAX_INTERFACE_ADDR]; /* subnet masks in net ord */
135     afs_int32       mtu[AFS_MAX_INTERFACE_ADDR]; /* MTU */
136 };
137
138 const AFSMAXCELLHOSTS = 8;      /*Max VLDB servers per cell*/
139 typedef afs_int32 serverList[AFSMAXCELLHOSTS];
140
141 typedef afs_uint32 cacheConfig<>;
142
143 %#endif /* FSINT_COMMON_XG */