1809ba9f125e1ae1df54a45d321c261a719eb2b3
[metze/samba/wip.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 #include "libads/ads_status.h"
27
28 /* The following definitions come from utils/net.c  */
29
30 enum netr_SchannelType get_sec_channel_type(const char *param);
31
32 /* The following definitions come from utils/net_ads.c  */
33 struct ads_struct;
34 ADS_STATUS ads_startup(struct net_context *c, bool only_own_domain, struct ads_struct **ads);
35 ADS_STATUS ads_startup_nobind(struct net_context *c, bool only_own_domain, struct ads_struct **ads);
36 int net_ads_check_our_domain(struct net_context *c);
37 int net_ads_check(struct net_context *c);
38 int net_ads_user(struct net_context *c, int argc, const char **argv);
39 int net_ads_group(struct net_context *c, int argc, const char **argv);
40 int net_ads_testjoin(struct net_context *c, int argc, const char **argv);
41 int net_ads_join(struct net_context *c, int argc, const char **argv);
42 int net_ads_printer_usage(struct net_context *c, int argc, const char **argv);
43 int net_ads_changetrustpw(struct net_context *c, int argc, const char **argv);
44 int net_ads_keytab(struct net_context *c, int argc, const char **argv);
45 int net_ads_kerberos(struct net_context *c, int argc, const char **argv);
46 int net_ads(struct net_context *c, int argc, const char **argv);
47
48 /* The following definitions come from utils/net_ads_gpo.c  */
49
50 int net_ads_gpo(struct net_context *c, int argc, const char **argv);
51
52 /* The following definitions come from utils/net_cache.c  */
53
54 int net_cache(struct net_context *c, int argc, const char **argv);
55
56 /* The following definitions come from utils/net_conf.c  */
57
58 int net_conf(struct net_context *c, int argc, const char **argv);
59
60 /* The following definitions come from utils/net_dns.c  */
61
62 int get_my_ip_address( struct sockaddr_storage **pp_ss );
63
64 /* The following definitions come from utils/net_dom.c  */
65
66 int net_dom_usage(struct net_context *c, int argc, const char **argv);
67 int net_dom(struct net_context *c, int argc, const char **argv);
68
69 /* The following definitions come from utils/net_file.c  */
70
71 int net_file_usage(struct net_context *c, int argc, const char **argv);
72 int net_file(struct net_context *c, int argc, const char **argv);
73
74 /* The following definitions come from utils/net_group.c  */
75
76 int net_group_usage(struct net_context *c, int argc, const char **argv);
77 int net_group(struct net_context *c, int argc, const char **argv);
78
79 /* The following definitions come from utils/net_groupmap.c  */
80
81 int net_groupmap_usage(struct net_context *c, int argc, const char **argv);
82 int net_groupmap(struct net_context *c, int argc, const char **argv);
83
84 /* The following definitions come from utils/net_help.c  */
85
86 int net_help(struct net_context *c, int argc, const char **argv);
87
88 /* The following definitions come from utils/net_idmap.c  */
89
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_interface_table *table,
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_testjoin(struct net_context *c, int argc, const char **argv);
149 int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv);
150 int net_rpc_join(struct net_context *c, int argc, const char **argv);
151 NTSTATUS rpc_info_internals(struct net_context *c,
152                         const struct dom_sid *domain_sid,
153                         const char *domain_name,
154                         struct cli_state *cli,
155                         struct rpc_pipe_client *pipe_hnd,
156                         TALLOC_CTX *mem_ctx,
157                         int argc,
158                         const char **argv);
159 int net_rpc_info(struct net_context *c, int argc, const char **argv);
160 int net_rpc_getsid(struct net_context *c, int argc, const char **argv);
161 int net_rpc_user(struct net_context *c, int argc, const char **argv);
162 struct rpc_sh_cmd *net_rpc_user_edit_cmds(struct net_context *c,
163                                           TALLOC_CTX *mem_ctx,
164                                           struct rpc_sh_ctx *ctx);
165 struct rpc_sh_cmd *net_rpc_user_cmds(struct net_context *c,
166                                      TALLOC_CTX *mem_ctx,
167                                      struct rpc_sh_ctx *ctx);
168 int net_rpc_group(struct net_context *c, int argc, const char **argv);
169 bool copy_top_level_perms(struct net_context *c,
170                                 struct copy_clistate *cp_clistate,
171                                 const char *sharename);
172 int net_usersidlist(struct net_context *c, int argc, const char **argv);
173 int net_usersidlist_usage(struct net_context *c, int argc, const char **argv);
174 int net_rpc_share(struct net_context *c, int argc, const char **argv);
175 struct rpc_sh_cmd *net_rpc_share_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
176                                       struct rpc_sh_ctx *ctx);
177 int net_rpc_file(struct net_context *c, int argc, const char **argv);
178 NTSTATUS rpc_init_shutdown_internals(struct net_context *c,
179                                      const struct 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 NTSTATUS rpc_reg_shutdown_internals(struct net_context *c,
187                                     const struct dom_sid *domain_sid,
188                                     const char *domain_name,
189                                     struct cli_state *cli,
190                                     struct rpc_pipe_client *pipe_hnd,
191                                     TALLOC_CTX *mem_ctx,
192                                     int argc,
193                                     const char **argv);
194 bool net_rpc_check(struct net_context *c, unsigned flags);
195 int rpc_printer_migrate(struct net_context *c, int argc, const char **argv);
196 int rpc_printer_usage(struct net_context *c, int argc, const char **argv);
197 int net_rpc_printer(struct net_context *c, int argc, const char **argv);
198 int net_rpc(struct net_context *c, int argc, const char **argv);
199
200 /* The following definitions come from utils/net_rpc_audit.c  */
201
202 int net_rpc_audit(struct net_context *c, int argc, const char **argv);
203
204 /* The following definitions come from utils/net_rpc_printer.c  */
205
206 NTSTATUS net_copy_fileattr(struct net_context *c,
207                   TALLOC_CTX *mem_ctx,
208                   struct cli_state *cli_share_src,
209                   struct cli_state *cli_share_dst,
210                   const char *src_name, const char *dst_name,
211                   bool copy_acls, bool copy_attrs,
212                   bool copy_timestamps, bool is_file);
213 NTSTATUS net_copy_file(struct net_context *c,
214                        TALLOC_CTX *mem_ctx,
215                        struct cli_state *cli_share_src,
216                        struct cli_state *cli_share_dst,
217                        const char *src_name, const char *dst_name,
218                        bool copy_acls, bool copy_attrs,
219                        bool copy_timestamps, bool is_file);
220 NTSTATUS rpc_printer_list_internals(struct net_context *c,
221                                         const struct dom_sid *domain_sid,
222                                         const char *domain_name,
223                                         struct cli_state *cli,
224                                         struct rpc_pipe_client *pipe_hnd,
225                                         TALLOC_CTX *mem_ctx,
226                                         int argc,
227                                         const char **argv);
228 NTSTATUS rpc_printer_driver_list_internals(struct net_context *c,
229                                                 const struct dom_sid *domain_sid,
230                                                 const char *domain_name,
231                                                 struct cli_state *cli,
232                                                 struct rpc_pipe_client *pipe_hnd,
233                                                 TALLOC_CTX *mem_ctx,
234                                                 int argc,
235                                                 const char **argv);
236 NTSTATUS rpc_printer_publish_publish_internals(struct net_context *c,
237                                                 const struct dom_sid *domain_sid,
238                                                 const char *domain_name,
239                                                 struct cli_state *cli,
240                                                 struct rpc_pipe_client *pipe_hnd,
241                                                 TALLOC_CTX *mem_ctx,
242                                                 int argc,
243                                                 const char **argv);
244 NTSTATUS rpc_printer_publish_unpublish_internals(struct net_context *c,
245                                                 const struct dom_sid *domain_sid,
246                                                 const char *domain_name,
247                                                 struct cli_state *cli,
248                                                 struct rpc_pipe_client *pipe_hnd,
249                                                 TALLOC_CTX *mem_ctx,
250                                                 int argc,
251                                                 const char **argv);
252 NTSTATUS rpc_printer_publish_update_internals(struct net_context *c,
253                                                 const struct dom_sid *domain_sid,
254                                                 const char *domain_name,
255                                                 struct cli_state *cli,
256                                                 struct rpc_pipe_client *pipe_hnd,
257                                                 TALLOC_CTX *mem_ctx,
258                                                 int argc,
259                                                 const char **argv);
260 NTSTATUS rpc_printer_publish_list_internals(struct net_context *c,
261                                                 const struct dom_sid *domain_sid,
262                                                 const char *domain_name,
263                                                 struct cli_state *cli,
264                                                 struct rpc_pipe_client *pipe_hnd,
265                                                 TALLOC_CTX *mem_ctx,
266                                                 int argc,
267                                                 const char **argv);
268 NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c,
269                                                 const struct dom_sid *domain_sid,
270                                                 const char *domain_name,
271                                                 struct cli_state *cli,
272                                                 struct rpc_pipe_client *pipe_hnd,
273                                                 TALLOC_CTX *mem_ctx,
274                                                 int argc,
275                                                 const char **argv);
276 NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c,
277                                                 const struct dom_sid *domain_sid,
278                                                 const char *domain_name,
279                                                 struct cli_state *cli,
280                                                 struct rpc_pipe_client *pipe_hnd,
281                                                 TALLOC_CTX *mem_ctx,
282                                                 int argc,
283                                                 const char **argv);
284 NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c,
285                                                 const struct dom_sid *domain_sid,
286                                                 const char *domain_name,
287                                                 struct cli_state *cli,
288                                                 struct rpc_pipe_client *pipe_hnd,
289                                                 TALLOC_CTX *mem_ctx,
290                                                 int argc,
291                                                 const char **argv);
292 NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c,
293                                                 const struct dom_sid *domain_sid,
294                                                 const char *domain_name,
295                                                 struct cli_state *cli,
296                                                 struct rpc_pipe_client *pipe_hnd,
297                                                 TALLOC_CTX *mem_ctx,
298                                                 int argc,
299                                                 const char **argv);
300 NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c,
301                                                 const struct dom_sid *domain_sid,
302                                                 const char *domain_name,
303                                                 struct cli_state *cli,
304                                                 struct rpc_pipe_client *pipe_hnd,
305                                                 TALLOC_CTX *mem_ctx,
306                                                 int argc,
307                                                 const char **argv);
308
309 /* The following definitions come from utils/net_rpc_registry.c  */
310
311 int net_rpc_registry(struct net_context *c, int argc, const char **argv);
312
313 /* The following definitions come from utils/net_rpc_rights.c  */
314
315 int net_rpc_rights(struct net_context *c, int argc, const char **argv);
316 struct rpc_sh_cmd *net_rpc_rights_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
317                                        struct rpc_sh_ctx *ctx);
318
319 /* The following definitions come from utils/net_rpc_samsync.c  */
320
321 NTSTATUS rpc_samdump_internals(struct net_context *c,
322                                 const struct dom_sid *domain_sid,
323                                 const char *domain_name,
324                                 struct cli_state *cli,
325                                 struct rpc_pipe_client *pipe_hnd,
326                                 TALLOC_CTX *mem_ctx,
327                                 int argc,
328                                 const char **argv);
329 int rpc_vampire_usage(struct net_context *c, int argc, const char **argv);
330 int rpc_vampire_passdb(struct net_context *c, int argc, const char **argv);
331 int rpc_vampire_ldif(struct net_context *c, int argc, const char **argv);
332 int rpc_vampire_keytab(struct net_context *c, int argc, const char **argv);
333
334 /* The following definitions come from utils/net_rpc_service.c  */
335
336 const char *svc_status_string( uint32 state );
337 int net_rpc_service(struct net_context *c, int argc, const char **argv);
338
339 /* The following definitions come from utils/net_rpc_sh_acct.c  */
340
341 struct rpc_sh_cmd *net_rpc_acct_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
342                                      struct rpc_sh_ctx *ctx);
343
344 /* The following definitions come from utils/net_rpc_shell.c  */
345
346 int net_rpc_shell(struct net_context *c, int argc, const char **argv);
347
348 /* The following definitions come from utils/net_sam.c  */
349
350 int net_sam(struct net_context *c, int argc, const char **argv);
351
352 /* The following definitions come from utils/net_share.c  */
353
354 int net_share_usage(struct net_context *c, int argc, const char **argv);
355 int net_share(struct net_context *c, int argc, const char **argv);
356
357 /* The following definitions come from utils/net_status.c  */
358
359 int net_status_usage(struct net_context *c, int argc, const char **argv);
360 int net_status(struct net_context *c, int argc, const char **argv);
361
362 /* The following definitions come from utils/net_time.c  */
363
364 int net_time_usage(struct net_context *c, int argc, const char **argv);
365 int net_time(struct net_context *c, int argc, const char **argv);
366
367 /* The following definitions come from utils/net_user.c  */
368
369 int net_user_usage(struct net_context *c, int argc, const char **argv);
370 int net_user(struct net_context *c, int argc, const char **argv);
371
372 /* The following definitions come from utils/net_usershare.c  */
373
374 int net_usershare_usage(struct net_context *c, int argc, const char **argv);
375 int net_usershare_help(struct net_context *c, int argc, const char **argv);
376 int net_usershare(struct net_context *c, int argc, const char **argv);
377
378 /* The following definitions come from utils/net_eventlog.c  */
379
380 int net_eventlog(struct net_context *c, int argc, const char **argv);
381
382 /* The following definitions come from utils/net_printing.c  */
383
384 int net_printing(struct net_context *c, int argc, const char **argv);
385
386 /* The following definitions come from utils/net_serverid.c  */
387
388 int net_serverid(struct net_context *c, int argc, const char **argv);
389
390 /* The following definitions come from utils/net_util.c  */
391
392 NTSTATUS net_rpc_lookup_name(struct net_context *c,
393                              TALLOC_CTX *mem_ctx, struct cli_state *cli,
394                              const char *name, const char **ret_domain,
395                              const char **ret_name, struct dom_sid *ret_sid,
396                              enum lsa_SidType *ret_type);
397 NTSTATUS connect_to_service(struct net_context *c,
398                             struct cli_state **cli_ctx,
399                             const struct sockaddr_storage *server_ss,
400                             const char *server_name,
401                             const char *service_name,
402                             const char *service_type);
403 NTSTATUS connect_to_ipc(struct net_context *c,
404                         struct cli_state **cli_ctx,
405                         const struct sockaddr_storage *server_ss,
406                         const char *server_name);
407 NTSTATUS connect_to_ipc_anonymous(struct net_context *c,
408                                 struct cli_state **cli_ctx,
409                                 const struct sockaddr_storage *server_ss,
410                                 const char *server_name);
411 NTSTATUS connect_dst_pipe(struct net_context *c, struct cli_state **cli_dst,
412                           struct rpc_pipe_client **pp_pipe_hnd,
413                           const struct ndr_interface_table *table);
414 int net_use_krb_machine_account(struct net_context *c);
415 int net_use_machine_account(struct net_context *c);
416 bool net_find_server(struct net_context *c,
417                         const char *domain,
418                         unsigned flags,
419                         struct sockaddr_storage *server_ss,
420                         char **server_name);
421 bool net_find_pdc(struct sockaddr_storage *server_ss,
422                 fstring server_name,
423                 const char *domain_name);
424 NTSTATUS net_make_ipc_connection(struct net_context *c, unsigned flags,
425                                  struct cli_state **pcli);
426 NTSTATUS net_make_ipc_connection_ex(struct net_context *c ,const char *domain,
427                                     const char *server,
428                                     const struct sockaddr_storage *pss,
429                                     unsigned flags, struct cli_state **pcli);
430 const char *net_prompt_pass(struct net_context *c, const char *user);
431 int net_run_function(struct net_context *c, int argc, const char **argv,
432                       const char *whoami, struct functable *table);
433 void net_display_usage_from_functable(struct functable *table);
434
435 const char *net_share_type_str(int num_type);
436
437 NTSTATUS net_scan_dc(struct net_context *c,
438                      struct cli_state *cli,
439                      struct net_dc_info *dc_info);
440
441 /* The following definitions come from utils/netlookup.c  */
442
443 NTSTATUS net_lookup_name_from_sid(struct net_context *c,
444                                 TALLOC_CTX *ctx,
445                                 struct dom_sid *psid,
446                                 const char **ppdomain,
447                                 const char **ppname);
448 NTSTATUS net_lookup_sid_from_name(struct net_context *c, TALLOC_CTX *ctx,
449                                   const char *full_name, struct dom_sid *pret_sid);
450
451 /* The following definitions come from utils/passwd_util.c  */
452
453 char *stdin_new_passwd( void);
454 char *get_pass( const char *prompt, bool stdin_get);
455
456 /* The following definitions come from utils/net_g_lock.c  */
457 int net_g_lock(struct net_context *c, int argc, const char **argv);
458
459 /* The following definitions come from utils/net_rpc_trust.c  */
460 int net_rpc_trust(struct net_context *c, int argc, const char **argv);
461
462 /* The following definitions come from utils/net_rpc_conf.c */
463 int net_rpc_conf(struct net_context *c, int argc, const char **argv);
464
465 #endif /*  _NET_PROTO_H_  */