aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifspdu.h
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2006-05-31 18:40:51 -0400
committerSteve French <sfrench@us.ibm.com>2006-05-31 18:40:51 -0400
commit3979877e5606ecc58c5a31bd0078c6d80ba9cbe7 (patch)
treed221455b5176ea8b26e750d6498c3ed822998ba3 /fs/cifs/cifspdu.h
parent26a21b980b1897b11fd7f9ba4bf6060c9e15df10 (diff)
[CIFS] Support for setting up SMB sessions to legacy lanman servers
Diffstat (limited to 'fs/cifs/cifspdu.h')
-rw-r--r--fs/cifs/cifspdu.h37
1 files changed, 31 insertions, 6 deletions
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h
index b2233ac05bd2..e0ff9b56cc4c 100644
--- a/fs/cifs/cifspdu.h
+++ b/fs/cifs/cifspdu.h
@@ -16,7 +16,7 @@
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public License 17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library; if not, write to the Free Software 18 * along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21 21
22#ifndef _CIFSPDU_H 22#ifndef _CIFSPDU_H
@@ -24,8 +24,14 @@
24 24
25#include <net/sock.h> 25#include <net/sock.h>
26 26
27#ifdef CONFIG_CIFS_WEAK_PW_HASH
28#define LANMAN_PROT 0
29#define CIFS_PROT 1
30#else
27#define CIFS_PROT 0 31#define CIFS_PROT 0
28#define BAD_PROT CIFS_PROT+1 32#endif
33#define POSIX_PROT CIFS_PROT+1
34#define BAD_PROT 0xFFFF
29 35
30/* SMB command codes */ 36/* SMB command codes */
31/* Some commands have minimal (wct=0,bcc=0), or uninteresting, responses 37/* Some commands have minimal (wct=0,bcc=0), or uninteresting, responses
@@ -400,6 +406,25 @@ typedef struct negotiate_req {
400 unsigned char DialectsArray[1]; 406 unsigned char DialectsArray[1];
401} __attribute__((packed)) NEGOTIATE_REQ; 407} __attribute__((packed)) NEGOTIATE_REQ;
402 408
409/* Dialect index is 13 for LANMAN */
410
411typedef struct lanman_neg_rsp {
412 struct smb_hdr hdr; /* wct = 13 */
413 __le16 DialectIndex;
414 __le16 SecurityMode;
415 __le16 MaxBufSize;
416 __le16 MaxMpxCount;
417 __le16 MaxNumberVcs;
418 __le16 RawMode;
419 __le32 SessionKey;
420 __le32 ServerTime;
421 __le16 ServerTimeZone;
422 __le16 EncryptionKeyLength;
423 __le16 Reserved;
424 __u16 ByteCount;
425 unsigned char EncryptionKey[1];
426} __attribute__((packed)) LANMAN_NEG_RSP;
427
403typedef struct negotiate_rsp { 428typedef struct negotiate_rsp {
404 struct smb_hdr hdr; /* wct = 17 */ 429 struct smb_hdr hdr; /* wct = 17 */
405 __le16 DialectIndex; 430 __le16 DialectIndex;
@@ -520,8 +545,8 @@ typedef union smb_com_session_setup_andx {
520 __le16 MaxMpxCount; 545 __le16 MaxMpxCount;
521 __le16 VcNumber; 546 __le16 VcNumber;
522 __u32 SessionKey; 547 __u32 SessionKey;
523 __le16 PassswordLength; 548 __le16 PasswordLength;
524 __u32 Reserved; 549 __u32 Reserved; /* encrypt key len and offset */
525 __le16 ByteCount; 550 __le16 ByteCount;
526 unsigned char AccountPassword[1]; /* followed by */ 551 unsigned char AccountPassword[1]; /* followed by */
527 /* STRING AccountName */ 552 /* STRING AccountName */
@@ -1844,13 +1869,13 @@ typedef struct {
1844typedef struct { 1869typedef struct {
1845 __le32 DeviceType; 1870 __le32 DeviceType;
1846 __le32 DeviceCharacteristics; 1871 __le32 DeviceCharacteristics;
1847} __attribute__((packed)) FILE_SYSTEM_DEVICE_INFO; /* device info, level 0x104 */ 1872} __attribute__((packed)) FILE_SYSTEM_DEVICE_INFO; /* device info level 0x104 */
1848 1873
1849typedef struct { 1874typedef struct {
1850 __le32 Attributes; 1875 __le32 Attributes;
1851 __le32 MaxPathNameComponentLength; 1876 __le32 MaxPathNameComponentLength;
1852 __le32 FileSystemNameLen; 1877 __le32 FileSystemNameLen;
1853 char FileSystemName[52]; /* do not really need to save this - so potentially get only subset of name */ 1878 char FileSystemName[52]; /* do not have to save this - get subset? */
1854} __attribute__((packed)) FILE_SYSTEM_ATTRIBUTE_INFO; 1879} __attribute__((packed)) FILE_SYSTEM_ATTRIBUTE_INFO;
1855 1880
1856/******************************************************************************/ 1881/******************************************************************************/