c2e6f3edaad6e3ed9fe4ae97d201eb21ddcd8f00
[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 #include <rx/rx.h>
14 #ifdef DJGPP      /* we need these for vldbentry decl., etc. */
15 #include <afs/vldbint.h>
16 #include <afs/afsint.h>
17 #endif /* DJGPP */
18
19 /* from .xg file */
20 /* FIXME: these were "long" but Windows NT wants "int" */
21 int VL_GetEntryByID(struct rx_connection *, long, long, struct vldbentry *);
22 int VL_GetEntryByNameO(struct rx_connection *, char *, struct vldbentry *);
23 int VL_ProbeServer(struct rx_connection *);
24 int VL_GetEntryBYIDN(struct rx_connection *, long, long, struct nvldbentry *);
25 int VL_GetEntryByNameN(struct rx_connection *, char *, struct nvldbentry *);
26
27 /* from .xg file */
28 extern StartRXAFS_FetchData (struct rx_call *,
29         struct AFSFid *Fid,
30         afs_int32 Pos, 
31         afs_int32 Length);
32 extern EndRXAFS_FetchData (struct rx_call *,
33         struct AFSFetchStatus *OutStatus, 
34         struct AFSCallBack *CallBack, 
35         struct AFSVolSync *Sync);
36
37 extern RXAFS_FetchACL(struct rx_connection *,
38         struct AFSFid *Fid, 
39         struct AFSOpaque *AccessList, 
40         struct AFSFetchStatus *OutStatus, 
41         struct AFSVolSync *Sync);
42
43 extern RXAFS_FetchStatus (struct rx_connection *,
44         struct AFSFid *Fid, 
45         struct AFSFetchStatus *OutStatus, 
46         struct AFSCallBack *CallBack, 
47         struct AFSVolSync *Sync);
48
49 int StartRXAFS_StoreData (struct rx_call *,
50         struct AFSFid *Fid, 
51         struct AFSStoreStatus *InStatus, 
52         afs_int32 Pos, 
53         afs_int32 Length, 
54         afs_int32 FileLength);
55
56 int EndRXAFS_StoreData(struct rx_call *,
57         struct AFSFetchStatus *OutStatus, 
58         struct AFSVolSync *Sync);
59
60 int RXAFS_StoreACL (struct rx_connection *,
61         struct AFSFid *Fid, 
62         struct AFSOpaque *AccessList,  
63         struct AFSFetchStatus *OutStatus, 
64         struct AFSVolSync *Sync);
65
66 int RXAFS_StoreStatus(struct rx_connection *,
67         struct AFSFid *Fid, 
68         struct AFSStoreStatus *InStatus, 
69         struct AFSFetchStatus *OutStatus, 
70         struct AFSVolSync *Sync);
71
72 int RXAFS_RemoveFile (struct rx_connection *,
73         struct AFSFid *DirFid, 
74         char *namep,
75         struct AFSFetchStatus *OutStatus, 
76         struct AFSVolSync *Sync);
77
78 int RXAFS_CreateFile (struct rx_connection *,
79         struct AFSFid *DirFid, 
80         char *Name,
81         struct AFSStoreStatus *InStatus, 
82         struct AFSFid *OutFid, 
83         struct AFSFetchStatus *OutFidStatus, 
84         struct AFSFetchStatus *OutDirStatus, 
85         struct AFSCallBack *CallBack, 
86         struct AFSVolSync *Sync);
87
88 int RXAFS_Rename (struct rx_connection *,
89         struct AFSFid *OldDirFid, 
90         char *OldName,
91         struct AFSFid *NewDirFid, 
92         char *NewName,
93         struct AFSFetchStatus *OutOldDirStatus, 
94         struct AFSFetchStatus *OutNewDirStatus, 
95         struct AFSVolSync *Sync);
96
97 int RXAFS_Symlink (struct rx_connection *,
98         struct AFSFid *DirFid, 
99         char *name,
100         char *LinkContents,
101         struct AFSStoreStatus *InStatus,
102         struct AFSFid *OutFid, 
103         struct AFSFetchStatus *OutFidStatus, 
104         struct AFSFetchStatus *OutDirStatus, 
105         struct AFSVolSync *Sync);
106
107 int RXAFS_Link (struct rx_connection *,
108         struct AFSFid *DirFid, 
109         char *Name,
110         struct AFSFid *ExistingFid, 
111         struct AFSFetchStatus *OutFidStatus, 
112         struct AFSFetchStatus *OutDirStatus, 
113         struct AFSVolSync *Sync);
114
115 int RXAFS_MakeDir (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_RemoveDir (struct rx_connection *,
126         struct AFSFid *DirFid, 
127         char *Name,
128         struct AFSFetchStatus *OutDirStatus, 
129         struct AFSVolSync *Sync);
130
131 int RXAFS_GetStatistics (struct rx_connection *,
132         struct ViceStatistics *Statistics);
133
134 int RXAFS_GiveUpCallBacks (struct rx_connection *,
135         struct AFSCBFids *Fids_Array,
136         struct AFSCBs *CallBacks_Array);
137
138 int RXAFS_GetVolumeInfo (struct rx_connection *,
139         char *VolumeName,
140         struct VolumeInfo *Volumeinfo);
141
142 int RXAFS_GetVolumeStatus (struct rx_connection *,
143         afs_int32 Volumeid, 
144         struct AFSFetchVolumeStatus *Volumestatus, 
145         char **name,
146         char **offlineMsg,
147         char **motd);
148
149 int RXAFS_SetVolumeStatus (struct rx_connection *,
150         afs_int32 Volumeid, 
151         struct AFSStoreVolumeStatus *Volumestatus,
152         char *name,
153         char *olm,
154         char *motd);
155
156 int RXAFS_GetRootVolume (struct rx_connection *,
157         char **VolumeName);
158
159 int RXAFS_CheckToken (struct rx_connection *,
160         afs_int32 ViceId,
161         struct AFSOpaque *token);
162
163 int RXAFS_GetTime (struct rx_connection *,
164         afs_uint32 *Seconds, 
165         afs_uint32 *USeconds);
166
167 int RXAFS_BulkStatus (struct rx_connection *,
168         struct AFSCBFids *FidsArray,
169         struct AFSBulkStats *StatArray,
170         struct AFSCBs *CBArray,
171         struct AFSVolSync *Sync);
172
173 int RXAFS_SetLock (struct rx_connection *,
174         struct AFSFid *Fid, 
175         int Type, 
176         struct AFSVolSync *Sync);
177
178 int RXAFS_ExtendLock (struct rx_connection *,
179         struct AFSFid *Fid, 
180         struct AFSVolSync *Sync);
181
182 int RXAFS_ReleaseLock (struct rx_connection *,
183         struct AFSFid *Fid, 
184         struct AFSVolSync *Sync);
185
186 /* This interface is to supported the AFS/DFS Protocol Translator */
187 int RXAFS_Lookup (struct rx_connection *,
188         struct AFSFid *DirFid,
189         char *Name,
190         struct AFSFid *OutFid,
191         struct AFSFetchStatus *OutFidStatus,
192         struct AFSFetchStatus *OutDirStatus,
193         struct AFSCallBack *CallBack,
194         struct AFSVolSync *Sync);
195
196 /* common flags to many procedures */
197 #define CM_FLAG_CREATE          1               /* create entry */
198 #define CM_FLAG_CASEFOLD        2               /* fold case in namei, lookup, etc. */
199 #define CM_FLAG_EXCLUSIVE       4               /* create exclusive */
200 #define CM_FLAG_FOLLOW          8               /* follow symlinks, even at the end (namei) */
201 #define CM_FLAG_8DOT3           0x10            /* restrict to 8.3 name */
202 #define CM_FLAG_NOMOUNTCHASE    0x20            /* don't follow mount points */
203 #define CM_FLAG_DIRSEARCH       0x40            /* for directory search */
204 #define CM_FLAG_CHECKPATH       0x80            /* Path instead of File */
205
206 /* error codes */
207 #define CM_ERROR_BASE                   0x66543200
208 #define CM_ERROR_NOSUCHCELL             (CM_ERROR_BASE+0)
209 #define CM_ERROR_NOSUCHVOLUME           (CM_ERROR_BASE+1)
210 #define CM_ERROR_TIMEDOUT               (CM_ERROR_BASE+2)
211 #define CM_ERROR_RETRY                  (CM_ERROR_BASE+3)
212 #define CM_ERROR_NOACCESS               (CM_ERROR_BASE+4)
213 #define CM_ERROR_NOSUCHFILE             (CM_ERROR_BASE+5)
214 #define CM_ERROR_STOPNOW                (CM_ERROR_BASE+6)
215 #define CM_ERROR_TOOBIG                 (CM_ERROR_BASE+7)
216 #define CM_ERROR_INVAL                  (CM_ERROR_BASE+8)
217 #define CM_ERROR_BADFD                  (CM_ERROR_BASE+9)
218 #define CM_ERROR_BADFDOP                (CM_ERROR_BASE+10)
219 #define CM_ERROR_EXISTS                 (CM_ERROR_BASE+11)
220 #define CM_ERROR_CROSSDEVLINK           (CM_ERROR_BASE+12)
221 #define CM_ERROR_BADOP                  (CM_ERROR_BASE+13)
222 #define CM_ERROR_BADSMB                 (CM_ERROR_BASE+32)
223 /* CM_ERROR_BADPASSWORD used to be here */
224 #define CM_ERROR_NOTDIR                 (CM_ERROR_BASE+15)
225 #define CM_ERROR_ISDIR                  (CM_ERROR_BASE+16)
226 #define CM_ERROR_READONLY               (CM_ERROR_BASE+17)
227 #define CM_ERROR_WOULDBLOCK             (CM_ERROR_BASE+18)
228 #define CM_ERROR_QUOTA                  (CM_ERROR_BASE+19)
229 #define CM_ERROR_SPACE                  (CM_ERROR_BASE+20)
230 #define CM_ERROR_BADSHARENAME           (CM_ERROR_BASE+21)
231 #define CM_ERROR_BADTID                 (CM_ERROR_BASE+22)
232 #define CM_ERROR_UNKNOWN                (CM_ERROR_BASE+23)
233 #define CM_ERROR_NOMORETOKENS           (CM_ERROR_BASE+24)
234 #define CM_ERROR_NOTEMPTY               (CM_ERROR_BASE+25)
235 #define CM_ERROR_USESTD                 (CM_ERROR_BASE+26)
236 #define CM_ERROR_REMOTECONN             (CM_ERROR_BASE+27)
237 #define CM_ERROR_ATSYS                  (CM_ERROR_BASE+28)
238 #define CM_ERROR_NOSUCHPATH             (CM_ERROR_BASE+29)
239
240 #define CM_ERROR_CLOCKSKEW              (CM_ERROR_BASE+31)
241
242 #define CM_ERROR_ALLBUSY                (CM_ERROR_BASE+33)
243 #define CM_ERROR_NOFILES                (CM_ERROR_BASE+34)
244 #define CM_ERROR_PARTIALWRITE           (CM_ERROR_BASE+35)
245 #define CM_ERROR_NOIPC                  (CM_ERROR_BASE+36)
246 #define CM_ERROR_BADNTFILENAME          (CM_ERROR_BASE+37)
247 #define CM_ERROR_BUFFERTOOSMALL         (CM_ERROR_BASE+38)
248 #define CM_ERROR_RENAME_IDENTICAL       (CM_ERROR_BASE+39)
249 #define CM_ERROR_ALLOFFLINE             (CM_ERROR_BASE+40)
250
251 #endif /*  __CM_H_ENV__ */