8af83aca56f4ee26a21db882b7691cb674dade8b
[openafs.git] / src / libadmin / client / afs_clientAdmin.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 TRANSARC_AFS_CLIENT_ADMIN_H
11 #define TRANSARC_AFS_CLIENT_ADMIN_H
12
13 #include <afs/afs_Admin.h>
14
15 #ifdef DELETE
16 #undef DELETE
17 #endif
18
19 typedef enum {READ_ONLY, READ_WRITE} vol_type_t, *vol_type_p;
20 typedef enum {CHECK_VOLUME, DONT_CHECK_VOLUME} vol_check_t, *vol_check_p;
21
22 typedef enum {READ, NO_READ} acl_read_t, *acl_read_p;
23 typedef enum {WRITE, NO_WRITE} acl_write_t, *acl_write_p;
24 typedef enum {LOOKUP, NO_LOOKUP} acl_lookup_t, *acl_lookup_p;
25 typedef enum {DELETE, NO_DELETE} acl_delete_t, *acl_delete_p;
26 typedef enum {INSERT, NO_INSERT} acl_insert_t, *acl_insert_p;
27 typedef enum {LOCK, NO_LOCK} acl_lock_t, *acl_lock_p;
28 typedef enum {ADMIN, NO_ADMIN} acl_admin_t, *acl_admin_p;
29
30 typedef struct acl {
31   acl_read_t read;
32   acl_write_t write;
33   acl_lookup_t lookup;
34   acl_delete_t del;
35   acl_insert_t insert;
36   acl_lock_t lock;
37   acl_admin_t admin;
38 } acl_t, *acl_p;
39
40 #define AFS_MAX_SERVER_NAME_LEN   128
41 #define AFS_MAX_SERVER_ADDRESS     16
42
43 typedef enum {
44   DATABASE_SERVER = 0x1,
45   FILE_SERVER = 0x2
46 } afs_server_type_t, *afs_server_type_p;
47
48 typedef enum {
49   AFS_BOSSERVER,
50   AFS_FILESERVER,
51   AFS_KASERVER,
52   AFS_PTSERVER,
53   AFS_VOLSERVER,
54   AFS_VLSERVER,
55   AFS_CLIENT
56 } afs_stat_source_t, *afs_stat_source_p;
57
58 typedef struct {
59   char serverName[ AFS_MAX_SERVER_NAME_LEN ];
60   afs_server_type_t serverType;
61   int serverAddress[ AFS_MAX_SERVER_ADDRESS ];
62 } afs_serverEntry_t, *afs_serverEntry_p;
63
64 extern int ADMINAPI afsclient_TokenGetExisting(
65   const char *cellName,
66   void **tokenHandle,
67   afs_status_p st
68 );
69
70 extern int ADMINAPI afsclient_TokenSet(
71   const void *tokenHandle,
72   afs_status_p st
73 );
74
75 extern int ADMINAPI afsclient_TokenGetNew(
76   const char *cellName,
77   const char *principal,
78   const char *password,
79   void **tokenHandle,
80   afs_status_p st
81 );
82
83 extern int ADMINAPI afsclient_TokenClose(
84   const void *tokenHandle,
85   afs_status_p st
86 );
87
88 extern int ADMINAPI afsclient_TokenQuery(
89   void *tokenHandle,
90   unsigned long *expirationDateP,
91   char *principal,
92   char *instance,
93   char *cell,
94   int *hasKasTokens,
95   afs_status_p st
96 );
97
98 extern int ADMINAPI afsclient_CellOpen(
99   const char *cellName,
100   const void *tokenHandle,
101   void **cellHandleP,
102   afs_status_p st
103 );
104
105 extern int ADMINAPI afsclient_NullCellOpen(
106   void **cellHandleP,
107   afs_status_p st
108 );
109  
110 extern int ADMINAPI afsclient_CellClose(
111   const void *cellHandle,
112   afs_status_p st
113 );
114
115 extern int ADMINAPI afsclient_CellNameGet(
116   const void *cellHandle,
117   const char **cellNameP,
118   afs_status_p st
119 );
120  
121 extern int ADMINAPI afsclient_LocalCellGet(
122   char *cellName,
123   afs_status_p st
124 );
125
126 extern int ADMINAPI afsclient_MountPointCreate(
127   const void *cellHandle,
128   const char *directory,
129   const char *volumeName,
130   vol_type_t volType,
131   vol_check_t volCheck,
132   afs_status_p st
133 );
134
135 extern int ADMINAPI afsclient_ACLEntryAdd(
136   const char *directory,
137   const char *user,
138   const acl_p acl,
139   afs_status_p st
140 );
141
142 extern int ADMINAPI afsclient_Init(
143   afs_status_p st
144 );
145
146 extern int ADMINAPI afsclient_AFSServerGet(
147   const void *cellHandle,
148   const char *serverName,
149   afs_serverEntry_p serverEntryP,
150   afs_status_p st
151 );
152  
153 extern int ADMINAPI afsclient_AFSServerGetBegin(
154   const void *cellHandle,
155   void **iterationIdP,
156   afs_status_p st
157 );
158  
159 extern int ADMINAPI afsclient_AFSServerGetNext(
160   void *iterationId,
161   afs_serverEntry_p serverEntryP,
162   afs_status_p st
163 );
164  
165 extern int ADMINAPI afsclient_AFSServerGetDone(
166   void *iterationId,
167   afs_status_p st
168 );
169
170 extern int ADMINAPI afsclient_RPCStatOpen(
171   const void *cellHandle,
172   const char *serverName,
173   afs_stat_source_t type,
174   struct rx_connection **rpcStatHandleP,
175   afs_status_p st
176 );
177
178 extern int ADMINAPI afsclient_RPCStatOpenPort(
179   const void *cellHandle,
180   const char *serverName,
181   int serverPort,
182   struct rx_connection **rpcStatHandleP,
183   afs_status_p st
184 );
185
186 extern int ADMINAPI afsclient_RPCStatClose(
187   struct rx_connection *rpcStatHandle,
188   afs_status_p st
189 );
190
191 extern int ADMINAPI afsclient_CMStatOpen(
192   const void *cellHandle,
193   const char *serverName,
194   struct rx_connection **rpcStatHandleP,
195   afs_status_p st
196 );
197
198 extern int ADMINAPI afsclient_CMStatOpenPort(
199   const void *cellHandle,
200   const char *serverName,
201   int serverPort,
202   struct rx_connection **rpcStatHandleP,
203   afs_status_p st
204 );
205
206 extern int ADMINAPI afsclient_CMStatClose(
207   struct rx_connection *rpcStatHandle,
208   afs_status_p st
209 );
210
211 extern int ADMINAPI afsclient_RXDebugOpen(
212   const char *serverName,
213   afs_stat_source_t type,
214   rxdebugHandle_p *rxdebugHandleP,
215   afs_status_p st);
216
217 extern int ADMINAPI afsclient_RXDebugOpenPort(
218   const char *serverName,
219   int serverPort,
220   rxdebugHandle_p *rxdebugHandleP,
221   afs_status_p st);
222
223 extern int ADMINAPI afsclient_RXDebugClose(
224   rxdebugHandle_p rxdebugHandle,
225   afs_status_p st);
226
227 #endif /* TRANSARC_AFS_CLIENT_ADMIN_H */