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