2 * Unix SMB/CIFS implementation.
3 * collected prototypes header
5 * frozen from "make proto" in May 2008
7 * Copyright (C) Michael Adam 2008
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, see <http://www.gnu.org/licenses/>.
27 /* The following definitions come from auth/token_util.c */
29 bool nt_token_check_sid ( const DOM_SID
*sid
, const NT_USER_TOKEN
*token
);
30 bool nt_token_check_domain_rid( NT_USER_TOKEN
*token
, uint32 rid
);
31 NT_USER_TOKEN
*get_root_nt_token( void );
32 NTSTATUS
add_aliases(const DOM_SID
*domain_sid
,
33 struct nt_user_token
*token
);
34 struct nt_user_token
*create_local_nt_token(TALLOC_CTX
*mem_ctx
,
35 const DOM_SID
*user_sid
,
38 const DOM_SID
*groupsids
);
39 void debug_nt_user_token(int dbg_class
, int dbg_lev
, NT_USER_TOKEN
*token
);
40 void debug_unix_user_token(int dbg_class
, int dbg_lev
, uid_t uid
, gid_t gid
,
41 int n_groups
, gid_t
*groups
);
43 /* The following definitions come from utils/net.c */
45 enum netr_SchannelType
get_sec_channel_type(const char *param
);
47 /* The following definitions come from utils/net_ads.c */
49 ADS_STATUS
ads_startup(struct net_context
*c
, bool only_own_domain
, ADS_STRUCT
**ads
);
50 ADS_STATUS
ads_startup_nobind(struct net_context
*c
, bool only_own_domain
, ADS_STRUCT
**ads
);
51 int net_ads_check_our_domain(struct net_context
*c
);
52 int net_ads_check(struct net_context
*c
);
53 int net_ads_user(struct net_context
*c
, int argc
, const char **argv
);
54 int net_ads_group(struct net_context
*c
, int argc
, const char **argv
);
55 int net_ads_testjoin(struct net_context
*c
, int argc
, const char **argv
);
56 int net_ads_join(struct net_context
*c
, int argc
, const char **argv
);
57 int net_ads_printer_usage(struct net_context
*c
, int argc
, const char **argv
);
58 int net_ads_changetrustpw(struct net_context
*c
, int argc
, const char **argv
);
59 int net_ads_keytab(struct net_context
*c
, int argc
, const char **argv
);
60 int net_ads_kerberos(struct net_context
*c
, int argc
, const char **argv
);
61 int net_ads(struct net_context
*c
, int argc
, const char **argv
);
63 /* The following definitions come from utils/net_ads_gpo.c */
65 int net_ads_gpo(struct net_context
*c
, int argc
, const char **argv
);
67 /* The following definitions come from utils/net_cache.c */
69 int net_cache(struct net_context
*c
, int argc
, const char **argv
);
71 /* The following definitions come from utils/net_conf.c */
73 int net_conf(struct net_context
*c
, int argc
, const char **argv
);
75 /* The following definitions come from utils/net_dns.c */
77 int get_my_ip_address( struct sockaddr_storage
**pp_ss
);
79 /* The following definitions come from utils/net_dom.c */
81 int net_dom_usage(struct net_context
*c
, int argc
, const char **argv
);
82 int net_dom(struct net_context
*c
, int argc
, const char **argv
);
84 /* The following definitions come from utils/net_file.c */
86 int net_file_usage(struct net_context
*c
, int argc
, const char **argv
);
87 int net_file(struct net_context
*c
, int argc
, const char **argv
);
89 /* The following definitions come from utils/net_group.c */
91 int net_group_usage(struct net_context
*c
, int argc
, const char **argv
);
92 int net_group(struct net_context
*c
, int argc
, const char **argv
);
94 /* The following definitions come from utils/net_groupmap.c */
96 int net_groupmap_usage(struct net_context
*c
, int argc
, const char **argv
);
97 int net_groupmap(struct net_context
*c
, int argc
, const char **argv
);
99 /* The following definitions come from utils/net_help.c */
101 int net_help(struct net_context
*c
, int argc
, const char **argv
);
103 /* The following definitions come from utils/net_idmap.c */
105 bool idmap_store_secret(const char *backend
, bool alloc
,
106 const char *domain
, const char *identity
,
108 int net_help_idmap(struct net_context
*c
, int argc
, const char **argv
);
109 int net_idmap(struct net_context
*c
, int argc
, const char **argv
);
111 /* The following definitions come from utils/net_join.c */
113 int net_join_usage(struct net_context
*c
, int argc
, const char **argv
);
114 int net_join(struct net_context
*c
, int argc
, const char **argv
);
116 /* The following definitions come from utils/net_lookup.c */
118 int net_lookup_usage(struct net_context
*c
, int argc
, const char **argv
);
119 int net_lookup(struct net_context
*c
, int argc
, const char **argv
);
121 /* The following definitions come from utils/net_rap.c */
123 int net_rap_file_usage(struct net_context
*c
, int argc
, const char **argv
);
124 int net_rap_file(struct net_context
*c
, int argc
, const char **argv
);
125 int net_rap_share_usage(struct net_context
*c
, int argc
, const char **argv
);
126 int net_rap_share(struct net_context
*c
, int argc
, const char **argv
);
127 int net_rap_session_usage(struct net_context
*c
, int argc
, const char **argv
);
128 int net_rap_session(struct net_context
*c
, int argc
, const char **argv
);
129 int net_rap_server_usage(struct net_context
*c
, int argc
, const char **argv
);
130 int net_rap_server(struct net_context
*c
, int argc
, const char **argv
);
131 int net_rap_domain_usage(struct net_context
*c
, int argc
, const char **argv
);
132 int net_rap_domain(struct net_context
*c
, int argc
, const char **argv
);
133 int net_rap_printq_usage(struct net_context
*c
, int argc
, const char **argv
);
134 int net_rap_printq(struct net_context
*c
, int argc
, const char **argv
);
135 int net_rap_user(struct net_context
*c
, int argc
, const char **argv
);
136 int net_rap_group_usage(struct net_context
*c
, int argc
, const char **argv
);
137 int net_rap_group(struct net_context
*c
, int argc
, const char **argv
);
138 int net_rap_groupmember_usage(struct net_context
*c
, int argc
, const char **argv
);
139 int net_rap_groupmember(struct net_context
*c
, int argc
, const char **argv
);
140 int net_rap_validate_usage(struct net_context
*c
, int argc
, const char **argv
);
141 int net_rap_validate(struct net_context
*c
, int argc
, const char **argv
);
142 int net_rap_service_usage(struct net_context
*c
, int argc
, const char **argv
);
143 int net_rap_service(struct net_context
*c
, int argc
, const char **argv
);
144 int net_rap_password_usage(struct net_context
*c
, int argc
, const char **argv
);
145 int net_rap_password(struct net_context
*c
, int argc
, const char **argv
);
146 int net_rap_admin_usage(struct net_context
*c
, int argc
, const char **argv
);
147 int net_rap_admin(struct net_context
*c
, int argc
, const char **argv
);
148 int net_rap(struct net_context
*c
, int argc
, const char **argv
);
150 /* The following definitions come from utils/net_registry.c */
152 int net_registry(struct net_context
*c
, int argc
, const char **argv
);
154 /* The following definitions come from utils/net_rpc.c */
156 NTSTATUS
net_get_remote_domain_sid(struct cli_state
*cli
, TALLOC_CTX
*mem_ctx
,
157 DOM_SID
**domain_sid
,
158 const char **domain_name
);
159 int run_rpc_command(struct net_context
*c
,
160 struct cli_state
*cli_arg
,
161 const char *interface
,
162 uint32_t interface_version
,
167 int net_rpc_changetrustpw(struct net_context
*c
, int argc
, const char **argv
);
168 int net_rpc_join(struct net_context
*c
, int argc
, const char **argv
);
169 NTSTATUS
rpc_info_internals(struct net_context
*c
,
170 const DOM_SID
*domain_sid
,
171 const char *domain_name
,
172 struct cli_state
*cli
,
173 struct rpc_pipe_client
*pipe_hnd
,
177 int net_rpc_info(struct net_context
*c
, int argc
, const char **argv
);
178 int net_rpc_getsid(struct net_context
*c
, int argc
, const char **argv
);
179 int net_rpc_user(struct net_context
*c
, int argc
, const char **argv
);
180 struct rpc_sh_cmd
*net_rpc_user_edit_cmds(struct net_context
*c
,
182 struct rpc_sh_ctx
*ctx
);
183 struct rpc_sh_cmd
*net_rpc_user_cmds(struct net_context
*c
,
185 struct rpc_sh_ctx
*ctx
);
186 int net_rpc_group(struct net_context
*c
, int argc
, const char **argv
);
187 bool copy_top_level_perms(struct net_context
*c
,
188 struct copy_clistate
*cp_clistate
,
189 const char *sharename
);
190 int net_usersidlist(struct net_context
*c
, int argc
, const char **argv
);
191 int net_usersidlist_usage(struct net_context
*c
, int argc
, const char **argv
);
192 int net_rpc_share(struct net_context
*c
, int argc
, const char **argv
);
193 struct rpc_sh_cmd
*net_rpc_share_cmds(struct net_context
*c
, TALLOC_CTX
*mem_ctx
,
194 struct rpc_sh_ctx
*ctx
);
195 int net_rpc_file(struct net_context
*c
, int argc
, const char **argv
);
196 NTSTATUS
rpc_init_shutdown_internals(struct net_context
*c
,
197 const DOM_SID
*domain_sid
,
198 const char *domain_name
,
199 struct cli_state
*cli
,
200 struct rpc_pipe_client
*pipe_hnd
,
204 NTSTATUS
rpc_reg_shutdown_internals(struct net_context
*c
,
205 const DOM_SID
*domain_sid
,
206 const char *domain_name
,
207 struct cli_state
*cli
,
208 struct rpc_pipe_client
*pipe_hnd
,
212 bool net_rpc_check(struct net_context
*c
, unsigned flags
);
213 int rpc_printer_migrate(struct net_context
*c
, int argc
, const char **argv
);
214 int rpc_printer_usage(struct net_context
*c
, int argc
, const char **argv
);
215 int net_rpc_printer(struct net_context
*c
, int argc
, const char **argv
);
216 int net_rpc(struct net_context
*c
, int argc
, const char **argv
);
218 /* The following definitions come from utils/net_rpc_audit.c */
220 int net_rpc_audit(struct net_context
*c
, int argc
, const char **argv
);
222 /* The following definitions come from utils/net_rpc_join.c */
224 NTSTATUS
net_rpc_join_ok(struct net_context
*c
, const char *domain
,
225 const char *server
, struct sockaddr_storage
*pss
);
226 int net_rpc_join_newstyle(struct net_context
*c
, int argc
, const char **argv
);
227 int net_rpc_testjoin(struct net_context
*c
, int argc
, const char **argv
);
229 /* The following definitions come from utils/net_rpc_printer.c */
231 NTSTATUS
net_copy_fileattr(struct net_context
*c
,
233 struct cli_state
*cli_share_src
,
234 struct cli_state
*cli_share_dst
,
235 const char *src_name
, const char *dst_name
,
236 bool copy_acls
, bool copy_attrs
,
237 bool copy_timestamps
, bool is_file
);
238 NTSTATUS
net_copy_file(struct net_context
*c
,
240 struct cli_state
*cli_share_src
,
241 struct cli_state
*cli_share_dst
,
242 const char *src_name
, const char *dst_name
,
243 bool copy_acls
, bool copy_attrs
,
244 bool copy_timestamps
, bool is_file
);
245 NTSTATUS
rpc_printer_list_internals(struct net_context
*c
,
246 const DOM_SID
*domain_sid
,
247 const char *domain_name
,
248 struct cli_state
*cli
,
249 struct rpc_pipe_client
*pipe_hnd
,
253 NTSTATUS
rpc_printer_driver_list_internals(struct net_context
*c
,
254 const DOM_SID
*domain_sid
,
255 const char *domain_name
,
256 struct cli_state
*cli
,
257 struct rpc_pipe_client
*pipe_hnd
,
261 NTSTATUS
rpc_printer_publish_publish_internals(struct net_context
*c
,
262 const DOM_SID
*domain_sid
,
263 const char *domain_name
,
264 struct cli_state
*cli
,
265 struct rpc_pipe_client
*pipe_hnd
,
269 NTSTATUS
rpc_printer_publish_unpublish_internals(struct net_context
*c
,
270 const DOM_SID
*domain_sid
,
271 const char *domain_name
,
272 struct cli_state
*cli
,
273 struct rpc_pipe_client
*pipe_hnd
,
277 NTSTATUS
rpc_printer_publish_update_internals(struct net_context
*c
,
278 const DOM_SID
*domain_sid
,
279 const char *domain_name
,
280 struct cli_state
*cli
,
281 struct rpc_pipe_client
*pipe_hnd
,
285 NTSTATUS
rpc_printer_publish_list_internals(struct net_context
*c
,
286 const DOM_SID
*domain_sid
,
287 const char *domain_name
,
288 struct cli_state
*cli
,
289 struct rpc_pipe_client
*pipe_hnd
,
293 NTSTATUS
rpc_printer_migrate_security_internals(struct net_context
*c
,
294 const DOM_SID
*domain_sid
,
295 const char *domain_name
,
296 struct cli_state
*cli
,
297 struct rpc_pipe_client
*pipe_hnd
,
301 NTSTATUS
rpc_printer_migrate_forms_internals(struct net_context
*c
,
302 const DOM_SID
*domain_sid
,
303 const char *domain_name
,
304 struct cli_state
*cli
,
305 struct rpc_pipe_client
*pipe_hnd
,
309 NTSTATUS
rpc_printer_migrate_drivers_internals(struct net_context
*c
,
310 const DOM_SID
*domain_sid
,
311 const char *domain_name
,
312 struct cli_state
*cli
,
313 struct rpc_pipe_client
*pipe_hnd
,
317 NTSTATUS
rpc_printer_migrate_printers_internals(struct net_context
*c
,
318 const DOM_SID
*domain_sid
,
319 const char *domain_name
,
320 struct cli_state
*cli
,
321 struct rpc_pipe_client
*pipe_hnd
,
325 NTSTATUS
rpc_printer_migrate_settings_internals(struct net_context
*c
,
326 const DOM_SID
*domain_sid
,
327 const char *domain_name
,
328 struct cli_state
*cli
,
329 struct rpc_pipe_client
*pipe_hnd
,
334 /* The following definitions come from utils/net_rpc_registry.c */
336 int net_rpc_registry(struct net_context
*c
, int argc
, const char **argv
);
338 /* The following definitions come from utils/net_rpc_rights.c */
340 int net_rpc_rights(struct net_context
*c
, int argc
, const char **argv
);
341 struct rpc_sh_cmd
*net_rpc_rights_cmds(struct net_context
*c
, TALLOC_CTX
*mem_ctx
,
342 struct rpc_sh_ctx
*ctx
);
344 /* The following definitions come from utils/net_rpc_samsync.c */
346 NTSTATUS
rpc_samdump_internals(struct net_context
*c
,
347 const DOM_SID
*domain_sid
,
348 const char *domain_name
,
349 struct cli_state
*cli
,
350 struct rpc_pipe_client
*pipe_hnd
,
354 int rpc_vampire_usage(struct net_context
*c
, int argc
, const char **argv
);
355 NTSTATUS
rpc_vampire_internals(struct net_context
*c
,
356 const DOM_SID
*domain_sid
,
357 const char *domain_name
,
358 struct cli_state
*cli
,
359 struct rpc_pipe_client
*pipe_hnd
,
363 int rpc_vampire_passdb(struct net_context
*c
, int argc
, const char **argv
);
364 int rpc_vampire_ldif(struct net_context
*c
, int argc
, const char **argv
);
365 NTSTATUS
rpc_vampire_ldif_internals(struct net_context
*c
,
366 const DOM_SID
*domain_sid
,
367 const char *domain_name
,
368 struct cli_state
*cli
,
369 struct rpc_pipe_client
*pipe_hnd
,
373 NTSTATUS
rpc_vampire_keytab_internals(struct net_context
*c
,
374 const DOM_SID
*domain_sid
,
375 const char *domain_name
,
376 struct cli_state
*cli
,
377 struct rpc_pipe_client
*pipe_hnd
,
381 int rpc_vampire_keytab(struct net_context
*c
, int argc
, const char **argv
);
383 /* The following definitions come from utils/net_rpc_service.c */
385 const char *svc_status_string( uint32 state
);
386 int net_rpc_service(struct net_context
*c
, int argc
, const char **argv
);
388 /* The following definitions come from utils/net_rpc_sh_acct.c */
390 struct rpc_sh_cmd
*net_rpc_acct_cmds(struct net_context
*c
, TALLOC_CTX
*mem_ctx
,
391 struct rpc_sh_ctx
*ctx
);
393 /* The following definitions come from utils/net_rpc_shell.c */
395 int net_rpc_shell(struct net_context
*c
, int argc
, const char **argv
);
397 /* The following definitions come from utils/net_sam.c */
399 int net_sam(struct net_context
*c
, int argc
, const char **argv
);
401 /* The following definitions come from utils/net_share.c */
403 int net_share_usage(struct net_context
*c
, int argc
, const char **argv
);
404 int net_share(struct net_context
*c
, int argc
, const char **argv
);
406 /* The following definitions come from utils/net_status.c */
408 int net_status_usage(struct net_context
*c
, int argc
, const char **argv
);
409 int net_status(struct net_context
*c
, int argc
, const char **argv
);
411 /* The following definitions come from utils/net_time.c */
413 int net_time_usage(struct net_context
*c
, int argc
, const char **argv
);
414 int net_time(struct net_context
*c
, int argc
, const char **argv
);
416 /* The following definitions come from utils/net_user.c */
418 int net_user_usage(struct net_context
*c
, int argc
, const char **argv
);
419 int net_user(struct net_context
*c
, int argc
, const char **argv
);
421 /* The following definitions come from utils/net_usershare.c */
423 int net_usershare_usage(struct net_context
*c
, int argc
, const char **argv
);
424 int net_usershare_help(struct net_context
*c
, int argc
, const char **argv
);
425 int net_usershare(struct net_context
*c
, int argc
, const char **argv
);
427 /* The following definitions come from utils/net_eventlog.c */
429 int net_eventlog(struct net_context
*c
, int argc
, const char **argv
);
431 /* The following definitions come from utils/net_util.c */
433 NTSTATUS
net_rpc_lookup_name(struct net_context
*c
,
434 TALLOC_CTX
*mem_ctx
, struct cli_state
*cli
,
435 const char *name
, const char **ret_domain
,
436 const char **ret_name
, DOM_SID
*ret_sid
,
437 enum lsa_SidType
*ret_type
);
438 NTSTATUS
connect_to_service(struct net_context
*c
,
439 struct cli_state
**cli_ctx
,
440 struct sockaddr_storage
*server_ss
,
441 const char *server_name
,
442 const char *service_name
,
443 const char *service_type
);
444 NTSTATUS
connect_to_ipc(struct net_context
*c
,
445 struct cli_state
**cli_ctx
,
446 struct sockaddr_storage
*server_ss
,
447 const char *server_name
);
448 NTSTATUS
connect_to_ipc_anonymous(struct net_context
*c
,
449 struct cli_state
**cli_ctx
,
450 struct sockaddr_storage
*server_ss
,
451 const char *server_name
);
452 NTSTATUS
connect_to_ipc_krb5(struct net_context
*c
,
453 struct cli_state
**cli_ctx
,
454 struct sockaddr_storage
*server_ss
,
455 const char *server_name
);
456 NTSTATUS
connect_dst_pipe(struct net_context
*c
, struct cli_state
**cli_dst
,
457 struct rpc_pipe_client
**pp_pipe_hnd
,
458 const struct ndr_syntax_id
*interface
);
459 int net_use_krb_machine_account(struct net_context
*c
);
460 int net_use_machine_account(struct net_context
*c
);
461 bool net_find_server(struct net_context
*c
,
464 struct sockaddr_storage
*server_ss
,
466 bool net_find_pdc(struct sockaddr_storage
*server_ss
,
468 const char *domain_name
);
469 NTSTATUS
net_make_ipc_connection(struct net_context
*c
, unsigned flags
,
470 struct cli_state
**pcli
);
471 NTSTATUS
net_make_ipc_connection_ex(struct net_context
*c
,const char *domain
,
473 struct sockaddr_storage
*pss
,
474 unsigned flags
, struct cli_state
**pcli
);
475 const char *net_prompt_pass(struct net_context
*c
, const char *user
);
476 int net_run_function(struct net_context
*c
, int argc
, const char **argv
,
477 const char *whoami
, struct functable
*table
);
478 void net_display_usage_from_functable(struct functable
*table
);
480 const char *net_share_type_str(int num_type
);
482 NTSTATUS
net_scan_dc(struct net_context
*c
,
483 struct cli_state
*cli
,
484 struct net_dc_info
*dc_info
);
486 /* The following definitions come from utils/netlookup.c */
488 NTSTATUS
net_lookup_name_from_sid(struct net_context
*c
,
491 const char **ppdomain
,
492 const char **ppname
);
493 NTSTATUS
net_lookup_sid_from_name(struct net_context
*c
, TALLOC_CTX
*ctx
,
494 const char *full_name
, DOM_SID
*pret_sid
);
496 /* The following definitions come from utils/passwd_util.c */
498 char *stdin_new_passwd( void);
499 char *get_pass( const char *prompt
, bool stdin_get
);
501 #endif /* _NET_PROTO_H_ */