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 _NETSMB_SMBIO_2_H_
25#define _NETSMB_SMBIO_2_H_
26
27#include <netsmb/smbio.h>
28
29struct open_outparm_ex {
30	uint64_t createTime;
31	uint64_t accessTime;
32	uint64_t writeTime;
33	uint64_t changeTime;
34	uint32_t attributes;
35	uint64_t allocationSize;
36	uint64_t fileSize;
37	uint64_t fileInode;
38	uint32_t maxAccessRights;
39    SMBFID fid;
40};
41
42int smb_is_smb2(struct smb_ctx *ctx);
43
44int smb2io_check_directory(struct smb_ctx *ctx, const void *path,
45                           uint32_t flags, uint32_t *nt_error);
46int smb2io_close_file(void *smbctx, SMBFID fid);
47int smb2io_get_dfs_referral(struct smb_ctx *smbctx, CFStringRef dfs_referral_str,
48                            uint16_t max_referral_level,
49                            CFMutableDictionaryRef *out_referral_dict);
50int smb2io_ntcreatex(void *smbctx, const char *path, const char *streamName,
51                     struct open_inparms *inparms,
52                     struct open_outparm_ex *outparms, SMBFID *fid);
53int smb2io_read(struct smb_ctx *smbctx, SMBFID fid, off_t offset, uint32_t count,
54                char *dst, uint32_t *bytes_read);
55int smb2io_transact(struct smb_ctx *smbctx, uint64_t *setup, int setupCnt,
56                    const char *pipeName,
57                    const uint8_t *sndPData, size_t sndPDataLen,
58                    const uint8_t *sndData, size_t sndDataLen,
59                    uint8_t *rcvPData, size_t *rcvPDataLen,
60                    uint8_t *rcvdData, size_t *rcvDataLen);
61int smb2io_write(struct smb_ctx *smbctx, SMBFID fid, off_t offset, uint32_t count,
62                 const char *src, uint32_t *bytes_written);
63
64#endif
65