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
10 #ifndef OPENAFS_VOS_ADMIN_H
11 #define OPENAFS_VOS_ADMIN_H
13 #include <afs/param.h>
14 #include <afs/afs_Admin.h>
15 #include <sys/types.h>
21 #include <sys/socket.h>
24 #define VOS_MAX_PARTITION_NAME_LEN 32
25 #define VOS_MAX_VOLUME_NAME_LEN 32
26 #define VOS_MAX_VOLUME_TYPES 3
27 #define VOS_MAX_REPLICA_SITES 13
28 #define VOS_MAX_SERVER_ADDRESS 16
33 } vos_force_t, *vos_force_p;
38 } vos_exclude_t, *vos_exclude_p;
53 } vos_volumeStatus_t, *vos_volumeStatus_p;
56 VOS_READ_WRITE_VOLUME,
59 } vos_volumeType_t, *vos_volumeType_p;
61 typedef struct vos_fileServerEntry {
62 int serverAddress[VOS_MAX_SERVER_ADDRESS];
64 } vos_fileServerEntry_t, *vos_fileServerEntry_p;
67 VOS_VOLUME_READ_WRITE_STATS_SAME_NETWORK,
68 VOS_VOLUME_READ_WRITE_STATS_SAME_NETWORK_AUTHENTICATED,
69 VOS_VOLUME_READ_WRITE_STATS_DIFFERENT_NETWORK,
70 VOS_VOLUME_READ_WRITE_STATS_DIFFERENT_NETWORK_AUTHENTICATED
71 } vos_volumeReadWriteStats_t, *vos_volumeReadWriteStats_p;
73 #define VOS_VOLUME_READ_WRITE_STATS_NUMBER 4
76 VOS_VOLUME_TIME_STATS_0_TO_60_SECONDS,
77 VOS_VOLUME_TIME_STATS_1_TO_10_MINUTES,
78 VOS_VOLUME_TIME_STATS_10_TO_60_MINUTES,
79 VOS_VOLUME_TIME_STATS_1_TO_24_HOURS,
80 VOS_VOLUME_TIME_STATS_1_TO_7_DAYS,
81 VOS_VOLUME_TIME_STATS_GREATER_THAN_7_DAYS
82 } vos_volumeTimeStats_t, *vos_volumeTimeStats_p;
84 #define VOS_VOLUME_TIME_STATS_NUMBER 6
86 typedef struct vos_volumeEntry {
88 unsigned int readWriteId;
89 unsigned int readOnlyId;
90 unsigned int backupId;
91 unsigned long creationDate;
92 unsigned long lastAccessDate;
93 unsigned long lastUpdateDate;
94 unsigned long lastBackupDate;
95 unsigned long copyCreationDate;
96 int accessesSinceMidnight;
100 int readStats[VOS_VOLUME_READ_WRITE_STATS_NUMBER];
101 int writeStats[VOS_VOLUME_READ_WRITE_STATS_NUMBER];
102 int fileAuthorWriteSameNetwork[VOS_VOLUME_TIME_STATS_NUMBER];
103 int fileAuthorWriteDifferentNetwork[VOS_VOLUME_TIME_STATS_NUMBER];
104 int dirAuthorWriteSameNetwork[VOS_VOLUME_TIME_STATS_NUMBER];
105 int dirAuthorWriteDifferentNetwork[VOS_VOLUME_TIME_STATS_NUMBER];
106 vos_volumeStatus_t status;
107 vos_volumeStatus_t volumeDisposition;
108 vos_volumeType_t type;
109 char name[VOS_MAX_VOLUME_NAME_LEN];
110 } vos_volumeEntry_t, *vos_volumeEntry_p;
112 typedef struct vos_partitionEntry {
113 char name[VOS_MAX_PARTITION_NAME_LEN];
114 char deviceName[VOS_MAX_PARTITION_NAME_LEN];
115 int lockFileDescriptor;
118 } vos_partitionEntry_t, *vos_partitionEntry_p;
121 VOS_VLDB_ENTRY_OK = 0x1,
122 VOS_VLDB_ENTRY_MOVE = 0x2,
123 VOS_VLDB_ENTRY_RELEASE = 0x4,
124 VOS_VLDB_ENTRY_BACKUP = 0x8,
125 VOS_VLDB_ENTRY_DELETE = 0x10,
126 VOS_VLDB_ENTRY_DUMP = 0x20,
127 VOS_VLDB_ENTRY_LOCKED = 0x40,
128 VOS_VLDB_ENTRY_RWEXISTS = 0x1000,
129 VOS_VLDB_ENTRY_ROEXISTS = 0x2000,
130 VOS_VLDB_ENTRY_BACKEXISTS = 0x4000
131 } vos_vldbEntryStatus_t, *vos_vldbEntryStatus_p;
134 VOS_VLDB_NEW_REPSITE = 0x1,
135 VOS_VLDB_READ_ONLY = 0x2,
136 VOS_VLDB_READ_WRITE = 0x4,
137 VOS_VLDB_BACKUP = 0x8,
138 VOS_VLDB_DONT_USE = 0x10
139 } vos_vldbServerFlag_t, *vos_vldbServerFlag_p;
141 typedef struct vos_vldbEntry {
143 unsigned int volumeId[VOS_MAX_VOLUME_TYPES];
144 unsigned int cloneId;
145 vos_vldbEntryStatus_t status;
149 vos_vldbServerFlag_t serverFlags;
150 } volumeSites[VOS_MAX_REPLICA_SITES];
151 char name[VOS_MAX_VOLUME_NAME_LEN];
152 } vos_vldbEntry_t, *vos_vldbEntry_p;
154 #define VOS_PROCEDURE_NAME_LEN 30
157 VOS_VOLUME_ATTACH_MODE_OK,
158 VOS_VOLUME_ATTACH_MODE_OFFLINE,
159 VOS_VOLUME_ATTACH_MODE_BUSY,
160 VOS_VOLUME_ATTACH_MODE_READONLY,
161 VOS_VOLUME_ATTACH_MODE_CREATE,
162 VOS_VOLUME_ATTACH_MODE_CREATE_VOLID
163 } vol_volumeAttachMode_t, *vol_volumeAttachMode_p;
166 VOS_VOLUME_ACTIVE_STATUS_OK,
167 VOS_VOLUME_ACTIVE_STATUS_DELETE_ON_SALVAGE,
168 VOS_VOLUME_ACTIVE_STATUS_OUT_OF_SERVICE,
169 VOS_VOLUME_ACTIVE_STATUS_DELETED
170 } vos_volumeActiveStatus_t, *vos_volumeActiveStatus_p;
173 VOS_VOLUME_TRANSACTION_STATUS_OK,
174 VOS_VOLUME_TRANSACTION_STATUS_DELETED
175 } vos_volumeTransactionStatus_t, *vos_volumeTransactionStatus_p;
177 typedef struct vos_serverTransactionStatus {
182 unsigned int volumeId;
184 char lastProcedureName[VOS_PROCEDURE_NAME_LEN];
185 int nextReceivePacketSequenceNumber;
186 int nextSendPacketSequenceNumber;
189 vol_volumeAttachMode_t volumeAttachMode;
190 vos_volumeActiveStatus_t volumeActiveStatus;
191 vos_volumeTransactionStatus_t volumeTransactionStatus;
192 } vos_serverTransactionStatus_t, *vos_serverTransactionStatus_p;
196 VOS_RESTORE_INCREMENTAL
197 } vos_volumeRestoreType_t, *vos_volumeRestoreType_p;
202 } vos_volumeOnlineType_t, *vos_volumeOnlineType_p;
205 VOS_DEBUG_MESSAGE = 0x1,
206 VOS_ERROR_MESSAGE = 0x2,
207 VOS_VERBOSE_MESSAGE = 0x4
208 } vos_messageType_t, *vos_messageType_p;
211 (ADMINAPI * vos_MessageCallBack_t) (vos_messageType_t type, char *message);
213 extern int ADMINAPI vos_BackupVolumeCreate(const void *cellHandle,
214 vos_MessageCallBack_t callBack,
215 unsigned int volumeId,
218 extern int ADMINAPI vos_BackupVolumeCreateMultiple(const void *cellHandle,
219 const void *serverHandle,
220 vos_MessageCallBack_t
224 const char *volumePrefix,
229 extern int ADMINAPI vos_PartitionGet(const void *cellHandle,
230 const void *serverHandle,
231 vos_MessageCallBack_t callBack,
232 unsigned int partition,
233 vos_partitionEntry_p partitionP,
236 extern int ADMINAPI vos_PartitionGetBegin(const void *cellHandle,
237 const void *serverHandle,
238 vos_MessageCallBack_t callBack,
242 extern int ADMINAPI vos_PartitionGetNext(const void *iterationId,
243 vos_partitionEntry_p partitionP,
246 extern int ADMINAPI vos_PartitionGetDone(const void *iterationId,
249 extern int ADMINAPI vos_ServerOpen(const void *cellHandle,
250 const char *serverName,
251 void **serverHandleP, afs_status_p st);
253 extern int ADMINAPI vos_ServerClose(const void *serverHandle,
256 extern int ADMINAPI vos_ServerSync(const void *cellHandle,
257 const void *serverHandle,
258 vos_MessageCallBack_t callBack,
259 const unsigned int *partition,
262 extern int ADMINAPI vos_FileServerAddressChange(const void *cellHandle,
263 vos_MessageCallBack_t
264 callBack, int oldAddress,
268 extern int ADMINAPI vos_FileServerAddressRemove(const void *cellHandle,
269 vos_MessageCallBack_t
270 callBack, int serverAddress,
273 extern int ADMINAPI vos_FileServerGetBegin(const void *cellHandle,
274 vos_MessageCallBack_t callBack,
278 extern int ADMINAPI vos_FileServerGetNext(void *iterationId,
279 vos_fileServerEntry_p serverEntryP,
282 extern int ADMINAPI vos_FileServerGetDone(void *iterationId, afs_status_p st);
284 extern int ADMINAPI vos_ServerTransactionStatusGetBegin(const void
285 *cellHandle, const void
287 vos_MessageCallBack_t
292 extern int ADMINAPI vos_ServerTransactionStatusGetNext(const void
294 vos_serverTransactionStatus_p
295 serverTransactionStatusP,
298 extern int ADMINAPI vos_ServerTransactionStatusGetDone(const void
302 extern int ADMINAPI vos_VLDBGet(const void *cellHandle,
303 vos_MessageCallBack_t callBack,
304 const unsigned int *volumeId,
305 const char *volumeName,
306 vos_vldbEntry_p vldbEntry, afs_status_p st);
308 extern int ADMINAPI vos_VLDBGetBegin(const void *cellHandle,
309 const void *serverHandle,
310 vos_MessageCallBack_t callBack,
311 unsigned int *partition,
312 void **iterationIdP, afs_status_p st);
314 extern int ADMINAPI vos_VLDBGetNext(const void *iterationId,
315 vos_vldbEntry_p vldbEntry,
318 extern int ADMINAPI vos_VLDBGetDone(const void *iterationId, afs_status_p st);
320 extern int ADMINAPI vos_VLDBEntryRemove(const void *cellHandle,
321 const void *serverHandle,
322 vos_MessageCallBack_t callBack,
323 const unsigned int *partition,
324 unsigned int *volumeId,
327 extern int ADMINAPI vos_VLDBUnlock(const void *cellHandle,
328 const void *serverHandle,
329 vos_MessageCallBack_t callBack,
330 const unsigned int *partition,
333 extern int ADMINAPI vos_VLDBEntryLock(const void *cellHandle,
334 vos_MessageCallBack_t callBack,
335 unsigned int volumeId, afs_status_p st);
337 extern int ADMINAPI vos_VLDBEntryUnlock(const void *cellHandle,
338 vos_MessageCallBack_t callBack,
339 unsigned int volumeId,
342 extern int ADMINAPI vos_VLDBReadOnlySiteCreate(const void *cellHandle,
343 const void *serverHandle,
344 vos_MessageCallBack_t callBack,
345 unsigned int partition,
346 unsigned int volumeId,
349 extern int ADMINAPI vos_VLDBReadOnlySiteDelete(const void *cellHandle,
350 const void *serverHandle,
351 vos_MessageCallBack_t callBack,
352 unsigned int partition,
353 unsigned int volumeId,
356 extern int ADMINAPI vos_VLDBSync(const void *cellHandle,
357 const void *serverHandle,
358 vos_MessageCallBack_t callBack,
359 const unsigned int *partition,
360 vos_force_t force, afs_status_p st);
362 extern int ADMINAPI vos_VolumeCreate(const void *cellHandle,
363 const void *serverHandle,
364 vos_MessageCallBack_t callBack,
365 unsigned int partition,
366 const char *volumeName,
368 unsigned int *volumeId, afs_status_p st);
370 extern int ADMINAPI vos_VolumeDelete(const void *cellHandle,
371 const void *serverHandle,
372 vos_MessageCallBack_t callBack,
373 unsigned int partition,
374 unsigned int volumeId, afs_status_p st);
376 extern int ADMINAPI vos_VolumeRename(const void *cellHandle,
377 vos_MessageCallBack_t callBack,
378 unsigned int readWriteVolumeId,
379 const char *newVolumeName,
382 extern int ADMINAPI vos_VolumeDump(const void *cellHandle,
383 const void *serverHandle,
384 vos_MessageCallBack_t callBack,
385 unsigned int *partition,
386 unsigned int volumeId,
387 unsigned int startTime,
388 const char *dumpFile, afs_status_p st);
390 extern int ADMINAPI vos_VolumeRestore(const void *cellHandle,
391 const void *serverHandle,
392 vos_MessageCallBack_t callBack,
393 unsigned int partition,
394 unsigned int *volumeId,
395 const char *volumeName,
396 const char *dumpFile,
397 vos_volumeRestoreType_t dumpType,
400 extern int ADMINAPI vos_VolumeOnline(const void *serverHandle,
401 vos_MessageCallBack_t callBack,
402 unsigned int partition,
403 unsigned int volumeId,
404 unsigned int sleepTime,
405 vos_volumeOnlineType_t volumeStatus,
408 extern int ADMINAPI vos_VolumeOffline(const void *serverHandle,
409 vos_MessageCallBack_t callBack,
410 unsigned int partition,
411 unsigned int volumeId, afs_status_p st);
413 extern int ADMINAPI vos_VolumeGet(const void *cellHandle,
414 const void *serverHandle,
415 vos_MessageCallBack_t callBack,
416 unsigned int partition,
417 unsigned int volumeId,
418 vos_volumeEntry_p volumeP, afs_status_p st);
420 extern int ADMINAPI vos_VolumeGetBegin(const void *cellHandle,
421 const void *serverHandle,
422 vos_MessageCallBack_t callBack,
423 unsigned int partition,
424 void **iterationIdP, afs_status_p st);
426 extern int ADMINAPI vos_VolumeGetNext(const void *iterationId,
427 vos_volumeEntry_p volumeP,
430 extern int ADMINAPI vos_VolumeGetDone(const void *iterationId,
433 extern int ADMINAPI vos_VolumeMove(const void *cellHandle,
434 vos_MessageCallBack_t callBack,
435 unsigned int volumeId,
436 const void *fromServer,
437 unsigned int fromPartition,
438 const void *toServer,
439 unsigned int toPartition, afs_status_p st);
441 extern int ADMINAPI vos_VolumeRelease(const void *cellHandle,
442 vos_MessageCallBack_t callBack,
443 unsigned int volumeId,
444 vos_force_t force, afs_status_p st);
446 extern int ADMINAPI vos_VolumeZap(const void *cellHandle,
447 const void *serverHandle,
448 vos_MessageCallBack_t callBack,
449 unsigned int partition,
450 unsigned int volumeId, vos_force_t force,
453 extern int ADMINAPI vos_PartitionNameToId(const char *partitionName,
454 unsigned int *partitionId,
457 extern int ADMINAPI vos_PartitionIdToName(unsigned int partitionId,
461 extern int ADMINAPI vos_VolumeQuotaChange(const void *cellHandle,
462 const void *serverHandle,
463 vos_MessageCallBack_t callBack,
464 unsigned int partition,
465 unsigned int volumeId,
466 unsigned int volumeQuota,
469 #endif /* OPENAFS_VOS_ADMIN_H */