Remove unused xdr types
[openafs.git] / src / ubik / ubik_int.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 prefix S
11
12 struct ubik_version {
13     afs_int32 epoch;
14     afs_int32 counter;
15 };
16
17 struct ubik_tid {
18     afs_int32 epoch;
19     afs_int32 counter;
20 };
21
22 const UBIK_MAX_INTERFACE_ADDR = 256; /* max interfaces per server */
23
24 struct ubik_debug {
25     /* variables from basic voting module */
26     afs_int32 now;                      /* time of day now */
27     afs_int32 lastYesTime;              /* last time we sent last yes vote */
28     afs_int32 lastYesHost;              /* host to which we sent last yes vote */
29     afs_int32 lastYesState;             /* did last yes host claim to be sync site */
30     afs_int32 lastYesClaim;             /* time last vote started; claim sync site until .+SMALLTIME */
31     afs_int32 lowestHost;               /* host we'd prefer to vote for */
32     afs_int32 lowestTime;               /* time we last chose lowestHost */
33     afs_int32 syncHost;                 /* sync site we've heard from last (even if we didn't vote) */
34     afs_int32 syncTime;                 /* time of above */
35     struct ubik_version syncVersion;    /* sync site's claimed db version */
36     struct ubik_tid syncTid;            /* sync site's claimed tid */
37
38     /* variables from beacon module */
39     afs_int32 amSyncSite;               /* do I think I'm the sync site */
40     afs_int32 syncSiteUntil;            /* when does my sync site mandate expire? */
41     afs_int32 nServers;                 /* number of servers participating in vote */
42
43     /* variables from disk module */
44     afs_int32 lockedPages;              /* count of read-locked pages */
45     afs_int32 writeLockedPages;         /* count of write-locked pages */
46     struct ubik_version localVersion;
47     afs_int32 activeWrite;              /* is there an active write transaction with this as sync site */
48     afs_int32 tidCounter;                       /* tid counter field from dbase, or 0 if no write trans. */
49
50     /* variables from the lock module */
51     afs_int32 anyReadLocks;             /* are any read locks held on the current trans, if any */
52     afs_int32 anyWriteLocks;            /* are any write locks held on the current trans, if any */
53
54     /* variables from the recovery module */
55     afs_int32 recoveryState;            /* recovery state flags */
56
57     /* variables from the remote module */
58     afs_int32 currentTrans;             /* is there a current transaction on this server */
59     afs_int32 writeTrans;               /* is it a write transaction */
60
61     /* variables from the ubik module */
62     afs_int32 epochTime;                /* time this server started */
63                 /* all network interface addresses of host in host order*/
64     afs_int32 interfaceAddr[UBIK_MAX_INTERFACE_ADDR];
65 };
66
67 /* data from the per-server structure */
68 struct ubik_sdebug {
69     afs_int32 addr;                     /* primary address in *host* order */
70     afs_int32 lastVoteTime;             /* time last vote received */
71     afs_int32 lastBeaconSent;           /* time last beacon sent */
72     afs_int32 lastVote;                 /* was last vote yes? */
73     struct ubik_version remoteVersion;
74     afs_int32 currentDB;                        /* is current DB up to date? */
75     afs_int32 beaconSinceDown;          /* beacon sent since last noticed up? */
76     afs_int32 up;                       /* is site up */
77     afs_int32 altAddr[255];             /*alternate addresses:host byte */
78                                 /*this is actually UBIK_MAX_INTERFACE_ADDR-1*/
79 };
80
81 struct ubik_debug_old {
82     /* variables from basic voting module */
83     afs_int32 now;                      /* time of day now */
84     afs_int32 lastYesTime;              /* last time we sent last yes vote */
85     afs_int32 lastYesHost;              /* host to which we sent last yes vote */
86     afs_int32 lastYesState;             /* did last yes host claim to be sync site */
87     afs_int32 lastYesClaim;             /* time last vote started; claim sync site until .+SMALLTIME */
88     afs_int32 lowestHost;               /* host we'd prefer to vote for */
89     afs_int32 lowestTime;               /* time we last chose lowestHost */
90     afs_int32 syncHost;                 /* sync site we've heard from last (even if we didn't vote) */
91     afs_int32 syncTime;                 /* time of above */
92     struct ubik_version syncVersion;    /* sync site's claimed db version */
93     struct ubik_tid syncTid;            /* sync site's claimed tid */
94
95     /* variables from beacon module */
96     afs_int32 amSyncSite;               /* do I think I'm the sync site */
97     afs_int32 syncSiteUntil;            /* when does my sync site mandate expire? */
98     afs_int32 nServers;                 /* number of servers participating in vote */
99
100     /* variables from disk module */
101     afs_int32 lockedPages;              /* count of read-locked pages */
102     afs_int32 writeLockedPages;         /* count of write-locked pages */
103     struct ubik_version localVersion;
104     afs_int32 activeWrite;              /* is there an active write transaction with this as sync site */
105     afs_int32 tidCounter;                       /* tid counter field from dbase, or 0 if no write trans. */
106
107     /* variables from the lock module */
108     afs_int32 anyReadLocks;             /* are any read locks held on the current trans, if any */
109     afs_int32 anyWriteLocks;            /* are any write locks held on the current trans, if any */
110
111     /* variables from the recovery module */
112     afs_int32 recoveryState;            /* recovery state flags */
113
114     /* variables from the remote module */
115     afs_int32 currentTrans;             /* is there a current transaction on this server */
116     afs_int32 writeTrans;               /* is it a write transaction */
117
118     /* variables from the ubik module */
119     afs_int32 epochTime;                /* time this server started */
120 };
121
122 /* data from the per-server structure */
123 struct ubik_sdebug_old {
124     afs_int32 addr;                     /* address in *host* order */
125     afs_int32 lastVoteTime;             /* time last vote received */
126     afs_int32 lastBeaconSent;           /* time last beacon sent */
127     afs_int32 lastVote;                 /* was last vote yes? */
128     struct ubik_version remoteVersion;
129     afs_int32 currentDB;                        /* is current DB up to date? */
130     afs_int32 beaconSinceDown;          /* beacon sent since last noticed up? */
131     afs_int32 up;                       /* is site up */
132 };
133                 /* list of network interface addresses in hostbyte order */
134 struct UbikInterfaceAddr {
135     afs_int32 hostAddr[UBIK_MAX_INTERFACE_ADDR];
136 } ;
137
138
139 const   BULK_ERROR      = 1;
140
141 typedef opaque bulkdata<20000>;
142
143 const IOVEC_MAXBUF  = 65536;      /* 64*1K */
144 const IOVEC_MAXWRT  = 64;         /* max number of bulk writes allowed */
145 typedef opaque iovec_buf<IOVEC_MAXBUF>;
146 struct ubik_iovec {
147     afs_int32 file;                 /* File to be written */
148     afs_int32 position;             /* File position */
149     afs_int32 length;               /* number of bytes to write */
150 };
151 typedef struct ubik_iovec iovec_wrt<IOVEC_MAXWRT>;
152
153 /* This package handles call sent to other voters to synchronize things in ubik. */
154 package VOTE_
155 statindex 11
156
157 /* Opcodes for the Vote package interface calls */
158 #define VOTE_BEACON             10000
159 #define VOTE_DEBUG_OLD          10001
160 #define VOTE_SDEBUG_OLD         10002
161 #define VOTE_GETSYNCSITE        10003
162 #define VOTE_DEBUG              10004
163 #define VOTE_SDEBUG             10005
164 #define VOTE_XDEBUG             10006
165 #define VOTE_XSDEBUG            10007
166
167 /* Vote package interface calls */
168 Beacon          (IN afs_int32 state,
169                 afs_int32 voteStart,
170                 ubik_version *Version,
171                 ubik_tid *tid) multi = VOTE_BEACON;
172
173 DebugOld        (OUT ubik_debug_old *db) = VOTE_DEBUG_OLD;
174
175 SDebugOld       (IN afs_int32 which,
176                 OUT ubik_sdebug_old *db) = VOTE_SDEBUG_OLD;
177
178 /*
179  * The output of GetSyncSite (site) is mistakenly marked as an input argument.
180  * As a result, this RPC can't be used to find the current sync-site.
181  */
182
183 /* GetSyncSite  (IN afs_int32 *site) = VOTE_GETSYNCSITE; */
184
185 Debug           (OUT ubik_debug *db) = VOTE_DEBUG;
186
187 SDebug          (IN afs_int32 which,
188                 OUT ubik_sdebug *db) = VOTE_SDEBUG;
189
190 XDebug          (OUT ubik_debug *db,
191                  OUT afs_int32 *isClone) = VOTE_XDEBUG;
192
193 XSDebug         (IN afs_int32 which,
194                  OUT ubik_sdebug *db,
195                  OUT afs_int32 *isClone) = VOTE_XSDEBUG;
196
197 /* This package handles calls used to pass writes, begins and ends to other servers */
198 package DISK_
199 statindex 12
200
201 /* Opcodes for the Disk package interface calls */
202 #define DISK_BEGIN              20000
203 #define DISK_COMMIT             20001
204 #define DISK_LOCK               20002
205 #define DISK_WRITE              20003
206 #define DISK_GETVERSION         20004
207 #define DISK_GETFILE            20005
208 #define DISK_SENDFILE           20006
209 #define DISK_ABORT              20007
210 #define DISK_RELEASELOCKS       20008
211 #define DISK_TRUNCATE           20009
212 #define DISK_PROBE              20010
213 #define DISK_WRITEV             20011
214 #define DISK_INTERFACEADDR      20012
215 #define DISK_SETVERSION         20013
216
217 /* Disk package interface calls - the order of
218  * these declarations is important.
219  */
220 Begin           (IN ubik_tid *tid) = DISK_BEGIN;
221
222 Commit          (IN ubik_tid *tid) = DISK_COMMIT;
223
224 Lock            (IN ubik_tid *tid,
225                 afs_int32 file,
226                 afs_int32 position,
227                 afs_int32 length,
228                 afs_int32 type) = DISK_LOCK;
229
230 Write           (IN ubik_tid *tid,
231                 afs_int32 file,
232                 afs_int32 position,
233                 bulkdata *data) = DISK_WRITE;
234
235 GetVersion      (OUT ubik_version *Version) = DISK_GETVERSION;
236
237 GetFile         (IN afs_int32 file,
238                 OUT ubik_version *Version) split = DISK_GETFILE;
239
240 SendFile        (IN afs_int32 file,
241                 afs_int32 length,
242                 ubik_version *Version) split = DISK_SENDFILE    ;
243
244 Abort           (IN ubik_tid *tid) = DISK_ABORT;
245
246 ReleaseLocks    (IN ubik_tid *tid) = DISK_RELEASELOCKS;
247
248 Truncate        (IN ubik_tid *tid,
249                 afs_int32 file,
250                 afs_int32 length) = DISK_TRUNCATE;
251
252 Probe           () multi = DISK_PROBE;
253
254 WriteV          (IN ubik_tid *tid,
255                 iovec_wrt *io_vector,
256                 iovec_buf *io_buffer) = DISK_WRITEV;
257
258 UpdateInterfaceAddr(IN  UbikInterfaceAddr* inAddr,
259                     OUT UbikInterfaceAddr* outAddr) multi = DISK_INTERFACEADDR;
260
261 SetVersion      (IN ubik_tid     *tid,
262                  IN ubik_version *OldVersion,
263                  IN ubik_version *NewVersion) = DISK_SETVERSION;