2 Unix SMB/CIFS implementation.
4 Copyright (C) Andrew Tridgell 1994-1998
5 Copyright (C) Jeremy Allison 2001-2002
6 Copyright (C) James Myers 2003
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.
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.
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/>.
23 #include "system/filesys.h"
24 #include "smb_constants.h"
26 #include "libcli/util/ntstatus.h"
31 const char *smb_protocol_types_string(enum protocol_types protocol
);
32 char *attrib_string(TALLOC_CTX
*mem_ctx
, uint32_t attrib
);
33 uint32_t unix_perms_to_wire(mode_t perms
);
34 mode_t
wire_perms_to_unix(uint32_t perms
);
35 mode_t
wire_filetype_to_unix(uint32_t wire_type
);
36 uint32_t unix_filetype_to_wire(mode_t mode
);
37 mode_t
wire_mode_to_unix(uint32_t wire
);
38 uint32_t unix_mode_to_wire(mode_t mode
);
40 bool smb_buffer_oob(uint32_t bufsize
, uint32_t offset
, uint32_t length
);
42 uint8_t *smb_bytes_push_str(uint8_t *buf
, bool ucs2
,
43 const char *str
, size_t str_len
,
44 size_t *pconverted_size
);
45 uint8_t *smb_bytes_push_bytes(uint8_t *buf
, uint8_t prefix
,
46 const uint8_t *bytes
, size_t num_bytes
);
47 uint8_t *trans2_bytes_push_str(uint8_t *buf
, bool ucs2
,
48 const char *str
, size_t str_len
,
49 size_t *pconverted_size
);
50 uint8_t *trans2_bytes_push_bytes(uint8_t *buf
,
51 const uint8_t *bytes
, size_t num_bytes
);
52 NTSTATUS
smb_bytes_pull_str(TALLOC_CTX
*mem_ctx
, char **_str
, bool ucs2
,
53 const uint8_t *buf
, size_t buf_len
,
54 const uint8_t *position
,
57 enum smb_signing_setting
smb_signing_setting_translate(const char *str
);
58 enum smb_encryption_setting
smb_encryption_setting_translate(const char *str
);
60 #endif /* _SMB_UTIL_H */