2 * Copyright 2000, International Business Machines Corporation and others.
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
14 #include "vl_opcodes.h"
15 %#include <afs/vl_opcodes.h> /* directly to other places */
18 %#define afs_xdr_array(a,b,c,d,e,f) afs_xdr_arrayN(a,b,c,d,e,f)
21 /* Current limitations on parameters that affect other packages (i.e. volume) */
22 const VLDBVERSION_4 = 4;
23 const VLDBVERSION = 3;
24 const OVLDBVERSION = 2;
25 const VL_MAXNAMELEN = 65;
26 const OMAXNSERVERS = 8;
27 const NMAXNSERVERS = 13;
30 /* Structure used by the VLUpdateEntry routine; multiple entries can be updated at once by setting the appropriate Mask bits. */
31 struct VldbUpdateEntry {
33 char name[VL_MAXNAMELEN];
36 afs_uint32 ReadOnlyId;
39 afs_int32 nModifiedRepsites;
40 afs_uint32 RepsitesMask[OMAXNSERVERS];
41 afs_int32 RepsitesTargetServer[OMAXNSERVERS];
42 afs_int32 RepsitesTargetPart[OMAXNSERVERS];
43 afs_int32 RepsitesNewServer[OMAXNSERVERS];
44 afs_int32 RepsitesNewPart[OMAXNSERVERS];
45 afs_int32 RepsitesNewFlags[OMAXNSERVERS];
48 /* struct VldbUpdateEntry Mask bit values */
49 const VLUPDATE_VOLUMENAME = 0x0001;
50 /*const VLUPDATE_VOLUMETYPE = 0x0002;*/
51 const VLUPDATE_FLAGS = 0x0004;
52 const VLUPDATE_READONLYID = 0x0008;
53 const VLUPDATE_BACKUPID = 0x0010;
54 const VLUPDATE_REPSITES = 0x0020;
55 const VLUPDATE_CLONEID = 0x0080;
56 const VLUPDATE_VOLNAMEHASH = 0x0100;
57 const VLUPDATE_RWID = 0x0200;
59 /* struct VldbUpdateEntry RepsitesMask[i] bit values */
60 const VLUPDATE_REPS_DELETE = 0x0100;
61 const VLUPDATE_REPS_ADD = 0x0200;
62 const VLUPDATE_REPS_MODSERV = 0x0400;
63 const VLUPDATE_REPS_MODPART = 0x0800;
64 const VLUPDATE_REPS_MODFLAG = 0x1000;
66 const VLSERVER_FLAG_UUID = 0x0010;
68 /*typedef string volumename<VL_MAXNAMELEN>;*/
70 const DEFAULTBULK = 10000;
71 typedef opaque bulk<DEFAULTBULK>;
73 /* Structure used by the VLListAttributes routine */
74 struct VldbListByAttributes {
83 /* struct VldbListByAttributes Mask bit values */
84 const VLLIST_SERVER = 0x1;
85 const VLLIST_PARTITION= 0x2;
86 /*const VLLIST_VOLUMETYPE= 0x4;*/
87 const VLLIST_VOLUMEID= 0x8;
88 const VLLIST_FLAG= 0x10;
90 /* External (visible) representation of an individual vldb entry */
92 char name[VL_MAXNAMELEN]; /* Volume name */
94 afs_int32 nServers; /* Number of servers that have this volume */
95 afs_int32 serverNumber[OMAXNSERVERS]; /* Server # for each server that holds volume */
96 afs_int32 serverPartition[OMAXNSERVERS]; /* Server Partition number */
97 afs_int32 serverFlags[OMAXNSERVERS]; /* Server flags */
98 afs_uint32 volumeId[MAXTYPES]; /* Corresponding volume of each type */
99 afs_uint32 cloneId; /* Used during cloning */
100 afs_int32 flags; /* General flags */
104 char name[VL_MAXNAMELEN]; /* Volume name */
105 afs_int32 nServers; /* Number of servers that have this volume */
106 afs_int32 serverNumber[NMAXNSERVERS]; /* Server # for each server that holds volume */
107 afs_int32 serverPartition[NMAXNSERVERS]; /* Server Partition number */
108 afs_int32 serverFlags[NMAXNSERVERS]; /* Server flags */
109 afs_uint32 volumeId[MAXTYPES]; /* Corresponding volume of each type */
110 afs_uint32 cloneId; /* Used during cloning */
111 afs_int32 flags; /* General flags */
112 afs_int32 matchindex;
124 struct ListAddrByAttributes {
131 const VLADDR_IPADDR = 0x1;
132 const VLADDR_INDEX = 0x2;
133 const VLADDR_UUID = 0x4;
136 char name[VL_MAXNAMELEN]; /* Volume name */
137 afs_int32 nServers; /* Number of servers that have this volume */
138 afsUUID serverNumber[NMAXNSERVERS]; /* Server # for each server that holds volume */
139 afs_int32 serverUnique[NMAXNSERVERS]; /* Server unique address */
140 afs_int32 serverPartition[NMAXNSERVERS]; /* Server Partition number */
141 afs_int32 serverFlags[NMAXNSERVERS]; /* Server flags */
142 afs_uint32 volumeId[MAXTYPES]; /* Corresponding volume of each type */
143 afs_uint32 cloneId; /* Used during cloning */
144 afs_int32 flags; /* General flags */
145 afs_int32 spares1; /* The server index we matched */
157 /* Leading section of the vldb header (vlheader); contains frequently used globals and general statistics information */
158 struct vital_vlheader {
159 afs_int32 vldbversion; /* vldb version number--must be 1st */
160 afs_int32 headersize; /* total bytes in header */
161 afs_int32 freePtr; /* first (if any) free enry in freelist */
162 afs_int32 eofPtr; /* first free byte in file */
163 afs_int32 allocs; /* total calls to AllocBlock */
164 afs_int32 frees; /* total calls to FreeBlock */
165 afs_uint32 MaxVolumeId; /* Global volume id holder */
166 afs_int32 totalEntries[MAXTYPES]; /* Total entries by voltype in vldb */
169 /* General stats on opcode hit frequency */
170 const MAX_NUMBER_OPCODES = 50;
172 afs_uint32 start_time; /* Time statistics were last cleared */
173 afs_int32 requests[MAX_NUMBER_OPCODES]; /* requests of each type */
174 afs_int32 aborts[MAX_NUMBER_OPCODES]; /* aborts of each type */
175 afs_int32 reserved[5]; /* for future usage */
178 /* Volser information/status */
179 const VLOP_MOVE = 0x10;
180 const VLOP_RELEASE = 0x20;
181 const VLOP_BACKUP = 0x40;
182 const VLOP_DELETE = 0x80;
183 const VLOP_DUMP = 0x100;
185 %#define VLOP_ALLOPERS ( VLOP_MOVE | VLOP_RELEASE | VLOP_BACKUP | VLOP_DELETE | VLOP_DUMP)
187 /* defines for convenience of vl users */
188 %#define VLF_RWEXISTS 0x1000 /* flags for whole vldb entry */
189 %#define VLF_ROEXISTS 0x2000
190 %#define VLF_BACKEXISTS 0x4000
191 %#define VLF_DFSFILESET 0x8000 /* Volume is really DFS fileset */
192 %#define VLSF_NEWREPSITE 0x01 /* flags for indiv. server entry */
193 %#define VLSF_ROVOL 0x02
194 %#define VLSF_RWVOL 0x04
195 %#define VLSF_BACKVOL 0x08
196 %#define VLSF_DONTUSE 0x20 /* no conflict with VLSERVER_FLAG_UUID */
198 typedef vldbentry bulkentries<>;
199 typedef nvldbentry nbulkentries<>;
200 typedef uvldbentry ubulkentries<>;
201 typedef afs_uint32 bulkaddrs<>;
204 afs_uint32 CallBackVersion;
205 afs_uint32 ExpirationTime;
206 afs_uint32 CallBackType;
210 /* vldb interface calls */
213 * The kernel needs to be able to use a subset of these.
215 * Rather than try to make sure the all the kernels have
216 * all the necessary xdr routines for *all* the interfaces,
217 * we arrange that only the ones necessary for the kernel
218 * get compiled in the kernel.
222 * VL_Probe was renamed to VL_ProbeServer to avoid namespace collisions
230 * VL_GetEntryByName was renamed to VL_GetEntryByNameO to avoid
231 * namespace collisions with DFS clients.
235 IN string volumename<VL_MAXNAMELEN>,
237 ) = VLGETENTRYBYNAME;
240 IN string volumename<VL_MAXNAMELEN>,
241 OUT nvldbentry *entry
242 ) = VLGETENTRYBYNAMEN;
245 IN string volumename<VL_MAXNAMELEN>,
246 OUT uvldbentry *entry
247 ) = VLGETENTRYBYNAMEU;
250 IN ListAddrByAttributes *inaddr,
252 OUT afs_int32 *uniquifier,
253 OUT afs_int32 *nentries,
254 OUT bulkaddrs *blkaddrs
258 * The rest of the interfaces are not needed in the kernel
261 %#if !defined(KERNEL)
263 typedef struct single_vldbentry *vldblist;
265 struct single_vldbentry {
274 typedef struct single_nvldbentry *nvldblist;
276 struct single_nvldbentry {
277 nvldbentry VldbEntry;
286 IN vldbentry *newentry
301 IN afs_uint32 bumpcount,
302 OUT afs_uint32 *newvolumid
303 ) = VLGETNEWVOLUMEID;
309 afs_int32 ReleaseType
315 VldbUpdateEntry *UpdateEntry,
316 afs_int32 ReleaseType
328 afs_int32 ReleaseType
332 IN afs_int32 previous_index,
333 OUT afs_int32 *count,
334 afs_int32 *next_index,
339 IN VldbListByAttributes *attributes,
340 OUT afs_int32 *nentries,
341 OUT bulkentries *blkentries
342 ) = VLLISTATTRIBUTES;
345 IN VldbListByAttributes *attributes,
346 OUT afs_int32 *nentries,
347 OUT vldb_list *linkedentries
352 vital_vlheader *vital_header
358 OUT VLCallBack *spare3,
359 OUT afs_int32 *nentries,
360 OUT bulkaddrs *blkaddrs
370 IN nvldbentry *newentry
376 OUT nvldbentry *entry
382 nvldbentry *newentry,
383 afs_int32 ReleaseType
387 IN afs_int32 previous_index,
388 OUT afs_int32 *count,
389 afs_int32 *next_index,
394 IN VldbListByAttributes *attributes,
395 OUT afs_int32 *nentries,
396 OUT nbulkentries *blkentries
397 ) = VLLISTATTRIBUTESN;
400 IN VldbListByAttributes *attributes,
401 OUT afs_int32 *nentries,
402 OUT nvldb_list *linkedentries
406 IN string volumename<VL_MAXNAMELEN>,
407 VldbUpdateEntry *UpdateEntry,
408 afs_int32 ReleaseType
409 ) = VLUPDATEENTRYBYNAME;
418 IN VldbListByAttributes *attributes,
419 IN string volumename<VL_MAXNAMELEN>,
420 IN afs_int32 startindex,
421 OUT afs_int32 *nentries,
422 OUT nbulkentries *blkentries,
423 OUT afs_int32 *nextstartindex
424 ) = VLLISTATTRIBUTESN2;
426 %#endif /* !defined(KERNEL) */