libadmin-client-prototypes-20090320
[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 OPENAFS_CLIENT_ADMIN_H
11 #define OPENAFS_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(const char *cellName,
65                                                void **tokenHandle,
66                                                afs_status_p st);
67
68 extern int ADMINAPI afsclient_TokenSet(const void *tokenHandle,
69                                        afs_status_p st);
70
71 extern int ADMINAPI afsclient_TokenGetNew(const char *cellName,
72                                           const char *principal,
73                                           const char *password,
74                                           void **tokenHandle,
75                                           afs_status_p st);
76
77 extern int ADMINAPI afsclient_TokenClose(const void *tokenHandle,
78                                          afs_status_p st);
79
80 extern int ADMINAPI afsclient_TokenQuery(void *tokenHandle,
81                                          unsigned long *expirationDateP,
82                                          char *principal, char *instance,
83                                          char *cell, int *hasKasTokens,
84                                          afs_status_p st);
85
86 extern int ADMINAPI afsclient_CellOpen(const char *cellName,
87                                        const void *tokenHandle,
88                                        void **cellHandleP, afs_status_p st);
89
90 extern int ADMINAPI afsclient_NullCellOpen(void **cellHandleP,
91                                            afs_status_p st);
92
93 extern int ADMINAPI afsclient_CellClose(const void *cellHandle,
94                                         afs_status_p st);
95
96 extern int ADMINAPI afsclient_CellNameGet(const void *cellHandle,
97                                           const char **cellNameP,
98                                           afs_status_p st);
99
100 extern int ADMINAPI afsclient_LocalCellGet(char *cellName, afs_status_p st);
101
102 extern int ADMINAPI afsclient_MountPointCreate(const void *cellHandle,
103                                                const char *directory,
104                                                const char *volumeName,
105                                                vol_type_t volType,
106                                                vol_check_t volCheck,
107                                                afs_status_p st);
108
109 extern int ADMINAPI afsclient_ACLEntryAdd(const char *directory,
110                                           const char *user, const acl_p acl,
111                                           afs_status_p st);
112
113 extern int ADMINAPI afsclient_Init(afs_status_p st);
114
115 extern int ADMINAPI afsclient_AFSServerGet(const void *cellHandle,
116                                            const char *serverName,
117                                            afs_serverEntry_p serverEntryP,
118                                            afs_status_p st);
119
120 extern int ADMINAPI afsclient_AFSServerGetBegin(const void *cellHandle,
121                                                 void **iterationIdP,
122                                                 afs_status_p st);
123
124 extern int ADMINAPI afsclient_AFSServerGetNext(void *iterationId,
125                                                afs_serverEntry_p serverEntryP,
126                                                afs_status_p st);
127
128 extern int ADMINAPI afsclient_AFSServerGetDone(void *iterationId,
129                                                afs_status_p st);
130
131 extern int ADMINAPI afsclient_RPCStatOpen(const void *cellHandle,
132                                           const char *serverName,
133                                           afs_stat_source_t type,
134                                           struct rx_connection
135                                           **rpcStatHandleP, afs_status_p st);
136
137 extern int ADMINAPI afsclient_RPCStatOpenPort(const void *cellHandle,
138                                               const char *serverName,
139                                               const int serverPort,
140                                               struct rx_connection
141                                               **rpcStatHandleP,
142                                               afs_status_p st);
143
144 extern int ADMINAPI afsclient_RPCStatClose(struct rx_connection
145                                            *rpcStatHandle, afs_status_p st);
146
147 extern int ADMINAPI afsclient_CMStatOpen(const void *cellHandle,
148                                          const char *serverName,
149                                          struct rx_connection
150                                          **rpcStatHandleP, afs_status_p st);
151
152 extern int ADMINAPI afsclient_CMStatOpenPort(const void *cellHandle,
153                                              const char *serverName,
154                                              const int serverPort,
155                                              struct rx_connection
156                                              **rpcStatHandleP,
157                                              afs_status_p st);
158
159 extern int ADMINAPI afsclient_CMStatClose(struct rx_connection *rpcStatHandle,
160                                           afs_status_p st);
161
162 extern int ADMINAPI afsclient_RXDebugOpen(const char *serverName,
163                                           afs_stat_source_t type,
164                                           rxdebugHandle_p * rxdebugHandleP,
165                                           afs_status_p st);
166
167 extern int ADMINAPI afsclient_RXDebugOpenPort(const char *serverName,
168                                               int serverPort,
169                                               rxdebugHandle_p *
170                                               rxdebugHandleP,
171                                               afs_status_p st);
172
173 extern int ADMINAPI afsclient_RXDebugClose(rxdebugHandle_p rxdebugHandle,
174                                            afs_status_p st);
175
176 #endif /* OPENAFS_CLIENT_ADMIN_H */