root/include/linux/smb.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  *  smb.h
   3  *
   4  *  Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke
   5  *
   6  */
   7 
   8 #ifndef _LINUX_SMB_H
   9 #define _LINUX_SMB_H
  10 
  11 #define SMB_PORT 139
  12 #define SMB_MAXNAMELEN 255
  13 #define SMB_MAXPATHLEN 1024
  14 
  15 #define SMB_DEF_MAX_XMIT 32768
  16 
  17 /* Allocate max. 1 page */
  18 #define TRANS2_MAX_TRANSFER (4096-17)
  19 
  20 #include <asm/types.h>
  21 #ifdef __KERNEL__
  22 typedef u8  byte;
  23 typedef u16 word;
  24 typedef u32 dword;
  25 #else
  26 typedef unsigned char byte;
  27 typedef unsigned short word;
  28 typedef unsigned long dword;
  29 #endif
  30 
  31 /*
  32  * Set/Get values in SMB-byte order
  33  */
  34 #define ARCH i386
  35 #if (ARCH == i386)
  36 #define BVAL(p,off)      (*((byte  *)(((void *)p)+off)))
  37 #define WVAL(p,off)      (*((word  *)(((void *)p)+off)))
  38 #define DVAL(p,off)      (*((dword *)(((void *)p)+off)))
  39 #define BSET(p,off,new)  (*((byte  *)(((void *)p)+off))=(new))
  40 #define WSET(p,off,new)  (*((word  *)(((void *)p)+off))=(new))
  41 #define DSET(p,off,new)  (*((dword *)(((void *)p)+off))=(new))
  42 
  43 /* where to find the base of the SMB packet proper */
  44 #define smb_base(buf) ((byte *)(((byte *)(buf))+4))
  45 
  46 #else
  47 #error "Currently only on 386, sorry"
  48 #endif
  49 
  50 
  51 #define LANMAN1
  52 #define LANMAN2
  53 
  54 enum smb_protocol { 
  55         PROTOCOL_NONE, 
  56         PROTOCOL_CORE, 
  57         PROTOCOL_COREPLUS, 
  58         PROTOCOL_LANMAN1, 
  59         PROTOCOL_LANMAN2, 
  60         PROTOCOL_NT1 
  61 };
  62 
  63 enum smb_case_hndl {
  64         CASE_DEFAULT,
  65         CASE_LOWER,
  66         CASE_UPPER
  67 };
  68 
  69 #ifdef __KERNEL__
  70 
  71 enum smb_conn_state {
  72         CONN_VALID,             /* everything's fine */
  73         CONN_INVALID,           /* Something went wrong, but did not
  74                                    try to reconnect yet. */
  75         CONN_RETRIED            /* Tried a reconnection, but was refused */
  76 };
  77 
  78 struct smb_dskattr {
  79         word total;
  80         word allocblocks;
  81         word blocksize;
  82         word free;
  83 };
  84 
  85 /*
  86  * Contains all relevant data on a SMB networked file.
  87  */
  88 struct smb_dirent {
  89         int             opened; /* is it open on the fileserver? */
  90         word            fileid; /* What id to handle a file with? */
  91         word            attr;   /* Attribute fields, DOS value */
  92 
  93         time_t atime, mtime,    /* Times, as seen by the server, normalized */
  94                ctime;           /* to UTC. The ugly conversion happens in */
  95                                 /* proc.c */
  96 
  97         unsigned long   size;   /* File size. */
  98         unsigned short  access; /* Access bits. */
  99         unsigned long   f_pos;  /* File position. (For readdir.) */
 100         char*           path;   /* Complete path, MS-DOS notation, with '\' */
 101         int             len;    /* Namelength. */
 102 };
 103 
 104 #endif  /* __KERNEL__ */
 105 #endif  /* _LINUX_SMB_H */
 106 
 107 
 108 /*
 109  * Overrides for Emacs so that we follow Linus's tabbing style.
 110  * Emacs will notice this stuff at the end of the file and automatically
 111  * adjust the settings for this buffer only.  This must remain at the end
 112  * of the file.
 113  * ---------------------------------------------------------------------------
 114  * Local variables:
 115  * c-indent-level: 8
 116  * c-brace-imaginary-offset: 0
 117  * c-brace-offset: -8
 118  * c-argdecl-indent: 8
 119  * c-label-offset: -8
 120  * c-continued-statement-offset: 8
 121  * c-continued-brace-offset: 0
 122  * End:
 123  */

/* [previous][next][first][last][top][bottom][index][help] */