Windows: Add cm_req_t parameter to buf_Get* functions
[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 /* We use pthreads in the cache manager (not LWP) */
14 #ifndef AFS_PTHREAD_ENV
15 #define AFS_PTHREAD_ENV 1
16 #endif
17
18 /* Support largefiles by default */
19 #ifndef AFS_LARGEFILES
20 #define AFS_LARGEFILES 1
21 #endif
22
23 #include <rx/rx.h>
24 #include <afs/vldbint.h>
25 #include <afs/afsint.h>
26
27 #define CM_DEFAULT_CALLBACKPORT         7001
28
29 /* common flags to many procedures */
30 #define CM_FLAG_CREATE          1               /* create entry */
31 #define CM_FLAG_CASEFOLD        2               /* fold case in namei, lookup, etc. */
32 #define CM_FLAG_EXCLUSIVE       4               /* create exclusive */
33 #define CM_FLAG_FOLLOW          8               /* follow symlinks, even at the end (namei) */
34 #define CM_FLAG_8DOT3           0x10            /* restrict to 8.3 name */
35 #define CM_FLAG_NOMOUNTCHASE    0x20            /* don't follow mount points */
36 #define CM_FLAG_DIRSEARCH       0x40            /* for directory search */
37 #define CM_FLAG_CHECKPATH       0x80            /* Path instead of File */
38 #define CM_FLAG_NOPROBE         0x100           /* For use with cm_GetCellxxx - do not probe server status */
39 #define CM_FLAG_DFS_REFERRAL    0x200           /* The request is a DFS Referral - the last char of the lookup name may be missing */
40
41 /* error codes */
42 #define CM_ERROR_BASE                   0x66543200
43 #define CM_ERROR_NOSUCHCELL             (CM_ERROR_BASE+0)
44 #define CM_ERROR_NOSUCHVOLUME           (CM_ERROR_BASE+1)
45 #define CM_ERROR_TIMEDOUT               (CM_ERROR_BASE+2)
46 #define CM_ERROR_RETRY                  (CM_ERROR_BASE+3)
47 #define CM_ERROR_NOACCESS               (CM_ERROR_BASE+4)
48 #define CM_ERROR_NOSUCHFILE             (CM_ERROR_BASE+5)
49 #define CM_ERROR_STOPNOW                (CM_ERROR_BASE+6)
50 #define CM_ERROR_TOOBIG                 (CM_ERROR_BASE+7)
51 #define CM_ERROR_INVAL                  (CM_ERROR_BASE+8)
52 #define CM_ERROR_BADFD                  (CM_ERROR_BASE+9)
53 #define CM_ERROR_BADFDOP                (CM_ERROR_BASE+10)
54 #define CM_ERROR_EXISTS                 (CM_ERROR_BASE+11)
55 #define CM_ERROR_CROSSDEVLINK           (CM_ERROR_BASE+12)
56 #define CM_ERROR_BADOP                  (CM_ERROR_BASE+13)
57 #define CM_ERROR_BADPASSWORD            (CM_ERROR_BASE+14)
58 #define CM_ERROR_NOTDIR                 (CM_ERROR_BASE+15)
59 #define CM_ERROR_ISDIR                  (CM_ERROR_BASE+16)
60 #define CM_ERROR_READONLY               (CM_ERROR_BASE+17)
61 #define CM_ERROR_WOULDBLOCK             (CM_ERROR_BASE+18)
62 #define CM_ERROR_QUOTA                  (CM_ERROR_BASE+19)
63 #define CM_ERROR_SPACE                  (CM_ERROR_BASE+20)
64 #define CM_ERROR_BADSHARENAME           (CM_ERROR_BASE+21)
65 #define CM_ERROR_BADTID                 (CM_ERROR_BASE+22)
66 #define CM_ERROR_UNKNOWN                (CM_ERROR_BASE+23)
67 #define CM_ERROR_NOMORETOKENS           (CM_ERROR_BASE+24)
68 #define CM_ERROR_NOTEMPTY               (CM_ERROR_BASE+25)
69 #define CM_ERROR_USESTD                 (CM_ERROR_BASE+26)
70 #define CM_ERROR_REMOTECONN             (CM_ERROR_BASE+27)
71 #define CM_ERROR_ATSYS                  (CM_ERROR_BASE+28)
72 #define CM_ERROR_NOSUCHPATH             (CM_ERROR_BASE+29)
73 #define CM_ERROR_CLOCKSKEW              (CM_ERROR_BASE+31)
74 #define CM_ERROR_BADSMB                 (CM_ERROR_BASE+32)
75 #define CM_ERROR_ALLBUSY                (CM_ERROR_BASE+33)
76 #define CM_ERROR_NOFILES                (CM_ERROR_BASE+34)
77 #define CM_ERROR_PARTIALWRITE           (CM_ERROR_BASE+35)
78 #define CM_ERROR_NOIPC                  (CM_ERROR_BASE+36)
79 #define CM_ERROR_BADNTFILENAME          (CM_ERROR_BASE+37)
80 #define CM_ERROR_BUFFERTOOSMALL         (CM_ERROR_BASE+38)
81 #define CM_ERROR_RENAME_IDENTICAL       (CM_ERROR_BASE+39)
82 #define CM_ERROR_ALLOFFLINE             (CM_ERROR_BASE+40)
83 #define CM_ERROR_AMBIGUOUS_FILENAME     (CM_ERROR_BASE+41)
84 #define CM_ERROR_BADLOGONTYPE           (CM_ERROR_BASE+42)
85 #define CM_ERROR_GSSCONTINUE            (CM_ERROR_BASE+43)
86 #define CM_ERROR_TIDIPC                 (CM_ERROR_BASE+44)
87 #define CM_ERROR_TOO_MANY_SYMLINKS      (CM_ERROR_BASE+45)
88 #define CM_ERROR_PATH_NOT_COVERED       (CM_ERROR_BASE+46)
89 #define CM_ERROR_LOCK_CONFLICT          (CM_ERROR_BASE+47)
90 #define CM_ERROR_SHARING_VIOLATION      (CM_ERROR_BASE+48)
91 #define CM_ERROR_ALLDOWN                (CM_ERROR_BASE+49)
92 #define CM_ERROR_TOOFEWBUFS             (CM_ERROR_BASE+50)
93 #define CM_ERROR_TOOMANYBUFS            (CM_ERROR_BASE+51)
94 #define CM_ERROR_BAD_LEVEL              (CM_ERROR_BASE+52)
95 #define CM_ERROR_NOT_A_DFSLINK          (CM_ERROR_BASE+53)
96 #define CM_ERROR_INEXACT_MATCH          (CM_ERROR_BASE+54)
97 #define CM_ERROR_BPLUS_NOMATCH          (CM_ERROR_BASE+55)
98 #define CM_ERROR_EAS_NOT_SUPPORTED      (CM_ERROR_BASE+56)
99 #define CM_ERROR_RANGE_NOT_LOCKED       (CM_ERROR_BASE+57)
100 #define CM_ERROR_NOSUCHDEVICE           (CM_ERROR_BASE+58)
101 #define CM_ERROR_LOCK_NOT_GRANTED       (CM_ERROR_BASE+59)
102 #define CM_ERROR_NOTINCACHE             (CM_ERROR_BASE+60)
103 #define CM_ERROR_FORCE_DNS_LOOKUP       (CM_ERROR_BASE+61)
104
105 /* Used by cm_FollowMountPoint and cm_FindVolumeByName */
106 /* And as an index in cm_volume_t */
107 #define RWVOL   0
108 #define ROVOL   1
109 #define BACKVOL 2
110
111 #define LOCK_HIERARCHY_IGNORE                    0
112
113 #define LOCK_HIERARCHY_SMB_STARTED              20
114 #define LOCK_HIERARCHY_SMB_LISTENER             30
115 #define LOCK_HIERARCHY_SMB_DIRWATCH             40
116 #define LOCK_HIERARCHY_SMB_GLOBAL               50
117 #define LOCK_HIERARCHY_SMB_DIRSEARCH            60
118 #define LOCK_HIERARCHY_SMB_FID                  70
119 #define LOCK_HIERARCHY_SMB_TID                  80
120 #define LOCK_HIERARCHY_SMB_UID                  90
121 #define LOCK_HIERARCHY_SMB_RAWBUF              100
122 #define LOCK_HIERARCHY_SMB_RCT_GLOBAL          110
123 #define LOCK_HIERARCHY_SMB_USERNAME            115
124 #define LOCK_HIERARCHY_SMB_VC                  120
125
126
127 #define LOCK_HIERARCHY_DAEMON_GLOBAL           400
128
129 #define LOCK_HIERARCHY_SCACHE_DIRLOCK          500
130 #define LOCK_HIERARCHY_SCACHE_BUFCREATE        510
131 #define LOCK_HIERARCHY_BUFFER                  530
132 #define LOCK_HIERARCHY_SCACHE                  540
133 #define LOCK_HIERARCHY_BUF_GLOBAL              550
134 #define LOCK_HIERARCHY_VOLUME                  560
135 #define LOCK_HIERARCHY_USER                    570
136 #define LOCK_HIERARCHY_SCACHE_GLOBAL           580
137 #define LOCK_HIERARCHY_CONN_GLOBAL             600
138 #define LOCK_HIERARCHY_CELL                    620
139 #define LOCK_HIERARCHY_CELL_GLOBAL             630
140 #define LOCK_HIERARCHY_SERVER                  640
141 #define LOCK_HIERARCHY_CALLBACK_GLOBAL         645
142 #define LOCK_HIERARCHY_SERVER_GLOBAL           650
143 #define LOCK_HIERARCHY_CONN                    660 
144 #define LOCK_HIERARCHY_VOLUME_GLOBAL           670
145 #define LOCK_HIERARCHY_DNLC_GLOBAL             690
146 #define LOCK_HIERARCHY_FREELANCE_GLOBAL        700
147 #define LOCK_HIERARCHY_UTILS_GLOBAL            710
148 #define LOCK_HIERARCHY_OTHER_GLOBAL            720
149 #define LOCK_HIERARCHY_ACL_GLOBAL              730
150 #define LOCK_HIERARCHY_USER_GLOBAL             740
151 #define LOCK_HIERARCHY_AFSDBSBMT_GLOBAL       1000
152 #define LOCK_HIERARCHY_TOKEN_EVENT_GLOBAL     2000
153 #define LOCK_HIERARCHY_SYSCFG_GLOBAL          3000
154 #endif /*  __CM_H_ENV__ */
155