8 /* these define the attribute byte as seen by DOS */
10 #define aHIDDEN (1L<<1)
11 #define aSYSTEM (1L<<2)
12 #define aVOLID (1L<<3)
17 #define SUCCESS 0 /* The request was successful. */
18 #define ERRDOS 0x01 /* Error is from the core DOS operating system set. */
19 #define ERRSRV 0x02 /* Error is generated by the server network file manager. */
20 #define ERRHRD 0x03 /* Error is an hardware error. */
21 #define ERRCMD 0xFF /* Command was not in the "SMB" format. */
23 /* SMB X/Open error codes for the ERRdos error class */
25 #define ERRbadfunc 1 /* Invalid function (or system call) */
26 #define ERRbadfile 2 /* File not found (pathname error) */
27 #define ERRbadpath 3 /* Directory not found */
28 #define ERRnofids 4 /* Too many open files */
29 #define ERRnoaccess 5 /* Access denied */
30 #define ERRbadfid 6 /* Invalid fid */
31 #define ERRbadmcb 7 /* Memory control blocks destroyed */
32 #define ERRnomem 8 /* Out of memory */
33 #define ERRbadmem 9 /* Invalid memory block address */
34 #define ERRbadenv 10 /* Invalid environment */
35 #define ERRbadformat 11 /* Invalid format */
36 #define ERRbadaccess 12 /* Invalid open mode */
37 #define ERRbaddata 13 /* Invalid data (only from ioctl call) */
38 #define ERRres 14 /* reserved */
39 #define ERRbaddrive 15 /* Invalid drive */
40 #define ERRremcd 16 /* Attempt to delete current directory */
41 #define ERRdiffdevice 17 /* rename/move across different filesystems */
42 #define ERRnofiles 18 /* no more files found in file search */
43 #define ERRbadshare 32 /* Share mode on file conflict with open mode */
44 #define ERRlock 33 /* Lock request conflicts with existing lock */
45 #define ERRfilexists 80 /* File in operation already exists */
51 #define ERRnoresource 89
52 #define ERRtoomanyuids 90
54 #define ERRbadpipe 230 /* Named pipe invalid */
55 #define ERRpipebusy 231 /* All instances of pipe are busy */
56 #define ERRpipeclosing 232 /* named pipe close in progress */
57 #define ERRnotconnected 233 /* No process on other end of named pipe */
58 #define ERRmoredata 234 /* More data to be returned */
59 #define ERROR_EAS_DIDNT_FIT 275 /* Extended attributes didn't fit */
60 #define ERROR_EAS_NOT_SUPPORTED 282 /* Extended attributes not suppored */
62 /* Error codes for the ERRSRV class */
64 #define ERRerror 1 /* Non specific error code */
65 #define ERRbadpw 2 /* Bad password */
66 #define ERRbadtype 3 /* reserved */
67 #define ERRaccess 4 /* No permissions to do the requested operation */
68 #define ERRinvnid 5 /* tid invalid */
69 #define ERRinvnetname 6 /* Invalid servername */
70 #define ERRinvdevice 7 /* Invalid device */
71 #define ERRqfull 49 /* Print queue full */
72 #define ERRqtoobig 50 /* Queued item too big */
74 #define ERRinvpfid 52 /* Invalid print file in smb_fid */
75 #define ERRsmbcmd 64 /* Unrecognised command */
76 #define ERRsrverror 65 /* smb server internal error */
78 #define ERRfilespecs 67 /* fid and pathname invalid combination */
79 #define ERRbadlink 68 /* reserved */
80 #define ERRbadpermits 69 /* Access specified for a file is not valid */
81 #define ERRbadpid 70 /* reserved */
82 #define ERRsetattrmode 71 /* attribute mode invalid */
83 #define ERRpaused 81 /* Message server paused */
84 #define ERRmsgoff 82 /* Not receiving messages */
85 #define ERRnoroom 83 /* No room for message */
86 #define ERRrmuns 87 /* too many remote usernames */
87 #define ERRtimeout 88 /* operation timed out */
88 #define ERRnoresource 89 /* No resources currently available for request. */
89 #define ERRtoomanyuids 90 /* too many userids */
90 #define ERRbaduid 91 /* bad userid */
91 #define ERRuseMPX 250 /* temporarily unable to use raw mode, use MPX mode */
92 #define ERRuseSTD 251 /* temporarily unable to use raw mode, use std.mode */
93 #define ERRcontMPX 252 /* resume MPX mode */
95 #define ERRnotifyEnumDir 1024
96 #define ERRaccountExpired 2239
97 #define ERRbadClient 2240
98 #define ERRbadLogonTime 2241
99 #define ERRpasswordExpired 2242
100 #define ERRnosupport 0xFFFF
102 /* Error codes for the ERRHRD class */
104 #define ERRnowrite 19 /* read only media */
105 #define ERRbadunit 20 /* Unknown device */
106 #define ERRnotready 21 /* Drive not ready */
107 #define ERRbadcmd 22 /* Unknown command */
108 #define ERRdata 23 /* Data (CRC) error */
109 #define ERRbadreq 24 /* Bad request structure length */
111 #define ERRbadmedia 26
112 #define ERRbadsector 27
113 #define ERRnopaper 28
114 #define ERRwrite 29 /* write fault */
115 #define ERRread 30 /* read fault */
116 #define ERRgeneral 31 /* General hardware failure */
117 #define ERRbadshare 32
119 #define ERRwrongdisk 34
120 #define ERRFCBunavail 35
121 #define ERRsharebufexc 36 /* share buffer exceeded */
122 #define ERRdiskfull 39
124 /* offsets into message for common items */
156 /* these are the trans2 sub fields for primary requests */
157 #define smb_tpscnt smb_vwv0
158 #define smb_tdscnt smb_vwv1
159 #define smb_mprcnt smb_vwv2
160 #define smb_mdrcnt smb_vwv3
161 #define smb_msrcnt smb_vwv4
162 #define smb_flags smb_vwv5
163 #define smb_timeout smb_vwv6
164 #define smb_pscnt smb_vwv9
165 #define smb_psoff smb_vwv10
166 #define smb_dscnt smb_vwv11
167 #define smb_dsoff smb_vwv12
168 #define smb_suwcnt smb_vwv13
169 #define smb_setup smb_vwv14
170 #define smb_setup0 smb_setup
171 #define smb_setup1 (smb_setup+2)
172 #define smb_setup2 (smb_setup+4)
174 /* these are for the secondary requests */
175 #define smb_spscnt smb_vwv2
176 #define smb_spsoff smb_vwv3
177 #define smb_spsdisp smb_vwv4
178 #define smb_sdscnt smb_vwv5
179 #define smb_sdsoff smb_vwv6
180 #define smb_sdsdisp smb_vwv7
181 #define smb_sfid smb_vwv8
183 /* and these for responses */
184 #define smb_tprcnt smb_vwv0
185 #define smb_tdrcnt smb_vwv1
186 #define smb_prcnt smb_vwv3
187 #define smb_proff smb_vwv4
188 #define smb_prdisp smb_vwv5
189 #define smb_drcnt smb_vwv6
190 #define smb_droff smb_vwv7
191 #define smb_drdisp smb_vwv8
194 #define SMBmkdir 0x00 /* create directory */
195 #define SMBrmdir 0x01 /* delete directory */
196 #define SMBopen 0x02 /* open file */
197 #define SMBcreate 0x03 /* create file */
198 #define SMBclose 0x04 /* close file */
199 #define SMBflush 0x05 /* flush file */
200 #define SMBunlink 0x06 /* delete file */
201 #define SMBmv 0x07 /* rename file */
202 #define SMBgetatr 0x08 /* get file attributes */
203 #define SMBsetatr 0x09 /* set file attributes */
204 #define SMBread 0x0A /* read from file */
205 #define SMBwrite 0x0B /* write to file */
206 #define SMBlock 0x0C /* lock byte range */
207 #define SMBunlock 0x0D /* unlock byte range */
208 #define SMBctemp 0x0E /* create temporary file */
209 #define SMBmknew 0x0F /* make new file */
210 #define SMBchkpth 0x10 /* check directory path */
211 #define SMBexit 0x11 /* process exit */
212 #define SMBlseek 0x12 /* seek */
213 #define SMBtcon 0x70 /* tree connect */
214 #define SMBtconX 0x75 /* tree connect and X */
215 #define SMBtdis 0x71 /* tree disconnect */
216 #define SMBnegprot 0x72 /* negotiate protocol */
217 #define SMBdskattr 0x80 /* get disk attributes */
218 #define SMBsearch 0x81 /* search directory */
219 #define SMBsplopen 0xC0 /* open print spool file */
220 #define SMBsplwr 0xC1 /* write to print spool file */
221 #define SMBsplclose 0xC2 /* close print spool file */
222 #define SMBsplretq 0xC3 /* return print queue */
223 #define SMBsends 0xD0 /* send single block message */
224 #define SMBsendb 0xD1 /* send broadcast message */
225 #define SMBfwdname 0xD2 /* forward user name */
226 #define SMBcancelf 0xD3 /* cancel forward */
227 #define SMBgetmac 0xD4 /* get machine name */
228 #define SMBsendstrt 0xD5 /* send start of multi-block message */
229 #define SMBsendend 0xD6 /* send end of multi-block message */
230 #define SMBsendtxt 0xD7 /* send text of multi-block message */
233 #define SMBlockread 0x13 /* Lock a range and read */
234 #define SMBwriteunlock 0x14 /* Unlock a range then write */
235 #define SMBreadbraw 0x1a /* read a block of data with no smb header */
236 #define SMBwritebraw 0x1d /* write a block of data with no smb header */
237 #define SMBwritec 0x20 /* secondary write request */
238 #define SMBwriteclose 0x2c /* write a file then close it */
240 /* dos extended protocol */
241 #define SMBreadBraw 0x1A /* read block raw */
242 #define SMBreadBmpx 0x1B /* read block multiplexed */
243 #define SMBreadBs 0x1C /* read block (secondary response) */
244 #define SMBwriteBraw 0x1D /* write block raw */
245 #define SMBwriteBmpx 0x1E /* write block multiplexed */
246 #define SMBwriteBs 0x1F /* write block (secondary request) */
247 #define SMBwriteC 0x20 /* write complete response */
248 #define SMBsetattrE 0x22 /* set file attributes expanded */
249 #define SMBgetattrE 0x23 /* get file attributes expanded */
250 #define SMBlockingX 0x24 /* lock/unlock byte ranges and X */
251 #define SMBtrans 0x25 /* transaction - name, bytes in/out */
252 #define SMBtranss 0x26 /* transaction (secondary request/response) */
253 #define SMBioctl 0x27 /* IOCTL */
254 #define SMBioctls 0x28 /* IOCTL (secondary request/response) */
255 #define SMBcopy 0x29 /* copy */
256 #define SMBmove 0x2A /* move */
257 #define SMBecho 0x2B /* echo */
258 #define SMBopenX 0x2D /* open and X */
259 #define SMBreadX 0x2E /* read and X */
260 #define SMBwriteX 0x2F /* write and X */
261 #define SMBsesssetupX 0x73 /* Session Set Up & X (including User Logon) */
262 #define SMBtconX 0x75 /* tree connect and X */
263 #define SMBffirst 0x82 /* find first */
264 #define SMBfunique 0x83 /* find unique */
265 #define SMBfclose 0x84 /* find close */
266 #define SMBinvalid 0xFE /* invalid command */
269 /* Extended 2.0 protocol */
270 #define SMBtrans2 0x32 /* TRANS2 protocol set */
271 #define SMBtranss2 0x33 /* TRANS2 protocol set, secondary command */
272 #define SMBfindclose 0x34 /* Terminate a TRANSACT2_FINDFIRST */
273 #define SMBfindnclose 0x35 /* Terminate a TRANSACT2_FINDNOTIFYFIRST */
274 #define SMBulogoffX 0x74 /* user logoff */
276 /* these are the TRANS2 sub commands */
277 #define TRANSACT2_OPEN 0
278 #define TRANSACT2_FINDFIRST 1
279 #define TRANSACT2_FINDNEXT 2
280 #define TRANSACT2_QFSINFO 3
281 #define TRANSACT2_SETFSINFO 4
282 #define TRANSACT2_QPATHINFO 5
283 #define TRANSACT2_SETPATHINFO 6
284 #define TRANSACT2_QFILEINFO 7
285 #define TRANSACT2_SETFILEINFO 8
286 #define TRANSACT2_FSCTL 9
287 #define TRANSACT2_IOCTL 10
288 #define TRANSACT2_FINDNOTIFYFIRST 11
289 #define TRANSACT2_FINDNOTIFYNEXT 12
290 #define TRANSACT2_MKDIR 13
292 #endif /* _SMBNO_H_ */