smb_kproto.h revision 55bf511df53aad0fdb7eb3fa349f0308cc05234c
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Function prototypes for the SMB module.
*/
#ifndef _SMB_KPROTO_H_
#define _SMB_KPROTO_H_
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/socketvar.h>
#include <smbsrv/smb_vops.h>
#include <smbsrv/smb_token.h>
/*
* Definitions that should be elsewhere...
*/
int fd_dealloc(int);
/* Why? uint32_t inet_addr(char *str); */
int clock_get_uptime(void);
/*
*/
int smb_service_init(void);
void smb_service_fini(void);
/*
* Logging functions
*/
void smb_log_flush(void);
void smb_close_all_connections(void);
int smb_net_id(uint32_t);
void smb_oplock_init(void);
unsigned int level_requested,
unsigned int *level_granted);
int smb_maybe_mangled_name(char *name);
void smb_set_stability(int mode);
void smb_commit_required(int state);
int smbsr_connect_tree(struct smb_request *);
int smb_convert_unicode_wildcards(char *);
int smb_ascii_or_unicode_strlen(struct smb_request *, char *);
int smb_ascii_or_unicode_strlen_null(struct smb_request *, char *);
int smb_ascii_or_unicode_null_len(struct smb_request *);
int smb_search(struct smb_request *);
void smb_rdir_close(struct smb_request *);
int smb_rdir_open(struct smb_request *, char *, unsigned short);
void sshow_distribution_info(char *);
int smb_dispatch_request(struct smb_request *);
void smbsr_check_result(struct smb_request *, int, int);
void smbsr_decode_error(struct smb_request *);
void smbsr_encode_error(struct smb_request *);
#pragma does_not_return(smbsr_decode_error)
#pragma does_not_return(smbsr_encode_error)
void smbsr_encode_result(struct smb_request *, int, int, char *, ...);
void smbsr_send_reply(struct smb_request *);
int error_class, int error_code);
int smbsr_set_errno(struct smb_request *, int);
void smbsr_raise_errno(struct smb_request *, int);
void smbsr_raise_error(struct smb_request *, int, int);
#pragma does_not_return(smbsr_raise_cifs_error)
#pragma does_not_return(smbsr_raise_error)
#pragma does_not_return(smbsr_raise_nt_error)
#pragma does_not_return(smbsr_raise_errno)
int clock_get_milli_uptime(void);
int dosfs_dos_to_ux_time(int, int);
int dosfs_ux_to_dos_time(int, short int *, short int *);
int smb_xlate_dialect_str_to_cd(char *);
char *smb_xlate_com_cd_to_str(int);
char *smb_xlate_dialect_cd_to_str(int);
/*
* Socket functions
*/
/*
* SMB RPC interface
*/
/*
* SMB node functions (file smb_node.c)
*/
int smb_node_root_init();
void smb_node_root_fini();
void smb_node_reset_delete_on_close(smb_node_t *);
/*
* Pathname functions
*/
/*
* Share functions
*/
int smb_share_export(char *);
int smb_share_unexport(char *, char *);
/*
* smb_vfs functions
*/
void smb_vfs_rele(vfs_t *);
void smb_vfs_rele_all(void);
/*
* String manipulation function
*/
char *smb_kstrdup(const char *s, size_t n);
/* NOTIFY CHANGE */
/* FEM */
int smb_fem_init();
void smb_fem_shutdown();
/* functions from smb_memory_manager.c */
void *smbsr_realloc(void *, size_t);
void smbsr_free_malloc_list(smb_malloc_list *);
unsigned short smb_worker_getnum();
char *stream_name);
uint32_t smb_get_gmtoff(void);
void smb_set_gmtoff(uint32_t);
/* SMB signing routines smb_signing.c */
int request_length);
void smb_session_disconnect_share(char *);
void smb_session_disconnect_volume(fs_desc_t *);
/*
* ofile functions (file smb_ofile.c)
*/
/*
* odir functions (file smb_odir.c)
*/
/*
* SMB user functions (file smb_user.c)
*/
/*
* SMB tree functions (file smb_tree.c)
*/
uint32_t smb_user_get_num(void);
/*
* SMB user's credential functions
*/
void smb_check_status(void);
void smb_winpipe_init(void);
void smb_winpipe_fini(void);
int smb_winpipe_open(int door_id);
void smb_winpipe_close(void);
int is_dot_or_dotdot(char *name);
/*
* Pool ID function prototypes
*/
/*
* SMB thread function prototypes
*/
void smb_session_worker(void *arg);
/*
* SMB locked list function prototypes
*/
void smb_llist_destructor(smb_llist_t *);
/*
* SMB Synchronized list function prototypes
*/
void smb_slist_destructor(smb_slist_t *);
smb_thread_aw_t, void *);
void smb_thread_destroy(smb_thread_t *);
int smb_thread_start(smb_thread_t *);
void smb_thread_stop(smb_thread_t *);
void smb_thread_signal(smb_thread_t *);
#define smb_audit_node(_n_) \
if ((_n_)->n_audit_buf) { \
\
}
/* 100's of ns between 1/1/1970 and 1/1/1601 */
void smb_sd_term(smb_sd_t *);
void smb_fssd_term(smb_fssd_t *);
void smb_acl_sort(smb_acl_t *);
void smb_acl_free(smb_acl_t *);
void smb_fsacl_free(acl_t *);
acl_t *smb_fsacl_alloc(int, int);
boolean_t smb_ace_is_generic(int);
boolean_t smb_ace_is_access(int);
boolean_t smb_ace_is_audit(int);
#ifdef __cplusplus
}
#endif
#endif /* _SMB_KPROTO_H_ */