smbd.h revision a4b239dfde5f1d873c730c047e87e5714ebddbb7
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER START
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The contents of this file are subject to the terms of the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Common Development and Distribution License (the "License").
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You may not use this file except in compliance with the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * or http://www.opensolaris.org/os/licensing.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * See the License for the specific language governing permissions
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * and limitations under the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * When distributing Covered Code, include this CDDL HEADER in each
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * If applicable, add the following below this CDDL HEADER, with the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * fields enclosed by brackets "[]" replaced with your own identifying
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * information: Portions Copyright [yyyy] [name of copyright owner]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER END
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*
89dc44ce9705974a8bc4a39f1e878a0491a5be61jose borrego * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Use is subject to license terms.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#ifndef _SMBD_H
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define _SMBD_H
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#ifdef __cplusplus
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwextern "C" {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#endif
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#include <sys/types.h>
94fff7907278e4540aa7abee2b1b0ea71d36f7faAlan Wright#include <smbsrv/smb_ioctl.h>
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#include <smbsrv/smb_token.h>
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#include <smbsrv/libsmb.h>
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#include <smbsrv/libmlsvc.h>
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
3db3f65c6274eb042354801a308c8e9bc4994553amwextern int smbd_opipe_dsrv_start(void);
3db3f65c6274eb042354801a308c8e9bc4994553amwextern void smbd_opipe_dsrv_stop(void);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
3ad684d66b78e06edd37e2c4fd3b3949f095194bjbextern int smb_share_dsrv_start(void);
3ad684d66b78e06edd37e2c4fd3b3949f095194bjbextern void smb_share_dsrv_stop(void);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
8d7e41661dc4633488e93b13363137523ce59977jose borregoextern boolean_t smbd_set_netlogon_cred(void);
8d7e41661dc4633488e93b13363137523ce59977jose borregoextern int smbd_locate_dc_start(void);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwextern smb_token_t *smbd_user_auth_logon(netr_client_t *);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwextern void smbd_user_nonauth_logon(uint32_t);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwextern void smbd_user_auth_logoff(uint32_t);
faa1795a28a5c712eed6d0a3f84d98c368a316c6jbextern uint32_t smbd_join(smb_joininfo_t *);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
94fff7907278e4540aa7abee2b1b0ea71d36f7faAlan Wrightextern int smbd_ioctl(int, smb_io_t *);
8d7e41661dc4633488e93b13363137523ce59977jose borregoextern void smbd_set_secmode(int);
3ad684d66b78e06edd37e2c4fd3b3949f095194bjb
6d57f8333dfc689618aaf2efe76a8066de053841Alan Wrightextern int smbd_vss_get_count(const char *, uint32_t *);
6d57f8333dfc689618aaf2efe76a8066de053841Alan Wrightextern void smbd_vss_get_snapshots(const char *, uint32_t, uint32_t *,
6d57f8333dfc689618aaf2efe76a8066de053841Alan Wright uint32_t *, char **);
6d57f8333dfc689618aaf2efe76a8066de053841Alan Wrightextern int smbd_vss_map_gmttoken(const char *, char *, char *);
89dc44ce9705974a8bc4a39f1e878a0491a5be61jose borrego
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwtypedef struct smbd {
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas const char *s_version; /* smbd version string */
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas const char *s_pname; /* basename to use for messages */
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas pid_t s_pid; /* process-ID of current daemon */
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas uid_t s_uid; /* UID of current daemon */
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas gid_t s_gid; /* GID of current daemon */
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas int s_fg; /* Run in foreground */
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas int s_drv_fd; /* Handle for SMB kernel driver */
8d7e41661dc4633488e93b13363137523ce59977jose borrego boolean_t s_shutting_down; /* shutdown control */
8d7e41661dc4633488e93b13363137523ce59977jose borrego volatile uint_t s_sigval;
8d7e41661dc4633488e93b13363137523ce59977jose borrego volatile uint_t s_refreshes;
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas boolean_t s_kbound; /* B_TRUE if bound to kernel */
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas int s_door_lmshr;
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas int s_door_srv;
3db3f65c6274eb042354801a308c8e9bc4994553amw int s_door_opipe;
6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2eas int s_secmode; /* Current security mode */
a4b239dfde5f1d873c730c047e87e5714ebddbb7jose borrego boolean_t s_nbt_listener_running;
a4b239dfde5f1d873c730c047e87e5714ebddbb7jose borrego boolean_t s_tcp_listener_running;
a4b239dfde5f1d873c730c047e87e5714ebddbb7jose borrego pthread_t s_nbt_listener_id;
a4b239dfde5f1d873c730c047e87e5714ebddbb7jose borrego pthread_t s_tcp_listener_id;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw} smbd_t;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#ifdef __cplusplus
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#endif
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#endif /* _SMBD_H */