Convert all uint32/16/8 to _t in source3/libsmb.
[bbaumbach/samba-autobuild/.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 bool cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation);
38 int cli_RNetShareEnum(struct cli_state *cli, void (*fn)(const char *, uint32_t, const char *, void *), void *state);
39 bool cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32_t stype,
40                        void (*fn)(const char *, uint32_t, const char *, void *),
41                        void *state);
42 bool cli_oem_change_password(struct cli_state *cli, const char *user, const char *new_password,
43                              const char *old_password);
44 struct tevent_req *cli_qpathinfo1_send(TALLOC_CTX *mem_ctx,
45                                        struct tevent_context *ev,
46                                        struct cli_state *cli,
47                                        const char *fname);
48 NTSTATUS cli_qpathinfo1_recv(struct tevent_req *req,
49                              time_t *change_time,
50                              time_t *access_time,
51                              time_t *write_time,
52                              off_t *size,
53                              uint16_t *mode);
54 NTSTATUS cli_qpathinfo1(struct cli_state *cli,
55                         const char *fname,
56                         time_t *change_time,
57                         time_t *access_time,
58                         time_t *write_time,
59                         off_t *size,
60                         uint16_t *mode);
61 NTSTATUS cli_setpathinfo_basic(struct cli_state *cli, const char *fname,
62                                time_t create_time,
63                                time_t access_time,
64                                time_t write_time,
65                                time_t change_time,
66                                uint16_t mode);
67 struct tevent_req *cli_qpathinfo2_send(TALLOC_CTX *mem_ctx,
68                                        struct tevent_context *ev,
69                                        struct cli_state *cli,
70                                        const char *fname);
71 NTSTATUS cli_qpathinfo2_recv(struct tevent_req *req,
72                              struct timespec *create_time,
73                              struct timespec *access_time,
74                              struct timespec *write_time,
75                              struct timespec *change_time,
76                              off_t *size, uint16_t *mode,
77                              SMB_INO_T *ino);
78 NTSTATUS cli_qpathinfo2(struct cli_state *cli, const char *fname,
79                         struct timespec *create_time,
80                         struct timespec *access_time,
81                         struct timespec *write_time,
82                         struct timespec *change_time,
83                         off_t *size, uint16_t *mode,
84                         SMB_INO_T *ino);
85 NTSTATUS cli_qpathinfo3(struct cli_state *cli, const char *fname,
86                         struct timespec *create_time,
87                         struct timespec *access_time,
88                         struct timespec *write_time,
89                         struct timespec *change_time,
90                         off_t *size, uint16_t *mode,
91                         SMB_INO_T *ino);
92 struct tevent_req *cli_qpathinfo_streams_send(TALLOC_CTX *mem_ctx,
93                                               struct tevent_context *ev,
94                                               struct cli_state *cli,
95                                               const char *fname);
96 NTSTATUS cli_qpathinfo_streams_recv(struct tevent_req *req,
97                                     TALLOC_CTX *mem_ctx,
98                                     unsigned int *pnum_streams,
99                                     struct stream_struct **pstreams);
100 NTSTATUS cli_qpathinfo_streams(struct cli_state *cli, const char *fname,
101                                TALLOC_CTX *mem_ctx,
102                                unsigned int *pnum_streams,
103                                struct stream_struct **pstreams);
104 bool parse_streams_blob(TALLOC_CTX *mem_ctx, const uint8_t *rdata,
105                                 size_t data_len,
106                                 unsigned int *pnum_streams,
107                                 struct stream_struct **pstreams);
108 NTSTATUS cli_qfilename(struct cli_state *cli, uint16_t fnum,
109                        TALLOC_CTX *mem_ctx, char **name);
110 NTSTATUS cli_qfileinfo_basic(struct cli_state *cli, uint16_t fnum,
111                              uint16_t *mode, off_t *size,
112                              struct timespec *create_time,
113                              struct timespec *access_time,
114                              struct timespec *write_time,
115                              struct timespec *change_time,
116                              SMB_INO_T *ino);
117 struct tevent_req *cli_qpathinfo_basic_send(TALLOC_CTX *mem_ctx,
118                                             struct tevent_context *ev,
119                                             struct cli_state *cli,
120                                             const char *fname);
121 NTSTATUS cli_qpathinfo_basic_recv(struct tevent_req *req,
122                                   SMB_STRUCT_STAT *sbuf, uint32_t *attributes);
123 NTSTATUS cli_qpathinfo_basic(struct cli_state *cli, const char *name,
124                              SMB_STRUCT_STAT *sbuf, uint32_t *attributes);
125 NTSTATUS cli_qpathinfo_standard(struct cli_state *cli, const char *fname,
126                                 uint64_t *allocated, uint64_t *size,
127                                 uint32_t *nlinks,
128                                 bool *is_del_pending, bool *is_dir);
129 NTSTATUS cli_qpathinfo_alt_name(struct cli_state *cli, const char *fname, fstring alt_name);
130 struct tevent_req *cli_qpathinfo_send(TALLOC_CTX *mem_ctx,
131                                       struct tevent_context *ev,
132                                       struct cli_state *cli, const char *fname,
133                                       uint16_t level, uint32_t min_rdata,
134                                       uint32_t max_rdata);
135 NTSTATUS cli_qpathinfo_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
136                             uint8_t **rdata, uint32_t *num_rdata);
137 NTSTATUS cli_qpathinfo(TALLOC_CTX *mem_ctx, struct cli_state *cli,
138                        const char *fname, uint16_t level, uint32_t min_rdata,
139                        uint32_t max_rdata,
140                        uint8_t **rdata, uint32_t *num_rdata);
141
142 struct tevent_req *cli_qfileinfo_send(TALLOC_CTX *mem_ctx,
143                                       struct tevent_context *ev,
144                                       struct cli_state *cli, uint16_t fnum,
145                                       uint16_t level, uint32_t min_rdata,
146                                       uint32_t max_rdata);
147 NTSTATUS cli_qfileinfo_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
148                             uint16_t *recv_flags2,
149                             uint8_t **rdata, uint32_t *num_rdata);
150 NTSTATUS cli_qfileinfo(TALLOC_CTX *mem_ctx, struct cli_state *cli,
151                        uint16_t fnum, uint16_t level, uint32_t min_rdata,
152                        uint32_t max_rdata, uint16_t *recv_flags2,
153                        uint8_t **rdata, uint32_t *num_rdata);
154
155 struct tevent_req *cli_flush_send(TALLOC_CTX *mem_ctx,
156                                   struct tevent_context *ev,
157                                   struct cli_state *cli,
158                                   uint16_t fnum);
159 NTSTATUS cli_flush_recv(struct tevent_req *req);
160 NTSTATUS cli_flush(TALLOC_CTX *mem_ctx, struct cli_state *cli, uint16_t fnum);
161
162 struct tevent_req *cli_shadow_copy_data_send(TALLOC_CTX *mem_ctx,
163                                              struct tevent_context *ev,
164                                              struct cli_state *cli,
165                                              uint16_t fnum,
166                                              bool get_names);
167 NTSTATUS cli_shadow_copy_data_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
168                                    char ***pnames, int *pnum_names);
169 NTSTATUS cli_shadow_copy_data(TALLOC_CTX *mem_ctx, struct cli_state *cli,
170                               uint16_t fnum, bool get_names,
171                               char ***pnames, int *pnum_names);
172
173 /* The following definitions come from libsmb/clirap2.c  */
174 struct rap_group_info_1;
175 struct rap_user_info_1;
176 struct rap_share_info_2;
177
178 int cli_NetGroupDelete(struct cli_state *cli, const char *group_name);
179 int cli_NetGroupAdd(struct cli_state *cli, struct rap_group_info_1 *grinfo);
180 int cli_RNetGroupEnum(struct cli_state *cli, void (*fn)(const char *, const char *, void *), void *state);
181 int cli_RNetGroupEnum0(struct cli_state *cli,
182                        void (*fn)(const char *, void *),
183                        void *state);
184 int cli_NetGroupDelUser(struct cli_state * cli, const char *group_name, const char *user_name);
185 int cli_NetGroupAddUser(struct cli_state * cli, const char *group_name, const char *user_name);
186 int cli_NetGroupGetUsers(struct cli_state * cli, const char *group_name, void (*fn)(const char *, void *), void *state );
187 int cli_NetUserGetGroups(struct cli_state * cli, const char *user_name, void (*fn)(const char *, void *), void *state );
188 int cli_NetUserDelete(struct cli_state *cli, const char * user_name );
189 int cli_NetUserAdd(struct cli_state *cli, struct rap_user_info_1 * userinfo );
190 int cli_RNetUserEnum(struct cli_state *cli, void (*fn)(const char *, const char *, const char *, const char *, void *), void *state);
191 int cli_RNetUserEnum0(struct cli_state *cli,
192                       void (*fn)(const char *, void *),
193                       void *state);
194 int cli_NetFileClose(struct cli_state *cli, uint32_t file_id );
195 int cli_NetFileGetInfo(struct cli_state *cli, uint32_t file_id, void (*fn)(const char *, const char *, uint16_t, uint16_t, uint32_t));
196 int cli_NetFileEnum(struct cli_state *cli, const char * user,
197                     const char * base_path,
198                     void (*fn)(const char *, const char *, uint16_t, uint16_t,
199                                uint32_t));
200 int cli_NetShareAdd(struct cli_state *cli, struct rap_share_info_2 * sinfo );
201 int cli_NetShareDelete(struct cli_state *cli, const char * share_name );
202 bool cli_get_pdc_name(struct cli_state *cli, const char *workgroup, char **pdc_name);
203 bool cli_get_server_domain(struct cli_state *cli);
204 bool cli_get_server_type(struct cli_state *cli, uint32_t *pstype);
205 bool cli_get_server_name(TALLOC_CTX *mem_ctx, struct cli_state *cli,
206                          char **servername);
207 bool cli_ns_check_server_type(struct cli_state *cli, char *workgroup, uint32_t stype);
208 bool cli_NetWkstaUserLogoff(struct cli_state *cli, const char *user, const char *workstation);
209 int cli_NetPrintQEnum(struct cli_state *cli,
210                 void (*qfn)(const char*,uint16_t,uint16_t,uint16_t,const char*,const char*,const char*,const char*,const char*,uint16_t,uint16_t),
211                 void (*jfn)(uint16_t,const char*,const char*,const char*,const char*,uint16_t,uint16_t,const char*,unsigned int,unsigned int,const char*));
212 int cli_NetPrintQGetInfo(struct cli_state *cli, const char *printer,
213         void (*qfn)(const char*,uint16_t,uint16_t,uint16_t,const char*,const char*,const char*,const char*,const char*,uint16_t,uint16_t),
214         void (*jfn)(uint16_t,const char*,const char*,const char*,const char*,uint16_t,uint16_t,const char*,unsigned int,unsigned int,const char*));
215 int cli_RNetServiceEnum(struct cli_state *cli, void (*fn)(const char *, const char *, void *), void *state);
216 int cli_NetSessionEnum(struct cli_state *cli, void (*fn)(char *, char *, uint16_t, uint16_t, uint16_t, unsigned int, unsigned int, unsigned int, char *));
217 int cli_NetSessionGetInfo(struct cli_state *cli, const char *workstation,
218                 void (*fn)(const char *, const char *, uint16_t, uint16_t, uint16_t, unsigned int, unsigned int, unsigned int, const char *));
219 int cli_NetSessionDel(struct cli_state *cli, const char *workstation);
220 int cli_NetConnectionEnum(struct cli_state *cli, const char *qualifier,
221                         void (*fn)(uint16_t conid, uint16_t contype,
222                                 uint16_t numopens, uint16_t numusers,
223                                 uint32_t contime, const char *username,
224                                 const char *netname));
225
226 #endif /* _LIBSMB_CLIRAP_H */