use the generic smb_handle in smb2_getinfo/smb2_setinfo
[samba-svnmirror.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 2 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, write to the Free Software
20    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23 #include "libcli/raw/interfaces.h"
24
25 struct smb2_negprot {
26         struct {
27                 /* static body buffer 38 (0x26) bytes */
28                 /* uint16_t buffer_code;  0x24 (why?) */
29                 uint16_t unknown1;    /* 0x0001 */
30                 uint8_t  unknown2[32]; /* all zero */
31                 uint16_t unknown3; /* 0x00000 */
32         } in;
33         struct {
34                 /* static body buffer 64 (0x40) bytes */
35                 /* uint16_t buffer_code;  0x41 = 0x40 + 1 */
36                 uint16_t _pad;
37                 uint32_t unknown2; /* 0x06 */
38                 uint8_t  sessid[16];
39                 uint32_t unknown3; /* 0x0d */
40                 uint16_t unknown4; /* 0x00 */
41                 uint32_t unknown5; /* 0x01 */
42                 uint32_t unknown6; /* 0x01 */
43                 uint16_t unknown7; /* 0x01 */
44                 NTTIME   current_time;
45                 NTTIME   boot_time;
46                 /* uint16_t secblob_ofs */
47                 /* uint16_t secblob_size */
48                 uint32_t unknown9; /* 0x204d4c20 */
49
50                 /* dynamic body buffer */
51                 DATA_BLOB secblob;
52         } out;
53 };
54
55 /* getinfo classes */
56 #define SMB2_GETINFO_FILE               0x01
57 #define SMB2_GETINFO_FS                 0x02
58 #define SMB2_GETINFO_SECURITY           0x03
59
60 /* flags for RAW_FILEINFO_SMB2_ALL_EAS */
61 #define SMB2_CONTINUE_FLAG_RESTART    0x01
62 #define SMB2_CONTINUE_FLAG_SINGLE     0x02
63
64 /* NOTE! the getinfo fs and file levels exactly match up with the
65    'passthru' SMB levels, which are levels >= 1000. The SMB2 client
66    lib uses the names from the libcli/raw/ library */
67
68 struct smb2_getinfo {
69         struct {
70                 /* static body buffer 40 (0x28) bytes */
71                 /* uint16_t buffer_code;  0x29 = 0x28 + 1 (why???) */
72                 uint16_t level;
73                 uint32_t max_response_size;
74                 uint32_t unknown1;
75                 uint32_t unknown2;
76                 uint32_t flags; /* level specific */
77                 uint32_t flags2; /* used by all_eas level */
78                 union smb_handle file;
79         } in;
80
81         struct {
82                 /* static body buffer 8 (0x08) bytes */
83                 /* uint16_t buffer_code; 0x09 = 0x08 + 1 */
84                 /* uint16_t blob_ofs; */
85                 /* uint16_t blob_size; */
86
87                 /* dynamic body */
88                 DATA_BLOB blob;
89         } out;
90 };
91
92 struct smb2_setinfo {
93         struct {
94                 uint16_t level;
95                 uint32_t flags;
96                 union smb_handle file;
97                 DATA_BLOB blob;
98         } in;
99 };
100
101 struct cli_credentials;
102 struct event_context;
103 #include "libcli/smb2/smb2_proto.h"