2 * Unix SMB/CIFS implementation.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef __LIBCLI_SMB_REPARSE_H__
19 #define __LIBCLI_SMB_REPARSE_H__
23 #include "libcli/util/ntstatus.h"
25 struct symlink_reparse_struct
{
26 uint16_t unparsed_path_length
; /* reserved for the reparse point */
27 char *substitute_name
;
32 struct nfs_reparse_data_buffer
{
36 char *lnk_target
; /* NFS_SPECFILE_LNK */
40 } dev
; /* NFS_SPECFILE_[CHR|BLK] */
42 /* NFS_SPECFILE_[FIFO|SOCK] have no data */
46 struct reparse_data_buffer
{
50 /* IO_REPARSE_TAG_NFS */
51 struct nfs_reparse_data_buffer nfs
;
53 /* IO_REPARSE_TAG_SYMLINK */
54 struct symlink_reparse_struct lnk
;
56 /* Unknown reparse tag */
66 NTSTATUS
reparse_buffer_check(const uint8_t *in_data
,
68 uint32_t *reparse_tag
,
69 const uint8_t **_reparse_data
,
70 size_t *_reparse_data_length
);
71 NTSTATUS
reparse_data_buffer_parse(TALLOC_CTX
*mem_ctx
,
72 struct reparse_data_buffer
*dst
,
75 char *reparse_data_buffer_str(TALLOC_CTX
*mem_ctx
,
76 const struct reparse_data_buffer
*dst
);
78 ssize_t
reparse_data_buffer_marshall(const struct reparse_data_buffer
*src
,
82 int symlink_target_path(TALLOC_CTX
*ctx
,
85 const char *substitute
,