libcli/smb: add SMB3_DIALECT_REVISION_310 define
[sfrench/samba-autobuild/.git] / libcli / smb / tstream_smbXcli_np.h
1 /*
2    Unix SMB/CIFS implementation.
3
4    Copyright (C) Stefan Metzmacher 2010
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef _CLI_NP_TSTREAM_H_
21 #define _CLI_NP_TSTREAM_H_
22
23 struct tevent_context;
24 struct tevent_req;
25 struct tstream_context;
26 struct smbXcli_conn;
27 struct smbXcli_session;
28 struct smbXcli_tcon;
29
30 struct tevent_req *tstream_smbXcli_np_open_send(TALLOC_CTX *mem_ctx,
31                                                 struct tevent_context *ev,
32                                                 struct smbXcli_conn *conn,
33                                                 struct smbXcli_session *session,
34                                                 struct smbXcli_tcon *tcon,
35                                                 uint16_t pid,
36                                                 unsigned int timeout,
37                                                 const char *npipe);
38 NTSTATUS _tstream_smbXcli_np_open_recv(struct tevent_req *req,
39                                        TALLOC_CTX *mem_ctx,
40                                        struct tstream_context **_stream,
41                                        const char *location);
42 #define tstream_smbXcli_np_open_recv(req, mem_ctx, stream) \
43                 _tstream_smbXcli_np_open_recv(req, mem_ctx, stream, __location__)
44
45 bool tstream_is_smbXcli_np(struct tstream_context *stream);
46
47 NTSTATUS tstream_smbXcli_np_use_trans(struct tstream_context *stream);
48
49 unsigned int tstream_smbXcli_np_set_timeout(struct tstream_context *stream,
50                                             unsigned int timeout);
51
52 /*
53  * Windows uses 4280 (the max xmit/recv size negotiated on DCERPC).
54  * This is fits into the max_xmit negotiated at the SMB layer.
55  *
56  * On the sending side they may use SMBtranss if the request does not
57  * fit into a single SMBtrans call.
58  *
59  * Windows uses 1024 as max data size of a SMBtrans request and then
60  * possibly reads the rest of the DCERPC fragment (up to 3256 bytes)
61  * via a SMBreadX.
62  *
63  * For now we just ask for the full 4280 bytes (max data size) in the SMBtrans
64  * request to get the whole fragment at once (like samba 3.5.x and below did.
65  *
66  * It is important that we use do SMBwriteX with the size of a full fragment,
67  * otherwise we may get NT_STATUS_PIPE_BUSY on the SMBtrans request
68  * from NT4 servers. (See bug #8195)
69  */
70 #define TSTREAM_SMBXCLI_NP_MAX_BUF_SIZE 4280
71
72 #endif /*  _CLI_NP_TSTREAM_H_ */