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_CFG_ADMIN_H
11 #define OPENAFS_CFG_ADMIN_H
13 #include <afs/param.h>
14 #include <afs/afs_Admin.h>
19 * This API provides a mechanism for configuring AFS server processes.
20 * The API is designed to support both local and remote configuration,
21 * though remote configuration may not be supported in the library
24 * Functions in the API are partitioned into logical categories:
25 * cfg_Host*() - manipulate static server configuration information.
26 * cfg_Client*() - perform minimally necessary client configuration.
27 * cfg_CellServDb*() - manage the cell-wide server CellServDb database.
28 * cfg_BosServer*() - configure the BOS server.
29 * cfg_DbServers*() - configure the database servers.
30 * cfg_FileServer*() - configure the fileserver.
31 * cfg_UpdateServer*() - configure the update server.
32 * cfg_UpdateClient*() - configure update clients.
34 * Within a given function category, there may exist convenience wrappers
35 * that do not begin with the common function prefix for that category.
36 * Also provided are utility functions that complement the above; most
37 * of these are deallocator functions.
41 * General usage proceeds as follows:
42 * - static server configuration is set via the cfg_Host*() functions.
43 * - static client configuration is set via the cfg_Client*() functions.
44 * - server processes are dynamically configured via the functions
45 * in each server category; for configuring database servers, the
46 * server CellServDb is manipulated via the cfg_CellServDb*() functions.
48 * Detailed usage information is provided elsewhere.
52 * 1) The intent is to implement all functions to be idempotent (i.e., so
53 * that they can be called more than once w/o adverse side effects).
54 * 2) As functions are implemented, specific error codes of interest
55 * to users (e.g., GUI tools) will be documented so that appropriate
56 * action can be taken on failure.
61 /* ----------- Type and constant declarations --------- */
64 /* AFS partition table entry */
66 char *partitionName; /* vice partition name */
67 char *deviceName; /* device path */
68 } cfg_partitionEntry_t;
70 /* Status callback invoked by functions that update the CellServDB. */
72 char *fsDbHost; /* host on which CellServDB update was attempted */
73 afs_status_t status; /* update completion status */
74 } cfg_cellServDbStatus_t;
77 (ADMINAPI *cfg_cellServDbUpdateCallBack_t)(void *callBackId,
78 cfg_cellServDbStatus_t *statusItemP,
81 /* BOS instance names used to configure database servers */
82 ADMINEXPORT extern const char *cfg_kaserverBosName;
83 ADMINEXPORT extern const char *cfg_ptserverBosName;
84 ADMINEXPORT extern const char *cfg_vlserverBosName;
85 ADMINEXPORT extern const char *cfg_buserverBosName;
88 /* Database server status information */
90 short inCellServDb; /* host in its own server CellServDB */
91 short isKaserver; /* authentication server configured */
92 short isPtserver; /* protection server configured */
93 short isVlserver; /* volume location server configured */
94 short isBuserver; /* backup server configured */
96 /* isStdDb = (inCellServDb && isKaserver && isPtserver && isVlserver)
97 * isBkDbP = (inCellServDb && isBuserver)
99 } cfg_dbServersStatus_t;
102 /* BOS instance name used to configure file server */
103 ADMINEXPORT extern const char *cfg_fileserverBosName;
105 /* BOS instance name used to configure update server */
106 ADMINEXPORT extern const char *cfg_upserverBosName;
108 /* BOS instance prefix used to configure all update clients; full instance
109 * name is the concatenation of this prefix and a specified suffix.
111 ADMINEXPORT extern const char *cfg_upclientBosNamePrefix;
113 /* Default BOS instance suffix used to configure System Control client */
114 ADMINEXPORT extern const char *cfg_upclientSysBosSuffix;
116 /* Default BOS instance suffix used to configure Binary Distribution client */
117 ADMINEXPORT extern const char *cfg_upclientBinBosSuffix;
121 /* ---------------- Server Host ------------------ */
125 cfg_HostQueryStatus(const char *hostName,
126 afs_status_p configStP,
131 cfg_HostOpen(void *cellHandle,
132 const char *hostName,
137 cfg_HostClose(void *hostHandle,
141 cfg_HostSetCell(void *hostHandle,
142 const char *cellName,
143 const char *cellDbHosts,
147 cfg_HostSetAfsPrincipal(void *hostHandle,
153 cfg_HostSetAdminPrincipal(void *hostHandle,
161 cfg_HostInvalidate(void *hostHandle,
165 cfg_HostPartitionTableEnumerate(void *hostHandle,
166 cfg_partitionEntry_t **tablePP,
171 cfg_HostPartitionTableAddEntry(void *hostHandle,
172 const char *partName,
177 cfg_HostPartitionTableRemoveEntry(void *hostHandle,
178 const char *partName,
182 cfg_HostPartitionNameValid(const char *partName,
187 cfg_HostDeviceNameValid(const char *devName,
194 /* ---------------- AFS Client ------------------ */
198 cfg_ClientQueryStatus(const char *hostName,
201 afs_status_p configStP,
206 cfg_ClientSetCell(void *hostHandle,
207 const char *cellName,
208 const char *cellDbHosts,
212 cfg_ClientCellServDbAdd(void *hostHandle,
213 const char *cellName,
218 cfg_ClientCellServDbRemove(void *hostHandle,
219 const char *cellName,
224 cfg_ClientStop(void *hostHandle,
225 unsigned int timeout,
229 cfg_ClientStart(void *hostHandle,
230 unsigned int timeout,
235 /* ---------------- CellServDB ------------------ */
239 cfg_CellServDbAddHost(void *hostHandle,
240 const char *sysControlHost,
241 cfg_cellServDbUpdateCallBack_t callBack,
247 cfg_CellServDbRemoveHost(void *hostHandle,
248 const char *sysControlHost,
249 cfg_cellServDbUpdateCallBack_t callBack,
255 cfg_CellServDbEnumerate(const char *fsDbHost,
262 /* ---------------- BOS Server ------------------ */
266 cfg_BosServerStart(void *hostHandle,
268 unsigned int timeout,
272 cfg_BosServerStop(void *hostHandle,
273 unsigned int timeout,
277 cfg_BosServerQueryStatus(void *hostHandle,
284 /* ---------------- Database Servers ------------------ */
288 cfg_AuthServerStart(void *hostHandle,
292 cfg_DbServersStart(void *hostHandle,
297 cfg_DbServersStop(void *hostHandle,
301 cfg_DbServersQueryStatus(void *hostHandle,
304 cfg_dbServersStatus_t *detailsP,
308 cfg_DbServersRestartAll(void *hostHandle,
312 cfg_DbServersWaitForQuorum(void *hostHandle,
313 unsigned int timeout,
317 cfg_DbServersStopAllBackup(void *hostHandle,
322 /* ---------------- File Server ------------------ */
326 cfg_FileServerStart(void *hostHandle,
330 cfg_FileServerStop(void *hostHandle,
334 cfg_FileServerQueryStatus(void *hostHandle,
340 /* ---------------- Update Server ------------------ */
344 cfg_UpdateServerStart(void *hostHandle,
345 const char *exportClear,
346 const char *exportCrypt,
350 cfg_UpdateServerStop(void *hostHandle,
354 cfg_UpdateServerQueryStatus(void *hostHandle,
361 cfg_SysBinServerStart(void *hostHandle,
368 /* ---------------- Update Client ------------------ */
372 cfg_UpdateClientStart(void *hostHandle,
373 const char *bosSuffix,
374 const char *upserver,
377 unsigned int frequency,
381 cfg_UpdateClientStop(void *hostHandle,
382 const char *bosSuffix,
386 cfg_UpdateClientStopAll(void *hostHandle,
390 cfg_UpdateClientQueryStatus(void *hostHandle,
397 cfg_SysControlClientStart(void *hostHandle,
398 const char *upserver,
402 cfg_BinDistClientStart(void *hostHandle,
403 const char *upserver,
408 /* ---------------- Utilities ------------------ */
412 cfg_StringDeallocate(char *stringDataP,
416 cfg_PartitionListDeallocate(cfg_partitionEntry_t *partitionListDataP,
420 cfg_CellServDbStatusDeallocate(cfg_cellServDbStatus_t *statusItempP,
423 #endif /* OPENAFS_CFG_ADMIN_H */