smbd: Make hdr a field of its own in smbd_smb2_send_oplock_break
[Samba.git] / libcli / smb / tstream_smbXcli_np.h
blobe8c5c39297a8df891bc6b4aa3cc7bd360639af52
1 /*
2 Unix SMB/CIFS implementation.
4 Copyright (C) Stefan Metzmacher 2010
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.
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.
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/>.
20 #ifndef _CLI_NP_TSTREAM_H_
21 #define _CLI_NP_TSTREAM_H_
23 struct tevent_context;
24 struct tevent_req;
25 struct tstream_context;
26 struct smbXcli_conn;
27 struct smbXcli_session;
28 struct smbXcli_tcon;
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__)
45 bool tstream_is_smbXcli_np(struct tstream_context *stream);
47 NTSTATUS tstream_smbXcli_np_use_trans(struct tstream_context *stream);
49 unsigned int tstream_smbXcli_np_set_timeout(struct tstream_context *stream,
50 unsigned int timeout);
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.
56 * On the sending side they may use SMBtranss if the request does not
57 * fit into a single SMBtrans call.
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.
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.
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)
70 #define TSTREAM_SMBXCLI_NP_MAX_BUF_SIZE 4280
72 #endif /* _CLI_NP_TSTREAM_H_ */