s4-lsa: Fix a user after free in dcesrv_lsa_lookup_name().
[Samba/wip.git] / source3 / libsmb / cli_smb2_fnum.h
blob00686866361b6b3d30f806640f13e6f9f6776752
1 /*
2 Unix SMB/CIFS implementation.
3 smb2 wrapper client routines
4 Copyright (C) Jeremy Allison 2013
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef __SMB2CLI_FNUM_H__
21 #define __SMB2CLI_FNUM_H__
23 struct smbXcli_conn;
24 struct smbXcli_session;
25 struct cli_state;
26 struct file_info;
28 NTSTATUS cli_smb2_create_fnum(struct cli_state *cli,
29 const char *fname,
30 uint32_t create_flags,
31 uint32_t desired_access,
32 uint32_t file_attributes,
33 uint32_t share_access,
34 uint32_t create_disposition,
35 uint32_t create_options,
36 uint16_t *pfid,
37 struct smb2_create_returns *cr);
39 NTSTATUS cli_smb2_close_fnum(struct cli_state *cli, uint16_t fnum);
40 NTSTATUS cli_smb2_mkdir(struct cli_state *cli, const char *dirname);
41 NTSTATUS cli_smb2_rmdir(struct cli_state *cli, const char *dirname);
42 NTSTATUS cli_smb2_unlink(struct cli_state *cli,const char *fname);
43 NTSTATUS cli_smb2_list(struct cli_state *cli,
44 const char *pathname,
45 NTSTATUS (*fn)(const char *,
46 struct file_info *,
47 const char *,
48 void *),
49 void *state);
50 NTSTATUS cli_smb2_qpathinfo_basic(struct cli_state *cli,
51 const char *name,
52 SMB_STRUCT_STAT *sbuf,
53 uint32_t *attributes);
54 NTSTATUS cli_smb2_qpathinfo_alt_name(struct cli_state *cli,
55 const char *name,
56 fstring alt_name);
57 NTSTATUS cli_smb2_qfileinfo_basic(struct cli_state *cli,
58 uint16_t fnum,
59 uint16_t *mode,
60 off_t *size,
61 struct timespec *create_time,
62 struct timespec *access_time,
63 struct timespec *write_time,
64 struct timespec *change_time,
65 SMB_INO_T *ino);
66 NTSTATUS cli_smb2_getattrE(struct cli_state *cli,
67 uint16_t fnum,
68 uint16_t *attr,
69 off_t *size,
70 time_t *change_time,
71 time_t *access_time,
72 time_t *write_time);
73 NTSTATUS cli_smb2_getatr(struct cli_state *cli,
74 const char *name,
75 uint16_t *attr,
76 off_t *size,
77 time_t *write_time);
78 NTSTATUS cli_smb2_qpathinfo2(struct cli_state *cli,
79 const char *fname,
80 struct timespec *create_time,
81 struct timespec *access_time,
82 struct timespec *write_time,
83 struct timespec *change_time,
84 off_t *size,
85 uint16_t *mode,
86 SMB_INO_T *ino);
87 NTSTATUS cli_smb2_qpathinfo_streams(struct cli_state *cli,
88 const char *name,
89 TALLOC_CTX *mem_ctx,
90 unsigned int *pnum_streams,
91 struct stream_struct **pstreams);
92 NTSTATUS cli_smb2_setatr(struct cli_state *cli,
93 const char *fname,
94 uint16_t attr,
95 time_t mtime);
96 NTSTATUS cli_smb2_setattrE(struct cli_state *cli,
97 uint16_t fnum,
98 time_t change_time,
99 time_t access_time,
100 time_t write_time);
101 NTSTATUS cli_smb2_dskattr(struct cli_state *cli,
102 int *bsize,
103 int *total,
104 int *avail);
105 NTSTATUS cli_smb2_query_security_descriptor(struct cli_state *cli,
106 uint16_t fnum,
107 uint32_t sec_info,
108 TALLOC_CTX *mem_ctx,
109 struct security_descriptor **ppsd);
110 NTSTATUS cli_smb2_set_security_descriptor(struct cli_state *cli,
111 uint16_t fnum,
112 uint32_t sec_info,
113 const struct security_descriptor *sd);
114 NTSTATUS cli_smb2_rename(struct cli_state *cli,
115 const char *fname_src,
116 const char *fname_dst);
117 NTSTATUS cli_smb2_set_ea_fnum(struct cli_state *cli,
118 uint16_t fnum,
119 const char *ea_name,
120 const char *ea_val,
121 size_t ea_len);
122 NTSTATUS cli_smb2_get_ea_list_path(struct cli_state *cli,
123 const char *name,
124 TALLOC_CTX *ctx,
125 size_t *pnum_eas,
126 struct ea_struct **pea_list);
127 NTSTATUS cli_smb2_set_ea_path(struct cli_state *cli,
128 const char *name,
129 const char *ea_name,
130 const char *ea_val,
131 size_t ea_len);
132 struct tevent_req *cli_smb2_read_send(TALLOC_CTX *mem_ctx,
133 struct tevent_context *ev,
134 struct cli_state *cli,
135 uint16_t fnum,
136 off_t offset,
137 size_t size);
138 NTSTATUS cli_smb2_read_recv(struct tevent_req *req,
139 ssize_t *received,
140 uint8_t **rcvbuf);
141 struct tevent_req *cli_smb2_write_send(TALLOC_CTX *mem_ctx,
142 struct tevent_context *ev,
143 struct cli_state *cli,
144 uint16_t fnum,
145 uint16_t mode,
146 const uint8_t *buf,
147 off_t offset,
148 size_t size);
149 NTSTATUS cli_smb2_write_recv(struct tevent_req *req,
150 size_t *pwritten);
151 struct tevent_req *cli_smb2_writeall_send(TALLOC_CTX *mem_ctx,
152 struct tevent_context *ev,
153 struct cli_state *cli,
154 uint16_t fnum,
155 uint16_t mode,
156 const uint8_t *buf,
157 off_t offset,
158 size_t size);
159 NTSTATUS cli_smb2_writeall_recv(struct tevent_req *req,
160 size_t *pwritten);
161 #endif /* __SMB2CLI_FNUM_H__ */