4 Unix SMB/CIFS implementation.
5 SMB parameters and setup
6 Copyright (C) Andrew Tridgell 2003
7 Copyright (C) James Myers 2003 <myersjj@samba.org>
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "libcli/raw/signing.h"
25 #define BUFINFO_FLAG_UNICODE 0x0001
26 #define BUFINFO_FLAG_SMB2 0x0002
29 buffer limit structure used by both SMB and SMB2
31 struct request_bufinfo
{
34 const uint8_t *align_base
;
40 Shared state structure between client and server, representing the basic packet.
43 struct smb_request_buffer
{
44 /* the raw SMB buffer, including the 4 byte length header */
47 /* the size of the raw buffer, including 4 byte header */
50 /* how much has been allocated - on reply the buffer is over-allocated to
51 prevent too many realloc() calls
55 /* the start of the SMB header - this is always buffer+4 */
58 /* the command words and command word count. vwv points
59 into the raw buffer */
63 /* the data buffer and size. data points into the raw buffer */
67 /* ptr is used as a moving pointer into the data area
68 * of the packet. The reason its here and not a local
69 * variable in each function is that when a realloc of
70 * a send packet is done we need to move this
74 /* this is used to range check and align strings and buffers */
75 struct request_bufinfo bufinfo
;