windows-smb-started-synchronization-20080108
[openafs.git] / src / WINNT / afsd / smb.h
index b140539..f8f8980 100644 (file)
 #ifndef __SMB_H_ENV__
 #define __SMB_H_ENV__ 1
 
+#if _WIN32_WINNT < 0x0501
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0501
+#endif
 #include <ntsecapi.h>
 
 /* Support largefiles by default */
@@ -315,7 +319,7 @@ typedef struct smb_ioctl {
     char *inDatap;                     /* ioctl func's current position
                                         * in input parameter block */
     char *inAllocp;                    /* allocated input parameter block */
-    long inCopied;                     /* # of input bytes copied in so far
+    afs_uint32 inCopied;                       /* # of input bytes copied in so far
                                         * by write calls */
     cm_space_t *prefix;                        /* prefix for subst drives */
     char *tidPathp;                    /* Pathname associated with Tree ID */
@@ -323,11 +327,11 @@ typedef struct smb_ioctl {
     /* output side */
     char *outDatap;                    /* output results assembled so far */
     char *outAllocp;                   /* output results assembled so far */
-    long outCopied;                    /* # of output bytes copied back so far
+    afs_uint32 outCopied;              /* # of output bytes copied back so far
                                          * by read calls */
        
     /* flags */
-    long flags;
+    afs_uint32 flags;
 
     /* fid pointer */
     struct smb_fid *fidp;
@@ -370,7 +374,7 @@ typedef struct smb_fid {
     afs_uint32 delete;                 /* ok to del: locked by smb_rctLock */
 } smb_fid_t;
 
-#define SMB_FID_OPENREAD               1       /* open for reading */
+#define SMB_FID_OPENREAD_LISTDIR       1       /* open for reading / listing directory */
 #define SMB_FID_OPENWRITE              2       /* open for writing */
 #define SMB_FID_CREATED                 4       /* a new file */
 #define SMB_FID_IOCTL                  8       /* a file descriptor for the
@@ -385,6 +389,9 @@ typedef struct smb_fid {
 #define SMB_FID_MTIMESETDONE           0x80    /* have set modtime via Tr2 */
 #define SMB_FID_LOOKSLIKECOPY  (SMB_FID_LENGTHSETDONE | SMB_FID_MTIMESETDONE)
 #define SMB_FID_NTOPEN                 0x100   /* have dscp and pathp */
+#define SMB_FID_SEQUENTIAL             0x200
+#define SMB_FID_RANDOM                 0x400
+#define SMB_FID_EXECUTABLE              0x800
 
 #define SMB_FID_SHARE_READ              0x1000
 #define SMB_FID_SHARE_WRITE             0x2000
@@ -440,6 +447,8 @@ typedef struct smb_dirSearch {
                                         * locked by smb_globalLock */
     unsigned short attribute;          /* search attribute
                                         * (used for extended protocol) */
+    char tidPath[256];                  /* tid path */
+    char relPath[1024];                 /* relative path */        
     char mask[256];                    /* search mask for V3 */
 } smb_dirSearch_t;
 
@@ -504,11 +513,11 @@ typedef struct smb_dispatch {
                                                 * the response was already
                                                 * sent.
                                                  */
-#define SMB_MAX_PATH                    256     /* max path length */
+#define SMB_MAX_PATH                    260     /* max path length */
 
 /* prototypes */
 
-extern void smb_Init(osi_log_t *logp, char *smbNamep, int useV3, int LANadapt,
+extern void smb_Init(osi_log_t *logp, int useV3,
        int nThreads
         , void *aMBfunc
   );
@@ -592,7 +601,9 @@ extern unsigned char *smb_GetSMBData(smb_packet_t *smbp, int *nbytesp);
 
 extern void smb_SetSMBDataLength(smb_packet_t *smbp, unsigned int dsize);
 
-extern unsigned int smb_GetSMBParm(smb_packet_t *smbp, int parm);
+extern unsigned short smb_GetSMBParm(smb_packet_t *smbp, int parm);
+
+extern unsigned char smb_GetSMBParmByte(smb_packet_t *smbp, int parm);
 
 extern unsigned int smb_GetSMBParmLong(smb_packet_t *smbp, int parm);
 
@@ -719,6 +730,17 @@ extern DWORD smb_ServerExceptionFilter(void);
 extern void smb_UpdateServerPriority(void);
 extern void smb_SetRequestStartTime(void);
 extern void smb_ResetServerPriority(void);
+extern void smb_RestartListeners(int);
+extern void smb_StopListeners(int);
+extern void smb_StopListener(NCB *ncbp, int lana);
+extern long smb_IsNetworkStarted(void);
+extern void smb_LanAdapterChange(int);
+extern void smb_SetLanAdapterChangeDetected(void);
+
+
+#define SMB_LISTENER_UNINITIALIZED -1
+#define SMB_LISTENER_STOPPED 0
+#define SMB_LISTENER_STARTED 1
 
 /* include other include files */
 #include "smb3.h"