s3-net: Add net trust utility
[Samba.git] / source3 / utils / net_proto.h
blobba3860a88d84c993173ba0d88adf94eff54bf9a1
1 /*
2 * Unix SMB/CIFS implementation.
3 * collected prototypes header
5 * frozen from "make proto" in May 2008
7 * Copyright (C) Michael Adam 2008
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, see <http://www.gnu.org/licenses/>.
23 #ifndef _NET_PROTO_H_
24 #define _NET_PROTO_H_
27 /* The following definitions come from utils/net.c */
29 enum netr_SchannelType get_sec_channel_type(const char *param);
31 /* The following definitions come from utils/net_ads.c */
32 struct ads_struct;
33 ADS_STATUS ads_startup(struct net_context *c, bool only_own_domain, struct ads_struct **ads);
34 ADS_STATUS ads_startup_nobind(struct net_context *c, bool only_own_domain, struct ads_struct **ads);
35 int net_ads_check_our_domain(struct net_context *c);
36 int net_ads_check(struct net_context *c);
37 int net_ads_user(struct net_context *c, int argc, const char **argv);
38 int net_ads_group(struct net_context *c, int argc, const char **argv);
39 int net_ads_testjoin(struct net_context *c, int argc, const char **argv);
40 int net_ads_join(struct net_context *c, int argc, const char **argv);
41 int net_ads_printer_usage(struct net_context *c, int argc, const char **argv);
42 int net_ads_changetrustpw(struct net_context *c, int argc, const char **argv);
43 int net_ads_keytab(struct net_context *c, int argc, const char **argv);
44 int net_ads_kerberos(struct net_context *c, int argc, const char **argv);
45 int net_ads(struct net_context *c, int argc, const char **argv);
47 /* The following definitions come from utils/net_ads_gpo.c */
49 int net_ads_gpo(struct net_context *c, int argc, const char **argv);
51 /* The following definitions come from utils/net_cache.c */
53 int net_cache(struct net_context *c, int argc, const char **argv);
55 /* The following definitions come from utils/net_conf.c */
57 int net_conf(struct net_context *c, int argc, const char **argv);
59 /* The following definitions come from utils/net_dns.c */
61 int get_my_ip_address( struct sockaddr_storage **pp_ss );
63 /* The following definitions come from utils/net_dom.c */
65 int net_dom_usage(struct net_context *c, int argc, const char **argv);
66 int net_dom(struct net_context *c, int argc, const char **argv);
68 /* The following definitions come from utils/net_file.c */
70 int net_file_usage(struct net_context *c, int argc, const char **argv);
71 int net_file(struct net_context *c, int argc, const char **argv);
73 /* The following definitions come from utils/net_group.c */
75 int net_group_usage(struct net_context *c, int argc, const char **argv);
76 int net_group(struct net_context *c, int argc, const char **argv);
78 /* The following definitions come from utils/net_groupmap.c */
80 int net_groupmap_usage(struct net_context *c, int argc, const char **argv);
81 int net_groupmap(struct net_context *c, int argc, const char **argv);
83 /* The following definitions come from utils/net_help.c */
85 int net_help(struct net_context *c, int argc, const char **argv);
87 /* The following definitions come from utils/net_idmap.c */
89 int net_idmap(struct net_context *c, int argc, const char **argv);
91 /* The following definitions come from utils/net_join.c */
93 int net_join_usage(struct net_context *c, int argc, const char **argv);
94 int net_join(struct net_context *c, int argc, const char **argv);
96 /* The following definitions come from utils/net_lookup.c */
98 int net_lookup_usage(struct net_context *c, int argc, const char **argv);
99 int net_lookup(struct net_context *c, int argc, const char **argv);
101 /* The following definitions come from utils/net_rap.c */
103 int net_rap_file_usage(struct net_context *c, int argc, const char **argv);
104 int net_rap_file(struct net_context *c, int argc, const char **argv);
105 int net_rap_share_usage(struct net_context *c, int argc, const char **argv);
106 int net_rap_share(struct net_context *c, int argc, const char **argv);
107 int net_rap_session_usage(struct net_context *c, int argc, const char **argv);
108 int net_rap_session(struct net_context *c, int argc, const char **argv);
109 int net_rap_server_usage(struct net_context *c, int argc, const char **argv);
110 int net_rap_server(struct net_context *c, int argc, const char **argv);
111 int net_rap_domain_usage(struct net_context *c, int argc, const char **argv);
112 int net_rap_domain(struct net_context *c, int argc, const char **argv);
113 int net_rap_printq_usage(struct net_context *c, int argc, const char **argv);
114 int net_rap_printq(struct net_context *c, int argc, const char **argv);
115 int net_rap_user(struct net_context *c, int argc, const char **argv);
116 int net_rap_group_usage(struct net_context *c, int argc, const char **argv);
117 int net_rap_group(struct net_context *c, int argc, const char **argv);
118 int net_rap_groupmember_usage(struct net_context *c, int argc, const char **argv);
119 int net_rap_groupmember(struct net_context *c, int argc, const char **argv);
120 int net_rap_validate_usage(struct net_context *c, int argc, const char **argv);
121 int net_rap_validate(struct net_context *c, int argc, const char **argv);
122 int net_rap_service_usage(struct net_context *c, int argc, const char **argv);
123 int net_rap_service(struct net_context *c, int argc, const char **argv);
124 int net_rap_password_usage(struct net_context *c, int argc, const char **argv);
125 int net_rap_password(struct net_context *c, int argc, const char **argv);
126 int net_rap_admin_usage(struct net_context *c, int argc, const char **argv);
127 int net_rap_admin(struct net_context *c, int argc, const char **argv);
128 int net_rap(struct net_context *c, int argc, const char **argv);
130 /* The following definitions come from utils/net_registry.c */
132 int net_registry(struct net_context *c, int argc, const char **argv);
134 /* The following definitions come from utils/net_rpc.c */
136 NTSTATUS net_get_remote_domain_sid(struct cli_state *cli, TALLOC_CTX *mem_ctx,
137 struct dom_sid **domain_sid,
138 const char **domain_name);
139 int run_rpc_command(struct net_context *c,
140 struct cli_state *cli_arg,
141 const struct ndr_syntax_id *interface,
142 int conn_flags,
143 rpc_command_fn fn,
144 int argc,
145 const char **argv);
146 int net_rpc_changetrustpw(struct net_context *c, int argc, const char **argv);
147 int net_rpc_join(struct net_context *c, int argc, const char **argv);
148 NTSTATUS rpc_info_internals(struct net_context *c,
149 const struct dom_sid *domain_sid,
150 const char *domain_name,
151 struct cli_state *cli,
152 struct rpc_pipe_client *pipe_hnd,
153 TALLOC_CTX *mem_ctx,
154 int argc,
155 const char **argv);
156 int net_rpc_info(struct net_context *c, int argc, const char **argv);
157 int net_rpc_getsid(struct net_context *c, int argc, const char **argv);
158 int net_rpc_user(struct net_context *c, int argc, const char **argv);
159 struct rpc_sh_cmd *net_rpc_user_edit_cmds(struct net_context *c,
160 TALLOC_CTX *mem_ctx,
161 struct rpc_sh_ctx *ctx);
162 struct rpc_sh_cmd *net_rpc_user_cmds(struct net_context *c,
163 TALLOC_CTX *mem_ctx,
164 struct rpc_sh_ctx *ctx);
165 int net_rpc_group(struct net_context *c, int argc, const char **argv);
166 bool copy_top_level_perms(struct net_context *c,
167 struct copy_clistate *cp_clistate,
168 const char *sharename);
169 int net_usersidlist(struct net_context *c, int argc, const char **argv);
170 int net_usersidlist_usage(struct net_context *c, int argc, const char **argv);
171 int net_rpc_share(struct net_context *c, int argc, const char **argv);
172 struct rpc_sh_cmd *net_rpc_share_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
173 struct rpc_sh_ctx *ctx);
174 int net_rpc_file(struct net_context *c, int argc, const char **argv);
175 NTSTATUS rpc_init_shutdown_internals(struct net_context *c,
176 const struct dom_sid *domain_sid,
177 const char *domain_name,
178 struct cli_state *cli,
179 struct rpc_pipe_client *pipe_hnd,
180 TALLOC_CTX *mem_ctx,
181 int argc,
182 const char **argv);
183 NTSTATUS rpc_reg_shutdown_internals(struct net_context *c,
184 const struct dom_sid *domain_sid,
185 const char *domain_name,
186 struct cli_state *cli,
187 struct rpc_pipe_client *pipe_hnd,
188 TALLOC_CTX *mem_ctx,
189 int argc,
190 const char **argv);
191 bool net_rpc_check(struct net_context *c, unsigned flags);
192 int rpc_printer_migrate(struct net_context *c, int argc, const char **argv);
193 int rpc_printer_usage(struct net_context *c, int argc, const char **argv);
194 int net_rpc_printer(struct net_context *c, int argc, const char **argv);
195 int net_rpc(struct net_context *c, int argc, const char **argv);
197 /* The following definitions come from utils/net_rpc_audit.c */
199 int net_rpc_audit(struct net_context *c, int argc, const char **argv);
201 /* The following definitions come from utils/net_rpc_join.c */
203 NTSTATUS net_rpc_join_ok(struct net_context *c, const char *domain,
204 const char *server, struct sockaddr_storage *pss);
205 int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv);
206 int net_rpc_testjoin(struct net_context *c, int argc, const char **argv);
208 /* The following definitions come from utils/net_rpc_printer.c */
210 NTSTATUS net_copy_fileattr(struct net_context *c,
211 TALLOC_CTX *mem_ctx,
212 struct cli_state *cli_share_src,
213 struct cli_state *cli_share_dst,
214 const char *src_name, const char *dst_name,
215 bool copy_acls, bool copy_attrs,
216 bool copy_timestamps, bool is_file);
217 NTSTATUS net_copy_file(struct net_context *c,
218 TALLOC_CTX *mem_ctx,
219 struct cli_state *cli_share_src,
220 struct cli_state *cli_share_dst,
221 const char *src_name, const char *dst_name,
222 bool copy_acls, bool copy_attrs,
223 bool copy_timestamps, bool is_file);
224 NTSTATUS rpc_printer_list_internals(struct net_context *c,
225 const struct dom_sid *domain_sid,
226 const char *domain_name,
227 struct cli_state *cli,
228 struct rpc_pipe_client *pipe_hnd,
229 TALLOC_CTX *mem_ctx,
230 int argc,
231 const char **argv);
232 NTSTATUS rpc_printer_driver_list_internals(struct net_context *c,
233 const struct dom_sid *domain_sid,
234 const char *domain_name,
235 struct cli_state *cli,
236 struct rpc_pipe_client *pipe_hnd,
237 TALLOC_CTX *mem_ctx,
238 int argc,
239 const char **argv);
240 NTSTATUS rpc_printer_publish_publish_internals(struct net_context *c,
241 const struct dom_sid *domain_sid,
242 const char *domain_name,
243 struct cli_state *cli,
244 struct rpc_pipe_client *pipe_hnd,
245 TALLOC_CTX *mem_ctx,
246 int argc,
247 const char **argv);
248 NTSTATUS rpc_printer_publish_unpublish_internals(struct net_context *c,
249 const struct dom_sid *domain_sid,
250 const char *domain_name,
251 struct cli_state *cli,
252 struct rpc_pipe_client *pipe_hnd,
253 TALLOC_CTX *mem_ctx,
254 int argc,
255 const char **argv);
256 NTSTATUS rpc_printer_publish_update_internals(struct net_context *c,
257 const struct dom_sid *domain_sid,
258 const char *domain_name,
259 struct cli_state *cli,
260 struct rpc_pipe_client *pipe_hnd,
261 TALLOC_CTX *mem_ctx,
262 int argc,
263 const char **argv);
264 NTSTATUS rpc_printer_publish_list_internals(struct net_context *c,
265 const struct dom_sid *domain_sid,
266 const char *domain_name,
267 struct cli_state *cli,
268 struct rpc_pipe_client *pipe_hnd,
269 TALLOC_CTX *mem_ctx,
270 int argc,
271 const char **argv);
272 NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c,
273 const struct dom_sid *domain_sid,
274 const char *domain_name,
275 struct cli_state *cli,
276 struct rpc_pipe_client *pipe_hnd,
277 TALLOC_CTX *mem_ctx,
278 int argc,
279 const char **argv);
280 NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c,
281 const struct dom_sid *domain_sid,
282 const char *domain_name,
283 struct cli_state *cli,
284 struct rpc_pipe_client *pipe_hnd,
285 TALLOC_CTX *mem_ctx,
286 int argc,
287 const char **argv);
288 NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c,
289 const struct dom_sid *domain_sid,
290 const char *domain_name,
291 struct cli_state *cli,
292 struct rpc_pipe_client *pipe_hnd,
293 TALLOC_CTX *mem_ctx,
294 int argc,
295 const char **argv);
296 NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c,
297 const struct dom_sid *domain_sid,
298 const char *domain_name,
299 struct cli_state *cli,
300 struct rpc_pipe_client *pipe_hnd,
301 TALLOC_CTX *mem_ctx,
302 int argc,
303 const char **argv);
304 NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c,
305 const struct dom_sid *domain_sid,
306 const char *domain_name,
307 struct cli_state *cli,
308 struct rpc_pipe_client *pipe_hnd,
309 TALLOC_CTX *mem_ctx,
310 int argc,
311 const char **argv);
313 /* The following definitions come from utils/net_rpc_registry.c */
315 int net_rpc_registry(struct net_context *c, int argc, const char **argv);
317 /* The following definitions come from utils/net_rpc_rights.c */
319 int net_rpc_rights(struct net_context *c, int argc, const char **argv);
320 struct rpc_sh_cmd *net_rpc_rights_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
321 struct rpc_sh_ctx *ctx);
323 /* The following definitions come from utils/net_rpc_samsync.c */
325 NTSTATUS rpc_samdump_internals(struct net_context *c,
326 const struct dom_sid *domain_sid,
327 const char *domain_name,
328 struct cli_state *cli,
329 struct rpc_pipe_client *pipe_hnd,
330 TALLOC_CTX *mem_ctx,
331 int argc,
332 const char **argv);
333 int rpc_vampire_usage(struct net_context *c, int argc, const char **argv);
334 int rpc_vampire_passdb(struct net_context *c, int argc, const char **argv);
335 int rpc_vampire_ldif(struct net_context *c, int argc, const char **argv);
336 int rpc_vampire_keytab(struct net_context *c, int argc, const char **argv);
338 /* The following definitions come from utils/net_rpc_service.c */
340 const char *svc_status_string( uint32 state );
341 int net_rpc_service(struct net_context *c, int argc, const char **argv);
343 /* The following definitions come from utils/net_rpc_sh_acct.c */
345 struct rpc_sh_cmd *net_rpc_acct_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
346 struct rpc_sh_ctx *ctx);
348 /* The following definitions come from utils/net_rpc_shell.c */
350 int net_rpc_shell(struct net_context *c, int argc, const char **argv);
352 /* The following definitions come from utils/net_sam.c */
354 int net_sam(struct net_context *c, int argc, const char **argv);
356 /* The following definitions come from utils/net_share.c */
358 int net_share_usage(struct net_context *c, int argc, const char **argv);
359 int net_share(struct net_context *c, int argc, const char **argv);
361 /* The following definitions come from utils/net_status.c */
363 int net_status_usage(struct net_context *c, int argc, const char **argv);
364 int net_status(struct net_context *c, int argc, const char **argv);
366 /* The following definitions come from utils/net_time.c */
368 int net_time_usage(struct net_context *c, int argc, const char **argv);
369 int net_time(struct net_context *c, int argc, const char **argv);
371 /* The following definitions come from utils/net_user.c */
373 int net_user_usage(struct net_context *c, int argc, const char **argv);
374 int net_user(struct net_context *c, int argc, const char **argv);
376 /* The following definitions come from utils/net_usershare.c */
378 int net_usershare_usage(struct net_context *c, int argc, const char **argv);
379 int net_usershare_help(struct net_context *c, int argc, const char **argv);
380 int net_usershare(struct net_context *c, int argc, const char **argv);
382 /* The following definitions come from utils/net_eventlog.c */
384 int net_eventlog(struct net_context *c, int argc, const char **argv);
386 /* The following definitions come from utils/net_printing.c */
388 int net_printing(struct net_context *c, int argc, const char **argv);
390 /* The following definitions come from utils/net_serverid.c */
392 int net_serverid(struct net_context *c, int argc, const char **argv);
394 /* The following definitions come from utils/net_util.c */
396 NTSTATUS net_rpc_lookup_name(struct net_context *c,
397 TALLOC_CTX *mem_ctx, struct cli_state *cli,
398 const char *name, const char **ret_domain,
399 const char **ret_name, struct dom_sid *ret_sid,
400 enum lsa_SidType *ret_type);
401 NTSTATUS connect_to_service(struct net_context *c,
402 struct cli_state **cli_ctx,
403 struct sockaddr_storage *server_ss,
404 const char *server_name,
405 const char *service_name,
406 const char *service_type);
407 NTSTATUS connect_to_ipc(struct net_context *c,
408 struct cli_state **cli_ctx,
409 struct sockaddr_storage *server_ss,
410 const char *server_name);
411 NTSTATUS connect_to_ipc_anonymous(struct net_context *c,
412 struct cli_state **cli_ctx,
413 struct sockaddr_storage *server_ss,
414 const char *server_name);
415 NTSTATUS connect_to_ipc_krb5(struct net_context *c,
416 struct cli_state **cli_ctx,
417 struct sockaddr_storage *server_ss,
418 const char *server_name);
419 NTSTATUS connect_dst_pipe(struct net_context *c, struct cli_state **cli_dst,
420 struct rpc_pipe_client **pp_pipe_hnd,
421 const struct ndr_syntax_id *interface);
422 int net_use_krb_machine_account(struct net_context *c);
423 int net_use_machine_account(struct net_context *c);
424 bool net_find_server(struct net_context *c,
425 const char *domain,
426 unsigned flags,
427 struct sockaddr_storage *server_ss,
428 char **server_name);
429 bool net_find_pdc(struct sockaddr_storage *server_ss,
430 fstring server_name,
431 const char *domain_name);
432 NTSTATUS net_make_ipc_connection(struct net_context *c, unsigned flags,
433 struct cli_state **pcli);
434 NTSTATUS net_make_ipc_connection_ex(struct net_context *c ,const char *domain,
435 const char *server,
436 struct sockaddr_storage *pss,
437 unsigned flags, struct cli_state **pcli);
438 const char *net_prompt_pass(struct net_context *c, const char *user);
439 int net_run_function(struct net_context *c, int argc, const char **argv,
440 const char *whoami, struct functable *table);
441 void net_display_usage_from_functable(struct functable *table);
443 const char *net_share_type_str(int num_type);
445 NTSTATUS net_scan_dc(struct net_context *c,
446 struct cli_state *cli,
447 struct net_dc_info *dc_info);
449 /* The following definitions come from utils/netlookup.c */
451 NTSTATUS net_lookup_name_from_sid(struct net_context *c,
452 TALLOC_CTX *ctx,
453 struct dom_sid *psid,
454 const char **ppdomain,
455 const char **ppname);
456 NTSTATUS net_lookup_sid_from_name(struct net_context *c, TALLOC_CTX *ctx,
457 const char *full_name, struct dom_sid *pret_sid);
459 /* The following definitions come from utils/passwd_util.c */
461 char *stdin_new_passwd( void);
462 char *get_pass( const char *prompt, bool stdin_get);
464 /* The following definitions come from utils/net_g_lock.c */
465 int net_g_lock(struct net_context *c, int argc, const char **argv);
467 /* The following definitions come from utils/net_rpc_trust.c */
468 int net_rpc_trust(struct net_context *c, int argc, const char **argv);
470 #endif /* _NET_PROTO_H_ */