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
;
78 (ADMINAPI
* cfg_cellServDbUpdateCallBack_t
) (void *callBackId
,
79 cfg_cellServDbStatus_t
*
83 /* BOS instance names used to configure database servers */
84 ADMINEXPORT
extern const char *cfg_kaserverBosName
;
85 ADMINEXPORT
extern const char *cfg_ptserverBosName
;
86 ADMINEXPORT
extern const char *cfg_vlserverBosName
;
87 ADMINEXPORT
extern const char *cfg_buserverBosName
;
90 /* Database server status information */
92 short inCellServDb
; /* host in its own server CellServDB */
93 short isKaserver
; /* authentication server configured */
94 short isPtserver
; /* protection server configured */
95 short isVlserver
; /* volume location server configured */
96 short isBuserver
; /* backup server configured */
98 /* isStdDb = (inCellServDb && isKaserver && isPtserver && isVlserver)
99 * isBkDbP = (inCellServDb && isBuserver)
101 } cfg_dbServersStatus_t
;
104 /* BOS instance name used to configure file server */
105 ADMINEXPORT
extern const char *cfg_fileserverBosName
;
107 /* BOS instance name used to configure update server */
108 ADMINEXPORT
extern const char *cfg_upserverBosName
;
110 /* BOS instance prefix used to configure all update clients; full instance
111 * name is the concatenation of this prefix and a specified suffix.
113 ADMINEXPORT
extern const char *cfg_upclientBosNamePrefix
;
115 /* Default BOS instance suffix used to configure System Control client */
116 ADMINEXPORT
extern const char *cfg_upclientSysBosSuffix
;
118 /* Default BOS instance suffix used to configure Binary Distribution client */
119 ADMINEXPORT
extern const char *cfg_upclientBinBosSuffix
;
123 /* ---------------- Server Host ------------------ */
126 extern int ADMINAPI
cfg_HostQueryStatus(const char *hostName
,
127 afs_status_p configStP
,
128 char **cellNameP
, afs_status_p st
);
130 extern int ADMINAPI
cfg_HostOpen(void *cellHandle
, const char *hostName
,
131 void **hostHandleP
, afs_status_p st
);
133 extern int ADMINAPI
cfg_HostClose(void *hostHandle
, afs_status_p st
);
135 extern int ADMINAPI
cfg_HostSetCell(void *hostHandle
, const char *cellName
,
136 const char *cellDbHosts
, afs_status_p st
);
138 extern int ADMINAPI
cfg_HostSetAfsPrincipal(void *hostHandle
, short isFirst
,
142 extern int ADMINAPI
cfg_HostSetAdminPrincipal(void *hostHandle
, short isFirst
,
148 extern int ADMINAPI
cfg_HostInvalidate(void *hostHandle
, afs_status_p st
);
150 extern int ADMINAPI
cfg_HostPartitionTableEnumerate(void *hostHandle
,
151 cfg_partitionEntry_t
**
152 tablePP
, int *nEntriesP
,
155 extern int ADMINAPI
cfg_HostPartitionTableAddEntry(void *hostHandle
,
156 const char *partName
,
160 extern int ADMINAPI
cfg_HostPartitionTableRemoveEntry(void *hostHandle
,
161 const char *partName
,
164 extern int ADMINAPI
cfg_HostPartitionNameValid(const char *partName
,
168 extern int ADMINAPI
cfg_HostDeviceNameValid(const char *devName
,
169 short *isValidP
, afs_status_p st
);
174 /* ---------------- AFS Client ------------------ */
177 extern int ADMINAPI
cfg_ClientQueryStatus(const char *hostName
,
180 afs_status_p configStP
,
181 char **cellNameP
, afs_status_p st
);
183 extern int ADMINAPI
cfg_ClientSetCell(void *hostHandle
, const char *cellName
,
184 const char *cellDbHosts
,
187 extern int ADMINAPI
cfg_ClientCellServDbAdd(void *hostHandle
,
188 const char *cellName
,
192 extern int ADMINAPI
cfg_ClientCellServDbRemove(void *hostHandle
,
193 const char *cellName
,
197 extern int ADMINAPI
cfg_ClientStop(void *hostHandle
, unsigned int timeout
,
200 extern int ADMINAPI
cfg_ClientStart(void *hostHandle
, unsigned int timeout
,
205 /* ---------------- CellServDB ------------------ */
208 extern int ADMINAPI
cfg_CellServDbAddHost(void *hostHandle
,
209 const char *sysControlHost
,
210 cfg_cellServDbUpdateCallBack_t
211 callBack
, void *callBackId
,
212 int *maxUpdates
, afs_status_p st
);
214 extern int ADMINAPI
cfg_CellServDbRemoveHost(void *hostHandle
,
215 const char *sysControlHost
,
216 cfg_cellServDbUpdateCallBack_t
217 callBack
, void *callBackId
,
221 extern int ADMINAPI
cfg_CellServDbEnumerate(const char *fsDbHost
,
228 /* ---------------- BOS Server ------------------ */
231 extern int ADMINAPI
cfg_BosServerStart(void *hostHandle
, short noAuth
,
232 unsigned int timeout
, afs_status_p st
);
234 extern int ADMINAPI
cfg_BosServerStop(void *hostHandle
, unsigned int timeout
,
237 extern int ADMINAPI
cfg_BosServerQueryStatus(void *hostHandle
,
244 /* ---------------- Database Servers ------------------ */
247 extern int ADMINAPI
cfg_AuthServerStart(void *hostHandle
, afs_status_p st
);
249 extern int ADMINAPI
cfg_DbServersStart(void *hostHandle
, short startBkDb
,
252 extern int ADMINAPI
cfg_DbServersStop(void *hostHandle
, afs_status_p st
);
254 extern int ADMINAPI
cfg_DbServersQueryStatus(void *hostHandle
,
255 short *isStdDbP
, short *isBkDbP
,
256 cfg_dbServersStatus_t
* detailsP
,
259 extern int ADMINAPI
cfg_DbServersRestartAll(void *hostHandle
,
262 extern int ADMINAPI
cfg_DbServersWaitForQuorum(void *hostHandle
,
263 unsigned int timeout
,
266 extern int ADMINAPI
cfg_DbServersStopAllBackup(void *hostHandle
,
271 /* ---------------- File Server ------------------ */
274 extern int ADMINAPI
cfg_FileServerStart(void *hostHandle
, afs_status_p st
);
276 extern int ADMINAPI
cfg_FileServerStop(void *hostHandle
, afs_status_p st
);
278 extern int ADMINAPI
cfg_FileServerQueryStatus(void *hostHandle
, short *isFsP
,
283 /* ---------------- Update Server ------------------ */
286 extern int ADMINAPI
cfg_UpdateServerStart(void *hostHandle
,
287 const char *exportClear
,
288 const char *exportCrypt
,
291 extern int ADMINAPI
cfg_UpdateServerStop(void *hostHandle
, afs_status_p st
);
293 extern int ADMINAPI
cfg_UpdateServerQueryStatus(void *hostHandle
,
299 extern int ADMINAPI
cfg_SysBinServerStart(void *hostHandle
, short makeSysCtrl
,
300 short makeBinDist
, afs_status_p st
);
304 /* ---------------- Update Client ------------------ */
307 extern int ADMINAPI
cfg_UpdateClientStart(void *hostHandle
,
308 const char *bosSuffix
,
309 const char *upserver
, short crypt
,
311 unsigned int frequency
,
314 extern int ADMINAPI
cfg_UpdateClientStop(void *hostHandle
,
315 const char *bosSuffix
,
318 extern int ADMINAPI
cfg_UpdateClientStopAll(void *hostHandle
,
321 extern int ADMINAPI
cfg_UpdateClientQueryStatus(void *hostHandle
,
323 short *isSysP
, short *isBinP
,
326 extern int ADMINAPI
cfg_SysControlClientStart(void *hostHandle
,
327 const char *upserver
,
330 extern int ADMINAPI
cfg_BinDistClientStart(void *hostHandle
,
331 const char *upserver
,
336 /* ---------------- Utilities ------------------ */
339 extern int ADMINAPI
cfg_StringDeallocate(char *stringDataP
, afs_status_p st
);
341 extern int ADMINAPI
cfg_PartitionListDeallocate(cfg_partitionEntry_t
*
345 extern int ADMINAPI
cfg_CellServDbStatusDeallocate(cfg_cellServDbStatus_t
*
349 #endif /* OPENAFS_CFG_ADMIN_H */