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