2 Unix SMB/CIFS implementation.
6 Copyright (C) Andrew Tridgell 2005
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 uint32_t unknown1; /* 0x00010024 */
27 uint16_t unknown2; /* 0x00 */
28 uint8_t unknown3[32]; /* all zero */
33 uint32_t unknown2; /* 0x06 */
35 uint32_t unknown3; /* 0x0d */
36 uint16_t unknown4; /* 0x00 */
37 uint32_t unknown5; /* 0x01 */
38 uint32_t unknown6; /* 0x01 */
39 uint16_t unknown7; /* 0x01 */
42 uint16_t unknown8; /* 0x80 */
43 /* uint16_t secblob size here */
44 uint32_t unknown9; /* 0x204d4c20 */
49 struct smb2_session_setup {
51 uint32_t unknown1; /* 0x11 */
52 uint32_t unknown2; /* 0xF */
53 uint32_t unknown3; /* 0x00 */
54 /* uint16_t secblob ofs/size here */
60 /* uint16_t secblob ofs/size here */
62 uint64_t uid; /* returned in header */
66 struct smb2_tree_connect {
68 uint32_t unknown1; /* 0x09 */
73 uint16_t unknown1; /* 0x02 */
74 uint32_t unknown2; /* 0x00 */
75 uint32_t unknown3; /* 0x00 */
82 file handles in SMB2 are 16 bytes
89 #define SMB2_CREATE_FLAG_REQUEST_OPLOCK 0x0100
90 #define SMB2_CREATE_FLAG_REQUEST_EXCLUSIVE_OPLOCK 0x0800
91 #define SMB2_CREATE_FLAG_GRANT_OPLOCK 0x0001
92 #define SMB2_CREATE_FLAG_GRANT_EXCLUSIVE_OPLOCK 0x0080
96 uint16_t buffer_code; /* 0x39 */
97 uint16_t oplock_flags; /* SMB2_CREATE_FLAG_* */
100 uint32_t access_mask;
102 uint32_t share_access;
103 uint32_t open_disposition;
104 uint32_t create_options;
105 /* ofs/len of name here, 16 bits */
116 uint16_t buffer_code; /* 0x59 */
117 uint16_t oplock_flags; /* SMB2_CREATE_FLAG_* */
118 uint32_t create_action;
127 struct smb2_handle handle;
134 #define SMB2_CLOSE_FLAGS_FULL_INFORMATION (1<<0)
138 uint16_t buffer_code;
139 uint16_t flags; /* SMB2_CLOSE_FLAGS_* */
141 struct smb2_handle handle;
145 uint16_t buffer_code;
158 /* fs information levels */
159 #define SMB2_GETINFO_FS_01 0x0102
160 #define SMB2_GETINFO_FS_03 0x0302
161 #define SMB2_GETINFO_FS_04 0x0402
162 #define SMB2_GETINFO_FS_ATTRIB_INFO 0x0502
163 #define SMB2_GETINFO_FS_06 0x0602
164 #define SMB2_GETINFO_FS_07 0x0702
165 #define SMB2_GETINFO_FS_08 0x0802
168 #define SMB2_GETINFO_3_00 0x0003
170 /* file information levels */
171 #define SMB2_GETINFO_FILE_BASIC_INFO 0x0401
172 #define SMB2_GETINFO_FILE_SIZE_INFO 0x0501
173 #define SMB2_GETINFO_FILE_06 0x0601
174 #define SMB2_GETINFO_FILE_EA_SIZE 0x0701
175 #define SMB2_GETINFO_FILE_ACCESS_INFO 0x0801
176 #define SMB2_GETINFO_FILE_0E 0x0e01
177 #define SMB2_GETINFO_FILE_EA_INFO 0x0f01
178 #define SMB2_GETINFO_FILE_10 0x1001
179 #define SMB2_GETINFO_FILE_11 0x1101
180 #define SMB2_GETINFO_FILE_ALL_INFO 0x1201
181 #define SMB2_GETINFO_FILE_SHORT_INFO 0x1501
182 #define SMB2_GETINFO_FILE_STREAM_INFO 0x1601
183 #define SMB2_GETINFO_FILE_EOF_INFO 0x1c01
184 #define SMB2_GETINFO_FILE_STANDARD_INFO 0x2201
185 #define SMB2_GETINFO_FILE_ATTRIB_INFO 0x2301
188 struct smb2_getinfo {
190 uint16_t buffer_code;
192 uint32_t max_response_size;
197 struct smb2_handle handle;
201 uint16_t buffer_code;
206 union smb2_fileinfo {
233 uint32_t access_mask;
242 struct smb_ea_list all_eas;
246 uint32_t unknown; /* 2 */
267 uint32_t access_mask;
274 const char *short_name;
281 const char *stream_name;