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
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 bool cli_NetWkstaUserLogon(struct cli_state
*cli
,char *user
, char *workstation
);
38 int cli_RNetShareEnum(struct cli_state
*cli
, void (*fn
)(const char *, uint32
, const char *, void *), void *state
);
39 bool cli_NetServerEnum(struct cli_state
*cli
, char *workgroup
, uint32 stype
,
40 void (*fn
)(const char *, uint32
, const char *, void *),
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
,
48 NTSTATUS
cli_qpathinfo1_recv(struct tevent_req
*req
,
54 NTSTATUS
cli_qpathinfo1(struct cli_state
*cli
,
61 NTSTATUS
cli_setpathinfo_basic(struct cli_state
*cli
, const char *fname
,
67 struct tevent_req
*cli_qpathinfo2_send(TALLOC_CTX
*mem_ctx
,
68 struct tevent_context
*ev
,
69 struct cli_state
*cli
,
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
*mode
,
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
*mode
,
85 struct tevent_req
*cli_qpathinfo_streams_send(TALLOC_CTX
*mem_ctx
,
86 struct tevent_context
*ev
,
87 struct cli_state
*cli
,
89 NTSTATUS
cli_qpathinfo_streams_recv(struct tevent_req
*req
,
91 unsigned int *pnum_streams
,
92 struct stream_struct
**pstreams
);
93 NTSTATUS
cli_qpathinfo_streams(struct cli_state
*cli
, const char *fname
,
95 unsigned int *pnum_streams
,
96 struct stream_struct
**pstreams
);
97 bool parse_streams_blob(TALLOC_CTX
*mem_ctx
, const uint8_t *rdata
,
99 unsigned int *pnum_streams
,
100 struct stream_struct
**pstreams
);
101 NTSTATUS
cli_qfilename(struct cli_state
*cli
, uint16_t fnum
,
102 TALLOC_CTX
*mem_ctx
, char **name
);
103 NTSTATUS
cli_qfileinfo_basic(struct cli_state
*cli
, uint16_t fnum
,
104 uint16
*mode
, off_t
*size
,
105 struct timespec
*create_time
,
106 struct timespec
*access_time
,
107 struct timespec
*write_time
,
108 struct timespec
*change_time
,
110 struct tevent_req
*cli_qpathinfo_basic_send(TALLOC_CTX
*mem_ctx
,
111 struct tevent_context
*ev
,
112 struct cli_state
*cli
,
114 NTSTATUS
cli_qpathinfo_basic_recv(struct tevent_req
*req
,
115 SMB_STRUCT_STAT
*sbuf
, uint32
*attributes
);
116 NTSTATUS
cli_qpathinfo_basic(struct cli_state
*cli
, const char *name
,
117 SMB_STRUCT_STAT
*sbuf
, uint32
*attributes
);
118 NTSTATUS
cli_qpathinfo_alt_name(struct cli_state
*cli
, const char *fname
, fstring alt_name
);
119 struct tevent_req
*cli_qpathinfo_send(TALLOC_CTX
*mem_ctx
,
120 struct tevent_context
*ev
,
121 struct cli_state
*cli
, const char *fname
,
122 uint16_t level
, uint32_t min_rdata
,
124 NTSTATUS
cli_qpathinfo_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
125 uint8_t **rdata
, uint32_t *num_rdata
);
126 NTSTATUS
cli_qpathinfo(TALLOC_CTX
*mem_ctx
, struct cli_state
*cli
,
127 const char *fname
, uint16_t level
, uint32_t min_rdata
,
129 uint8_t **rdata
, uint32_t *num_rdata
);
131 struct tevent_req
*cli_qfileinfo_send(TALLOC_CTX
*mem_ctx
,
132 struct tevent_context
*ev
,
133 struct cli_state
*cli
, uint16_t fnum
,
134 uint16_t level
, uint32_t min_rdata
,
136 NTSTATUS
cli_qfileinfo_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
137 uint16_t *recv_flags2
,
138 uint8_t **rdata
, uint32_t *num_rdata
);
139 NTSTATUS
cli_qfileinfo(TALLOC_CTX
*mem_ctx
, struct cli_state
*cli
,
140 uint16_t fnum
, uint16_t level
, uint32_t min_rdata
,
141 uint32_t max_rdata
, uint16_t *recv_flags2
,
142 uint8_t **rdata
, uint32_t *num_rdata
);
144 struct tevent_req
*cli_flush_send(TALLOC_CTX
*mem_ctx
,
145 struct tevent_context
*ev
,
146 struct cli_state
*cli
,
148 NTSTATUS
cli_flush_recv(struct tevent_req
*req
);
149 NTSTATUS
cli_flush(TALLOC_CTX
*mem_ctx
, struct cli_state
*cli
, uint16_t fnum
);
151 struct tevent_req
*cli_shadow_copy_data_send(TALLOC_CTX
*mem_ctx
,
152 struct tevent_context
*ev
,
153 struct cli_state
*cli
,
156 NTSTATUS
cli_shadow_copy_data_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
157 char ***pnames
, int *pnum_names
);
158 NTSTATUS
cli_shadow_copy_data(TALLOC_CTX
*mem_ctx
, struct cli_state
*cli
,
159 uint16_t fnum
, bool get_names
,
160 char ***pnames
, int *pnum_names
);
162 /* The following definitions come from libsmb/clirap2.c */
163 struct rap_group_info_1
;
164 struct rap_user_info_1
;
165 struct rap_share_info_2
;
167 int cli_NetGroupDelete(struct cli_state
*cli
, const char *group_name
);
168 int cli_NetGroupAdd(struct cli_state
*cli
, struct rap_group_info_1
*grinfo
);
169 int cli_RNetGroupEnum(struct cli_state
*cli
, void (*fn
)(const char *, const char *, void *), void *state
);
170 int cli_RNetGroupEnum0(struct cli_state
*cli
,
171 void (*fn
)(const char *, void *),
173 int cli_NetGroupDelUser(struct cli_state
* cli
, const char *group_name
, const char *user_name
);
174 int cli_NetGroupAddUser(struct cli_state
* cli
, const char *group_name
, const char *user_name
);
175 int cli_NetGroupGetUsers(struct cli_state
* cli
, const char *group_name
, void (*fn
)(const char *, void *), void *state
);
176 int cli_NetUserGetGroups(struct cli_state
* cli
, const char *user_name
, void (*fn
)(const char *, void *), void *state
);
177 int cli_NetUserDelete(struct cli_state
*cli
, const char * user_name
);
178 int cli_NetUserAdd(struct cli_state
*cli
, struct rap_user_info_1
* userinfo
);
179 int cli_RNetUserEnum(struct cli_state
*cli
, void (*fn
)(const char *, const char *, const char *, const char *, void *), void *state
);
180 int cli_RNetUserEnum0(struct cli_state
*cli
,
181 void (*fn
)(const char *, void *),
183 int cli_NetFileClose(struct cli_state
*cli
, uint32 file_id
);
184 int cli_NetFileGetInfo(struct cli_state
*cli
, uint32 file_id
, void (*fn
)(const char *, const char *, uint16
, uint16
, uint32
));
185 int cli_NetFileEnum(struct cli_state
*cli
, const char * user
,
186 const char * base_path
,
187 void (*fn
)(const char *, const char *, uint16
, uint16
,
189 int cli_NetShareAdd(struct cli_state
*cli
, struct rap_share_info_2
* sinfo
);
190 int cli_NetShareDelete(struct cli_state
*cli
, const char * share_name
);
191 bool cli_get_pdc_name(struct cli_state
*cli
, const char *workgroup
, char **pdc_name
);
192 bool cli_get_server_domain(struct cli_state
*cli
);
193 bool cli_get_server_type(struct cli_state
*cli
, uint32
*pstype
);
194 bool cli_get_server_name(TALLOC_CTX
*mem_ctx
, struct cli_state
*cli
,
196 bool cli_ns_check_server_type(struct cli_state
*cli
, char *workgroup
, uint32 stype
);
197 bool cli_NetWkstaUserLogoff(struct cli_state
*cli
, const char *user
, const char *workstation
);
198 int cli_NetPrintQEnum(struct cli_state
*cli
,
199 void (*qfn
)(const char*,uint16
,uint16
,uint16
,const char*,const char*,const char*,const char*,const char*,uint16
,uint16
),
200 void (*jfn
)(uint16
,const char*,const char*,const char*,const char*,uint16
,uint16
,const char*,unsigned int,unsigned int,const char*));
201 int cli_NetPrintQGetInfo(struct cli_state
*cli
, const char *printer
,
202 void (*qfn
)(const char*,uint16
,uint16
,uint16
,const char*,const char*,const char*,const char*,const char*,uint16
,uint16
),
203 void (*jfn
)(uint16
,const char*,const char*,const char*,const char*,uint16
,uint16
,const char*,unsigned int,unsigned int,const char*));
204 int cli_RNetServiceEnum(struct cli_state
*cli
, void (*fn
)(const char *, const char *, void *), void *state
);
205 int cli_NetSessionEnum(struct cli_state
*cli
, void (*fn
)(char *, char *, uint16
, uint16
, uint16
, unsigned int, unsigned int, unsigned int, char *));
206 int cli_NetSessionGetInfo(struct cli_state
*cli
, const char *workstation
,
207 void (*fn
)(const char *, const char *, uint16
, uint16
, uint16
, unsigned int, unsigned int, unsigned int, const char *));
208 int cli_NetSessionDel(struct cli_state
*cli
, const char *workstation
);
209 int cli_NetConnectionEnum(struct cli_state
*cli
, const char *qualifier
,
210 void (*fn
)(uint16_t conid
, uint16_t contype
,
211 uint16_t numopens
, uint16_t numusers
,
212 uint32_t contime
, const char *username
,
213 const char *netname
));
215 #endif /* _LIBSMB_CLIRAP_H */