net: The top level help function for net cmd is always net_cmd_usage
[samba.git] / source3 / utils / net_proto.h
1 /*
2  * Unix SMB/CIFS implementation.
3  * collected prototypes header
4  *
5  * frozen from "make proto" in May 2008
6  *
7  * Copyright (C) Michael Adam 2008
8  *
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.
13  *
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.
18  *
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/>.
21  */
22
23 #ifndef _NET_PROTO_H_
24 #define _NET_PROTO_H_
25
26
27 /* The following definitions come from auth/token_util.c  */
28
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);
42
43 /* The following definitions come from utils/net.c  */
44
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);
52
53 /* The following definitions come from utils/net_ads.c  */
54
55 int net_ads_help(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_usage(struct net_context *c, int argc, const char **argv);
69 int net_ads(struct net_context *c, int argc, const char **argv);
70
71 /* The following definitions come from utils/net_ads_gpo.c  */
72
73 int net_ads_gpo(struct net_context *c, int argc, const char **argv);
74
75 /* The following definitions come from utils/net_cache.c  */
76
77 int net_cache(struct net_context *c, int argc, const char **argv);
78
79 /* The following definitions come from utils/net_conf.c  */
80
81 int net_conf(struct net_context *c, int argc, const char **argv);
82
83 /* The following definitions come from utils/net_dns.c  */
84
85 int get_my_ip_address( struct sockaddr_storage **pp_ss );
86
87 /* The following definitions come from utils/net_dom.c  */
88
89 int net_dom_usage(struct net_context *c, int argc, const char **argv);
90 int net_dom(struct net_context *c, int argc, const char **argv);
91
92 /* The following definitions come from utils/net_file.c  */
93
94 int net_file_usage(struct net_context *c, int argc, const char **argv);
95 int net_file(struct net_context *c, int argc, const char **argv);
96
97 /* The following definitions come from utils/net_group.c  */
98
99 int net_group_usage(struct net_context *c, int argc, const char **argv);
100 int net_group(struct net_context *c, int argc, const char **argv);
101
102 /* The following definitions come from utils/net_groupmap.c  */
103
104 int net_groupmap_usage(struct net_context *c, int argc, const char **argv);
105 int net_groupmap(struct net_context *c, int argc, const char **argv);
106
107 /* The following definitions come from utils/net_help.c  */
108
109 int net_help(struct net_context *c, int argc, const char **argv);
110
111 /* The following definitions come from utils/net_idmap.c  */
112
113 bool idmap_store_secret(const char *backend, bool alloc,
114                         const char *domain, const char *identity,
115                         const char *secret);
116 int net_help_idmap(struct net_context *c, int argc, const char **argv);
117 int net_idmap(struct net_context *c, int argc, const char **argv);
118
119 /* The following definitions come from utils/net_join.c  */
120
121 int net_join_usage(struct net_context *c, int argc, const char **argv);
122 int net_join(struct net_context *c, int argc, const char **argv);
123
124 /* The following definitions come from utils/net_lookup.c  */
125
126 int net_lookup_usage(struct net_context *c, int argc, const char **argv);
127 int net_lookup(struct net_context *c, int argc, const char **argv);
128
129 /* The following definitions come from utils/net_rap.c  */
130
131 int net_rap_file_usage(struct net_context *c, int argc, const char **argv);
132 int net_rap_file(struct net_context *c, int argc, const char **argv);
133 int net_rap_share_usage(struct net_context *c, int argc, const char **argv);
134 int net_rap_share(struct net_context *c, int argc, const char **argv);
135 int net_rap_session_usage(struct net_context *c, int argc, const char **argv);
136 int net_rap_session(struct net_context *c, int argc, const char **argv);
137 int net_rap_server_usage(struct net_context *c, int argc, const char **argv);
138 int net_rap_server(struct net_context *c, int argc, const char **argv);
139 int net_rap_domain_usage(struct net_context *c, int argc, const char **argv);
140 int net_rap_domain(struct net_context *c, int argc, const char **argv);
141 int net_rap_printq_usage(struct net_context *c, int argc, const char **argv);
142 int net_rap_printq(struct net_context *c, int argc, const char **argv);
143 int net_rap_user(struct net_context *c, int argc, const char **argv);
144 int net_rap_group_usage(struct net_context *c, int argc, const char **argv);
145 int net_rap_group(struct net_context *c, int argc, const char **argv);
146 int net_rap_groupmember_usage(struct net_context *c, int argc, const char **argv);
147 int net_rap_groupmember(struct net_context *c, int argc, const char **argv);
148 int net_rap_validate_usage(struct net_context *c, int argc, const char **argv);
149 int net_rap_validate(struct net_context *c, int argc, const char **argv);
150 int net_rap_service_usage(struct net_context *c, int argc, const char **argv);
151 int net_rap_service(struct net_context *c, int argc, const char **argv);
152 int net_rap_password_usage(struct net_context *c, int argc, const char **argv);
153 int net_rap_password(struct net_context *c, int argc, const char **argv);
154 int net_rap_admin_usage(struct net_context *c, int argc, const char **argv);
155 int net_rap_admin(struct net_context *c, int argc, const char **argv);
156 int net_rap_help(struct net_context *c, int argc, const char **argv);
157 int net_rap_usage(struct net_context *c, int argc, const char **argv);
158 int net_rap(struct net_context *c, int argc, const char **argv);
159
160 /* The following definitions come from utils/net_registry.c  */
161
162 int net_registry(struct net_context *c, int argc, const char **argv);
163
164 /* The following definitions come from utils/net_rpc.c  */
165
166 NTSTATUS net_get_remote_domain_sid(struct cli_state *cli, TALLOC_CTX *mem_ctx,
167                                    DOM_SID **domain_sid,
168                                    const char **domain_name);
169 int run_rpc_command(struct net_context *c,
170                         struct cli_state *cli_arg,
171                         const int pipe_idx,
172                         int conn_flags,
173                         rpc_command_fn fn,
174                         int argc,
175                         const char **argv);
176 int net_rpc_changetrustpw(struct net_context *c, int argc, const char **argv);
177 int net_rpc_join(struct net_context *c, int argc, const char **argv);
178 NTSTATUS rpc_info_internals(struct net_context *c,
179                         const DOM_SID *domain_sid,
180                         const char *domain_name,
181                         struct cli_state *cli,
182                         struct rpc_pipe_client *pipe_hnd,
183                         TALLOC_CTX *mem_ctx,
184                         int argc,
185                         const char **argv);
186 int net_rpc_info(struct net_context *c, int argc, const char **argv);
187 int net_rpc_getsid(struct net_context *c, int argc, const char **argv);
188 int net_rpc_user(struct net_context *c, int argc, const char **argv);
189 struct rpc_sh_cmd *net_rpc_user_edit_cmds(struct net_context *c,
190                                           TALLOC_CTX *mem_ctx,
191                                           struct rpc_sh_ctx *ctx);
192 struct rpc_sh_cmd *net_rpc_user_cmds(struct net_context *c,
193                                      TALLOC_CTX *mem_ctx,
194                                      struct rpc_sh_ctx *ctx);
195 int net_rpc_group(struct net_context *c, int argc, const char **argv);
196 bool copy_top_level_perms(struct net_context *c,
197                                 struct copy_clistate *cp_clistate,
198                                 const char *sharename);
199 int net_usersidlist(struct net_context *c, int argc, const char **argv);
200 int net_usersidlist_usage(struct net_context *c, int argc, const char **argv);
201 int net_rpc_share(struct net_context *c, int argc, const char **argv);
202 struct rpc_sh_cmd *net_rpc_share_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
203                                       struct rpc_sh_ctx *ctx);
204 int net_rpc_file(struct net_context *c, int argc, const char **argv);
205 NTSTATUS rpc_init_shutdown_internals(struct net_context *c,
206                                      const DOM_SID *domain_sid,
207                                      const char *domain_name,
208                                      struct cli_state *cli,
209                                      struct rpc_pipe_client *pipe_hnd,
210                                      TALLOC_CTX *mem_ctx,
211                                      int argc,
212                                      const char **argv);
213 NTSTATUS rpc_reg_shutdown_internals(struct net_context *c,
214                                     const DOM_SID *domain_sid,
215                                     const char *domain_name,
216                                     struct cli_state *cli,
217                                     struct rpc_pipe_client *pipe_hnd,
218                                     TALLOC_CTX *mem_ctx,
219                                     int argc,
220                                     const char **argv);
221 bool net_rpc_check(struct net_context *c, unsigned flags);
222 int rpc_printer_migrate(struct net_context *c, int argc, const char **argv);
223 int rpc_printer_usage(struct net_context *c, int argc, const char **argv);
224 int net_rpc_printer(struct net_context *c, int argc, const char **argv);
225 int net_rpc_help(struct net_context *c, int argc, const char **argv);
226 int net_rpc_usage(struct net_context *c, int argc, const char **argv);
227 int net_rpc(struct net_context *c, int argc, const char **argv);
228
229 /* The following definitions come from utils/net_rpc_audit.c  */
230
231 int net_rpc_audit(struct net_context *c, int argc, const char **argv);
232
233 /* The following definitions come from utils/net_rpc_join.c  */
234
235 NTSTATUS net_rpc_join_ok(struct net_context *c, const char *domain,
236                          const char *server, struct sockaddr_storage *pss);
237 int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv);
238 int net_rpc_testjoin(struct net_context *c, int argc, const char **argv);
239
240 /* The following definitions come from utils/net_rpc_printer.c  */
241
242 NTSTATUS net_copy_fileattr(struct net_context *c,
243                   TALLOC_CTX *mem_ctx,
244                   struct cli_state *cli_share_src,
245                   struct cli_state *cli_share_dst,
246                   const char *src_name, const char *dst_name,
247                   bool copy_acls, bool copy_attrs,
248                   bool copy_timestamps, bool is_file);
249 NTSTATUS net_copy_file(struct net_context *c,
250                        TALLOC_CTX *mem_ctx,
251                        struct cli_state *cli_share_src,
252                        struct cli_state *cli_share_dst,
253                        const char *src_name, const char *dst_name,
254                        bool copy_acls, bool copy_attrs,
255                        bool copy_timestamps, bool is_file);
256 NTSTATUS rpc_printer_list_internals(struct net_context *c,
257                                         const 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_driver_list_internals(struct net_context *c,
265                                                 const 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_publish_publish_internals(struct net_context *c,
273                                                 const 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_publish_unpublish_internals(struct net_context *c,
281                                                 const 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_publish_update_internals(struct net_context *c,
289                                                 const 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_publish_list_internals(struct net_context *c,
297                                                 const 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_security_internals(struct net_context *c,
305                                                 const 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);
312 NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c,
313                                                 const DOM_SID *domain_sid,
314                                                 const char *domain_name,
315                                                 struct cli_state *cli,
316                                                 struct rpc_pipe_client *pipe_hnd,
317                                                 TALLOC_CTX *mem_ctx,
318                                                 int argc,
319                                                 const char **argv);
320 NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c,
321                                                 const DOM_SID *domain_sid,
322                                                 const char *domain_name,
323                                                 struct cli_state *cli,
324                                                 struct rpc_pipe_client *pipe_hnd,
325                                                 TALLOC_CTX *mem_ctx,
326                                                 int argc,
327                                                 const char **argv);
328 NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c,
329                                                 const DOM_SID *domain_sid,
330                                                 const char *domain_name,
331                                                 struct cli_state *cli,
332                                                 struct rpc_pipe_client *pipe_hnd,
333                                                 TALLOC_CTX *mem_ctx,
334                                                 int argc,
335                                                 const char **argv);
336 NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c,
337                                                 const DOM_SID *domain_sid,
338                                                 const char *domain_name,
339                                                 struct cli_state *cli,
340                                                 struct rpc_pipe_client *pipe_hnd,
341                                                 TALLOC_CTX *mem_ctx,
342                                                 int argc,
343                                                 const char **argv);
344
345 /* The following definitions come from utils/net_rpc_registry.c  */
346
347 int net_rpc_registry(struct net_context *c, int argc, const char **argv);
348
349 /* The following definitions come from utils/net_rpc_rights.c  */
350
351 int net_rpc_rights(struct net_context *c, int argc, const char **argv);
352 struct rpc_sh_cmd *net_rpc_rights_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
353                                        struct rpc_sh_ctx *ctx);
354
355 /* The following definitions come from utils/net_rpc_samsync.c  */
356
357 NTSTATUS rpc_samdump_internals(struct net_context *c,
358                                 const DOM_SID *domain_sid,
359                                 const char *domain_name,
360                                 struct cli_state *cli,
361                                 struct rpc_pipe_client *pipe_hnd,
362                                 TALLOC_CTX *mem_ctx,
363                                 int argc,
364                                 const char **argv);
365 int rpc_vampire_usage(struct net_context *c, int argc, const char **argv);
366 NTSTATUS rpc_vampire_internals(struct net_context *c,
367                                 const DOM_SID *domain_sid,
368                                 const char *domain_name,
369                                 struct cli_state *cli,
370                                 struct rpc_pipe_client *pipe_hnd,
371                                 TALLOC_CTX *mem_ctx,
372                                 int argc,
373                                 const char **argv);
374
375 /* The following definitions come from utils/net_rpc_service.c  */
376
377 const char *svc_status_string( uint32 state );
378 int net_rpc_service(struct net_context *c, int argc, const char **argv);
379
380 /* The following definitions come from utils/net_rpc_sh_acct.c  */
381
382 struct rpc_sh_cmd *net_rpc_acct_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
383                                      struct rpc_sh_ctx *ctx);
384
385 /* The following definitions come from utils/net_rpc_shell.c  */
386
387 int net_rpc_shell(struct net_context *c, int argc, const char **argv);
388
389 /* The following definitions come from utils/net_sam.c  */
390
391 int net_sam(struct net_context *c, int argc, const char **argv);
392
393 /* The following definitions come from utils/net_share.c  */
394
395 int net_share_usage(struct net_context *c, int argc, const char **argv);
396 int net_share(struct net_context *c, int argc, const char **argv);
397
398 /* The following definitions come from utils/net_status.c  */
399
400 int net_status_usage(struct net_context *c, int argc, const char **argv);
401 int net_status(struct net_context *c, int argc, const char **argv);
402
403 /* The following definitions come from utils/net_time.c  */
404
405 int net_time_usage(struct net_context *c, int argc, const char **argv);
406 int net_time(struct net_context *c, int argc, const char **argv);
407
408 /* The following definitions come from utils/net_user.c  */
409
410 int net_user_usage(struct net_context *c, int argc, const char **argv);
411 int net_user(struct net_context *c, int argc, const char **argv);
412
413 /* The following definitions come from utils/net_usershare.c  */
414
415 int net_usershare_usage(struct net_context *c, int argc, const char **argv);
416 int net_usershare_help(struct net_context *c, int argc, const char **argv);
417 int net_usershare(struct net_context *c, int argc, const char **argv);
418
419 /* The following definitions come from utils/net_util.c  */
420
421 NTSTATUS net_rpc_lookup_name(struct net_context *c,
422                              TALLOC_CTX *mem_ctx, struct cli_state *cli,
423                              const char *name, const char **ret_domain,
424                              const char **ret_name, DOM_SID *ret_sid,
425                              enum lsa_SidType *ret_type);
426 NTSTATUS connect_to_service(struct net_context *c,
427                                         struct cli_state **cli_ctx,
428                                         struct sockaddr_storage *server_ss,
429                                         const char *server_name,
430                                         const char *service_name,
431                                         const char *service_type);
432 NTSTATUS connect_to_ipc(struct net_context *c,
433                         struct cli_state **cli_ctx,
434                         struct sockaddr_storage *server_ss,
435                         const char *server_name);
436 NTSTATUS connect_to_ipc_anonymous(struct net_context *c,
437                                 struct cli_state **cli_ctx,
438                                 struct sockaddr_storage *server_ss,
439                                 const char *server_name);
440 NTSTATUS connect_to_ipc_krb5(struct net_context *c,
441                         struct cli_state **cli_ctx,
442                         struct sockaddr_storage *server_ss,
443                         const char *server_name);
444 NTSTATUS connect_dst_pipe(struct net_context *c, struct cli_state **cli_dst,
445                           struct rpc_pipe_client **pp_pipe_hnd, int pipe_num);
446 int net_use_krb_machine_account(struct net_context *c);
447 int net_use_machine_account(struct net_context *c);
448 bool net_find_server(struct net_context *c,
449                         const char *domain,
450                         unsigned flags,
451                         struct sockaddr_storage *server_ss,
452                         char **server_name);
453 bool net_find_pdc(struct sockaddr_storage *server_ss,
454                 fstring server_name,
455                 const char *domain_name);
456 NTSTATUS net_make_ipc_connection(struct net_context *c, unsigned flags,
457                                  struct cli_state **pcli);
458 NTSTATUS net_make_ipc_connection_ex(struct net_context *c ,const char *domain,
459                                     const char *server,
460                                     struct sockaddr_storage *pss,
461                                     unsigned flags, struct cli_state **pcli);
462 const char *net_prompt_pass(struct net_context *c, const char *user);
463
464 /* The following definitions come from utils/netlookup.c  */
465
466 NTSTATUS net_lookup_name_from_sid(struct net_context *c,
467                                 TALLOC_CTX *ctx,
468                                 DOM_SID *psid,
469                                 const char **ppdomain,
470                                 const char **ppname);
471 NTSTATUS net_lookup_sid_from_name(struct net_context *c, TALLOC_CTX *ctx,
472                                   const char *full_name, DOM_SID *pret_sid);
473
474 /* The following definitions come from utils/passwd_util.c  */
475
476 char *stdin_new_passwd( void);
477 char *get_pass( const char *prompt, bool stdin_get);
478
479 #endif /*  _NET_PROTO_H_  */