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>
16 #include <afs/volint.h>
22 #include <sys/socket.h>
25 #define VOS_MAX_PARTITION_NAME_LEN 32
26 #define VOS_MAX_VOLUME_NAME_LEN 32
27 #define VOS_MAX_VOLUME_TYPES 3
28 #define VOS_MAX_REPLICA_SITES 13
29 #define VOS_MAX_SERVER_ADDRESS 16
34 } vos_force_t
, *vos_force_p
;
39 } vos_exclude_t
, *vos_exclude_p
;
54 } vos_volumeStatus_t
, *vos_volumeStatus_p
;
57 VOS_READ_WRITE_VOLUME
,
60 } vos_volumeType_t
, *vos_volumeType_p
;
62 typedef struct vos_fileServerEntry
{
63 int serverAddress
[VOS_MAX_SERVER_ADDRESS
];
65 } vos_fileServerEntry_t
, *vos_fileServerEntry_p
;
68 VOS_VOLUME_READ_WRITE_STATS_SAME_NETWORK
,
69 VOS_VOLUME_READ_WRITE_STATS_SAME_NETWORK_AUTHENTICATED
,
70 VOS_VOLUME_READ_WRITE_STATS_DIFFERENT_NETWORK
,
71 VOS_VOLUME_READ_WRITE_STATS_DIFFERENT_NETWORK_AUTHENTICATED
72 } vos_volumeReadWriteStats_t
, *vos_volumeReadWriteStats_p
;
74 #define VOS_VOLUME_READ_WRITE_STATS_NUMBER 4
77 VOS_VOLUME_TIME_STATS_0_TO_60_SECONDS
,
78 VOS_VOLUME_TIME_STATS_1_TO_10_MINUTES
,
79 VOS_VOLUME_TIME_STATS_10_TO_60_MINUTES
,
80 VOS_VOLUME_TIME_STATS_1_TO_24_HOURS
,
81 VOS_VOLUME_TIME_STATS_1_TO_7_DAYS
,
82 VOS_VOLUME_TIME_STATS_GREATER_THAN_7_DAYS
83 } vos_volumeTimeStats_t
, *vos_volumeTimeStats_p
;
85 #define VOS_VOLUME_TIME_STATS_NUMBER 6
87 typedef struct vos_volumeEntry
{
89 unsigned int readWriteId
;
90 unsigned int readOnlyId
;
91 unsigned int backupId
;
92 unsigned long creationDate
;
93 unsigned long lastAccessDate
;
94 unsigned long lastUpdateDate
;
95 unsigned long lastBackupDate
;
96 unsigned long copyCreationDate
;
97 int accessesSinceMidnight
;
101 int readStats
[VOS_VOLUME_READ_WRITE_STATS_NUMBER
];
102 int writeStats
[VOS_VOLUME_READ_WRITE_STATS_NUMBER
];
103 int fileAuthorWriteSameNetwork
[VOS_VOLUME_TIME_STATS_NUMBER
];
104 int fileAuthorWriteDifferentNetwork
[VOS_VOLUME_TIME_STATS_NUMBER
];
105 int dirAuthorWriteSameNetwork
[VOS_VOLUME_TIME_STATS_NUMBER
];
106 int dirAuthorWriteDifferentNetwork
[VOS_VOLUME_TIME_STATS_NUMBER
];
107 vos_volumeStatus_t status
;
108 vos_volumeStatus_t volumeDisposition
;
109 vos_volumeType_t type
;
110 char name
[VOS_MAX_VOLUME_NAME_LEN
];
111 } vos_volumeEntry_t
, *vos_volumeEntry_p
;
113 typedef struct vos_partitionEntry
{
114 char name
[VOS_MAX_PARTITION_NAME_LEN
];
115 char deviceName
[VOS_MAX_PARTITION_NAME_LEN
];
116 int lockFileDescriptor
;
119 } vos_partitionEntry_t
, *vos_partitionEntry_p
;
122 VOS_VLDB_ENTRY_OK
= 0x1,
123 VOS_VLDB_ENTRY_MOVE
= 0x2,
124 VOS_VLDB_ENTRY_RELEASE
= 0x4,
125 VOS_VLDB_ENTRY_BACKUP
= 0x8,
126 VOS_VLDB_ENTRY_DELETE
= 0x10,
127 VOS_VLDB_ENTRY_DUMP
= 0x20,
128 VOS_VLDB_ENTRY_LOCKED
= 0x40,
129 VOS_VLDB_ENTRY_RWEXISTS
= 0x1000,
130 VOS_VLDB_ENTRY_ROEXISTS
= 0x2000,
131 VOS_VLDB_ENTRY_BACKEXISTS
= 0x4000
132 } vos_vldbEntryStatus_t
, *vos_vldbEntryStatus_p
;
135 VOS_VLDB_NEW_REPSITE
= 0x1,
136 VOS_VLDB_READ_ONLY
= 0x2,
137 VOS_VLDB_READ_WRITE
= 0x4,
138 VOS_VLDB_BACKUP
= 0x8,
139 VOS_VLDB_DONT_USE
= 0x10
140 } vos_vldbServerFlag_t
, *vos_vldbServerFlag_p
;
142 typedef struct vos_vldbEntry
{
144 unsigned int volumeId
[VOS_MAX_VOLUME_TYPES
];
145 unsigned int cloneId
;
146 vos_vldbEntryStatus_t status
;
150 vos_vldbServerFlag_t serverFlags
;
151 } volumeSites
[VOS_MAX_REPLICA_SITES
];
152 char name
[VOS_MAX_VOLUME_NAME_LEN
];
153 } vos_vldbEntry_t
, *vos_vldbEntry_p
;
155 #define VOS_PROCEDURE_NAME_LEN 30
158 VOS_VOLUME_ATTACH_MODE_OK
,
159 VOS_VOLUME_ATTACH_MODE_OFFLINE
,
160 VOS_VOLUME_ATTACH_MODE_BUSY
,
161 VOS_VOLUME_ATTACH_MODE_READONLY
,
162 VOS_VOLUME_ATTACH_MODE_CREATE
,
163 VOS_VOLUME_ATTACH_MODE_CREATE_VOLID
164 } vol_volumeAttachMode_t
, *vol_volumeAttachMode_p
;
167 VOS_VOLUME_ACTIVE_STATUS_OK
,
168 VOS_VOLUME_ACTIVE_STATUS_DELETE_ON_SALVAGE
,
169 VOS_VOLUME_ACTIVE_STATUS_OUT_OF_SERVICE
,
170 VOS_VOLUME_ACTIVE_STATUS_DELETED
171 } vos_volumeActiveStatus_t
, *vos_volumeActiveStatus_p
;
174 VOS_VOLUME_TRANSACTION_STATUS_OK
,
175 VOS_VOLUME_TRANSACTION_STATUS_DELETED
176 } vos_volumeTransactionStatus_t
, *vos_volumeTransactionStatus_p
;
178 typedef struct vos_serverTransactionStatus
{
183 unsigned int volumeId
;
185 char lastProcedureName
[VOS_PROCEDURE_NAME_LEN
];
186 int nextReceivePacketSequenceNumber
;
187 int nextSendPacketSequenceNumber
;
190 vol_volumeAttachMode_t volumeAttachMode
;
191 vos_volumeActiveStatus_t volumeActiveStatus
;
192 vos_volumeTransactionStatus_t volumeTransactionStatus
;
193 } vos_serverTransactionStatus_t
, *vos_serverTransactionStatus_p
;
197 VOS_RESTORE_INCREMENTAL
198 } vos_volumeRestoreType_t
, *vos_volumeRestoreType_p
;
203 } vos_volumeOnlineType_t
, *vos_volumeOnlineType_p
;
206 VOS_DEBUG_MESSAGE
= 0x1,
207 VOS_ERROR_MESSAGE
= 0x2,
208 VOS_VERBOSE_MESSAGE
= 0x4
209 } vos_messageType_t
, *vos_messageType_p
;
212 (ADMINAPI
* vos_MessageCallBack_t
) (vos_messageType_t type
, char *message
);
214 extern int ADMINAPI
vos_BackupVolumeCreate(const void *cellHandle
,
215 vos_MessageCallBack_t callBack
,
216 unsigned int volumeId
,
219 extern int ADMINAPI
vos_BackupVolumeCreateMultiple(const void *cellHandle
,
220 const void *serverHandle
,
221 vos_MessageCallBack_t
225 const char *volumePrefix
,
230 extern int ADMINAPI
vos_PartitionGet(const void *cellHandle
,
231 const void *serverHandle
,
232 vos_MessageCallBack_t callBack
,
233 unsigned int partition
,
234 vos_partitionEntry_p partitionP
,
237 extern int ADMINAPI
vos_PartitionGetBegin(const void *cellHandle
,
238 const void *serverHandle
,
239 vos_MessageCallBack_t callBack
,
243 extern int ADMINAPI
vos_PartitionGetNext(const void *iterationId
,
244 vos_partitionEntry_p partitionP
,
247 extern int ADMINAPI
vos_PartitionGetDone(const void *iterationId
,
250 extern int ADMINAPI
vos_ServerOpen(const void *cellHandle
,
251 const char *serverName
,
252 void **serverHandleP
, afs_status_p st
);
254 extern int ADMINAPI
vos_ServerClose(const void *serverHandle
,
257 extern int ADMINAPI
vos_ServerSync(const void *cellHandle
,
258 const void *serverHandle
,
259 vos_MessageCallBack_t callBack
,
260 const unsigned int *partition
,
263 extern int ADMINAPI
vos_FileServerAddressChange(const void *cellHandle
,
264 vos_MessageCallBack_t
265 callBack
, unsigned int oldAddress
,
266 unsigned int newAddress
,
269 extern int ADMINAPI
vos_FileServerAddressRemove(const void *cellHandle
,
270 vos_MessageCallBack_t
271 callBack
, unsigned int serverAddress
,
274 extern int ADMINAPI
vos_FileServerGetBegin(const void *cellHandle
,
275 vos_MessageCallBack_t callBack
,
279 extern int ADMINAPI
vos_FileServerGetNext(void *iterationId
,
280 vos_fileServerEntry_p serverEntryP
,
283 extern int ADMINAPI
vos_FileServerGetDone(void *iterationId
, afs_status_p st
);
285 extern int ADMINAPI
vos_ServerTransactionStatusGetBegin(const void
286 *cellHandle
, const void
288 vos_MessageCallBack_t
293 extern int ADMINAPI
vos_ServerTransactionStatusGetNext(const void
295 vos_serverTransactionStatus_p
296 serverTransactionStatusP
,
299 extern int ADMINAPI
vos_ServerTransactionStatusGetDone(const void
303 extern int ADMINAPI
vos_VLDBGet(const void *cellHandle
,
304 vos_MessageCallBack_t callBack
,
305 const unsigned int *volumeId
,
307 vos_vldbEntry_p vldbEntry
, afs_status_p st
);
309 extern int ADMINAPI
vos_VLDBGetBegin(const void *cellHandle
,
310 const void *serverHandle
,
311 vos_MessageCallBack_t callBack
,
312 unsigned int *partition
,
313 void **iterationIdP
, afs_status_p st
);
315 extern int ADMINAPI
vos_VLDBGetNext(const void *iterationId
,
316 vos_vldbEntry_p vldbEntry
,
319 extern int ADMINAPI
vos_VLDBGetDone(const void *iterationId
, afs_status_p st
);
321 extern int ADMINAPI
vos_VLDBEntryRemove(const void *cellHandle
,
322 const void *serverHandle
,
323 vos_MessageCallBack_t callBack
,
324 const unsigned int *partition
,
325 unsigned int *volumeId
,
328 extern int ADMINAPI
vos_VLDBUnlock(const void *cellHandle
,
329 const void *serverHandle
,
330 vos_MessageCallBack_t callBack
,
331 const unsigned int *partition
,
334 extern int ADMINAPI
vos_VLDBEntryLock(const void *cellHandle
,
335 vos_MessageCallBack_t callBack
,
336 unsigned int volumeId
, afs_status_p st
);
338 extern int ADMINAPI
vos_VLDBEntryUnlock(const void *cellHandle
,
339 vos_MessageCallBack_t callBack
,
340 unsigned int volumeId
,
343 extern int ADMINAPI
vos_VLDBReadOnlySiteCreate(const void *cellHandle
,
344 const void *serverHandle
,
345 vos_MessageCallBack_t callBack
,
346 unsigned int partition
,
347 unsigned int volumeId
,
350 extern int ADMINAPI
vos_VLDBReadOnlySiteDelete(const void *cellHandle
,
351 const void *serverHandle
,
352 vos_MessageCallBack_t callBack
,
353 unsigned int partition
,
354 unsigned int volumeId
,
357 extern int ADMINAPI
vos_VLDBSync(const void *cellHandle
,
358 const void *serverHandle
,
359 vos_MessageCallBack_t callBack
,
360 const unsigned int *partition
,
361 vos_force_t force
, afs_status_p st
);
363 extern int ADMINAPI
vos_VolumeCreate(const void *cellHandle
,
364 const void *serverHandle
,
365 vos_MessageCallBack_t callBack
,
366 unsigned int partition
,
369 unsigned int *volumeId
, afs_status_p st
);
371 extern int ADMINAPI
vos_VolumeDelete(const void *cellHandle
,
372 const void *serverHandle
,
373 vos_MessageCallBack_t callBack
,
374 unsigned int partition
,
375 unsigned int volumeId
, afs_status_p st
);
377 extern int ADMINAPI
vos_VolumeRename(const void *cellHandle
,
378 vos_MessageCallBack_t callBack
,
379 unsigned int readWriteVolumeId
,
383 extern int ADMINAPI
vos_VolumeDump(const void *cellHandle
,
384 const void *serverHandle
,
385 vos_MessageCallBack_t callBack
,
386 unsigned int *partition
,
387 unsigned int volumeId
,
388 unsigned int startTime
,
389 const char *dumpFile
, afs_status_p st
);
391 extern int ADMINAPI
vos_VolumeRestore(const void *cellHandle
,
392 const void *serverHandle
,
393 vos_MessageCallBack_t callBack
,
394 unsigned int partition
,
395 unsigned int *volumeId
,
397 const char *dumpFile
,
398 vos_volumeRestoreType_t dumpType
,
401 extern int ADMINAPI
vos_VolumeOnline(const void *serverHandle
,
402 vos_MessageCallBack_t callBack
,
403 unsigned int partition
,
404 unsigned int volumeId
,
405 unsigned int sleepTime
,
406 vos_volumeOnlineType_t volumeStatus
,
409 extern int ADMINAPI
vos_VolumeOffline(const void *serverHandle
,
410 vos_MessageCallBack_t callBack
,
411 unsigned int partition
,
412 unsigned int volumeId
, afs_status_p st
);
414 extern int ADMINAPI
vos_VolumeGet(const void *cellHandle
,
415 const void *serverHandle
,
416 vos_MessageCallBack_t callBack
,
417 unsigned int partition
,
418 unsigned int volumeId
,
419 vos_volumeEntry_p volumeP
, afs_status_p st
);
421 extern int ADMINAPI
vos_VolumeGetBegin(const void *cellHandle
,
422 const void *serverHandle
,
423 vos_MessageCallBack_t callBack
,
424 unsigned int partition
,
425 void **iterationIdP
, afs_status_p st
);
427 extern int ADMINAPI
vos_VolumeGetNext(const void *iterationId
,
428 vos_volumeEntry_p volumeP
,
431 extern int ADMINAPI
vos_VolumeGetDone(const void *iterationId
,
434 extern int ADMINAPI
vos_VolumeMove(const void *cellHandle
,
435 vos_MessageCallBack_t callBack
,
436 unsigned int volumeId
,
437 const void *fromServer
,
438 unsigned int fromPartition
,
439 const void *toServer
,
440 unsigned int toPartition
, afs_status_p st
);
442 extern int ADMINAPI
vos_VolumeRelease(const void *cellHandle
,
443 vos_MessageCallBack_t callBack
,
444 unsigned int volumeId
,
445 vos_force_t force
, afs_status_p st
);
447 extern int ADMINAPI
vos_VolumeZap(const void *cellHandle
,
448 const void *serverHandle
,
449 vos_MessageCallBack_t callBack
,
450 unsigned int partition
,
451 unsigned int volumeId
, vos_force_t force
,
454 extern int ADMINAPI
vos_PartitionNameToId(const char *partitionName
,
455 unsigned int *partitionId
,
458 extern int ADMINAPI
vos_PartitionIdToName(unsigned int partitionId
,
462 extern int ADMINAPI
vos_VolumeQuotaChange(const void *cellHandle
,
463 const void *serverHandle
,
464 vos_MessageCallBack_t callBack
,
465 unsigned int partition
,
466 unsigned int volumeId
,
467 unsigned int volumeQuota
,
470 extern int ADMINAPI
vos_VolumeGet2(const void *cellHandle
,
471 const void *serverHandle
,
472 vos_MessageCallBack_t callBack
,
473 unsigned int partition
,
474 unsigned int volumeId
,
475 volintInfo
* pinfo
, afs_status_p st
);
477 extern int ADMINAPI
vos_ClearVolUpdateCounter(const void *cellHandle
,
478 const void *serverHandle
,
479 unsigned int partition
,
480 unsigned int volumeId
,
483 #endif /* OPENAFS_VOS_ADMIN_H */