s3-libnet: avoid using lp_dns_hostname() in join code
[samba4-gss.git] / libcli / smb / reparse.h
blob78c55ca324550d5f1897104fd10705a01dd88313
1 /*
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__
21 #include <talloc.h>
22 #include "replace.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;
28 char *print_name;
29 uint32_t flags;
32 struct nfs_reparse_data_buffer {
33 uint64_t type;
35 union {
36 char *lnk_target; /* NFS_SPECFILE_LNK */
37 struct {
38 uint32_t major;
39 uint32_t minor;
40 } dev; /* NFS_SPECFILE_[CHR|BLK] */
42 /* NFS_SPECFILE_[FIFO|SOCK] have no data */
43 } data;
46 struct reparse_data_buffer {
47 uint32_t tag;
49 union {
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 */
57 struct {
58 uint16_t length;
59 uint16_t reserved;
60 uint8_t *data;
61 } raw;
63 } parsed;
66 NTSTATUS reparse_buffer_check(const uint8_t *in_data,
67 size_t in_len,
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,
73 const uint8_t *buf,
74 size_t buflen);
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,
79 uint8_t *buf,
80 size_t buflen);
82 int symlink_target_path(TALLOC_CTX *ctx,
83 const char *_name_in,
84 size_t num_unparsed,
85 const char *substitute,
86 bool relative,
87 char separator,
88 char **_target);
90 #endif