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