net: Split out "net afs"
[Samba.git] / source / utils / net_proto.h
blob3a98c3bc015e7f72c0a9212320f5a5519c26def5
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 auth/token_util.c */
29 bool nt_token_check_sid ( const DOM_SID *sid, const NT_USER_TOKEN *token );
30 bool nt_token_check_domain_rid( NT_USER_TOKEN *token, uint32 rid );
31 NT_USER_TOKEN *get_root_nt_token( void );
32 NTSTATUS add_aliases(const DOM_SID *domain_sid,
33 struct nt_user_token *token);
34 struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
35 const DOM_SID *user_sid,
36 bool is_guest,
37 int num_groupsids,
38 const DOM_SID *groupsids);
39 void debug_nt_user_token(int dbg_class, int dbg_lev, NT_USER_TOKEN *token);
40 void debug_unix_user_token(int dbg_class, int dbg_lev, uid_t uid, gid_t gid,
41 int n_groups, gid_t *groups);
43 /* The following definitions come from utils/net.c */
45 uint32 get_sec_channel_type(const char *param);
46 int net_run_function(struct net_context *c, int argc, const char **argv,
47 struct functable *table,
48 int (*usage_fn)(struct net_context *c,
49 int argc, const char **argv));
50 int net_run_function2(struct net_context *c, int argc, const char **argv,
51 const char *whoami, struct functable2 *table);
53 /* The following definitions come from utils/net_ads.c */
55 int net_ads_usage(struct net_context *c, int argc, const char **argv);
56 ADS_STATUS ads_startup(struct net_context *c, bool only_own_domain, ADS_STRUCT **ads);
57 ADS_STATUS ads_startup_nobind(struct net_context *c, bool only_own_domain, ADS_STRUCT **ads);
58 int net_ads_check_our_domain(struct net_context *c);
59 int net_ads_check(struct net_context *c);
60 int net_ads_user(struct net_context *c, int argc, const char **argv);
61 int net_ads_group(struct net_context *c, int argc, const char **argv);
62 int net_ads_testjoin(struct net_context *c, int argc, const char **argv);
63 int net_ads_join(struct net_context *c, int argc, const char **argv);
64 int net_ads_printer_usage(struct net_context *c, int argc, const char **argv);
65 int net_ads_changetrustpw(struct net_context *c, int argc, const char **argv);
66 int net_ads_keytab(struct net_context *c, int argc, const char **argv);
67 int net_ads_kerberos(struct net_context *c, int argc, const char **argv);
68 int net_ads_help(struct net_context *c, int argc, const char **argv);
69 int net_ads(struct net_context *c, int argc, const char **argv);
70 int net_ads_keytab(struct net_context *c, int argc, const char **argv);
71 int net_ads_kerberos(struct net_context *c, int argc, const char **argv);
72 int net_ads_usage(struct net_context *c, int argc, const char **argv);
73 int net_ads_help(struct net_context *c, int argc, const char **argv);
74 int net_ads_changetrustpw(struct net_context *c, int argc, const char **argv);
75 int net_ads_join(struct net_context *c, int argc, const char **argv);
76 int net_ads_user(struct net_context *c, int argc, const char **argv);
77 int net_ads_group(struct net_context *c, int argc, const char **argv);
78 int net_ads_check(struct net_context *c);
79 int net_ads_check_our_domain(struct net_context *c);
80 int net_ads(struct net_context *c, int argc, const char **argv);
82 /* The following definitions come from utils/net_ads_gpo.c */
84 int net_ads_gpo(struct net_context *c, int argc, const char **argv);
86 /* The following definitions come from utils/net_cache.c */
88 int net_cache(struct net_context *c, int argc, const char **argv);
90 /* The following definitions come from utils/net_conf.c */
92 int net_conf(struct net_context *c, int argc, const char **argv);
94 /* The following definitions come from utils/net_dns.c */
96 int get_my_ip_address( struct sockaddr_storage **pp_ss );
98 /* The following definitions come from utils/net_dom.c */
100 int net_help_dom(struct net_context *c, int argc, const char **argv);
101 int net_dom(struct net_context *c, int argc, const char **argv);
103 /* The following definitions come from utils/net_file.c */
105 int net_file_usage(struct net_context *c, int argc, const char **argv);
106 int net_file(struct net_context *c, int argc, const char **argv);
108 /* The following definitions come from utils/net_group.c */
110 int net_group_usage(struct net_context *c, int argc, const char **argv);
111 int net_group(struct net_context *c, int argc, const char **argv);
113 /* The following definitions come from utils/net_groupmap.c */
115 int net_help_groupmap(struct net_context *c, int argc, const char **argv);
116 int net_groupmap(struct net_context *c, int argc, const char **argv);
118 /* The following definitions come from utils/net_help.c */
120 int net_help_share(struct net_context *c, int argc, const char **argv);
121 int net_help_printer(struct net_context *c, int argc, const char **argv);
122 int net_help_status(struct net_context *c, int argc, const char **argv);
123 int net_help(struct net_context *c, int argc, const char **argv);
125 /* The following definitions come from utils/net_idmap.c */
127 bool idmap_store_secret(const char *backend, bool alloc,
128 const char *domain, const char *identity,
129 const char *secret);
130 int net_help_idmap(struct net_context *c, int argc, const char **argv);
131 int net_idmap(struct net_context *c, int argc, const char **argv);
133 /* The following definitions come from utils/net_join.c */
135 int net_join_usage(struct net_context *c, int argc, const char **argv);
136 int net_join(struct net_context *c, int argc, const char **argv);
138 /* The following definitions come from utils/net_lookup.c */
140 int net_lookup_usage(struct net_context *c, int argc, const char **argv);
141 int net_lookup(struct net_context *c, int argc, const char **argv);
143 /* The following definitions come from utils/net_rap.c */
145 int net_rap_file_usage(struct net_context *c, int argc, const char **argv);
146 int net_rap_file(struct net_context *c, int argc, const char **argv);
147 int net_rap_share_usage(struct net_context *c, int argc, const char **argv);
148 int net_rap_share(struct net_context *c, int argc, const char **argv);
149 int net_rap_session_usage(struct net_context *c, int argc, const char **argv);
150 int net_rap_session(struct net_context *c, int argc, const char **argv);
151 int net_rap_server_usage(struct net_context *c, int argc, const char **argv);
152 int net_rap_server(struct net_context *c, int argc, const char **argv);
153 int net_rap_domain_usage(struct net_context *c, int argc, const char **argv);
154 int net_rap_domain(struct net_context *c, int argc, const char **argv);
155 int net_rap_printq_usage(struct net_context *c, int argc, const char **argv);
156 int net_rap_printq(struct net_context *c, int argc, const char **argv);
157 int net_rap_user(struct net_context *c, int argc, const char **argv);
158 int net_rap_group_usage(struct net_context *c, int argc, const char **argv);
159 int net_rap_group(struct net_context *c, int argc, const char **argv);
160 int net_rap_groupmember_usage(struct net_context *c, int argc, const char **argv);
161 int net_rap_groupmember(struct net_context *c, int argc, const char **argv);
162 int net_rap_validate_usage(struct net_context *c, int argc, const char **argv);
163 int net_rap_validate(struct net_context *c, int argc, const char **argv);
164 int net_rap_service_usage(struct net_context *c, int argc, const char **argv);
165 int net_rap_service(struct net_context *c, int argc, const char **argv);
166 int net_rap_password_usage(struct net_context *c, int argc, const char **argv);
167 int net_rap_password(struct net_context *c, int argc, const char **argv);
168 int net_rap_admin_usage(struct net_context *c, int argc, const char **argv);
169 int net_rap_admin(struct net_context *c, int argc, const char **argv);
170 int net_rap_usage(struct net_context *c, int argc, const char **argv);
171 int net_rap_help(struct net_context *c, int argc, const char **argv);
172 int net_rap(struct net_context *c, int argc, const char **argv);
174 /* The following definitions come from utils/net_registry.c */
176 int net_registry(struct net_context *c, int argc, const char **argv);
178 /* The following definitions come from utils/net_rpc.c */
180 NTSTATUS net_get_remote_domain_sid(struct cli_state *cli, TALLOC_CTX *mem_ctx,
181 DOM_SID **domain_sid,
182 const char **domain_name);
183 int run_rpc_command(struct net_context *c,
184 struct cli_state *cli_arg,
185 const int pipe_idx,
186 int conn_flags,
187 rpc_command_fn fn,
188 int argc,
189 const char **argv);
190 int net_rpc_changetrustpw(struct net_context *c, int argc, const char **argv);
191 int net_rpc_join(struct net_context *c, int argc, const char **argv);
192 NTSTATUS rpc_info_internals(struct net_context *c,
193 const DOM_SID *domain_sid,
194 const char *domain_name,
195 struct cli_state *cli,
196 struct rpc_pipe_client *pipe_hnd,
197 TALLOC_CTX *mem_ctx,
198 int argc,
199 const char **argv);
200 int net_rpc_info(struct net_context *c, int argc, const char **argv);
201 int net_rpc_getsid(struct net_context *c, int argc, const char **argv);
202 int net_rpc_user(struct net_context *c, int argc, const char **argv);
203 struct rpc_sh_cmd *net_rpc_user_edit_cmds(struct net_context *c,
204 TALLOC_CTX *mem_ctx,
205 struct rpc_sh_ctx *ctx);
206 struct rpc_sh_cmd *net_rpc_user_cmds(struct net_context *c,
207 TALLOC_CTX *mem_ctx,
208 struct rpc_sh_ctx *ctx);
209 int net_rpc_group(struct net_context *c, int argc, const char **argv);
210 bool copy_top_level_perms(struct net_context *c,
211 struct copy_clistate *cp_clistate,
212 const char *sharename);
213 int net_usersidlist(struct net_context *c, int argc, const char **argv);
214 int net_usersidlist_usage(struct net_context *c, int argc, const char **argv);
215 int net_rpc_share(struct net_context *c, int argc, const char **argv);
216 struct rpc_sh_cmd *net_rpc_share_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
217 struct rpc_sh_ctx *ctx);
218 int net_rpc_file(struct net_context *c, int argc, const char **argv);
219 NTSTATUS rpc_init_shutdown_internals(struct net_context *c,
220 const DOM_SID *domain_sid,
221 const char *domain_name,
222 struct cli_state *cli,
223 struct rpc_pipe_client *pipe_hnd,
224 TALLOC_CTX *mem_ctx,
225 int argc,
226 const char **argv);
227 NTSTATUS rpc_reg_shutdown_internals(struct net_context *c,
228 const DOM_SID *domain_sid,
229 const char *domain_name,
230 struct cli_state *cli,
231 struct rpc_pipe_client *pipe_hnd,
232 TALLOC_CTX *mem_ctx,
233 int argc,
234 const char **argv);
235 bool net_rpc_check(struct net_context *c, unsigned flags);
236 int rpc_printer_migrate(struct net_context *c, int argc, const char **argv);
237 int rpc_printer_usage(struct net_context *c, int argc, const char **argv);
238 int net_rpc_printer(struct net_context *c, int argc, const char **argv);
239 int net_rpc_usage(struct net_context *c, int argc, const char **argv);
240 int net_rpc_help(struct net_context *c, int argc, const char **argv);
241 int net_rpc(struct net_context *c, int argc, const char **argv);
243 /* The following definitions come from utils/net_rpc_audit.c */
245 int net_rpc_audit(struct net_context *c, int argc, const char **argv);
247 /* The following definitions come from utils/net_rpc_join.c */
249 NTSTATUS net_rpc_join_ok(struct net_context *c, const char *domain,
250 const char *server, struct sockaddr_storage *pss);
251 int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv);
252 int net_rpc_testjoin(struct net_context *c, int argc, const char **argv);
254 /* The following definitions come from utils/net_rpc_printer.c */
256 NTSTATUS net_copy_fileattr(struct net_context *c,
257 TALLOC_CTX *mem_ctx,
258 struct cli_state *cli_share_src,
259 struct cli_state *cli_share_dst,
260 const char *src_name, const char *dst_name,
261 bool copy_acls, bool copy_attrs,
262 bool copy_timestamps, bool is_file);
263 NTSTATUS net_copy_file(struct net_context *c,
264 TALLOC_CTX *mem_ctx,
265 struct cli_state *cli_share_src,
266 struct cli_state *cli_share_dst,
267 const char *src_name, const char *dst_name,
268 bool copy_acls, bool copy_attrs,
269 bool copy_timestamps, bool is_file);
270 NTSTATUS rpc_printer_list_internals(struct net_context *c,
271 const DOM_SID *domain_sid,
272 const char *domain_name,
273 struct cli_state *cli,
274 struct rpc_pipe_client *pipe_hnd,
275 TALLOC_CTX *mem_ctx,
276 int argc,
277 const char **argv);
278 NTSTATUS rpc_printer_driver_list_internals(struct net_context *c,
279 const DOM_SID *domain_sid,
280 const char *domain_name,
281 struct cli_state *cli,
282 struct rpc_pipe_client *pipe_hnd,
283 TALLOC_CTX *mem_ctx,
284 int argc,
285 const char **argv);
286 NTSTATUS rpc_printer_publish_publish_internals(struct net_context *c,
287 const DOM_SID *domain_sid,
288 const char *domain_name,
289 struct cli_state *cli,
290 struct rpc_pipe_client *pipe_hnd,
291 TALLOC_CTX *mem_ctx,
292 int argc,
293 const char **argv);
294 NTSTATUS rpc_printer_publish_unpublish_internals(struct net_context *c,
295 const DOM_SID *domain_sid,
296 const char *domain_name,
297 struct cli_state *cli,
298 struct rpc_pipe_client *pipe_hnd,
299 TALLOC_CTX *mem_ctx,
300 int argc,
301 const char **argv);
302 NTSTATUS rpc_printer_publish_update_internals(struct net_context *c,
303 const DOM_SID *domain_sid,
304 const char *domain_name,
305 struct cli_state *cli,
306 struct rpc_pipe_client *pipe_hnd,
307 TALLOC_CTX *mem_ctx,
308 int argc,
309 const char **argv);
310 NTSTATUS rpc_printer_publish_list_internals(struct net_context *c,
311 const DOM_SID *domain_sid,
312 const char *domain_name,
313 struct cli_state *cli,
314 struct rpc_pipe_client *pipe_hnd,
315 TALLOC_CTX *mem_ctx,
316 int argc,
317 const char **argv);
318 NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c,
319 const DOM_SID *domain_sid,
320 const char *domain_name,
321 struct cli_state *cli,
322 struct rpc_pipe_client *pipe_hnd,
323 TALLOC_CTX *mem_ctx,
324 int argc,
325 const char **argv);
326 NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c,
327 const DOM_SID *domain_sid,
328 const char *domain_name,
329 struct cli_state *cli,
330 struct rpc_pipe_client *pipe_hnd,
331 TALLOC_CTX *mem_ctx,
332 int argc,
333 const char **argv);
334 NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c,
335 const DOM_SID *domain_sid,
336 const char *domain_name,
337 struct cli_state *cli,
338 struct rpc_pipe_client *pipe_hnd,
339 TALLOC_CTX *mem_ctx,
340 int argc,
341 const char **argv);
342 NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c,
343 const DOM_SID *domain_sid,
344 const char *domain_name,
345 struct cli_state *cli,
346 struct rpc_pipe_client *pipe_hnd,
347 TALLOC_CTX *mem_ctx,
348 int argc,
349 const char **argv);
350 NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c,
351 const DOM_SID *domain_sid,
352 const char *domain_name,
353 struct cli_state *cli,
354 struct rpc_pipe_client *pipe_hnd,
355 TALLOC_CTX *mem_ctx,
356 int argc,
357 const char **argv);
359 /* The following definitions come from utils/net_rpc_registry.c */
361 int net_rpc_registry(struct net_context *c, int argc, const char **argv);
363 /* The following definitions come from utils/net_rpc_rights.c */
365 int net_rpc_rights(struct net_context *c, int argc, const char **argv);
366 struct rpc_sh_cmd *net_rpc_rights_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
367 struct rpc_sh_ctx *ctx);
369 /* The following definitions come from utils/net_rpc_samsync.c */
371 NTSTATUS rpc_samdump_internals(struct net_context *c,
372 const DOM_SID *domain_sid,
373 const char *domain_name,
374 struct cli_state *cli,
375 struct rpc_pipe_client *pipe_hnd,
376 TALLOC_CTX *mem_ctx,
377 int argc,
378 const char **argv);
379 int rpc_vampire_usage(struct net_context *c, int argc, const char **argv);
380 NTSTATUS rpc_vampire_internals(struct net_context *c,
381 const DOM_SID *domain_sid,
382 const char *domain_name,
383 struct cli_state *cli,
384 struct rpc_pipe_client *pipe_hnd,
385 TALLOC_CTX *mem_ctx,
386 int argc,
387 const char **argv);
389 /* The following definitions come from utils/net_rpc_service.c */
391 const char *svc_status_string( uint32 state );
392 int net_rpc_service(struct net_context *c, int argc, const char **argv);
394 /* The following definitions come from utils/net_rpc_sh_acct.c */
396 struct rpc_sh_cmd *net_rpc_acct_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
397 struct rpc_sh_ctx *ctx);
399 /* The following definitions come from utils/net_rpc_shell.c */
401 int net_rpc_shell(struct net_context *c, int argc, const char **argv);
403 /* The following definitions come from utils/net_sam.c */
405 int net_sam(struct net_context *c, int argc, const char **argv);
407 /* The following definitions come from utils/net_status.c */
409 int net_status(struct net_context *c, int argc, const char **argv);
411 /* The following definitions come from utils/net_time.c */
413 int net_time_usage(struct net_context *c, int argc, const char **argv);
414 int net_time(struct net_context *c, int argc, const char **argv);
416 /* The following definitions come from utils/net_user.c */
418 int net_user_usage(struct net_context *c, int argc, const char **argv);
419 int net_user(struct net_context *c, int argc, const char **argv);
421 /* The following definitions come from utils/net_usershare.c */
423 int net_usershare_usage(struct net_context *c, int argc, const char **argv);
424 int net_usershare_help(struct net_context *c, int argc, const char **argv);
425 int net_usershare(struct net_context *c, int argc, const char **argv);
427 /* The following definitions come from utils/net_util.c */
429 NTSTATUS net_rpc_lookup_name(struct net_context *c,
430 TALLOC_CTX *mem_ctx, struct cli_state *cli,
431 const char *name, const char **ret_domain,
432 const char **ret_name, DOM_SID *ret_sid,
433 enum lsa_SidType *ret_type);
434 NTSTATUS connect_to_service(struct net_context *c,
435 struct cli_state **cli_ctx,
436 struct sockaddr_storage *server_ss,
437 const char *server_name,
438 const char *service_name,
439 const char *service_type);
440 NTSTATUS connect_to_ipc(struct net_context *c,
441 struct cli_state **cli_ctx,
442 struct sockaddr_storage *server_ss,
443 const char *server_name);
444 NTSTATUS connect_to_ipc_anonymous(struct net_context *c,
445 struct cli_state **cli_ctx,
446 struct sockaddr_storage *server_ss,
447 const char *server_name);
448 NTSTATUS connect_to_ipc_krb5(struct net_context *c,
449 struct cli_state **cli_ctx,
450 struct sockaddr_storage *server_ss,
451 const char *server_name);
452 NTSTATUS connect_dst_pipe(struct net_context *c, struct cli_state **cli_dst,
453 struct rpc_pipe_client **pp_pipe_hnd, int pipe_num);
454 int net_use_krb_machine_account(struct net_context *c);
455 int net_use_machine_account(struct net_context *c);
456 bool net_find_server(struct net_context *c,
457 const char *domain,
458 unsigned flags,
459 struct sockaddr_storage *server_ss,
460 char **server_name);
461 bool net_find_pdc(struct sockaddr_storage *server_ss,
462 fstring server_name,
463 const char *domain_name);
464 NTSTATUS net_make_ipc_connection(struct net_context *c, unsigned flags,
465 struct cli_state **pcli);
466 NTSTATUS net_make_ipc_connection_ex(struct net_context *c ,const char *domain,
467 const char *server,
468 struct sockaddr_storage *pss,
469 unsigned flags, struct cli_state **pcli);
470 const char *net_prompt_pass(struct net_context *c, const char *user);
472 /* The following definitions come from utils/netlookup.c */
474 NTSTATUS net_lookup_name_from_sid(struct net_context *c,
475 TALLOC_CTX *ctx,
476 DOM_SID *psid,
477 const char **ppdomain,
478 const char **ppname);
479 NTSTATUS net_lookup_sid_from_name(struct net_context *c, TALLOC_CTX *ctx,
480 const char *full_name, DOM_SID *pret_sid);
482 /* The following definitions come from utils/passwd_util.c */
484 char *stdin_new_passwd( void);
485 char *get_pass( const char *prompt, bool stdin_get);
487 #endif /* _NET_PROTO_H_ */