s3:libsmb: Use lpcfg_set_cmdline()
[samba.git] / source3 / libsmb / clirap.h
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
10
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.
15
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.
20
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/>.
23 */
24
25 #ifndef _LIBSMB_CLIRAP_H
26 #define _LIBSMB_CLIRAP_H
27
28 struct cli_state;
29
30 /* The following definitions come from libsmb/clirap.c  */
31
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, uint32_t *pattr,
78                              SMB_INO_T *ino);
79 NTSTATUS cli_qpathinfo2(struct cli_state *cli, 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, uint32_t *pattr,
85                         SMB_INO_T *ino);
86 NTSTATUS cli_qpathinfo3(struct cli_state *cli, const char *fname,
87                         struct timespec *create_time,
88                         struct timespec *access_time,
89                         struct timespec *write_time,
90                         struct timespec *change_time,
91                         off_t *size, uint32_t *pattr,
92                         SMB_INO_T *ino);
93 struct tevent_req *cli_qpathinfo_streams_send(TALLOC_CTX *mem_ctx,
94                                               struct tevent_context *ev,
95                                               struct cli_state *cli,
96                                               const char *fname);
97 NTSTATUS cli_qpathinfo_streams_recv(struct tevent_req *req,
98                                     TALLOC_CTX *mem_ctx,
99                                     unsigned int *pnum_streams,
100                                     struct stream_struct **pstreams);
101 NTSTATUS cli_qpathinfo_streams(struct cli_state *cli, const char *fname,
102                                TALLOC_CTX *mem_ctx,
103                                unsigned int *pnum_streams,
104                                struct stream_struct **pstreams);
105 bool parse_streams_blob(TALLOC_CTX *mem_ctx, const uint8_t *rdata,
106                                 size_t data_len,
107                                 unsigned int *pnum_streams,
108                                 struct stream_struct **pstreams);
109 struct tevent_req *cli_qfileinfo_basic_send(
110         TALLOC_CTX *mem_ctx,
111         struct tevent_context *ev,
112         struct cli_state *cli,
113         uint16_t fnum);
114 NTSTATUS cli_qfileinfo_basic_recv(
115         struct tevent_req *req,
116         uint32_t *attr,
117         off_t *size,
118         struct timespec *create_time,
119         struct timespec *access_time,
120         struct timespec *write_time,
121         struct timespec *change_time,
122         SMB_INO_T *ino);
123 NTSTATUS cli_qfileinfo_basic(
124         struct cli_state *cli,
125         uint16_t fnum,
126         uint32_t *attr,
127         off_t *size,
128         struct timespec *create_time,
129         struct timespec *access_time,
130         struct timespec *write_time,
131         struct timespec *change_time,
132         SMB_INO_T *ino);
133 struct tevent_req *cli_qpathinfo_basic_send(TALLOC_CTX *mem_ctx,
134                                             struct tevent_context *ev,
135                                             struct cli_state *cli,
136                                             const char *fname);
137 NTSTATUS cli_qpathinfo_basic_recv(struct tevent_req *req,
138                                   SMB_STRUCT_STAT *sbuf, uint32_t *attributes);
139 NTSTATUS cli_qpathinfo_basic(struct cli_state *cli, const char *name,
140                              SMB_STRUCT_STAT *sbuf, uint32_t *attributes);
141 NTSTATUS cli_qpathinfo_standard(struct cli_state *cli, const char *fname,
142                                 uint64_t *allocated, uint64_t *size,
143                                 uint32_t *nlinks,
144                                 bool *is_del_pending, bool *is_dir);
145 NTSTATUS cli_qpathinfo_alt_name(struct cli_state *cli, const char *fname, fstring alt_name);
146 struct tevent_req *cli_qpathinfo_send(TALLOC_CTX *mem_ctx,
147                                       struct tevent_context *ev,
148                                       struct cli_state *cli, const char *fname,
149                                       uint16_t level, uint32_t min_rdata,
150                                       uint32_t max_rdata);
151 NTSTATUS cli_qpathinfo_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
152                             uint8_t **rdata, uint32_t *num_rdata);
153 NTSTATUS cli_qpathinfo(TALLOC_CTX *mem_ctx, struct cli_state *cli,
154                        const char *fname, uint16_t level, uint32_t min_rdata,
155                        uint32_t max_rdata,
156                        uint8_t **rdata, uint32_t *num_rdata);
157
158 struct tevent_req *cli_qfileinfo_send(TALLOC_CTX *mem_ctx,
159                                       struct tevent_context *ev,
160                                       struct cli_state *cli, uint16_t fnum,
161                                       uint16_t level, uint32_t min_rdata,
162                                       uint32_t max_rdata);
163 NTSTATUS cli_qfileinfo_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
164                             uint16_t *recv_flags2,
165                             uint8_t **rdata, uint32_t *num_rdata);
166 NTSTATUS cli_qfileinfo(TALLOC_CTX *mem_ctx, struct cli_state *cli,
167                        uint16_t fnum, uint16_t level, uint32_t min_rdata,
168                        uint32_t max_rdata, uint16_t *recv_flags2,
169                        uint8_t **rdata, uint32_t *num_rdata);
170
171 struct tevent_req *cli_flush_send(TALLOC_CTX *mem_ctx,
172                                   struct tevent_context *ev,
173                                   struct cli_state *cli,
174                                   uint16_t fnum);
175 NTSTATUS cli_flush_recv(struct tevent_req *req);
176 NTSTATUS cli_flush(TALLOC_CTX *mem_ctx, struct cli_state *cli, uint16_t fnum);
177
178 struct tevent_req *cli_shadow_copy_data_send(TALLOC_CTX *mem_ctx,
179                                              struct tevent_context *ev,
180                                              struct cli_state *cli,
181                                              uint16_t fnum,
182                                              bool get_names);
183 NTSTATUS cli_shadow_copy_data_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
184                                    char ***pnames, int *pnum_names);
185 NTSTATUS cli_shadow_copy_data(TALLOC_CTX *mem_ctx, struct cli_state *cli,
186                               uint16_t fnum, bool get_names,
187                               char ***pnames, int *pnum_names);
188
189 struct tevent_req *cli_fsctl_send(
190         TALLOC_CTX *mem_ctx,
191         struct tevent_context *ev,
192         struct cli_state *cli,
193         uint16_t fnum,
194         uint32_t ctl_code,
195         const DATA_BLOB *in,
196         uint32_t max_out);
197 NTSTATUS cli_fsctl_recv(
198         struct tevent_req *req, TALLOC_CTX *mem_ctx, DATA_BLOB *out);
199
200
201 #endif /* _LIBSMB_CLIRAP_H */