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