s3:net: make idmap_store_secret static.
[bbaumbach/samba-autobuild/.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 utils/net.c  */
28
29 enum netr_SchannelType get_sec_channel_type(const char *param);
30
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);
46
47 /* The following definitions come from utils/net_ads_gpo.c  */
48
49 int net_ads_gpo(struct net_context *c, int argc, const char **argv);
50
51 /* The following definitions come from utils/net_cache.c  */
52
53 int net_cache(struct net_context *c, int argc, const char **argv);
54
55 /* The following definitions come from utils/net_conf.c  */
56
57 int net_conf(struct net_context *c, int argc, const char **argv);
58
59 /* The following definitions come from utils/net_dns.c  */
60
61 int get_my_ip_address( struct sockaddr_storage **pp_ss );
62
63 /* The following definitions come from utils/net_dom.c  */
64
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);
67
68 /* The following definitions come from utils/net_file.c  */
69
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);
72
73 /* The following definitions come from utils/net_group.c  */
74
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);
77
78 /* The following definitions come from utils/net_groupmap.c  */
79
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);
82
83 /* The following definitions come from utils/net_help.c  */
84
85 int net_help(struct net_context *c, int argc, const char **argv);
86
87 /* The following definitions come from utils/net_idmap.c  */
88
89 int net_help_idmap(struct net_context *c, int argc, const char **argv);
90 int net_idmap(struct net_context *c, int argc, const char **argv);
91
92 /* The following definitions come from utils/net_join.c  */
93
94 int net_join_usage(struct net_context *c, int argc, const char **argv);
95 int net_join(struct net_context *c, int argc, const char **argv);
96
97 /* The following definitions come from utils/net_lookup.c  */
98
99 int net_lookup_usage(struct net_context *c, int argc, const char **argv);
100 int net_lookup(struct net_context *c, int argc, const char **argv);
101
102 /* The following definitions come from utils/net_rap.c  */
103
104 int net_rap_file_usage(struct net_context *c, int argc, const char **argv);
105 int net_rap_file(struct net_context *c, int argc, const char **argv);
106 int net_rap_share_usage(struct net_context *c, int argc, const char **argv);
107 int net_rap_share(struct net_context *c, int argc, const char **argv);
108 int net_rap_session_usage(struct net_context *c, int argc, const char **argv);
109 int net_rap_session(struct net_context *c, int argc, const char **argv);
110 int net_rap_server_usage(struct net_context *c, int argc, const char **argv);
111 int net_rap_server(struct net_context *c, int argc, const char **argv);
112 int net_rap_domain_usage(struct net_context *c, int argc, const char **argv);
113 int net_rap_domain(struct net_context *c, int argc, const char **argv);
114 int net_rap_printq_usage(struct net_context *c, int argc, const char **argv);
115 int net_rap_printq(struct net_context *c, int argc, const char **argv);
116 int net_rap_user(struct net_context *c, int argc, const char **argv);
117 int net_rap_group_usage(struct net_context *c, int argc, const char **argv);
118 int net_rap_group(struct net_context *c, int argc, const char **argv);
119 int net_rap_groupmember_usage(struct net_context *c, int argc, const char **argv);
120 int net_rap_groupmember(struct net_context *c, int argc, const char **argv);
121 int net_rap_validate_usage(struct net_context *c, int argc, const char **argv);
122 int net_rap_validate(struct net_context *c, int argc, const char **argv);
123 int net_rap_service_usage(struct net_context *c, int argc, const char **argv);
124 int net_rap_service(struct net_context *c, int argc, const char **argv);
125 int net_rap_password_usage(struct net_context *c, int argc, const char **argv);
126 int net_rap_password(struct net_context *c, int argc, const char **argv);
127 int net_rap_admin_usage(struct net_context *c, int argc, const char **argv);
128 int net_rap_admin(struct net_context *c, int argc, const char **argv);
129 int net_rap(struct net_context *c, int argc, const char **argv);
130
131 /* The following definitions come from utils/net_registry.c  */
132
133 int net_registry(struct net_context *c, int argc, const char **argv);
134
135 /* The following definitions come from utils/net_rpc.c  */
136
137 NTSTATUS net_get_remote_domain_sid(struct cli_state *cli, TALLOC_CTX *mem_ctx,
138                                    struct dom_sid **domain_sid,
139                                    const char **domain_name);
140 int run_rpc_command(struct net_context *c,
141                         struct cli_state *cli_arg,
142                         const struct ndr_syntax_id *interface,
143                         int conn_flags,
144                         rpc_command_fn fn,
145                         int argc,
146                         const char **argv);
147 int net_rpc_changetrustpw(struct net_context *c, int argc, const char **argv);
148 int net_rpc_join(struct net_context *c, int argc, const char **argv);
149 NTSTATUS rpc_info_internals(struct net_context *c,
150                         const struct dom_sid *domain_sid,
151                         const char *domain_name,
152                         struct cli_state *cli,
153                         struct rpc_pipe_client *pipe_hnd,
154                         TALLOC_CTX *mem_ctx,
155                         int argc,
156                         const char **argv);
157 int net_rpc_info(struct net_context *c, int argc, const char **argv);
158 int net_rpc_getsid(struct net_context *c, int argc, const char **argv);
159 int net_rpc_user(struct net_context *c, int argc, const char **argv);
160 struct rpc_sh_cmd *net_rpc_user_edit_cmds(struct net_context *c,
161                                           TALLOC_CTX *mem_ctx,
162                                           struct rpc_sh_ctx *ctx);
163 struct rpc_sh_cmd *net_rpc_user_cmds(struct net_context *c,
164                                      TALLOC_CTX *mem_ctx,
165                                      struct rpc_sh_ctx *ctx);
166 int net_rpc_group(struct net_context *c, int argc, const char **argv);
167 bool copy_top_level_perms(struct net_context *c,
168                                 struct copy_clistate *cp_clistate,
169                                 const char *sharename);
170 int net_usersidlist(struct net_context *c, int argc, const char **argv);
171 int net_usersidlist_usage(struct net_context *c, int argc, const char **argv);
172 int net_rpc_share(struct net_context *c, int argc, const char **argv);
173 struct rpc_sh_cmd *net_rpc_share_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
174                                       struct rpc_sh_ctx *ctx);
175 int net_rpc_file(struct net_context *c, int argc, const char **argv);
176 NTSTATUS rpc_init_shutdown_internals(struct net_context *c,
177                                      const struct dom_sid *domain_sid,
178                                      const char *domain_name,
179                                      struct cli_state *cli,
180                                      struct rpc_pipe_client *pipe_hnd,
181                                      TALLOC_CTX *mem_ctx,
182                                      int argc,
183                                      const char **argv);
184 NTSTATUS rpc_reg_shutdown_internals(struct net_context *c,
185                                     const struct dom_sid *domain_sid,
186                                     const char *domain_name,
187                                     struct cli_state *cli,
188                                     struct rpc_pipe_client *pipe_hnd,
189                                     TALLOC_CTX *mem_ctx,
190                                     int argc,
191                                     const char **argv);
192 bool net_rpc_check(struct net_context *c, unsigned flags);
193 int rpc_printer_migrate(struct net_context *c, int argc, const char **argv);
194 int rpc_printer_usage(struct net_context *c, int argc, const char **argv);
195 int net_rpc_printer(struct net_context *c, int argc, const char **argv);
196 int net_rpc(struct net_context *c, int argc, const char **argv);
197
198 /* The following definitions come from utils/net_rpc_audit.c  */
199
200 int net_rpc_audit(struct net_context *c, int argc, const char **argv);
201
202 /* The following definitions come from utils/net_rpc_join.c  */
203
204 NTSTATUS net_rpc_join_ok(struct net_context *c, const char *domain,
205                          const char *server, struct sockaddr_storage *pss);
206 int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv);
207 int net_rpc_testjoin(struct net_context *c, int argc, const char **argv);
208
209 /* The following definitions come from utils/net_rpc_printer.c  */
210
211 NTSTATUS net_copy_fileattr(struct net_context *c,
212                   TALLOC_CTX *mem_ctx,
213                   struct cli_state *cli_share_src,
214                   struct cli_state *cli_share_dst,
215                   const char *src_name, const char *dst_name,
216                   bool copy_acls, bool copy_attrs,
217                   bool copy_timestamps, bool is_file);
218 NTSTATUS net_copy_file(struct net_context *c,
219                        TALLOC_CTX *mem_ctx,
220                        struct cli_state *cli_share_src,
221                        struct cli_state *cli_share_dst,
222                        const char *src_name, const char *dst_name,
223                        bool copy_acls, bool copy_attrs,
224                        bool copy_timestamps, bool is_file);
225 NTSTATUS rpc_printer_list_internals(struct net_context *c,
226                                         const struct dom_sid *domain_sid,
227                                         const char *domain_name,
228                                         struct cli_state *cli,
229                                         struct rpc_pipe_client *pipe_hnd,
230                                         TALLOC_CTX *mem_ctx,
231                                         int argc,
232                                         const char **argv);
233 NTSTATUS rpc_printer_driver_list_internals(struct net_context *c,
234                                                 const struct dom_sid *domain_sid,
235                                                 const char *domain_name,
236                                                 struct cli_state *cli,
237                                                 struct rpc_pipe_client *pipe_hnd,
238                                                 TALLOC_CTX *mem_ctx,
239                                                 int argc,
240                                                 const char **argv);
241 NTSTATUS rpc_printer_publish_publish_internals(struct net_context *c,
242                                                 const struct dom_sid *domain_sid,
243                                                 const char *domain_name,
244                                                 struct cli_state *cli,
245                                                 struct rpc_pipe_client *pipe_hnd,
246                                                 TALLOC_CTX *mem_ctx,
247                                                 int argc,
248                                                 const char **argv);
249 NTSTATUS rpc_printer_publish_unpublish_internals(struct net_context *c,
250                                                 const struct dom_sid *domain_sid,
251                                                 const char *domain_name,
252                                                 struct cli_state *cli,
253                                                 struct rpc_pipe_client *pipe_hnd,
254                                                 TALLOC_CTX *mem_ctx,
255                                                 int argc,
256                                                 const char **argv);
257 NTSTATUS rpc_printer_publish_update_internals(struct net_context *c,
258                                                 const struct dom_sid *domain_sid,
259                                                 const char *domain_name,
260                                                 struct cli_state *cli,
261                                                 struct rpc_pipe_client *pipe_hnd,
262                                                 TALLOC_CTX *mem_ctx,
263                                                 int argc,
264                                                 const char **argv);
265 NTSTATUS rpc_printer_publish_list_internals(struct net_context *c,
266                                                 const struct dom_sid *domain_sid,
267                                                 const char *domain_name,
268                                                 struct cli_state *cli,
269                                                 struct rpc_pipe_client *pipe_hnd,
270                                                 TALLOC_CTX *mem_ctx,
271                                                 int argc,
272                                                 const char **argv);
273 NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c,
274                                                 const struct dom_sid *domain_sid,
275                                                 const char *domain_name,
276                                                 struct cli_state *cli,
277                                                 struct rpc_pipe_client *pipe_hnd,
278                                                 TALLOC_CTX *mem_ctx,
279                                                 int argc,
280                                                 const char **argv);
281 NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c,
282                                                 const struct dom_sid *domain_sid,
283                                                 const char *domain_name,
284                                                 struct cli_state *cli,
285                                                 struct rpc_pipe_client *pipe_hnd,
286                                                 TALLOC_CTX *mem_ctx,
287                                                 int argc,
288                                                 const char **argv);
289 NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c,
290                                                 const struct dom_sid *domain_sid,
291                                                 const char *domain_name,
292                                                 struct cli_state *cli,
293                                                 struct rpc_pipe_client *pipe_hnd,
294                                                 TALLOC_CTX *mem_ctx,
295                                                 int argc,
296                                                 const char **argv);
297 NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c,
298                                                 const struct dom_sid *domain_sid,
299                                                 const char *domain_name,
300                                                 struct cli_state *cli,
301                                                 struct rpc_pipe_client *pipe_hnd,
302                                                 TALLOC_CTX *mem_ctx,
303                                                 int argc,
304                                                 const char **argv);
305 NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c,
306                                                 const struct dom_sid *domain_sid,
307                                                 const char *domain_name,
308                                                 struct cli_state *cli,
309                                                 struct rpc_pipe_client *pipe_hnd,
310                                                 TALLOC_CTX *mem_ctx,
311                                                 int argc,
312                                                 const char **argv);
313
314 /* The following definitions come from utils/net_rpc_registry.c  */
315
316 int net_rpc_registry(struct net_context *c, int argc, const char **argv);
317
318 /* The following definitions come from utils/net_rpc_rights.c  */
319
320 int net_rpc_rights(struct net_context *c, int argc, const char **argv);
321 struct rpc_sh_cmd *net_rpc_rights_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
322                                        struct rpc_sh_ctx *ctx);
323
324 /* The following definitions come from utils/net_rpc_samsync.c  */
325
326 NTSTATUS rpc_samdump_internals(struct net_context *c,
327                                 const struct 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 int rpc_vampire_usage(struct net_context *c, int argc, const char **argv);
335 NTSTATUS rpc_vampire_internals(struct net_context *c,
336                                 const struct dom_sid *domain_sid,
337                                 const char *domain_name,
338                                 struct cli_state *cli,
339                                 struct rpc_pipe_client *pipe_hnd,
340                                 TALLOC_CTX *mem_ctx,
341                                 int argc,
342                                 const char **argv);
343 int rpc_vampire_passdb(struct net_context *c, int argc, const char **argv);
344 int rpc_vampire_ldif(struct net_context *c, int argc, const char **argv);
345 NTSTATUS rpc_vampire_ldif_internals(struct net_context *c,
346                                     const struct dom_sid *domain_sid,
347                                     const char *domain_name,
348                                     struct cli_state *cli,
349                                     struct rpc_pipe_client *pipe_hnd,
350                                     TALLOC_CTX *mem_ctx,
351                                     int argc,
352                                     const char **argv);
353 NTSTATUS rpc_vampire_keytab_internals(struct net_context *c,
354                                       const struct dom_sid *domain_sid,
355                                       const char *domain_name,
356                                       struct cli_state *cli,
357                                       struct rpc_pipe_client *pipe_hnd,
358                                       TALLOC_CTX *mem_ctx,
359                                       int argc,
360                                       const char **argv);
361 int rpc_vampire_keytab(struct net_context *c, int argc, const char **argv);
362
363 /* The following definitions come from utils/net_rpc_service.c  */
364
365 const char *svc_status_string( uint32 state );
366 int net_rpc_service(struct net_context *c, int argc, const char **argv);
367
368 /* The following definitions come from utils/net_rpc_sh_acct.c  */
369
370 struct rpc_sh_cmd *net_rpc_acct_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
371                                      struct rpc_sh_ctx *ctx);
372
373 /* The following definitions come from utils/net_rpc_shell.c  */
374
375 int net_rpc_shell(struct net_context *c, int argc, const char **argv);
376
377 /* The following definitions come from utils/net_sam.c  */
378
379 int net_sam(struct net_context *c, int argc, const char **argv);
380
381 /* The following definitions come from utils/net_share.c  */
382
383 int net_share_usage(struct net_context *c, int argc, const char **argv);
384 int net_share(struct net_context *c, int argc, const char **argv);
385
386 /* The following definitions come from utils/net_status.c  */
387
388 int net_status_usage(struct net_context *c, int argc, const char **argv);
389 int net_status(struct net_context *c, int argc, const char **argv);
390
391 /* The following definitions come from utils/net_time.c  */
392
393 int net_time_usage(struct net_context *c, int argc, const char **argv);
394 int net_time(struct net_context *c, int argc, const char **argv);
395
396 /* The following definitions come from utils/net_user.c  */
397
398 int net_user_usage(struct net_context *c, int argc, const char **argv);
399 int net_user(struct net_context *c, int argc, const char **argv);
400
401 /* The following definitions come from utils/net_usershare.c  */
402
403 int net_usershare_usage(struct net_context *c, int argc, const char **argv);
404 int net_usershare_help(struct net_context *c, int argc, const char **argv);
405 int net_usershare(struct net_context *c, int argc, const char **argv);
406
407 /* The following definitions come from utils/net_eventlog.c  */
408
409 int net_eventlog(struct net_context *c, int argc, const char **argv);
410
411 /* The following definitions come from utils/net_printing.c  */
412
413 int net_printing(struct net_context *c, int argc, const char **argv);
414
415 /* The following definitions come from utils/net_serverid.c  */
416
417 int net_serverid(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, struct 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,
446                           const struct ndr_syntax_id *interface);
447 int net_use_krb_machine_account(struct net_context *c);
448 int net_use_machine_account(struct net_context *c);
449 bool net_find_server(struct net_context *c,
450                         const char *domain,
451                         unsigned flags,
452                         struct sockaddr_storage *server_ss,
453                         char **server_name);
454 bool net_find_pdc(struct sockaddr_storage *server_ss,
455                 fstring server_name,
456                 const char *domain_name);
457 NTSTATUS net_make_ipc_connection(struct net_context *c, unsigned flags,
458                                  struct cli_state **pcli);
459 NTSTATUS net_make_ipc_connection_ex(struct net_context *c ,const char *domain,
460                                     const char *server,
461                                     struct sockaddr_storage *pss,
462                                     unsigned flags, struct cli_state **pcli);
463 const char *net_prompt_pass(struct net_context *c, const char *user);
464 int net_run_function(struct net_context *c, int argc, const char **argv,
465                       const char *whoami, struct functable *table);
466 void net_display_usage_from_functable(struct functable *table);
467
468 const char *net_share_type_str(int num_type);
469
470 NTSTATUS net_scan_dc(struct net_context *c,
471                      struct cli_state *cli,
472                      struct net_dc_info *dc_info);
473
474 /* The following definitions come from utils/netlookup.c  */
475
476 NTSTATUS net_lookup_name_from_sid(struct net_context *c,
477                                 TALLOC_CTX *ctx,
478                                 struct dom_sid *psid,
479                                 const char **ppdomain,
480                                 const char **ppname);
481 NTSTATUS net_lookup_sid_from_name(struct net_context *c, TALLOC_CTX *ctx,
482                                   const char *full_name, struct dom_sid *pret_sid);
483
484 /* The following definitions come from utils/passwd_util.c  */
485
486 char *stdin_new_passwd( void);
487 char *get_pass( const char *prompt, bool stdin_get);
488
489 /* The following definitions come from utils/net_g_lock.c  */
490 int net_g_lock(struct net_context *c, int argc, const char **argv);
491
492 #endif /*  _NET_PROTO_H_  */