CIFS - jak to działa
Negocjacja protokołu SMB
 
 
Uwierzytelnienie
Podłączenie pod zasób
typedef unsigned char UCHAR; // 8
unsigned bits 
typedef unsigned short USHORT; // 16
unsigned bits 
typedef unsigned long ULONG; // 32
unsigned bits 
typedef struct { 
   ULONG LowPart; 
      LONG
HighPart; } 
LARGE_INTEGER; // 64 bits of
data 
typedef struct { 
   UCHAR Protocol[4]; //
Contains 0xFF,'SMB' UCHAR 
   Command; // Command
code 
   union { 
      
struct { UCHAR ErrorClass; // Error class 
               
UCHAR Reserved; // Reserved for future use 
               
USHORT Error; // Error code 
      
} DosError; 
      
ULONG Status; // 32-bit error code 
   } Status; 
   UCHAR Flags; //
Flags 
   USHORT Flags2; // More
flags 
   
   union { 
     
USHORT Pad[6]; // Ensure section is 12 bytes long 
     
struct { USHORT PidHigh; // High part of PID 
              
UCHAR SecuritySignature[8]; // reserved for security 
      }
Extra; 
   }; 
   USHORT Tid; // Tree
identifier 
   USHORT Pid; // Caller's
process id 
   USHORT Uid; //
Unauthenticated user id 
   USHORT Mid; //
multiplex id 
   UCHAR WordCount; //
Count of parameter words 
   USHORT ParameterWords[
WordCount ]; // The parameter words 
   USHORT ByteCount; //
Count of bytes 
   UCHAR Buffer[ ByteCount
]; // The bytes 
} SMB_HEADER;
Cachowanie i lokowanie
| Level II oplock - wiele procesów korzysta, ale żaden jeszcze nie zmodyfikował - więc można czytać (plik i atrybuty) | |
| Exclusive oplock - Mamy pewność, że możemy działać na pliku jak chcemy - potem update servera) | |
Batch oplock - j.w. i można nawet zamykać i oktwierać  |