1/*
2 * Copyright (c) 2011 - 2012 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _SMBFS_SMBFS_SUBR_2_H_
25#define _SMBFS_SMBFS_SUBR_2_H_
26
27/* Helper functions */
28int smb_fphelp(struct smbmount *smp, struct mbchain *mbp, struct smbnode *np,
29               int usingUnicode, size_t *lenp);
30int smb2fs_fullpath(struct mbchain *mbp, struct smbnode *dnp,
31                    const char *namep, size_t name_len,
32                    const char *strm_namep, size_t strm_name_len,
33                    int name_flags, uint8_t sep_char);
34void smb2fs_smb_file_id_check(struct smb_share *share, uint64_t ino,
35                              char *network_name, uint32_t network_name_len);
36uint64_t smb2fs_smb_file_id_get(struct smbmount *smp, uint64_t ino, char *name);
37
38
39int smb2fs_smb_cmpd_check_copyfile(struct smb_share *share,
40                                   struct smbnode *create_np,
41                                   vfs_context_t context);
42int smb2fs_smb_cmpd_create(struct smb_share *share, struct smbnode *np,
43                           const char *namep, size_t name_len,
44                           const char *strm_namep, size_t strm_name_len,
45                           uint32_t desired_access, enum vtype vnode_type,
46                           uint32_t share_access, uint32_t disposition,
47                           uint64_t create_flags, uint32_t *ntstatus,
48                           SMBFID *fidp, struct smbfattr *fap,
49                           void *create_contextp, vfs_context_t context);
50int smbfs_smb_cmpd_create_read_close(struct smb_share *share, struct smbnode *dnp,
51                                   const char *namep, size_t name_len,
52                                   const char *snamep, size_t sname_len,
53                                   uio_t uio, size_t *sizep,
54                                   uint32_t *max_access,
55                                   vfs_context_t context);
56int smb2fs_smb_cmpd_create_write(struct smb_share *share, struct smbnode *dnp,
57                                 const char *namep, size_t name_len,
58                                 const char *snamep, size_t sname_len,
59                                 uint32_t desired_access, struct smbfattr *fap,
60                                 uint64_t create_flags, uio_t uio,
61                                 SMBFID *fidp, int ioflag,
62                                 vfs_context_t context);
63int smb2fs_smb_cmpd_query_dir_one(struct smb_share *share, struct smbnode *np,
64                                  const char *query_namep, size_t query_name_len,
65                                  struct smbfattr *fap, char **namep, size_t *name_lenp,
66                                  vfs_context_t context);
67int smb2fs_smb_cmpd_resolve_id(struct smb_share *share, struct smbnode *np,
68                               uint64_t ino, uint32_t *resolve_errorp, char **pathp,
69                               vfs_context_t context);
70
71int smb2fs_smb_change_notify(struct smb_share *share, uint32_t output_buffer_len,
72                             uint32_t completion_filter,
73                             void *fn_callback, void *fn_callback_args,
74                             vfs_context_t context);
75int smb2fs_smb_copyfile(struct smb_share *share, struct smbnode *src_np,
76                        struct smbnode *tdnp, const char *tnamep,
77                        size_t tname_len, vfs_context_t context);
78int smbfs_smb_create_reparse_symlink(struct smb_share *share, struct smbnode *dnp,
79                                     const char *namep, size_t name_len,
80                                     char *targetp, size_t target_len,
81                                     struct smbfattr *fap, vfs_context_t context);
82int smbfs_smb_close(struct smb_share *share, SMBFID fid,
83                    vfs_context_t context);
84int smbfs_smb_delete(struct smb_share *share, struct smbnode *np, enum vtype vnode_type,
85                     const char *name, size_t nmlen,
86                     int xattr, vfs_context_t context);
87int smbfs_smb_flush(struct smb_share *share, SMBFID fid,
88                    vfs_context_t context);
89int smb1fs_smb_findclose(struct smbfs_fctx *ctx, vfs_context_t context);
90int smbfs_smb_findclose(struct smbfs_fctx *ctx, vfs_context_t context);
91int smb1fs_smb_findnext(struct smbfs_fctx *ctx, vfs_context_t context);
92int smbfs_smb_findnext(struct smbfs_fctx *ctx, vfs_context_t context);
93int smbfs_smb_lock(struct smb_share *share, int op, SMBFID fid, uint32_t pid,
94                   off_t start, uint64_t len, uint32_t timo,
95                   vfs_context_t context);
96int smbfs_smb_markfordelete(struct smb_share *share, SMBFID fid,
97                            vfs_context_t context);
98int smbfs_smb_ntcreatex(struct smb_share *share, struct smbnode *np,
99                        uint32_t rights, uint32_t shareMode, enum vtype vt,
100                        SMBFID *fidp, const char *name, size_t in_nmlen,
101                        uint32_t disp, int xattr, struct smbfattr *fap,
102                        int do_create, struct smb2_durable_handle *dur_handlep,
103                        vfs_context_t context);
104int smbfs_smb_openread(struct smb_share *share, struct smbnode *np,
105                       SMBFID *fidp, uint32_t desired_access,
106                       uio_t uio, size_t *sizep, const char *stream_namep,
107                       struct timespec *mtimep, vfs_context_t context);
108void smbfs_smb_qfsattr(struct smbmount *smp, vfs_context_t context);
109int smb1fs_smb_qpathinfo(struct smb_share *share, struct smbnode *np,
110                         struct smbfattr *fap, short infolevel,
111                         const char **namep, size_t *nmlenp,
112                         vfs_context_t context);
113int smbfs_smb_qpathinfo(struct smb_share *share, struct smbnode *np, enum vtype vnode_type,
114                        struct smbfattr *fap, short infolevel,
115                        const char **namep, size_t *nmlenp,
116                        vfs_context_t context);
117int smbfs_smb_qstreaminfo(struct smb_share *share, struct smbnode *np, enum vtype vnode_type,
118                          const char *namep, size_t name_len,
119                          const char *stream_namep,
120                          uio_t uio, size_t *sizep,
121                          uint64_t *strmsize, uint64_t *strm_alloc_size,
122                          uint32_t *stream_flagsp, uint32_t *max_accessp,
123                          vfs_context_t context);
124int smbfs_smb_query_info(struct smb_share *share, struct smbnode *dnp, enum vtype vnode_type,
125                         const char *in_name, size_t len, uint32_t *attr,
126                         vfs_context_t context);
127int smbfs_smb_rename(struct smb_share *share, struct smbnode *src,
128                     struct smbnode *tdnp, const char *tname, size_t tnmlen,
129                     vfs_context_t context);
130int smbfs_smb_reparse_read_symlink(struct smb_share *share, struct smbnode *np,
131                                   struct uio *uiop, vfs_context_t context);
132int smbfs_smb_rmdir(struct smb_share *share, struct smbnode *np,
133                    vfs_context_t context);
134int smb2fs_smb_security_get(struct smb_share *share, struct smbnode *np,
135                            uint32_t desired_access, uint32_t security_attrs,
136                            struct ntsecdesc **resp, uint32_t *resp_len,
137                            vfs_context_t context);
138int smb2fs_smb_security_set(struct smb_share *share, struct smbnode *np,
139                            uint32_t desired_access,
140                            uint32_t security_attrs, uint16_t control_flags,
141                            struct ntsid *owner, struct ntsid *group,
142                            struct ntacl *sacl, struct ntacl *dacl,
143                            vfs_context_t context);
144int smbfs_smb_set_allocation(struct smb_share *share, SMBFID fid,
145                             uint64_t new_size, vfs_context_t context);
146int smbfs_smb_seteof(struct smb_share *share, SMBFID fid, uint64_t newsize,
147                     vfs_context_t context);
148int smbfs_smb_setfattrNT(struct smb_share *share, uint32_t attr, SMBFID fid,
149                         struct timespec *crtime, struct timespec *mtime,
150                         struct timespec *atime, vfs_context_t context);
151int smbfs_smb_setpattr(struct smb_share *share, struct smbnode *np, enum vtype vnode_type,
152                       const char *namep, size_t name_len,
153                       uint16_t attr, vfs_context_t context);
154int smbfs_smb_setpattrNT(struct smb_share *share, struct smbnode *np, enum vtype vnode_type,
155                         const char *namep, size_t name_len,
156                         uint32_t attr, struct timespec *crtime,
157                         struct timespec *mtime, struct timespec *atime,
158                         vfs_context_t context);
159int smb2fs_smb_setpattrNT(struct smb_share *share, struct smbnode *np, enum vtype vnode_type,
160                          const char *namep, size_t name_len,
161                          uint32_t attr, struct timespec *crtime,
162                          struct timespec *mtime, struct timespec *atime,
163                          vfs_context_t context);
164int smbfs_smb_setsec(struct smb_share *share, struct smbnode *np,
165                     uint32_t desired_access, SMBFID fid,
166                     uint32_t selector, uint16_t control_flags,
167                     struct ntsid *owner, struct ntsid *group,
168                     struct ntacl *sacl, struct ntacl *dacl,
169                     vfs_context_t context);
170int smbfs_smb_statfs(struct smbmount *smp, struct vfsstatfs *sbp,
171                     vfs_context_t context);
172int smb2fs_smb_validate_neg_info(struct smb_share *share, vfs_context_t context);
173int smbfs_smb_undollardata(const char *fname, char *name, size_t *nmlen,
174                           uint32_t *is_data);
175
176
177#endif
178