s3:idmap_ad: add support for ADS_AUTH_SASL_{STARTTLS,LDAPS}
[Samba.git] / source3 / libsmb / clirap.h
blob4dc0441cc5bb786aaf8f6ed0729edf3182a22218
1 /*
2 Samba Unix/Linux SMB client library
3 More client RAP (SMB Remote Procedure Calls) functions
4 Copyright (C) 2001 Steve French (sfrench@us.ibm.com)
5 Copyright (C) 2001 Jim McDonough (jmcd@us.ibm.com)
6 Copyright (C) 2007 Jeremy Allison. jra@samba.org
7 Copyright (C) Andrew Tridgell 1994-1998
8 Copyright (C) Gerald (Jerry) Carter 2004
9 Copyright (C) James Peach 2007
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 3 of the License, or
14 (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #ifndef _LIBSMB_CLIRAP_H
26 #define _LIBSMB_CLIRAP_H
28 struct cli_state;
30 /* The following definitions come from libsmb/clirap.c */
32 bool cli_api(struct cli_state *cli,
33 char *param, int prcnt, int mprcnt,
34 char *data, int drcnt, int mdrcnt,
35 char **rparam, unsigned int *rprcnt,
36 char **rdata, unsigned int *rdrcnt);
37 int cli_RNetShareEnum(struct cli_state *cli, void (*fn)(const char *, uint32_t, const char *, void *), void *state);
38 bool cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32_t stype,
39 void (*fn)(const char *, uint32_t, const char *, void *),
40 void *state);
41 bool cli_oem_change_password(struct cli_state *cli, const char *user, const char *new_password,
42 const char *old_password);
43 NTSTATUS cli_setpathinfo_ext(struct cli_state *cli, const char *fname,
44 struct timespec create_time,
45 struct timespec access_time,
46 struct timespec write_time,
47 struct timespec change_time,
48 uint32_t attr);
49 struct tevent_req *cli_setfileinfo_ext_send(
50 TALLOC_CTX *mem_ctx,
51 struct tevent_context *ev,
52 struct cli_state *cli,
53 uint16_t fnum,
54 struct timespec create_time,
55 struct timespec access_time,
56 struct timespec write_time,
57 struct timespec change_time,
58 uint32_t attr);
59 NTSTATUS cli_setfileinfo_ext_recv(struct tevent_req *req);
60 NTSTATUS cli_setfileinfo_ext(
61 struct cli_state *cli,
62 uint16_t fnum,
63 struct timespec create_time,
64 struct timespec access_time,
65 struct timespec write_time,
66 struct timespec change_time,
67 uint32_t attr);
68 struct tevent_req *cli_qpathinfo2_send(TALLOC_CTX *mem_ctx,
69 struct tevent_context *ev,
70 struct cli_state *cli,
71 const char *fname);
72 NTSTATUS cli_qpathinfo2_recv(struct tevent_req *req,
73 struct timespec *create_time,
74 struct timespec *access_time,
75 struct timespec *write_time,
76 struct timespec *change_time,
77 off_t *size,
78 uint32_t *pattr,
79 SMB_INO_T *ino,
80 mode_t *mode);
81 NTSTATUS cli_qpathinfo2(struct cli_state *cli,
82 const char *fname,
83 struct timespec *create_time,
84 struct timespec *access_time,
85 struct timespec *write_time,
86 struct timespec *change_time,
87 off_t *size,
88 uint32_t *pattr,
89 SMB_INO_T *ino,
90 mode_t *mode);
91 NTSTATUS cli_qpathinfo3(struct cli_state *cli, const char *fname,
92 struct timespec *create_time,
93 struct timespec *access_time,
94 struct timespec *write_time,
95 struct timespec *change_time,
96 off_t *size, uint32_t *pattr,
97 SMB_INO_T *ino);
98 struct tevent_req *cli_qpathinfo_streams_send(TALLOC_CTX *mem_ctx,
99 struct tevent_context *ev,
100 struct cli_state *cli,
101 const char *fname);
102 NTSTATUS cli_qpathinfo_streams_recv(struct tevent_req *req,
103 TALLOC_CTX *mem_ctx,
104 unsigned int *pnum_streams,
105 struct stream_struct **pstreams);
106 NTSTATUS cli_qpathinfo_streams(struct cli_state *cli, const char *fname,
107 TALLOC_CTX *mem_ctx,
108 unsigned int *pnum_streams,
109 struct stream_struct **pstreams);
110 bool parse_streams_blob(TALLOC_CTX *mem_ctx, const uint8_t *rdata,
111 size_t data_len,
112 unsigned int *pnum_streams,
113 struct stream_struct **pstreams);
114 struct tevent_req *cli_qfileinfo_basic_send(
115 TALLOC_CTX *mem_ctx,
116 struct tevent_context *ev,
117 struct cli_state *cli,
118 uint16_t fnum);
119 NTSTATUS cli_qfileinfo_basic_recv(
120 struct tevent_req *req,
121 uint32_t *attr,
122 off_t *size,
123 struct timespec *create_time,
124 struct timespec *access_time,
125 struct timespec *write_time,
126 struct timespec *change_time,
127 SMB_INO_T *ino);
128 NTSTATUS cli_qfileinfo_basic(
129 struct cli_state *cli,
130 uint16_t fnum,
131 uint32_t *attr,
132 off_t *size,
133 struct timespec *create_time,
134 struct timespec *access_time,
135 struct timespec *write_time,
136 struct timespec *change_time,
137 SMB_INO_T *ino);
138 struct tevent_req *cli_qpathinfo_basic_send(TALLOC_CTX *mem_ctx,
139 struct tevent_context *ev,
140 struct cli_state *cli,
141 const char *fname);
142 NTSTATUS cli_qpathinfo_basic_recv(struct tevent_req *req,
143 SMB_STRUCT_STAT *sbuf, uint32_t *attributes);
144 NTSTATUS cli_qpathinfo_basic(struct cli_state *cli, const char *name,
145 SMB_STRUCT_STAT *sbuf, uint32_t *attributes);
146 NTSTATUS cli_qpathinfo_standard(struct cli_state *cli, const char *fname,
147 uint64_t *allocated, uint64_t *size,
148 uint32_t *nlinks,
149 bool *is_del_pending, bool *is_dir);
150 NTSTATUS cli_qpathinfo_alt_name(struct cli_state *cli, const char *fname, fstring alt_name);
151 struct tevent_req *cli_qpathinfo_send(TALLOC_CTX *mem_ctx,
152 struct tevent_context *ev,
153 struct cli_state *cli, const char *fname,
154 uint16_t level, uint32_t min_rdata,
155 uint32_t max_rdata);
156 NTSTATUS cli_qpathinfo_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
157 uint8_t **rdata, uint32_t *num_rdata);
158 NTSTATUS cli_qpathinfo(TALLOC_CTX *mem_ctx, struct cli_state *cli,
159 const char *fname, uint16_t level, uint32_t min_rdata,
160 uint32_t max_rdata,
161 uint8_t **rdata, uint32_t *num_rdata);
163 struct tevent_req *cli_qfileinfo_send(TALLOC_CTX *mem_ctx,
164 struct tevent_context *ev,
165 struct cli_state *cli, uint16_t fnum,
166 uint16_t level, uint32_t min_rdata,
167 uint32_t max_rdata);
168 NTSTATUS cli_qfileinfo_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
169 uint16_t *recv_flags2,
170 uint8_t **rdata, uint32_t *num_rdata);
171 NTSTATUS cli_qfileinfo(TALLOC_CTX *mem_ctx, struct cli_state *cli,
172 uint16_t fnum, uint16_t level, uint32_t min_rdata,
173 uint32_t max_rdata, uint16_t *recv_flags2,
174 uint8_t **rdata, uint32_t *num_rdata);
176 struct tevent_req *cli_flush_send(TALLOC_CTX *mem_ctx,
177 struct tevent_context *ev,
178 struct cli_state *cli,
179 uint16_t fnum);
180 NTSTATUS cli_flush_recv(struct tevent_req *req);
181 NTSTATUS cli_flush(TALLOC_CTX *mem_ctx, struct cli_state *cli, uint16_t fnum);
183 struct tevent_req *cli_shadow_copy_data_send(TALLOC_CTX *mem_ctx,
184 struct tevent_context *ev,
185 struct cli_state *cli,
186 uint16_t fnum,
187 bool get_names);
188 NTSTATUS cli_shadow_copy_data_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
189 char ***pnames, int *pnum_names);
190 NTSTATUS cli_shadow_copy_data(TALLOC_CTX *mem_ctx, struct cli_state *cli,
191 uint16_t fnum, bool get_names,
192 char ***pnames, int *pnum_names);
194 struct tevent_req *cli_fsctl_send(
195 TALLOC_CTX *mem_ctx,
196 struct tevent_context *ev,
197 struct cli_state *cli,
198 uint16_t fnum,
199 uint32_t ctl_code,
200 const DATA_BLOB *in,
201 uint32_t max_out);
202 NTSTATUS cli_fsctl_recv(
203 struct tevent_req *req, TALLOC_CTX *mem_ctx, DATA_BLOB *out);
206 #endif /* _LIBSMB_CLIRAP_H */