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_create(struct smb_share *share, struct smbnode *np, 40 const char *namep, size_t name_len, 41 const char *strm_namep, size_t strm_name_len, 42 uint32_t desired_access, enum vtype vnode_type, 43 uint32_t share_access, uint32_t disposition, 44 uint64_t create_flags, uint32_t *ntstatus, 45 SMBFID *fidp, struct smbfattr *fap, 46 void *create_contextp, vfs_context_t context); 47int smbfs_smb_cmpd_create_read_close(struct smb_share *share, struct smbnode *dnp, 48 const char *namep, size_t name_len, 49 const char *snamep, size_t sname_len, 50 uio_t uio, size_t *sizep, 51 uint32_t *max_access, 52 vfs_context_t context); 53int smb2fs_smb_cmpd_query_dir_one(struct smb_share *share, struct smbnode *np, 54 const char *query_namep, size_t query_name_len, 55 struct smbfattr *fap, char **namep, size_t *name_lenp, 56 vfs_context_t context); 57int smb2fs_smb_cmpd_resolve_id(struct smb_share *share, struct smbnode *np, 58 uint64_t ino, uint32_t *resolve_errorp, char **pathp, 59 vfs_context_t context); 60 61int smb2fs_smb_change_notify(struct smb_share *share, uint32_t output_buffer_len, 62 uint32_t completion_filter, 63 void *fn_callback, void *fn_callback_args, 64 vfs_context_t context); 65int smb2fs_smb_copyfile(struct smb_share *share, struct smbnode *src_np, 66 struct smbnode *tdnp, const char *tnamep, 67 size_t tname_len, vfs_context_t context); 68int smbfs_smb_create_reparse_symlink(struct smb_share *share, struct smbnode *dnp, 69 const char *namep, size_t name_len, 70 char *targetp, size_t target_len, 71 struct smbfattr *fap, vfs_context_t context); 72int smbfs_smb_close(struct smb_share *share, SMBFID fid, 73 vfs_context_t context); 74int smbfs_smb_delete(struct smb_share *share, struct smbnode *np, 75 const char *name, size_t nmlen, int xattr, 76 vfs_context_t context); 77int smbfs_smb_flush(struct smb_share *share, SMBFID fid, 78 vfs_context_t context); 79int smb1fs_smb_findclose(struct smbfs_fctx *ctx, vfs_context_t context); 80int smbfs_smb_findclose(struct smbfs_fctx *ctx, vfs_context_t context); 81int smb1fs_smb_findnext(struct smbfs_fctx *ctx, vfs_context_t context); 82int smbfs_smb_findnext(struct smbfs_fctx *ctx, vfs_context_t context); 83int smbfs_smb_lock(struct smb_share *share, int op, SMBFID fid, uint32_t pid, 84 off_t start, uint64_t len, uint32_t timo, 85 vfs_context_t context); 86int smbfs_smb_markfordelete(struct smb_share *share, SMBFID fid, 87 vfs_context_t context); 88int smbfs_smb_ntcreatex(struct smb_share *share, struct smbnode *np, 89 uint32_t rights, uint32_t shareMode, enum vtype vt, 90 SMBFID *fidp, const char *name, size_t in_nmlen, 91 uint32_t disp, int xattr, struct smbfattr *fap, 92 int do_create, struct smb2_durable_handle *dur_handlep, 93 vfs_context_t context); 94int smbfs_smb_openread(struct smb_share *share, struct smbnode *np, 95 SMBFID *fidp, uint32_t desired_access, uio_t uio, size_t *sizep, 96 const char *stream_namep, struct timespec *mtimep, 97 vfs_context_t context); 98int smbfs_smb_rmdir(struct smb_share *share, struct smbnode *np, 99 vfs_context_t context); 100int smb2fs_smb_security_get(struct smb_share *share, struct smbnode *np, 101 uint32_t desired_access, uint32_t security_attrs, 102 struct ntsecdesc **resp, uint32_t *resp_len, 103 vfs_context_t context); 104int smb2fs_smb_security_set(struct smb_share *share, struct smbnode *np, 105 uint32_t desired_access, 106 uint32_t security_attrs, uint16_t control_flags, 107 struct ntsid *owner, struct ntsid *group, 108 struct ntacl *sacl, struct ntacl *dacl, 109 vfs_context_t context); 110int smbfs_smb_setsec(struct smb_share *share, struct smbnode *np, 111 uint32_t desired_access, SMBFID fid, 112 uint32_t selector, uint16_t control_flags, 113 struct ntsid *owner, struct ntsid *group, 114 struct ntacl *sacl, struct ntacl *dacl, 115 vfs_context_t context); 116void smbfs_smb_qfsattr(struct smbmount *smp, vfs_context_t context); 117int smb1fs_smb_qpathinfo(struct smb_share *share, struct smbnode *np, 118 struct smbfattr *fap, short infolevel, 119 const char **namep, size_t *nmlenp, 120 vfs_context_t context); 121int smbfs_smb_qpathinfo(struct smb_share *share, struct smbnode *np, 122 struct smbfattr *fap, short infolevel, 123 const char **namep, size_t *nmlenp, 124 vfs_context_t context); 125int smbfs_smb_qstreaminfo(struct smb_share *share, struct smbnode *np, 126 const char *namep, size_t name_len, 127 const char *stream_namep, 128 uio_t uio, size_t *sizep, 129 uint64_t *strmsize, uint64_t *strm_alloc_size, 130 uint32_t *stream_flagsp, uint32_t *max_accessp, 131 vfs_context_t context); 132int smbfs_smb_query_info(struct smb_share *share, struct smbnode *dnp, 133 const char *in_name, size_t len, uint32_t *attr, 134 vfs_context_t context); 135int smbfs_smb_rename(struct smb_share *share, struct smbnode *src, 136 struct smbnode *tdnp, const char *tname, size_t tnmlen, 137 vfs_context_t context); 138int smbfs_smb_reparse_read_symlink(struct smb_share *share, struct smbnode *np, 139 struct uio *uiop, vfs_context_t context); 140int smbfs_smb_set_allocation(struct smb_share *share, SMBFID fid, 141 uint64_t new_size, vfs_context_t context); 142int smbfs_smb_seteof(struct smb_share *share, SMBFID fid, uint64_t newsize, 143 vfs_context_t context); 144int smbfs_smb_setfattrNT(struct smb_share *share, uint32_t attr, SMBFID fid, 145 struct timespec *crtime, struct timespec *mtime, 146 struct timespec *atime, vfs_context_t context); 147int smbfs_smb_setpattr(struct smb_share *share, struct smbnode *np, 148 const char *namep, size_t name_len, 149 uint16_t attr, vfs_context_t context); 150int smbfs_smb_setpattrNT(struct smb_share *share, struct smbnode *np, 151 const char *namep, size_t name_len, 152 uint32_t attr, struct timespec *crtime, 153 struct timespec *mtime, struct timespec *atime, 154 vfs_context_t context); 155int smb2fs_smb_setpattrNT(struct smb_share *share, struct smbnode *np, 156 const char *namep, size_t name_len, 157 uint32_t attr, struct timespec *crtime, 158 struct timespec *mtime, struct timespec *atime, 159 vfs_context_t context); 160int smbfs_smb_statfs(struct smbmount *smp, struct vfsstatfs *sbp, 161 vfs_context_t context); 162int smbfs_smb_undollardata(const char *fname, char *name, size_t *nmlen); 163 164 165#endif 166