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_BOS_ADMIN_H
11 #define OPENAFS_BOS_ADMIN_H
13 #include <afs/param.h>
14 #include <afs/afs_Admin.h>
15 #include <afs/afs_vosAdmin.h>
16 #include <afs/afs_kasAdmin.h>
18 #define BOS_MAX_NAME_LEN 256
19 #define BOS_MAX_PROCESS_PARAMETERS 6
20 #define BOS_ENCRYPTION_KEY_LEN 8
26 } bos_ProcessType_t, *bos_ProcessType_p;
30 * These execution state flags are defined to be == the BOZO BSTAT_
31 * values. This allows us to directly map from one to the other.
32 * If the BOZO BSTAT_ flags are ever modified, these guys need to
41 } bos_ProcessExecutionState_t, *bos_ProcessExecutionState_p;
45 BOS_PROCESS_CORE_DUMPED = 0x1,
46 BOS_PROCESS_TOO_MANY_ERRORS = 0x2,
47 BOS_PROCESS_BAD_FILE_ACCESS = 0x4
48 } bos_ProcessState_t, *bos_ProcessState_p;
53 } bos_Auth_t, *bos_Auth_p;
58 } bos_Prune_t, *bos_Prune_p;
63 } bos_Restart_t, *bos_Restart_p;
65 typedef struct bos_ProcessInfo {
66 bos_ProcessExecutionState_t processGoal;
67 unsigned long processStartTime;
68 unsigned long numberProcessStarts;
69 unsigned long processExitTime;
70 unsigned long processExitErrorTime;
71 unsigned long processErrorCode;
72 unsigned long processErrorSignal;
73 bos_ProcessState_t state;
74 } bos_ProcessInfo_t, *bos_ProcessInfo_p;
76 typedef struct bos_encryptionKeyStatus {
77 int lastModificationDate;
78 int lastModificationMicroSeconds;
79 unsigned int checkSum;
80 } bos_encryptionKeyStatus_t, *bos_encryptionKeyStatus_p;
82 typedef struct bos_KeyInfo {
84 kas_encryptionKey_t key;
85 bos_encryptionKeyStatus_t keyStatus;
86 } bos_KeyInfo_t, *bos_KeyInfo_p;
89 BOS_RESTART_TIME_HOUR = 0x1,
90 BOS_RESTART_TIME_MINUTE = 0x2,
91 BOS_RESTART_TIME_SECOND = 0x4,
92 BOS_RESTART_TIME_DAY = 0x8,
93 BOS_RESTART_TIME_NEVER = 0x10,
94 BOS_RESTART_TIME_NOW = 0x20
95 } bos_RestartTimeFields_t, *bos_RestartTimeFields_p;
97 typedef struct bos_RestartTime {
98 bos_RestartTimeFields_t mask;
103 } bos_RestartTime_t, *bos_RestartTime_p;
106 BOS_RESTART_BOS_SERVER,
107 BOS_DONT_RESTART_BOS_SERVER
108 } bos_RestartBosServer_t, *bos_RestartBosServer_p;
111 BOS_SALVAGE_DAMAGED_VOLUMES,
112 BOS_DONT_SALVAGE_DAMAGED_VOLUMES
113 } bos_SalvageDamagedVolumes_t, *bos_SalvageDamagedVolumes_p;
116 BOS_SALVAGE_WRITE_INODES,
117 BOS_SALVAGE_DONT_WRITE_INODES
118 } bos_WriteInodes_t, *bos_WriteInodes_p;
121 BOS_SALVAGE_WRITE_ROOT_INODES,
122 BOS_SALVAGE_DONT_WRITE_ROOT_INODES
123 } bos_WriteRootInodes_t, *bos_WriteRootInodes_p;
126 BOS_SALVAGE_FORCE_DIRECTORIES,
127 BOS_SALVAGE_DONT_FORCE_DIRECTORIES
128 } bos_ForceDirectory_t, *bos_ForceDirectory_p;
131 BOS_SALVAGE_FORCE_BLOCK_READS,
132 BOS_SALVAGE_DONT_FORCE_BLOCK_READS
133 } bos_ForceBlockRead_t, *bos_ForceBlockRead_p;
135 extern int ADMINAPI bos_ServerOpen(const void *cellHandle,
136 const char *serverName,
137 void **serverHandleP, afs_status_p st);
139 extern int ADMINAPI bos_ServerClose(const void *serverHandle,
142 extern int ADMINAPI bos_ProcessCreate(const void *serverHandle,
143 const char *processName,
144 bos_ProcessType_t processType,
146 const char *cronTime,
147 const char *notifier, afs_status_p st);
149 extern int ADMINAPI bos_FSProcessCreate(const void *serverHandle,
150 const char *processName,
151 const char *fileserverPath,
152 const char *volserverPath,
153 const char *salvagerPath,
154 const char *notifier,
157 extern int ADMINAPI bos_ProcessDelete(const void *serverHandle,
158 const char *processName,
161 extern int ADMINAPI bos_ProcessExecutionStateGet(const void *serverHandle,
162 const char *processName,
163 bos_ProcessExecutionState_p
165 char *auxiliaryProcessStatus,
168 extern int ADMINAPI bos_ProcessExecutionStateSet(const void *serverHandle,
169 const char *processName,
170 bos_ProcessExecutionState_t
174 extern int ADMINAPI bos_ProcessExecutionStateSetTemporary(const void
175 *serverHandle, const char
177 bos_ProcessExecutionState_t
181 extern int ADMINAPI bos_ProcessNameGetBegin(const void *serverHandle,
185 extern int ADMINAPI bos_ProcessNameGetNext(const void *iterationId,
189 extern int ADMINAPI bos_ProcessNameGetDone(const void *iterationId,
192 extern int ADMINAPI bos_ProcessInfoGet(const void *serverHandle,
193 const char *processName,
194 bos_ProcessType_p processTypeP,
195 bos_ProcessInfo_p processInfoP,
198 extern int ADMINAPI bos_ProcessParameterGetBegin(const void *serverHandle,
199 const char *processName,
203 extern int ADMINAPI bos_ProcessParameterGetNext(const void *iterationId,
207 extern int ADMINAPI bos_ProcessParameterGetDone(const void *iterationId,
210 extern int ADMINAPI bos_ProcessNotifierGet(const void *serverHandle,
211 const char *processName,
212 char *notifier, afs_status_p st);
214 extern int ADMINAPI bos_ProcessRestart(const void *serverHandle,
215 const char *processName,
218 extern int ADMINAPI bos_ProcessAllStop(const void *serverHandle,
221 extern int ADMINAPI bos_ProcessAllStart(const void *serverHandle,
224 extern int ADMINAPI bos_ProcessAllWaitStop(const void *serverHandle,
227 extern int ADMINAPI bos_ProcessAllWaitTransition(const void *serverHandle,
230 extern int ADMINAPI bos_ProcessAllStopAndRestart(const void *serverHandle,
231 bos_RestartBosServer_t
235 extern int ADMINAPI bos_AdminCreate(const void *serverHandle,
236 const char *adminName, afs_status_p st);
238 extern int ADMINAPI bos_AdminDelete(const void *serverHandle,
239 const char *adminName, afs_status_p st);
241 extern int ADMINAPI bos_AdminGetBegin(const void *serverHandle,
242 void **iterationIdP, afs_status_p st);
244 extern int ADMINAPI bos_AdminGetNext(const void *iterationId, char *adminName,
247 extern int ADMINAPI bos_AdminGetDone(const void *iterationId,
250 extern int ADMINAPI bos_KeyCreate(const void *serverHandle,
251 int keyVersionNumber,
252 const kas_encryptionKey_p key,
255 extern int ADMINAPI bos_KeyDelete(const void *serverHandle,
256 int keyVersionNumber, afs_status_p st);
258 extern int ADMINAPI bos_KeyGetBegin(const void *serverHandle,
259 void **iterationIdP, afs_status_p st);
261 extern int ADMINAPI bos_KeyGetNext(const void *iterationId,
262 bos_KeyInfo_p keyP, afs_status_p st);
264 extern int ADMINAPI bos_KeyGetDone(const void *iterationId, afs_status_p st);
266 extern int ADMINAPI bos_CellSet(const void *serverHandle,
267 const char *cellName, afs_status_p st);
269 extern int ADMINAPI bos_CellGet(const void *serverHandle, char *cellName,
272 extern int ADMINAPI bos_HostCreate(const void *serverHandle,
273 const char *hostName, afs_status_p st);
275 extern int ADMINAPI bos_HostDelete(const void *serverHandle,
276 const char *hostName, afs_status_p st);
278 extern int ADMINAPI bos_HostGetBegin(const void *serverHandle,
279 void **iterationIdP, afs_status_p st);
281 extern int ADMINAPI bos_HostGetNext(const void *iterationId, char *hostName,
284 extern int ADMINAPI bos_HostGetDone(const void *iterationId, afs_status_p st);
286 extern int ADMINAPI bos_ExecutableCreate(const void *serverHandle,
287 const char *sourceFile,
288 const char *destFile,
291 extern int ADMINAPI bos_ExecutableRevert(const void *serverHandle,
292 const char *execFile,
295 extern int ADMINAPI bos_ExecutableTimestampGet(const void *serverHandle,
296 const char *execFile,
297 unsigned long *newTime,
298 unsigned long *oldTime,
299 unsigned long *bakTime,
302 extern int ADMINAPI bos_ExecutablePrune(const void *serverHandle,
303 bos_Prune_t oldFiles,
304 bos_Prune_t bakFiles,
305 bos_Prune_t coreFiles,
308 extern int ADMINAPI bos_ExecutableRestartTimeSet(const void *serverHandle,
310 bos_RestartTime_t time,
313 extern int ADMINAPI bos_ExecutableRestartTimeGet(const void *serverHandle,
315 bos_RestartTime_p timeP,
318 extern int ADMINAPI bos_LogGet(const void *serverHandle, const char *log,
319 unsigned long *logBufferSizeP, char *logData,
322 extern int ADMINAPI bos_AuthSet(const void *serverHandle, bos_Auth_t auth,
325 extern int ADMINAPI bos_CommandExecute(const void *serverHandle,
326 const char *command, afs_status_p st);
328 extern int ADMINAPI bos_Salvage(const void *cellHandle,
329 const void *serverHandle,
330 const char *partitionName,
331 const char *volumeName, int numSalvagers,
332 const char *tmpDir, const char *logFile,
334 bos_SalvageDamagedVolumes_t
335 salvageDamagedVolumes,
336 bos_WriteInodes_t writeInodes,
337 bos_WriteRootInodes_t writeRootInodes,
338 bos_ForceDirectory_t forceDirectory,
339 bos_ForceBlockRead_t forceBlockRead,
342 #endif /* OPENAFS_BOS_ADMIN_H */