Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / libadmin / cfg / cfginternal.h
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
4 *
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
8 */
9
10 #ifndef OPENAFS_CFG_INTERNAL_H
11 #define OPENAFS_CFG_INTERNAL_H
12
13 /* Define types, macros, etc., internal to the configuration library */
14
15 typedef struct {
16 int begin_magic; /* begin and end magic help validate cfg handle */
17 int is_valid; /* true if cfg handle is valid */
18 char *hostName; /* name of host being configured */
19 int is_local; /* true if hostName specifies the local host */
20 void *cellHandle; /* cell handle establishing working cell */
21 const char *cellName; /* cell name in cell handle */
22 pthread_mutex_t mutex; /* protects bosHandle initialization */
23 void *bosHandle; /* handle for bosserver on host */
24 int end_magic;
25 } cfg_host_t, *cfg_host_p;
26
27
28 /* Declare utility functions internal to the configuration library */
29
30 extern int
31 cfgutil_HostHandleValidate(const cfg_host_p cfg_host, afs_status_p st);
32
33 extern int
34 cfgutil_HostHandleBosInit(cfg_host_p cfg_host, afs_status_p st);
35
36 extern int
37 cfgutil_HostHandleCellNameCompatible(const cfg_host_p cfg_host,
38 const char *cellName);
39
40 extern int
41 cfgutil_HostNameGetFull(const char *hostName, char *fullHostName,
42 afs_status_p st);
43
44 extern int
45 cfgutil_HostNameIsAlias(const char *hostName1, const char *hostName2,
46 short *isAlias, afs_status_p st);
47
48 extern int
49 cfgutil_HostNameIsLocal(const char *hostName, short *isLocal,
50 afs_status_p st);
51
52 extern int
53 cfgutil_HostNameGetCellServDbAlias(const char *fsDbHost,
54 const char *hostName,
55 char *hostNameAlias, afs_status_p st);
56
57 extern int
58 cfgutil_HostNameGetAddressString(const char *hostName,
59 const char **hostAddr, afs_status_p st);
60
61 extern int
62 cfgutil_HostAddressFetchAll(const char *hostName, int *addrCount,
63 afs_int32 ** addrList, afs_status_p st);
64
65 extern int
66 cfgutil_HostAddressIsValid(const char *hostName, int hostAddr,
67 short *isValid, afs_status_p st);
68
69 extern int
70 cfgutil_CleanDirectory(const char *dirName, afs_status_p st);
71
72 extern int
73 cfgutil_HostSetNoAuthFlag(const cfg_host_p cfg_host, short noAuth,
74 afs_status_p st);
75
76 extern void
77 cfgutil_Sleep(unsigned sec);
78
79
80 #ifdef AFS_NT40_ENV
81 /* Service control functions */
82
83 extern int
84 cfgutil_WindowsServiceStart(LPCTSTR svcName, DWORD svcArgc,
85 LPCTSTR * svcArgv, unsigned timeout,
86 short *wasRunning, afs_status_p st);
87
88 extern int
89 cfgutil_WindowsServiceStop(LPCTSTR svcName, unsigned timeout,
90 short *wasStopped, afs_status_p st);
91
92 extern int
93 cfgutil_WindowsServiceQuery(LPCTSTR svcName, DWORD * svcState,
94 afs_status_p st);
95 #endif /* AFS_NT40_ENV */
96
97 #endif /* OPENAFS_CFG_INTERNAL_H */