net: Move help for "net status" to net_status.c
[Samba/nascimento.git] / source3 / utils / net_proto.h
blob6d6700aa50ff0d77edc5024e4fb4ada929961e81
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(struct net_context *c, int argc, const char **argv);
122 /* The following definitions come from utils/net_idmap.c */
124 bool idmap_store_secret(const char *backend, bool alloc,
125 const char *domain, const char *identity,
126 const char *secret);
127 int net_help_idmap(struct net_context *c, int argc, const char **argv);
128 int net_idmap(struct net_context *c, int argc, const char **argv);
130 /* The following definitions come from utils/net_join.c */
132 int net_join_usage(struct net_context *c, int argc, const char **argv);
133 int net_join(struct net_context *c, int argc, const char **argv);
135 /* The following definitions come from utils/net_lookup.c */
137 int net_lookup_usage(struct net_context *c, int argc, const char **argv);
138 int net_lookup(struct net_context *c, int argc, const char **argv);
140 /* The following definitions come from utils/net_rap.c */
142 int net_rap_file_usage(struct net_context *c, int argc, const char **argv);
143 int net_rap_file(struct net_context *c, int argc, const char **argv);
144 int net_rap_share_usage(struct net_context *c, int argc, const char **argv);
145 int net_rap_share(struct net_context *c, int argc, const char **argv);
146 int net_rap_session_usage(struct net_context *c, int argc, const char **argv);
147 int net_rap_session(struct net_context *c, int argc, const char **argv);
148 int net_rap_server_usage(struct net_context *c, int argc, const char **argv);
149 int net_rap_server(struct net_context *c, int argc, const char **argv);
150 int net_rap_domain_usage(struct net_context *c, int argc, const char **argv);
151 int net_rap_domain(struct net_context *c, int argc, const char **argv);
152 int net_rap_printq_usage(struct net_context *c, int argc, const char **argv);
153 int net_rap_printq(struct net_context *c, int argc, const char **argv);
154 int net_rap_user(struct net_context *c, int argc, const char **argv);
155 int net_rap_group_usage(struct net_context *c, int argc, const char **argv);
156 int net_rap_group(struct net_context *c, int argc, const char **argv);
157 int net_rap_groupmember_usage(struct net_context *c, int argc, const char **argv);
158 int net_rap_groupmember(struct net_context *c, int argc, const char **argv);
159 int net_rap_validate_usage(struct net_context *c, int argc, const char **argv);
160 int net_rap_validate(struct net_context *c, int argc, const char **argv);
161 int net_rap_service_usage(struct net_context *c, int argc, const char **argv);
162 int net_rap_service(struct net_context *c, int argc, const char **argv);
163 int net_rap_password_usage(struct net_context *c, int argc, const char **argv);
164 int net_rap_password(struct net_context *c, int argc, const char **argv);
165 int net_rap_admin_usage(struct net_context *c, int argc, const char **argv);
166 int net_rap_admin(struct net_context *c, int argc, const char **argv);
167 int net_rap_usage(struct net_context *c, int argc, const char **argv);
168 int net_rap_help(struct net_context *c, int argc, const char **argv);
169 int net_rap(struct net_context *c, int argc, const char **argv);
171 /* The following definitions come from utils/net_registry.c */
173 int net_registry(struct net_context *c, int argc, const char **argv);
175 /* The following definitions come from utils/net_rpc.c */
177 NTSTATUS net_get_remote_domain_sid(struct cli_state *cli, TALLOC_CTX *mem_ctx,
178 DOM_SID **domain_sid,
179 const char **domain_name);
180 int run_rpc_command(struct net_context *c,
181 struct cli_state *cli_arg,
182 const int pipe_idx,
183 int conn_flags,
184 rpc_command_fn fn,
185 int argc,
186 const char **argv);
187 int net_rpc_changetrustpw(struct net_context *c, int argc, const char **argv);
188 int net_rpc_join(struct net_context *c, int argc, const char **argv);
189 NTSTATUS rpc_info_internals(struct net_context *c,
190 const DOM_SID *domain_sid,
191 const char *domain_name,
192 struct cli_state *cli,
193 struct rpc_pipe_client *pipe_hnd,
194 TALLOC_CTX *mem_ctx,
195 int argc,
196 const char **argv);
197 int net_rpc_info(struct net_context *c, int argc, const char **argv);
198 int net_rpc_getsid(struct net_context *c, int argc, const char **argv);
199 int net_rpc_user(struct net_context *c, int argc, const char **argv);
200 struct rpc_sh_cmd *net_rpc_user_edit_cmds(struct net_context *c,
201 TALLOC_CTX *mem_ctx,
202 struct rpc_sh_ctx *ctx);
203 struct rpc_sh_cmd *net_rpc_user_cmds(struct net_context *c,
204 TALLOC_CTX *mem_ctx,
205 struct rpc_sh_ctx *ctx);
206 int net_rpc_group(struct net_context *c, int argc, const char **argv);
207 bool copy_top_level_perms(struct net_context *c,
208 struct copy_clistate *cp_clistate,
209 const char *sharename);
210 int net_usersidlist(struct net_context *c, int argc, const char **argv);
211 int net_usersidlist_usage(struct net_context *c, int argc, const char **argv);
212 int net_rpc_share(struct net_context *c, int argc, const char **argv);
213 struct rpc_sh_cmd *net_rpc_share_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
214 struct rpc_sh_ctx *ctx);
215 int net_rpc_file(struct net_context *c, int argc, const char **argv);
216 NTSTATUS rpc_init_shutdown_internals(struct net_context *c,
217 const DOM_SID *domain_sid,
218 const char *domain_name,
219 struct cli_state *cli,
220 struct rpc_pipe_client *pipe_hnd,
221 TALLOC_CTX *mem_ctx,
222 int argc,
223 const char **argv);
224 NTSTATUS rpc_reg_shutdown_internals(struct net_context *c,
225 const 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 bool net_rpc_check(struct net_context *c, unsigned flags);
233 int rpc_printer_migrate(struct net_context *c, int argc, const char **argv);
234 int rpc_printer_usage(struct net_context *c, int argc, const char **argv);
235 int net_rpc_printer(struct net_context *c, int argc, const char **argv);
236 int net_rpc_usage(struct net_context *c, int argc, const char **argv);
237 int net_rpc_help(struct net_context *c, int argc, const char **argv);
238 int net_rpc(struct net_context *c, int argc, const char **argv);
240 /* The following definitions come from utils/net_rpc_audit.c */
242 int net_rpc_audit(struct net_context *c, int argc, const char **argv);
244 /* The following definitions come from utils/net_rpc_join.c */
246 NTSTATUS net_rpc_join_ok(struct net_context *c, const char *domain,
247 const char *server, struct sockaddr_storage *pss);
248 int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv);
249 int net_rpc_testjoin(struct net_context *c, int argc, const char **argv);
251 /* The following definitions come from utils/net_rpc_printer.c */
253 NTSTATUS net_copy_fileattr(struct net_context *c,
254 TALLOC_CTX *mem_ctx,
255 struct cli_state *cli_share_src,
256 struct cli_state *cli_share_dst,
257 const char *src_name, const char *dst_name,
258 bool copy_acls, bool copy_attrs,
259 bool copy_timestamps, bool is_file);
260 NTSTATUS net_copy_file(struct net_context *c,
261 TALLOC_CTX *mem_ctx,
262 struct cli_state *cli_share_src,
263 struct cli_state *cli_share_dst,
264 const char *src_name, const char *dst_name,
265 bool copy_acls, bool copy_attrs,
266 bool copy_timestamps, bool is_file);
267 NTSTATUS rpc_printer_list_internals(struct net_context *c,
268 const DOM_SID *domain_sid,
269 const char *domain_name,
270 struct cli_state *cli,
271 struct rpc_pipe_client *pipe_hnd,
272 TALLOC_CTX *mem_ctx,
273 int argc,
274 const char **argv);
275 NTSTATUS rpc_printer_driver_list_internals(struct net_context *c,
276 const DOM_SID *domain_sid,
277 const char *domain_name,
278 struct cli_state *cli,
279 struct rpc_pipe_client *pipe_hnd,
280 TALLOC_CTX *mem_ctx,
281 int argc,
282 const char **argv);
283 NTSTATUS rpc_printer_publish_publish_internals(struct net_context *c,
284 const DOM_SID *domain_sid,
285 const char *domain_name,
286 struct cli_state *cli,
287 struct rpc_pipe_client *pipe_hnd,
288 TALLOC_CTX *mem_ctx,
289 int argc,
290 const char **argv);
291 NTSTATUS rpc_printer_publish_unpublish_internals(struct net_context *c,
292 const DOM_SID *domain_sid,
293 const char *domain_name,
294 struct cli_state *cli,
295 struct rpc_pipe_client *pipe_hnd,
296 TALLOC_CTX *mem_ctx,
297 int argc,
298 const char **argv);
299 NTSTATUS rpc_printer_publish_update_internals(struct net_context *c,
300 const DOM_SID *domain_sid,
301 const char *domain_name,
302 struct cli_state *cli,
303 struct rpc_pipe_client *pipe_hnd,
304 TALLOC_CTX *mem_ctx,
305 int argc,
306 const char **argv);
307 NTSTATUS rpc_printer_publish_list_internals(struct net_context *c,
308 const DOM_SID *domain_sid,
309 const char *domain_name,
310 struct cli_state *cli,
311 struct rpc_pipe_client *pipe_hnd,
312 TALLOC_CTX *mem_ctx,
313 int argc,
314 const char **argv);
315 NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c,
316 const DOM_SID *domain_sid,
317 const char *domain_name,
318 struct cli_state *cli,
319 struct rpc_pipe_client *pipe_hnd,
320 TALLOC_CTX *mem_ctx,
321 int argc,
322 const char **argv);
323 NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c,
324 const DOM_SID *domain_sid,
325 const char *domain_name,
326 struct cli_state *cli,
327 struct rpc_pipe_client *pipe_hnd,
328 TALLOC_CTX *mem_ctx,
329 int argc,
330 const char **argv);
331 NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c,
332 const DOM_SID *domain_sid,
333 const char *domain_name,
334 struct cli_state *cli,
335 struct rpc_pipe_client *pipe_hnd,
336 TALLOC_CTX *mem_ctx,
337 int argc,
338 const char **argv);
339 NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c,
340 const DOM_SID *domain_sid,
341 const char *domain_name,
342 struct cli_state *cli,
343 struct rpc_pipe_client *pipe_hnd,
344 TALLOC_CTX *mem_ctx,
345 int argc,
346 const char **argv);
347 NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c,
348 const DOM_SID *domain_sid,
349 const char *domain_name,
350 struct cli_state *cli,
351 struct rpc_pipe_client *pipe_hnd,
352 TALLOC_CTX *mem_ctx,
353 int argc,
354 const char **argv);
356 /* The following definitions come from utils/net_rpc_registry.c */
358 int net_rpc_registry(struct net_context *c, int argc, const char **argv);
360 /* The following definitions come from utils/net_rpc_rights.c */
362 int net_rpc_rights(struct net_context *c, int argc, const char **argv);
363 struct rpc_sh_cmd *net_rpc_rights_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
364 struct rpc_sh_ctx *ctx);
366 /* The following definitions come from utils/net_rpc_samsync.c */
368 NTSTATUS rpc_samdump_internals(struct net_context *c,
369 const DOM_SID *domain_sid,
370 const char *domain_name,
371 struct cli_state *cli,
372 struct rpc_pipe_client *pipe_hnd,
373 TALLOC_CTX *mem_ctx,
374 int argc,
375 const char **argv);
376 int rpc_vampire_usage(struct net_context *c, int argc, const char **argv);
377 NTSTATUS rpc_vampire_internals(struct net_context *c,
378 const DOM_SID *domain_sid,
379 const char *domain_name,
380 struct cli_state *cli,
381 struct rpc_pipe_client *pipe_hnd,
382 TALLOC_CTX *mem_ctx,
383 int argc,
384 const char **argv);
386 /* The following definitions come from utils/net_rpc_service.c */
388 const char *svc_status_string( uint32 state );
389 int net_rpc_service(struct net_context *c, int argc, const char **argv);
391 /* The following definitions come from utils/net_rpc_sh_acct.c */
393 struct rpc_sh_cmd *net_rpc_acct_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
394 struct rpc_sh_ctx *ctx);
396 /* The following definitions come from utils/net_rpc_shell.c */
398 int net_rpc_shell(struct net_context *c, int argc, const char **argv);
400 /* The following definitions come from utils/net_sam.c */
402 int net_sam(struct net_context *c, int argc, const char **argv);
404 /* The following definitions come from utils/net_share.c */
406 int net_share_usage(struct net_context *c, int argc, const char **argv);
407 int net_share(struct net_context *c, int argc, const char **argv);
409 /* The following definitions come from utils/net_status.c */
411 int net_status_usage(struct net_context *c, int argc, const char **argv);
412 int net_status(struct net_context *c, int argc, const char **argv);
414 /* The following definitions come from utils/net_time.c */
416 int net_time_usage(struct net_context *c, int argc, const char **argv);
417 int net_time(struct net_context *c, int argc, const char **argv);
419 /* The following definitions come from utils/net_user.c */
421 int net_user_usage(struct net_context *c, int argc, const char **argv);
422 int net_user(struct net_context *c, int argc, const char **argv);
424 /* The following definitions come from utils/net_usershare.c */
426 int net_usershare_usage(struct net_context *c, int argc, const char **argv);
427 int net_usershare_help(struct net_context *c, int argc, const char **argv);
428 int net_usershare(struct net_context *c, int argc, const char **argv);
430 /* The following definitions come from utils/net_util.c */
432 NTSTATUS net_rpc_lookup_name(struct net_context *c,
433 TALLOC_CTX *mem_ctx, struct cli_state *cli,
434 const char *name, const char **ret_domain,
435 const char **ret_name, DOM_SID *ret_sid,
436 enum lsa_SidType *ret_type);
437 NTSTATUS connect_to_service(struct net_context *c,
438 struct cli_state **cli_ctx,
439 struct sockaddr_storage *server_ss,
440 const char *server_name,
441 const char *service_name,
442 const char *service_type);
443 NTSTATUS connect_to_ipc(struct net_context *c,
444 struct cli_state **cli_ctx,
445 struct sockaddr_storage *server_ss,
446 const char *server_name);
447 NTSTATUS connect_to_ipc_anonymous(struct net_context *c,
448 struct cli_state **cli_ctx,
449 struct sockaddr_storage *server_ss,
450 const char *server_name);
451 NTSTATUS connect_to_ipc_krb5(struct net_context *c,
452 struct cli_state **cli_ctx,
453 struct sockaddr_storage *server_ss,
454 const char *server_name);
455 NTSTATUS connect_dst_pipe(struct net_context *c, struct cli_state **cli_dst,
456 struct rpc_pipe_client **pp_pipe_hnd, int pipe_num);
457 int net_use_krb_machine_account(struct net_context *c);
458 int net_use_machine_account(struct net_context *c);
459 bool net_find_server(struct net_context *c,
460 const char *domain,
461 unsigned flags,
462 struct sockaddr_storage *server_ss,
463 char **server_name);
464 bool net_find_pdc(struct sockaddr_storage *server_ss,
465 fstring server_name,
466 const char *domain_name);
467 NTSTATUS net_make_ipc_connection(struct net_context *c, unsigned flags,
468 struct cli_state **pcli);
469 NTSTATUS net_make_ipc_connection_ex(struct net_context *c ,const char *domain,
470 const char *server,
471 struct sockaddr_storage *pss,
472 unsigned flags, struct cli_state **pcli);
473 const char *net_prompt_pass(struct net_context *c, const char *user);
475 /* The following definitions come from utils/netlookup.c */
477 NTSTATUS net_lookup_name_from_sid(struct net_context *c,
478 TALLOC_CTX *ctx,
479 DOM_SID *psid,
480 const char **ppdomain,
481 const char **ppname);
482 NTSTATUS net_lookup_sid_from_name(struct net_context *c, TALLOC_CTX *ctx,
483 const char *full_name, DOM_SID *pret_sid);
485 /* The following definitions come from utils/passwd_util.c */
487 char *stdin_new_passwd( void);
488 char *get_pass( const char *prompt, bool stdin_get);
490 #endif /* _NET_PROTO_H_ */