09dc570f66d8be62e82be7a5e42ffe98e30f1248
[openafs.git] / src / WINNT / afsd / cm.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 __CM_H_ENV__
11 #define __CM_H_ENV__ 1
12
13 #ifndef AFS_PTHREAD_ENV
14 #define AFS_PTHREAD_ENV 1
15 #endif
16 #include <rx/rx.h>
17
18 /* from .xg file */
19 /* FIXME: these were "long" but Windows NT wants "int" */
20 int VL_GetEntryByID(struct rx_connection *, afs_int32, afs_int32, struct vldbentry *);
21 int VL_GetEntryByNameO(struct rx_connection *, char *, struct vldbentry *);
22 int VL_ProbeServer(struct rx_connection *);
23 int VL_GetEntryBYIDN(struct rx_connection *, afs_int32, afs_int32, struct nvldbentry *);
24 int VL_GetEntryByNameN(struct rx_connection *, char *, struct nvldbentry *);
25
26 /* from .xg file */
27 int StartRXAFS_FetchData (struct rx_call *,
28         struct AFSFid *Fid,
29         afs_int32 Pos, 
30         afs_int32 Length);
31 int EndRXAFS_FetchData (struct rx_call *,
32         struct AFSFetchStatus *OutStatus, 
33         struct AFSCallBack *CallBack, 
34         struct AFSVolSync *Sync);
35
36 int RXAFS_FetchACL(struct rx_connection *,
37         struct AFSFid *Fid, 
38         struct AFSOpaque *AccessList, 
39         struct AFSFetchStatus *OutStatus, 
40         struct AFSVolSync *Sync);
41
42 int RXAFS_FetchStatus (struct rx_connection *,
43         struct AFSFid *Fid, 
44         struct AFSFetchStatus *OutStatus, 
45         struct AFSCallBack *CallBack, 
46         struct AFSVolSync *Sync);
47
48 int StartRXAFS_StoreData (struct rx_call *,
49         struct AFSFid *Fid, 
50         struct AFSStoreStatus *InStatus, 
51         afs_uint32 Pos, 
52         afs_uint32 Length, 
53         afs_uint32 FileLength);
54
55 int EndRXAFS_StoreData(struct rx_call *,
56         struct AFSFetchStatus *OutStatus, 
57         struct AFSVolSync *Sync);
58
59 int StartRXAFS_FetchData64(struct rx_call *z_call,
60         struct AFSFid * Fid,
61         afs_int64 Pos,
62         afs_int64 Length);
63
64 int EndRXAFS_FetchData64(struct rx_call *z_call,
65         struct AFSFetchStatus * OutStatus,
66         struct AFSCallBack * CallBack,
67         struct AFSVolSync * Sync);
68
69 afs_int32 SRXAFS_FetchData64(struct rx_call *z_call,
70         struct AFSFid * Fid,
71         afs_int64 Pos,
72         afs_int64 Length,
73         struct AFSFetchStatus * OutStatus,
74         struct AFSCallBack * CallBack,
75         struct AFSVolSync * Sync);
76
77 int StartRXAFS_StoreData64(struct rx_call *z_call,
78         struct AFSFid * Fid,
79         struct AFSStoreStatus * InStatus,
80         afs_uint64 Pos,
81         afs_uint64 Length,
82         afs_uint64 FileLength);
83
84 int EndRXAFS_StoreData64(struct rx_call *z_call,
85         struct AFSFetchStatus * OutStatus,
86         struct AFSVolSync * Sync);
87
88 afs_int32 SRXAFS_StoreData64(struct rx_call *z_call,
89         struct AFSFid * Fid,
90         struct AFSStoreStatus * InStatus,
91         afs_uint64 Pos,
92         afs_uint64 Length,
93         afs_uint64 FileLength,
94         struct AFSFetchStatus * OutStatus,
95         struct AFSVolSync * Sync);
96
97 int RXAFS_StoreACL (struct rx_connection *,
98         struct AFSFid *Fid, 
99         struct AFSOpaque *AccessList,  
100         struct AFSFetchStatus *OutStatus, 
101         struct AFSVolSync *Sync);
102
103 int RXAFS_StoreStatus(struct rx_connection *,
104         struct AFSFid *Fid, 
105         struct AFSStoreStatus *InStatus, 
106         struct AFSFetchStatus *OutStatus, 
107         struct AFSVolSync *Sync);
108
109 int RXAFS_RemoveFile (struct rx_connection *,
110         struct AFSFid *DirFid, 
111         char *namep,
112         struct AFSFetchStatus *OutStatus, 
113         struct AFSVolSync *Sync);
114
115 int RXAFS_CreateFile (struct rx_connection *,
116         struct AFSFid *DirFid, 
117         char *Name,
118         struct AFSStoreStatus *InStatus, 
119         struct AFSFid *OutFid, 
120         struct AFSFetchStatus *OutFidStatus, 
121         struct AFSFetchStatus *OutDirStatus, 
122         struct AFSCallBack *CallBack, 
123         struct AFSVolSync *Sync);
124
125 int RXAFS_Rename (struct rx_connection *,
126         struct AFSFid *OldDirFid, 
127         char *OldName,
128         struct AFSFid *NewDirFid, 
129         char *NewName,
130         struct AFSFetchStatus *OutOldDirStatus, 
131         struct AFSFetchStatus *OutNewDirStatus, 
132         struct AFSVolSync *Sync);
133
134 int RXAFS_Symlink (struct rx_connection *,
135         struct AFSFid *DirFid, 
136         char *name,
137         char *LinkContents,
138         struct AFSStoreStatus *InStatus,
139         struct AFSFid *OutFid, 
140         struct AFSFetchStatus *OutFidStatus, 
141         struct AFSFetchStatus *OutDirStatus, 
142         struct AFSVolSync *Sync);
143
144 int RXAFS_Link (struct rx_connection *,
145         struct AFSFid *DirFid, 
146         char *Name,
147         struct AFSFid *ExistingFid, 
148         struct AFSFetchStatus *OutFidStatus, 
149         struct AFSFetchStatus *OutDirStatus, 
150         struct AFSVolSync *Sync);
151
152 int RXAFS_MakeDir (struct rx_connection *,
153         struct AFSFid *DirFid, 
154         char *name,
155         struct AFSStoreStatus *InStatus, 
156         struct AFSFid *OutFid, 
157         struct AFSFetchStatus *OutFidStatus, 
158         struct AFSFetchStatus *OutDirStatus, 
159         struct AFSCallBack *CallBack, 
160         struct AFSVolSync *Sync);
161
162 int RXAFS_RemoveDir (struct rx_connection *,
163         struct AFSFid *DirFid, 
164         char *Name,
165         struct AFSFetchStatus *OutDirStatus, 
166         struct AFSVolSync *Sync);
167
168 int RXAFS_GetStatistics (struct rx_connection *,
169         struct ViceStatistics *Statistics);
170
171 int RXAFS_GiveUpCallBacks (struct rx_connection *,
172         struct AFSCBFids *Fids_Array,
173         struct AFSCBs *CallBacks_Array);
174
175 int RXAFS_GetVolumeInfo (struct rx_connection *,
176         char *VolumeName,
177         struct VolumeInfo *Volumeinfo);
178
179 int RXAFS_GetVolumeStatus (struct rx_connection *,
180         afs_int32 Volumeid, 
181         struct AFSFetchVolumeStatus *Volumestatus, 
182         char **name,
183         char **offlineMsg,
184         char **motd);
185
186 int RXAFS_SetVolumeStatus (struct rx_connection *,
187         afs_int32 Volumeid, 
188         struct AFSStoreVolumeStatus *Volumestatus,
189         char *name,
190         char *olm,
191         char *motd);
192
193 int RXAFS_GetRootVolume (struct rx_connection *,
194         char **VolumeName);
195
196 int RXAFS_CheckToken (struct rx_connection *,
197         afs_int32 ViceId,
198         struct AFSOpaque *token);
199
200 int RXAFS_GetTime (struct rx_connection *,
201         afs_uint32 *Seconds, 
202         afs_uint32 *USeconds);
203
204 int RXAFS_BulkStatus (struct rx_connection *,
205         struct AFSCBFids *FidsArray,
206         struct AFSBulkStats *StatArray,
207         struct AFSCBs *CBArray,
208         struct AFSVolSync *Sync);
209
210 int RXAFS_SetLock (struct rx_connection *,
211         struct AFSFid *Fid, 
212         int Type, 
213         struct AFSVolSync *Sync);
214
215 int RXAFS_ExtendLock (struct rx_connection *,
216         struct AFSFid *Fid, 
217         struct AFSVolSync *Sync);
218
219 int RXAFS_ReleaseLock (struct rx_connection *,
220         struct AFSFid *Fid, 
221         struct AFSVolSync *Sync);
222
223 /* This interface is to supported the AFS/DFS Protocol Translator */
224 int RXAFS_Lookup (struct rx_connection *,
225         struct AFSFid *DirFid,
226         char *Name,
227         struct AFSFid *OutFid,
228         struct AFSFetchStatus *OutFidStatus,
229         struct AFSFetchStatus *OutDirStatus,
230         struct AFSCallBack *CallBack,
231         struct AFSVolSync *Sync);
232
233 #define CM_DEFAULT_CALLBACKPORT         7001
234
235 /* common flags to many procedures */
236 #define CM_FLAG_CREATE          1               /* create entry */
237 #define CM_FLAG_CASEFOLD        2               /* fold case in namei, lookup, etc. */
238 #define CM_FLAG_EXCLUSIVE       4               /* create exclusive */
239 #define CM_FLAG_FOLLOW          8               /* follow symlinks, even at the end (namei) */
240 #define CM_FLAG_8DOT3           0x10            /* restrict to 8.3 name */
241 #define CM_FLAG_NOMOUNTCHASE    0x20            /* don't follow mount points */
242 #define CM_FLAG_DIRSEARCH       0x40            /* for directory search */
243 #define CM_FLAG_CHECKPATH       0x80            /* Path instead of File */
244 #define CM_FLAG_NOPROBE         0x100           /* For use with cm_GetCellxxx - do not probe server status */
245
246 /* error codes */
247 #define CM_ERROR_BASE                   0x66543200
248 #define CM_ERROR_NOSUCHCELL             (CM_ERROR_BASE+0)
249 #define CM_ERROR_NOSUCHVOLUME           (CM_ERROR_BASE+1)
250 #define CM_ERROR_TIMEDOUT               (CM_ERROR_BASE+2)
251 #define CM_ERROR_RETRY                  (CM_ERROR_BASE+3)
252 #define CM_ERROR_NOACCESS               (CM_ERROR_BASE+4)
253 #define CM_ERROR_NOSUCHFILE             (CM_ERROR_BASE+5)
254 #define CM_ERROR_STOPNOW                (CM_ERROR_BASE+6)
255 #define CM_ERROR_TOOBIG                 (CM_ERROR_BASE+7)
256 #define CM_ERROR_INVAL                  (CM_ERROR_BASE+8)
257 #define CM_ERROR_BADFD                  (CM_ERROR_BASE+9)
258 #define CM_ERROR_BADFDOP                (CM_ERROR_BASE+10)
259 #define CM_ERROR_EXISTS                 (CM_ERROR_BASE+11)
260 #define CM_ERROR_CROSSDEVLINK           (CM_ERROR_BASE+12)
261 #define CM_ERROR_BADOP                  (CM_ERROR_BASE+13)
262 #define CM_ERROR_BADPASSWORD            (CM_ERROR_BASE+14)
263 #define CM_ERROR_NOTDIR                 (CM_ERROR_BASE+15)
264 #define CM_ERROR_ISDIR                  (CM_ERROR_BASE+16)
265 #define CM_ERROR_READONLY               (CM_ERROR_BASE+17)
266 #define CM_ERROR_WOULDBLOCK             (CM_ERROR_BASE+18)
267 #define CM_ERROR_QUOTA                  (CM_ERROR_BASE+19)
268 #define CM_ERROR_SPACE                  (CM_ERROR_BASE+20)
269 #define CM_ERROR_BADSHARENAME           (CM_ERROR_BASE+21)
270 #define CM_ERROR_BADTID                 (CM_ERROR_BASE+22)
271 #define CM_ERROR_UNKNOWN                (CM_ERROR_BASE+23)
272 #define CM_ERROR_NOMORETOKENS           (CM_ERROR_BASE+24)
273 #define CM_ERROR_NOTEMPTY               (CM_ERROR_BASE+25)
274 #define CM_ERROR_USESTD                 (CM_ERROR_BASE+26)
275 #define CM_ERROR_REMOTECONN             (CM_ERROR_BASE+27)
276 #define CM_ERROR_ATSYS                  (CM_ERROR_BASE+28)
277 #define CM_ERROR_NOSUCHPATH             (CM_ERROR_BASE+29)
278 #define CM_ERROR_CLOCKSKEW              (CM_ERROR_BASE+31)
279 #define CM_ERROR_BADSMB                 (CM_ERROR_BASE+32)
280 #define CM_ERROR_ALLBUSY                (CM_ERROR_BASE+33)
281 #define CM_ERROR_NOFILES                (CM_ERROR_BASE+34)
282 #define CM_ERROR_PARTIALWRITE           (CM_ERROR_BASE+35)
283 #define CM_ERROR_NOIPC                  (CM_ERROR_BASE+36)
284 #define CM_ERROR_BADNTFILENAME          (CM_ERROR_BASE+37)
285 #define CM_ERROR_BUFFERTOOSMALL         (CM_ERROR_BASE+38)
286 #define CM_ERROR_RENAME_IDENTICAL       (CM_ERROR_BASE+39)
287 #define CM_ERROR_ALLOFFLINE             (CM_ERROR_BASE+40)
288 #define CM_ERROR_AMBIGUOUS_FILENAME     (CM_ERROR_BASE+41)
289 #define CM_ERROR_BADLOGONTYPE           (CM_ERROR_BASE+42)
290 #define CM_ERROR_GSSCONTINUE            (CM_ERROR_BASE+43)
291 #define CM_ERROR_TIDIPC                 (CM_ERROR_BASE+44)
292 #define CM_ERROR_TOO_MANY_SYMLINKS      (CM_ERROR_BASE+45)
293 #define CM_ERROR_PATH_NOT_COVERED       (CM_ERROR_BASE+46)
294 #define CM_ERROR_LOCK_CONFLICT          (CM_ERROR_BASE+47)
295 #define CM_ERROR_SHARING_VIOLATION      (CM_ERROR_BASE+48)
296 #define CM_ERROR_ALLDOWN                (CM_ERROR_BASE+49)
297 #define CM_ERROR_TOOFEWBUFS             (CM_ERROR_BASE+50)
298 #define CM_ERROR_TOOMANYBUFS            (CM_ERROR_BASE+51)
299 #define CM_ERROR_BAD_LEVEL              (CM_ERROR_BASE+52)
300 #define CM_ERROR_NOT_A_DFSLINK          (CM_ERROR_BASE+53)
301 #define CM_ERROR_INEXACT_MATCH          (CM_ERROR_BASE+54)
302 #define CM_ERROR_BPLUS_NOMATCH          (CM_ERROR_BASE+55)
303 #define CM_ERROR_EAS_NOT_SUPPORTED      (CM_ERROR_BASE+56)
304
305 /* Used by cm_FollowMountPoint and cm_GetVolumeByName */
306 #define RWVOL   0
307 #define ROVOL   1
308 #define BACKVOL 2
309 #endif /*  __CM_H_ENV__ */