1
2
3
4
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
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
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
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 #define NT1
54
55 enum smb_protocol {
56 PROTOCOL_NONE,
57 PROTOCOL_CORE,
58 PROTOCOL_COREPLUS,
59 PROTOCOL_LANMAN1,
60 PROTOCOL_LANMAN2,
61 PROTOCOL_NT1
62 };
63
64 enum smb_case_hndl {
65 CASE_DEFAULT,
66 CASE_LOWER,
67 CASE_UPPER
68 };
69
70 #ifdef __KERNEL__
71
72 enum smb_conn_state {
73 CONN_VALID,
74 CONN_INVALID,
75
76 CONN_RETRIED
77 };
78
79 struct smb_dskattr {
80 word total;
81 word allocblocks;
82 word blocksize;
83 word free;
84 };
85
86
87
88
89 struct smb_dirent {
90 int opened;
91 word fileid;
92 word attr;
93
94 time_t atime, mtime,
95 ctime;
96
97
98 unsigned long size;
99 unsigned short access;
100 unsigned long f_pos;
101 char* path;
102 int len;
103 };
104
105 #endif
106 #endif
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124