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
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,
73 CONN_INVALID,
74
75 CONN_RETRIED
76 };
77
78 struct smb_dskattr {
79 word total;
80 word allocblocks;
81 word blocksize;
82 word free;
83 };
84
85
86
87
88 struct smb_dirent {
89 int opened;
90 word fileid;
91 word attr;
92
93 time_t atime, mtime,
94 ctime;
95
96
97 unsigned long size;
98 unsigned short access;
99 unsigned long f_pos;
100 char* path;
101 int len;
102 };
103
104 #endif
105 #endif
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123