318a634ac418bdf2fefc353cb9dc1fe3ffc78615
[jelmer/samba4-debian.git] / source / libcli / smb2 / smb2_calls.h
1 /* 
2    Unix SMB/CIFS implementation.
3
4    SMB2 client calls 
5
6    Copyright (C) Andrew Tridgell 2005
7    
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 3 of the License, or
11    (at your option) any later version.
12    
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.
17    
18    You should have received a copy of the GNU General Public License
19    along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #include "libcli/raw/interfaces.h"
23
24 struct smb2_negprot {
25         struct {
26                 /* static body buffer 38 (0x26) bytes */
27                 /* uint16_t buffer_code;  0x24 (why?) */
28                 uint16_t unknown1;    /* 0x0001 */
29                 uint8_t  unknown2[32]; /* all zero */
30                 uint16_t unknown3; /* 0x00000 */
31         } in;
32         struct {
33                 /* static body buffer 64 (0x40) bytes */
34                 /* uint16_t buffer_code;  0x41 = 0x40 + 1 */
35                 uint16_t _pad;
36                 uint32_t unknown2; /* 0x06 */
37                 uint8_t  sessid[16];
38                 uint32_t unknown3; /* 0x0d */
39                 uint16_t unknown4; /* 0x00 */
40                 uint32_t unknown5; /* 0x01 */
41                 uint32_t unknown6; /* 0x01 */
42                 uint16_t unknown7; /* 0x01 */
43                 NTTIME   current_time;
44                 NTTIME   boot_time;
45                 /* uint16_t secblob_ofs */
46                 /* uint16_t secblob_size */
47                 uint32_t unknown9; /* 0x204d4c20 */
48
49                 /* dynamic body buffer */
50                 DATA_BLOB secblob;
51         } out;
52 };
53
54 /* getinfo classes */
55 #define SMB2_GETINFO_FILE               0x01
56 #define SMB2_GETINFO_FS                 0x02
57 #define SMB2_GETINFO_SECURITY           0x03
58
59 /* NOTE! the getinfo fs and file levels exactly match up with the
60    'passthru' SMB levels, which are levels >= 1000. The SMB2 client
61    lib uses the names from the libcli/raw/ library */
62
63 struct smb2_getinfo {
64         struct {
65                 /* static body buffer 40 (0x28) bytes */
66                 /* uint16_t buffer_code;  0x29 = 0x28 + 1 (why???) */
67                 uint16_t level;
68                 uint32_t max_response_size;
69                 uint32_t unknown1;
70                 uint32_t unknown2;
71                 uint32_t flags; /* level specific */
72                 uint32_t flags2; /* used by all_eas level */
73                 union smb_handle file;
74         } in;
75
76         struct {
77                 /* static body buffer 8 (0x08) bytes */
78                 /* uint16_t buffer_code; 0x09 = 0x08 + 1 */
79                 /* uint16_t blob_ofs; */
80                 /* uint16_t blob_size; */
81
82                 /* dynamic body */
83                 DATA_BLOB blob;
84         } out;
85 };
86
87 struct smb2_setinfo {
88         struct {
89                 uint16_t level;
90                 uint32_t flags;
91                 union smb_handle file;
92                 DATA_BLOB blob;
93         } in;
94 };
95
96 struct cli_credentials;
97 struct event_context;
98 #include "libcli/smb2/smb2_proto.h"