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 %#define VldbVersion "4"
24 const VLDBVERSION_4 = 4;
25 const VLDBVERSION = 3;
26 const OVLDBVERSION = 2;
27 const VL_MAXNAMELEN = 65;
28 const OMAXNSERVERS = 8;
29 const NMAXNSERVERS = 13;
32 /* Structure used by the VLUpdateEntry routine; multiple entries can be updated at once by setting the appropriate Mask bits. */
33 struct VldbUpdateEntry {
35 char name[VL_MAXNAMELEN];
38 afs_uint32 ReadOnlyId;
41 afs_int32 nModifiedRepsites;
42 afs_uint32 RepsitesMask[OMAXNSERVERS];
43 afs_int32 RepsitesTargetServer[OMAXNSERVERS];
44 afs_int32 RepsitesTargetPart[OMAXNSERVERS];
45 afs_int32 RepsitesNewServer[OMAXNSERVERS];
46 afs_int32 RepsitesNewPart[OMAXNSERVERS];
47 afs_int32 RepsitesNewFlags[OMAXNSERVERS];
50 /* struct VldbUpdateEntry Mask bit values */
51 const VLUPDATE_VOLUMENAME = 0x0001;
52 /*const VLUPDATE_VOLUMETYPE = 0x0002;*/
53 const VLUPDATE_FLAGS = 0x0004;
54 const VLUPDATE_READONLYID = 0x0008;
55 const VLUPDATE_BACKUPID = 0x0010;
56 const VLUPDATE_REPSITES = 0x0020;
57 const VLUPDATE_CLONEID = 0x0080;
58 const VLUPDATE_VOLNAMEHASH = 0x0100;
59 const VLUPDATE_RWID = 0x0200;
61 /* struct VldbUpdateEntry RepsitesMask[i] bit values */
62 const VLUPDATE_REPS_DELETE = 0x0100;
63 const VLUPDATE_REPS_ADD = 0x0200;
64 const VLUPDATE_REPS_MODSERV = 0x0400;
65 const VLUPDATE_REPS_MODPART = 0x0800;
66 const VLUPDATE_REPS_MODFLAG = 0x1000;
68 const VLSERVER_FLAG_UUID = 0x0010;
70 /*typedef string volumename<VL_MAXNAMELEN>;*/
72 const DEFAULTBULK = 10000;
73 typedef opaque bulk<DEFAULTBULK>;
75 /* Structure used by the VLListAttributes routine */
76 struct VldbListByAttributes {
85 /* struct VldbListByAttributes Mask bit values */
86 const VLLIST_SERVER = 0x1;
87 const VLLIST_PARTITION= 0x2;
88 /*const VLLIST_VOLUMETYPE= 0x4;*/
89 const VLLIST_VOLUMEID= 0x8;
90 const VLLIST_FLAG= 0x10;
92 /* External (visible) representation of an individual vldb entry */
94 char name[VL_MAXNAMELEN]; /* Volume name */
96 afs_int32 nServers; /* Number of servers that have this volume */
97 afs_int32 serverNumber[OMAXNSERVERS]; /* Server # for each server that holds volume */
98 afs_int32 serverPartition[OMAXNSERVERS]; /* Server Partition number */
99 afs_int32 serverFlags[OMAXNSERVERS]; /* Server flags */
100 afs_uint32 volumeId[MAXTYPES]; /* Corresponding volume of each type */
101 afs_uint32 cloneId; /* Used during cloning */
102 afs_int32 flags; /* General flags */
106 char name[VL_MAXNAMELEN]; /* Volume name */
107 afs_int32 nServers; /* Number of servers that have this volume */
108 afs_int32 serverNumber[NMAXNSERVERS]; /* Server # for each server that holds volume */
109 afs_int32 serverPartition[NMAXNSERVERS]; /* Server Partition number */
110 afs_int32 serverFlags[NMAXNSERVERS]; /* Server flags */
111 afs_uint32 volumeId[MAXTYPES]; /* Corresponding volume of each type */
112 afs_uint32 cloneId; /* Used during cloning */
113 afs_int32 flags; /* General flags */
114 afs_int32 matchindex;
126 struct ListAddrByAttributes {
133 const VLADDR_IPADDR = 0x1;
134 const VLADDR_INDEX = 0x2;
135 const VLADDR_UUID = 0x4;
138 char name[VL_MAXNAMELEN]; /* Volume name */
139 afs_int32 nServers; /* Number of servers that have this volume */
140 afsUUID serverNumber[NMAXNSERVERS]; /* Server # for each server that holds volume */
141 afs_int32 serverUnique[NMAXNSERVERS]; /* Server unique address */
142 afs_int32 serverPartition[NMAXNSERVERS]; /* Server Partition number */
143 afs_int32 serverFlags[NMAXNSERVERS]; /* Server flags */
144 afs_uint32 volumeId[MAXTYPES]; /* Corresponding volume of each type */
145 afs_uint32 cloneId; /* Used during cloning */
146 afs_int32 flags; /* General flags */
147 afs_int32 matchindex; /* The server index we matched */
159 /* Leading section of the vldb header (vlheader); contains frequently used globals and general statistics information */
160 struct vital_vlheader {
161 afs_int32 vldbversion; /* vldb version number--must be 1st */
162 afs_int32 headersize; /* total bytes in header */
163 afs_int32 freePtr; /* first (if any) free enry in freelist */
164 afs_int32 eofPtr; /* first free byte in file */
165 afs_int32 allocs; /* total calls to AllocBlock */
166 afs_int32 frees; /* total calls to FreeBlock */
167 afs_uint32 MaxVolumeId; /* Global volume id holder */
168 afs_int32 totalEntries[MAXTYPES]; /* Total entries by voltype in vldb */
171 /* General stats on opcode hit frequency */
172 const MAX_NUMBER_OPCODES = 50;
174 afs_uint32 start_time; /* Time statistics were last cleared */
175 afs_int32 requests[MAX_NUMBER_OPCODES]; /* requests of each type */
176 afs_int32 aborts[MAX_NUMBER_OPCODES]; /* aborts of each type */
177 afs_int32 reserved[5]; /* for future usage */
180 /* Volser information/status */
181 const VLOP_MOVE = 0x10;
182 const VLOP_RELEASE = 0x20;
183 const VLOP_BACKUP = 0x40;
184 const VLOP_DELETE = 0x80;
185 const VLOP_DUMP = 0x100;
187 %#define VLOP_ALLOPERS ( VLOP_MOVE | VLOP_RELEASE | VLOP_BACKUP | VLOP_DELETE | VLOP_DUMP)
189 /* defines for convenience of vl users */
190 %#define VLF_RWEXISTS 0x1000 /* flags for whole vldb entry */
191 %#define VLF_ROEXISTS 0x2000
192 %#define VLF_BACKEXISTS 0x4000
193 %#define VLF_DFSFILESET 0x8000 /* Volume is really DFS fileset */
194 %#define VLSF_NEWREPSITE 0x01 /* flags for indiv. server entry */
195 %#define VLSF_ROVOL 0x02
196 %#define VLSF_RWVOL 0x04
197 %#define VLSF_BACKVOL 0x08
198 %#define VLSF_DONTUSE 0x20 /* no conflict with VLSERVER_FLAG_UUID */
200 typedef vldbentry bulkentries<>;
201 typedef nvldbentry nbulkentries<>;
202 typedef uvldbentry ubulkentries<>;
203 typedef afs_uint32 bulkaddrs<>;
206 afs_uint32 CallBackVersion;
207 afs_uint32 ExpirationTime;
208 afs_uint32 CallBackType;
212 /* vldb interface calls */
215 * The kernel needs to be able to use a subset of these.
217 * Rather than try to make sure the all the kernels have
218 * all the necessary xdr routines for *all* the interfaces,
219 * we arrange that only the ones necessary for the kernel
220 * get compiled in the kernel.
224 * VL_Probe was renamed to VL_ProbeServer to avoid namespace collisions
232 * VL_GetEntryByName was renamed to VL_GetEntryByNameO to avoid
233 * namespace collisions with DFS clients.
237 IN string volumename<VL_MAXNAMELEN>,
239 ) = VLGETENTRYBYNAME;
242 IN string volumename<VL_MAXNAMELEN>,
243 OUT nvldbentry *entry
244 ) = VLGETENTRYBYNAMEN;
247 IN string volumename<VL_MAXNAMELEN>,
248 OUT uvldbentry *entry
249 ) = VLGETENTRYBYNAMEU;
252 IN ListAddrByAttributes *inaddr,
254 OUT afs_int32 *uniquifier,
255 OUT afs_int32 *nentries,
256 OUT bulkaddrs *blkaddrs
260 * The rest of the interfaces are not needed in the kernel
263 %#if !defined(KERNEL)
265 typedef struct single_vldbentry *vldblist;
267 struct single_vldbentry {
276 typedef struct single_nvldbentry *nvldblist;
278 struct single_nvldbentry {
279 nvldbentry VldbEntry;
288 IN vldbentry *newentry
303 IN afs_uint32 bumpcount,
304 OUT afs_uint32 *newvolumid
305 ) = VLGETNEWVOLUMEID;
311 afs_int32 ReleaseType
317 VldbUpdateEntry *UpdateEntry,
318 afs_int32 ReleaseType
330 afs_int32 ReleaseType
334 IN afs_int32 previous_index,
335 OUT afs_int32 *count,
336 afs_int32 *next_index,
341 IN VldbListByAttributes *attributes,
342 OUT afs_int32 *nentries,
343 OUT bulkentries *blkentries
344 ) = VLLISTATTRIBUTES;
347 IN VldbListByAttributes *attributes,
348 OUT afs_int32 *nentries,
349 OUT vldb_list *linkedentries
354 vital_vlheader *vital_header
360 OUT VLCallBack *spare3,
361 OUT afs_int32 *nentries,
362 OUT bulkaddrs *blkaddrs
372 IN nvldbentry *newentry
378 OUT nvldbentry *entry
384 nvldbentry *newentry,
385 afs_int32 ReleaseType
389 IN afs_int32 previous_index,
390 OUT afs_int32 *count,
391 afs_int32 *next_index,
396 IN VldbListByAttributes *attributes,
397 OUT afs_int32 *nentries,
398 OUT nbulkentries *blkentries
399 ) = VLLISTATTRIBUTESN;
402 IN VldbListByAttributes *attributes,
403 OUT afs_int32 *nentries,
404 OUT nvldb_list *linkedentries
408 IN string volumename<VL_MAXNAMELEN>,
409 VldbUpdateEntry *UpdateEntry,
410 afs_int32 ReleaseType
411 ) = VLUPDATEENTRYBYNAME;
420 IN VldbListByAttributes *attributes,
421 IN string volumename<VL_MAXNAMELEN>,
422 IN afs_int32 startindex,
423 OUT afs_int32 *nentries,
424 OUT nbulkentries *blkentries,
425 OUT afs_int32 *nextstartindex
426 ) = VLLISTATTRIBUTESN2;
428 %#endif /* !defined(KERNEL) */