2 * Copyright 2000, International Business Machines Corporation and others.
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
11 #define __SMB_H_ENV__ 1
14 #include "netbios95.h"
19 /* basic core protocol SMB structure */
26 unsigned char errHigh;
29 unsigned short res[6];
35 unsigned char vdata[1];
40 #define SMB_FLAGS_SUPPORT_LOCKREAD 0x01
41 #define SMB_FLAGS_CLIENT_BUF_AVAIL 0x02
42 #define SMB_FLAGS_CASELESS_PATHNAMES 0x08
43 #define SMB_FLAGS_CANONICAL_PATHNAMES 0x10
44 #define SMB_FLAGS_REQUEST_OPLOCK 0x20
45 #define SMB_FLAGS_REQUEST_BATCH_OPLOCK 0x40
46 #define SMB_FLAGS_SERVER_TO_CLIENT 0x80
50 #define SMB_FLAGS2_KNOWS_LONG_NAMES 0x0001
51 #define SMB_FLAGS2_KNOWS_EAS 0x0002
52 #define SMB_FLAGS2_SECURITY_SIGNATURE 0x0004
53 #define SMB_FLAGS2_RESERVED1 0x0008
54 #define SMB_FLAGS2_IS_LONG_NAME 0x0040
55 #define SMB_FLAGS2_EXT_SEC 0x0800
56 #define SMB_FLAGS2_DFS_PATHNAMES 0x1000
57 #define SMB_FLAGS2_PAGING_IO 0x2000
58 #define SMB_FLAGS2_32BIT_STATUS 0x4000
59 #define SMB_FLAGS2_UNICODE 0x8000
61 #define KNOWS_LONG_NAMES(inp) ((((smb_t *)inp)->flg2 & SMB_FLAGS2_KNOWS_LONG_NAMES)?1:0)
62 #define WANTS_DFS_PATHNAMES(inp) ((((smb_t *)inp)->flg2 & SMB_FLAGS2_DFS_PATHNAMES)?1:0)
64 /* Information Levels */
65 #define SMB_INFO_STANDARD 1
66 #define SMB_INFO_QUERY_EA_SIZE 2
67 #define SMB_INFO_QUERY_EAS_FROM_LIST 3
68 #define SMB_INFO_QUERY_ALL_EAS 4
69 #define SMB_INFO_IS_NAME_VALID 6
71 #define SMB_QUERY_FILE_BASIC_INFO 0x101
72 #define SMB_QUERY_FILE_STANDARD_INFO 0x102
73 #define SMB_QUERY_FILE_EA_INFO 0x103
74 #define SMB_QUERY_FILE_NAME_INFO 0x104
75 #define SMB_QUERY_FILE_ALL_INFO 0x107
76 #define SMB_QUERY_FILE_ALT_NAME_INFO 0x108
77 #define SMB_QUERY_FILE_STREAM_INFO 0x109
78 #define SMB_QUERY_FILE_COMPRESSION_INFO 0x10B
79 #define SMB_QUERY_FILE_UNIX_BASIC 0x200
80 #define SMB_QUERY_FILE_UNIX_LINK 0x201
82 #define SMB_SET_FILE_UNIX_BASIC 0x200
83 #define SMB_SET_FILE_UNIX_LINK 0x201
84 #define SMB_SET_FILE_UNIX_HLINK 0x203
87 #define SMB_NOPCODES 256 /* # of opcodes in the dispatch table */
90 #define SMB_THREADSPERVC 4 /* threads per VC */
92 /* flags for functions */
93 #define SMB_FLAG_CREATE 1 /* create the structure if necessary */
95 /* max # of bytes we'll receive in an incoming SMB message */
96 /* the maximum is 2^18-1 for NBT and 2^25-1 for Raw transport messages */
97 /* we will use something smaller but large enough to be efficient */
98 #define SMB_PACKETSIZE 32768 /* was 8400 */
99 /* raw mode is considered obsolete and cannot be used with message signing */
100 #define SMB_MAXRAWSIZE 65536
102 /* Negotiate protocol constants */
104 #define NEGOTIATE_SECURITY_USER_LEVEL 0x01
105 #define NEGOTIATE_SECURITY_CHALLENGE_RESPONSE 0x02
106 #define NEGOTIATE_SECURITY_SIGNATURES_ENABLED 0x04
107 #define NEGOTIATE_SECURITY_SIGNATURES_REQUIRED 0x08
110 #define NTNEGOTIATE_CAPABILITY_RAWMODE 0x00000001L
111 #define NTNEGOTIATE_CAPABILITY_MPXMODE 0x00000002L
112 #define NTNEGOTIATE_CAPABILITY_UNICODE 0x00000004L
113 #define NTNEGOTIATE_CAPABILITY_LARGEFILES 0x00000008L
114 #define NTNEGOTIATE_CAPABILITY_NTSMB 0x00000010L
115 #define NTNEGOTIATE_CAPABILITY_RPCAPI 0x00000020L
116 #define NTNEGOTIATE_CAPABILITY_NTSTATUS 0x00000040L
117 #define NTNEGOTIATE_CAPABILITY_LEVEL_II_OPLOCKS 0x00000080L
118 #define NTNEGOTIATE_CAPABILITY_LOCK_AND_READ 0x00000100L
119 #define NTNEGOTIATE_CAPABILITY_NTFIND 0x00000200L
120 #define NTNEGOTIATE_CAPABILITY_DFS 0x00001000L
121 #define NTNEGOTIATE_CAPABILITY_NT_INFO_PASSTHRU 0x00002000L
122 #define NTNEGOTIATE_CAPABILITY_LARGE_READX 0x00004000L
123 #define NTNEGOTIATE_CAPABILITY_LARGE_WRITEX 0x00008000L
124 #define NTNEGOTIATE_CAPABILITY_UNIX 0x00800000L
125 #define NTNEGOTIATE_CAPABILITY_BULK_TRANSFER 0x20000000L
126 #define NTNEGOTIATE_CAPABILITY_COMPRESSED 0x40000000L
127 #define NTNEGOTIATE_CAPABILITY_EXTENDED_SECURITY 0x80000000L
129 /* a packet structure for receiving SMB messages; locked by smb_globalLock.
130 * Most of the work involved is in handling chained requests and responses.
132 * When handling input, inWctp points to the current request's wct field (and
133 * the other parameters and request data can be found from this field). The
134 * opcode, unfortunately, isn't available there, so is instead copied to the
135 * packet's inCom field. It is initially set to com, but each chained
136 * operation sets it, also.
137 * The function smb_AdvanceInput advances an input packet to the next request
138 * in the chain. The inCom field is set to 0xFF when there are no more
139 * requests. The inCount field is 0 if this is the first request, and
140 * otherwise counts which request it is.
142 * When handling output, we also have to chain all of the responses together.
143 * The function smb_GetResponsePacket will setup outWctp to point to the right
146 #define SMB_PACKETMAGIC 0x7436353 /* magic # for packets */
147 typedef struct smb_packet {
148 char data[SMB_PACKETSIZE];
149 struct smb_packet *nextp; /* in free list, or whatever */
151 cm_space_t *spacep; /* use this for stripping last component */
152 NCB *ncbp; /* use this for sending */
154 unsigned long resumeCode;
155 unsigned short inCount;
156 unsigned short fid; /* for calls bundled with openAndX */
159 unsigned char oddByte;
160 unsigned short ncb_length;
164 unsigned int dos_pkt_sel;
168 /* smb_packet flags */
169 #define SMB_PACKETFLAG_PROFILE_UPDATE_OK 1
170 #define SMB_PACKETFLAG_NOSEND 2
171 #define SMB_PACKETFLAG_SUSPENDED 4
173 /* a structure for making Netbios calls; locked by smb_globalLock */
174 #define SMB_NCBMAGIC 0x2334344
175 typedef struct myncb {
176 NCB ncb; /* ncb to use */
177 struct myncb *nextp; /* when on free list */
181 smb_packet_t *orig_pkt;
182 unsigned int dos_ncb_sel;
186 /* structures representing environments from kernel / SMB network.
187 * Most have their own locks, but the tree connection fields and
188 * reference counts are locked by the smb_rctLock. Those fields will
189 * be marked in comments.
192 /* one per virtual circuit */
193 typedef struct smb_vc {
194 struct smb_vc *nextp; /* not used */
195 unsigned long refCount; /* the reference count */
196 long flags; /* the flags, if any; locked by mx */
197 osi_mutex_t mx; /* the mutex */
198 long vcID; /* VC id */
199 unsigned short lsn; /* the NCB LSN associated with this */
200 unsigned short uidCounter; /* session ID counter */
201 unsigned short tidCounter; /* tree ID counter */
202 unsigned short fidCounter; /* file handle ID counter */
203 struct smb_tid *tidsp; /* the first child in the tid list */
204 struct smb_user *usersp; /* the first child in the user session list */
205 struct smb_fid *fidsp; /* the first child in the open file list */
206 struct smb_user *justLoggedOut; /* ready for profile upload? */
207 time_t logoffTime; /* tick count when logged off */
208 unsigned char errorCount;
211 char encKey[MSV1_0_CHALLENGE_LENGTH]; /* MSV1_0_CHALLENGE_LENGTH is 8 */
212 void * secCtx; /* security context when negotiating SMB extended auth
213 * valid when SMB_VCFLAG_AUTH_IN_PROGRESS is set
217 /* have we negotiated ... */
218 #define SMB_VCFLAG_USEV3 1 /* ... version 3 of the protocol */
219 #define SMB_VCFLAG_USECORE 2 /* ... the core protocol */
220 #define SMB_VCFLAG_USENT 4 /* ... NT LM 0.12 or beyond */
221 #define SMB_VCFLAG_STATUS32 8 /* use 32-bit NT status codes */
222 #define SMB_VCFLAG_REMOTECONN 0x10 /* bad: remote conns not allowed */
223 #define SMB_VCFLAG_ALREADYDEAD 0x20 /* do not get tokens from this vc */
224 #define SMB_VCFLAG_SESSX_RCVD 0x40 /* we received at least one session setups on this vc */
225 #define SMB_VCFLAG_AUTH_IN_PROGRESS 0x80 /* a SMB NT extended authentication is in progress */
227 /* one per user session */
228 typedef struct smb_user {
229 struct smb_user *nextp; /* next sibling */
230 unsigned long refCount; /* ref count */
231 long flags; /* flags; locked by mx */
233 long userID; /* the session identifier */
234 struct smb_vc *vcp; /* back ptr to virtual circuit */
235 struct smb_username *unp; /* user name struct */
238 typedef struct smb_username {
239 struct smb_username *nextp; /* next sibling */
240 unsigned long refCount; /* ref count */
241 long flags; /* flags; locked by mx */
243 struct cm_user *userp; /* CM user structure */
244 char *name; /* user name */
245 char *machine; /* machine name */
248 #define SMB_USERFLAG_DELETE 1 /* delete struct when ref count zero */
250 #define SMB_MAX_USERNAME_LENGTH 256
252 /* one per tree-connect */
253 typedef struct smb_tid {
254 struct smb_tid *nextp; /* next sibling */
255 unsigned long refCount;
257 osi_mutex_t mx; /* for non-tree-related stuff */
258 unsigned short tid; /* the tid */
259 struct smb_vc *vcp; /* back ptr */
260 struct cm_user *userp; /* user logged in at the
261 * tree connect level (base) */
262 char *pathname; /* pathname derived from sharename */
265 #define SMB_TIDFLAG_DELETE 1 /* delete struct when ref count zero */
266 #define SMB_TIDFLAG_IPC 2 /* IPC$ */
268 /* one per process ID */
269 typedef struct smb_pid {
270 struct smb_pid *nextp; /* next sibling */
271 unsigned long refCount;
273 osi_mutex_t mx; /* for non-tree-related stuff */
274 unsigned short pid; /* the pid */
275 struct smb_tid *tidp; /* back ptr */
278 /* ioctl parameter, while being assembled and/or processed */
279 typedef struct smb_ioctl {
281 char *inDatap; /* ioctl func's current position
282 * in input parameter block */
283 char *inAllocp; /* allocated input parameter block */
284 long inCopied; /* # of input bytes copied in so far
286 cm_space_t *prefix; /* prefix for subst drives */
287 char *tidPathp; /* Pathname associated with Tree ID */
290 char *outDatap; /* output results assembled so far */
291 char *outAllocp; /* output results assembled so far */
292 long outCopied; /* # of output bytes copied back so far
299 struct smb_fid *fidp;
305 /* flags for smb_ioctl_t */
306 #define SMB_IOCTLFLAG_DATAIN 1 /* reading data from client to server */
307 #define SMB_IOCTLFLAG_LOGON 2 /* got tokens from integrated logon */
309 /* one per file ID; these are really file descriptors */
310 typedef struct smb_fid {
312 unsigned long refCount;
314 osi_mutex_t mx; /* for non-tree-related stuff */
315 unsigned short fid; /* the file ID */
316 struct smb_vc *vcp; /* back ptr */
317 struct cm_scache *scp; /* scache of open file */
318 long offset; /* our file pointer */
319 smb_ioctl_t *ioctlp; /* ptr to ioctl structure */
320 /* Under NT, we may need to know the
321 * parent directory and pathname used
322 * to open the file, either to delete
323 * the file on close, or to do a
324 * change notification */
325 struct cm_scache *NTopen_dscp; /* parent directory (NT) */
326 char *NTopen_pathp; /* path used in open (NT) */
327 char *NTopen_wholepathp; /* entire path, not just last name */
328 int curr_chunk; /* chunk being read */
329 int prev_chunk; /* previous chunk read */
330 int raw_writers; /* pending async raw writes */
331 EVENT_HANDLE raw_write_event; /* signal this when raw_writers zero */
334 #define SMB_FID_OPENREAD 1 /* open for reading */
335 #define SMB_FID_OPENWRITE 2 /* open for writing */
336 #define SMB_FID_DELETE 4 /* delete struct on ref count 0 */
337 #define SMB_FID_IOCTL 8 /* a file descriptor for the
338 * magic ioctl file */
339 #define SMB_FID_OPENDELETE 0x10 /* open for deletion (NT) */
340 #define SMB_FID_DELONCLOSE 0x20 /* marked for deletion */
342 * Now some special flags to work around a bug in NT Client
344 #define SMB_FID_LENGTHSETDONE 0x40 /* have done 0-length write */
345 #define SMB_FID_MTIMESETDONE 0x80 /* have set modtime via Tr2 */
346 #define SMB_FID_LOOKSLIKECOPY (SMB_FID_LENGTHSETDONE | SMB_FID_MTIMESETDONE)
347 #define SMB_FID_NTOPEN 0x100 /* have dscp and pathp */
350 * SMB file attributes (32-bit)
352 #define SMB_ATTR_READONLY 0x0001
353 #define SMB_ATTR_HIDDEN 0x0002 /* hidden file for the purpose of dir listings */
354 #define SMB_ATTR_SYSTEM 0x0004
355 #define SMB_ATTR_VOLUMEID 0x0008 /* obsolete */
356 #define SMB_ATTR_DIRECTORY 0x0010
357 #define SMB_ATTR_ARCHIVE 0x0020
358 #define SMB_ATTR_DEVICE 0x0040
359 #define SMB_ATTR_NORMAL 0x0080 /* normal file. Only valid if used alone */
360 #define SMB_ATTR_TEMPORARY 0x0100
361 #define SMB_ATTR_SPARSE_FILE 0x0200 /* used with dfs links */
362 #define SMB_ATTR_REPARSE_POINT 0x0400
363 #define SMB_ATTR_COMPRESSED 0x0800 /* file or dir is compressed */
364 #define SMB_ATTR_OFFLINE 0x1000
365 #define SMB_ATTR_NOT_CONTENT_INDEXED 0x2000
366 #define SMB_ATTR_ENCRYPTED 0x4000
368 /* for tracking in-progress directory searches */
369 typedef struct smb_dirSearch {
370 osi_queue_t q; /* queue of all outstanding cookies */
371 osi_mutex_t mx; /* just in case the caller screws up */
372 unsigned long refCount; /* reference count */
373 long cookie; /* value returned to the caller */
374 struct cm_scache *scp; /* vnode of the dir we're searching */
375 unsigned long lastTime; /* last time we used this (osi_Time) */
376 long flags; /* flags (see below);
377 * locked by smb_globalLock */
378 unsigned short attribute; /* search attribute
379 * (used for extended protocol) */
380 char mask[256]; /* search mask for V3 */
383 #define SMB_DIRSEARCH_DELETE 1 /* delete struct when ref count zero */
384 #define SMB_DIRSEARCH_HITEOF 2 /* perhaps useful for advisory later */
385 #define SMB_DIRSEARCH_SMALLID 4 /* cookie can only be 8 bits, not 16 */
386 #define SMB_DIRSEARCH_BULKST 8 /* get bulk stat info */
388 /* type for patching directory listings */
389 typedef struct smb_dirListPatch {
391 char *dptr; /* ptr to attr, time, data, sizel, sizeh */
392 long flags; /* flags. See below */
394 cm_dirEntry_t *dep; /* temp */
395 } smb_dirListPatch_t;
397 /* dirListPatch Flags */
398 #define SMB_DIRLISTPATCH_DOTFILE 1
399 /* the file referenced is a dot file
400 * Note: will not be set if smb_hideDotFiles is false
403 /* waiting lock list elements */
404 typedef struct smb_waitingLock {
409 time_t timeRemaining;
413 extern smb_waitingLock_t *smb_allWaitingLocks;
415 typedef long (smb_proc_t)(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp);
417 typedef struct smb_dispatch {
418 smb_proc_t *procp; /* proc to call */
419 int flags; /* flags describing function */
422 #define SMB_DISPATCHFLAG_CHAINED 1 /* this is an _AND_X function */
423 #define SMB_DISPATCHFLAG_NORESPONSE 2 /* don't send the response
424 * packet, typically because
425 * the response was already
428 #define SMB_MAX_PATH 256 /* max path length */
432 extern void smb_Init(osi_log_t *logp, char *smbNamep, int useV3, int LANadapt,
439 extern void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, time_t unixTime);
441 extern void smb_UnixTimeFromLargeSearchTime(time_t *unixTimep, FILETIME *largeTimep);
443 extern void smb_SearchTimeFromUnixTime(time_t *dosTimep, time_t unixTime);
445 extern void smb_UnixTimeFromSearchTime(time_t *unixTimep, time_t searchTime);
447 extern void smb_DosUTimeFromUnixTime(time_t *dosUTimep, time_t unixTime);
449 extern void smb_UnixTimeFromDosUTime(time_t *unixTimep, time_t dosUTime);
451 extern smb_vc_t *smb_FindVC(unsigned short lsn, int flags, int lana);
453 extern void smb_ReleaseVC(smb_vc_t *vcp);
455 extern void smb_ReleaseVCNoLock(smb_vc_t *vcp);
457 extern smb_tid_t *smb_FindTID(smb_vc_t *vcp, unsigned short tid, int flags);
459 extern void smb_ReleaseTID(smb_tid_t *tidp);
461 extern smb_user_t *smb_FindUID(smb_vc_t *vcp, unsigned short uid, int flags);
463 extern smb_username_t *smb_FindUserByName(char *usern, char *machine, int flags);
465 extern smb_user_t *smb_FindUserByNameThisSession(smb_vc_t *vcp, char *usern);
467 extern smb_username_t *smb_FindUserByName(char *usern, char *machine, int flags);
469 extern smb_user_t *smb_FindUserByNameThisSession(smb_vc_t *vcp, char *usern);
471 extern void smb_ReleaseUID(smb_user_t *uidp);
473 extern cm_user_t *smb_GetUser(smb_vc_t *vcp, smb_packet_t *inp);
475 extern long smb_LookupTIDPath(smb_vc_t *vcp, unsigned short tid, char ** tidPathp);
477 extern smb_fid_t *smb_FindFID(smb_vc_t *vcp, unsigned short fid, int flags);
479 extern void smb_ReleaseFID(smb_fid_t *fidp);
481 extern int smb_FindShare(smb_vc_t *vcp, smb_user_t *uidp, char *shareName, char **pathNamep);
483 extern int smb_FindShareCSCPolicy(char *shareName);
485 extern smb_dirSearch_t *smb_FindDirSearchNL(long cookie);
487 extern void smb_DeleteDirSearch(smb_dirSearch_t *dsp);
489 extern void smb_ReleaseDirSearch(smb_dirSearch_t *dsp);
491 extern smb_dirSearch_t *smb_FindDirSearch(long cookie);
493 extern smb_dirSearch_t *smb_NewDirSearch(int isV3);
495 extern smb_packet_t *smb_CopyPacket(smb_packet_t *packetp);
497 extern void smb_FreePacket(smb_packet_t *packetp);
499 extern unsigned char *smb_GetSMBData(smb_packet_t *smbp, int *nbytesp);
501 extern void smb_SetSMBDataLength(smb_packet_t *smbp, unsigned int dsize);
503 extern unsigned int smb_GetSMBParm(smb_packet_t *smbp, int parm);
505 extern unsigned int smb_GetSMBOffsetParm(smb_packet_t *smbp, int parm, int offset);
507 extern void smb_SetSMBParm(smb_packet_t *smbp, int slot, unsigned int parmValue);
509 extern void smb_SetSMBParmLong(smb_packet_t *smbp, int slot, unsigned int parmValue);
511 extern void smb_SetSMBParmDouble(smb_packet_t *smbp, int slot, char *parmValuep);
513 extern void smb_SetSMBParmByte(smb_packet_t *smbp, int slot, unsigned int parmValue);
515 extern void smb_StripLastComponent(char *outPathp, char **lastComponentp,
518 extern unsigned char *smb_ParseASCIIBlock(unsigned char *inp, char **chainpp);
520 extern unsigned char *smb_ParseVblBlock(unsigned char *inp, char **chainpp,
523 extern smb_packet_t *smb_GetResponsePacket(smb_vc_t *vcp, smb_packet_t *inp);
525 extern void smb_SendPacket(smb_vc_t *vcp, smb_packet_t *inp);
527 extern void smb_MapCoreError(long code, smb_vc_t *vcp, unsigned short *scodep,
528 unsigned char *classp);
530 extern void smb_MapNTError(long code, unsigned long *NTStatusp);
532 extern void smb_HoldVC(smb_vc_t *vcp);
534 extern void smb_HoldVCNoLock(smb_vc_t *vcp);
536 /* some globals, too */
537 extern char *smb_localNamep;
538 extern int loggedOut;
539 extern time_t loggedOutTime;
540 extern char *loggedOutName;
541 extern smb_user_t *loggedOutUserp;
543 extern osi_log_t *smb_logp;
545 extern osi_rwlock_t smb_globalLock;
547 extern osi_rwlock_t smb_rctLock;
549 extern int smb_LogoffTokenTransfer;
550 extern time_t smb_LogoffTransferTimeout;
552 extern int smb_maxVCPerServer; /* max # of VCs per server */
553 extern int smb_maxMpxRequests; /* max # of mpx requests */
555 extern int smb_StoreAnsiFilenames;
556 extern int smb_hideDotFiles;
557 extern unsigned int smb_IsDotFile(char *lastComp);
559 /* the following are used for smb auth */
560 extern int smb_authType; /* Type of SMB authentication to be used. One from below. */
562 #define SMB_AUTH_NONE 0
563 #define SMB_AUTH_NTLM 1
564 #define SMB_AUTH_EXTENDED 2
566 extern HANDLE smb_lsaHandle; /* LSA handle obtained during smb_init if using SMB auth */
567 extern ULONG smb_lsaSecPackage; /* LSA security package id. Set during smb_init */
568 extern char smb_ServerDomainName[];
569 extern int smb_ServerDomainNameLength;
570 extern char smb_ServerOS[];
571 extern int smb_ServerOSLength;
572 extern char smb_ServerLanManager[];
573 extern int smb_ServerLanManagerLength;
574 extern GUID smb_ServerGUID;
575 extern LSA_STRING smb_lsaLogonOrigin;
577 /* used for getting a challenge for SMB auth */
578 typedef struct _MSV1_0_LM20_CHALLENGE_REQUEST {
579 MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
580 } MSV1_0_LM20_CHALLENGE_REQUEST, *PMSV1_0_LM20_CHALLENGE_REQUEST;
582 typedef struct _MSV1_0_LM20_CHALLENGE_RESPONSE {
583 MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
584 UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
585 } MSV1_0_LM20_CHALLENGE_RESPONSE, *PMSV1_0_LM20_CHALLENGE_RESPONSE;
588 extern long smb_AuthenticateUserLM(smb_vc_t *vcp, char * accountName, char * primaryDomain, char * ciPwd, unsigned ciPwdLength, char * csPwd, unsigned csPwdLength);
590 extern long smb_GetNormalizedUsername(char * usern, const char * accountName, const char * domainName);
592 extern void smb_FormatResponsePacket(smb_vc_t *vcp, smb_packet_t *inp,
595 extern char *myCrt_Dispatch(int i);
597 extern char *myCrt_2Dispatch(int i);
599 extern char *myCrt_RapDispatch(int i);
601 extern unsigned int smb_Attributes(cm_scache_t *scp);
603 extern int smb_ChainFID(int fid, smb_packet_t *inp);
605 extern smb_fid_t *smb_FindFID(smb_vc_t *vcp, unsigned short fid, int flags);
607 extern void smb_ReleaseFID(smb_fid_t *fidp);
609 extern unsigned char *smb_ParseDataBlock(unsigned char *inp, char **chainpp, int *lengthp);
611 extern unsigned char *smb_ParseASCIIBlock(unsigned char *inp, char **chainpp);
613 extern unsigned char *smb_ParseVblBlock(unsigned char *inp, char **chainpp, int *lengthp);
615 extern int smb_SUser(cm_user_t *userp);
618 extern long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count,
619 char *op, cm_user_t *userp, long *readp);
621 extern long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count,
622 char *op, cm_user_t *userp, long *readp, int dosflag);
625 extern long smb_Rename(smb_vc_t *vcp, smb_packet_t *inp, char *oldPathp, char *newPathp, int attrs);
627 extern long smb_Link(smb_vc_t *vcp, smb_packet_t *inp, char *oldPathp, char *newPathp);
629 extern BOOL smb_IsLegalFilename(char *filename);
631 extern char *smb_GetSharename(void);
633 extern DWORD smb_ServerExceptionFilter(void);
635 /* include other include files */
637 #include "smb_ioctl.h"
638 #include "smb_iocons.h"
640 cm_user_t *smb_FindOrCreateUser(smb_vc_t *vcp, char *usern);
643 extern void smb_LogPacket(smb_packet_t *packet);
644 #endif /* NOTSERVICE */
645 #endif /* whole file */