xref: /titanic_41/usr/src/cmd/smbsrv/smbd/smbd.h (revision 37714ae43602c675f9dc59b070bfdf9fa702872c)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SMBD_H
28 #define	_SMBD_H
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #include <sys/types.h>
35 #include <smbsrv/smb_ioctl.h>
36 #include <smbsrv/smb_token.h>
37 #include <smbsrv/libsmb.h>
38 #include <smbsrv/libmlsvc.h>
39 
40 extern int smbd_opipe_dsrv_start(void);
41 extern void smbd_opipe_dsrv_stop(void);
42 
43 extern int smb_share_dsrv_start(void);
44 extern void smb_share_dsrv_stop(void);
45 
46 extern boolean_t smbd_set_netlogon_cred(void);
47 extern int smbd_locate_dc_start(void);
48 
49 extern smb_token_t *smbd_user_auth_logon(netr_client_t *);
50 extern void smbd_user_nonauth_logon(uint32_t);
51 extern void smbd_user_auth_logoff(uint32_t);
52 extern uint32_t smbd_join(smb_joininfo_t *);
53 
54 extern void smbd_set_secmode(int);
55 
56 extern int smbd_vss_get_count(const char *, uint32_t *);
57 extern void smbd_vss_get_snapshots(const char *, uint32_t, uint32_t *,
58     uint32_t *, char **);
59 extern int smbd_vss_map_gmttoken(const char *, char *, char *);
60 
61 typedef struct smbd {
62 	const char	*s_version;	/* smbd version string */
63 	const char	*s_pname;	/* basename to use for messages */
64 	pid_t		s_pid;		/* process-ID of current daemon */
65 	uid_t		s_uid;		/* UID of current daemon */
66 	gid_t		s_gid;		/* GID of current daemon */
67 	int		s_fg;		/* Run in foreground */
68 	boolean_t	s_shutting_down; /* shutdown control */
69 	volatile uint_t	s_sigval;
70 	volatile uint_t	s_refreshes;
71 	boolean_t	s_kbound;	/* B_TRUE if bound to kernel */
72 	int		s_door_lmshr;
73 	int		s_door_srv;
74 	int		s_door_opipe;
75 	int		s_secmode;	/* Current security mode */
76 	boolean_t	s_nbt_listener_running;
77 	boolean_t	s_tcp_listener_running;
78 	pthread_t	s_nbt_listener_id;
79 	pthread_t	s_tcp_listener_id;
80 	boolean_t	s_fatal_error;
81 } smbd_t;
82 
83 #ifdef __cplusplus
84 }
85 #endif
86 
87 #endif /* _SMBD_H */
88