Home | History | Annotate | Download | only in smbsrv
      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  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
     23  * Use is subject to license terms.
     24  */
     25 
     26 #ifndef _SMB_WINPIPE_H_
     27 #define	_SMB_WINPIPE_H_
     28 
     29 #pragma ident	"@(#)smb_winpipe.h	1.2	07/11/20 SMI"
     30 
     31 #ifndef _KERNEL
     32 #include <stddef.h>
     33 #endif /* _KERNEL */
     34 
     35 #include <sys/thread.h>
     36 #include <sys/door.h>
     37 #include <sys/disp.h>
     38 #include <sys/systm.h>
     39 #include <sys/processor.h>
     40 #include <sys/socket.h>
     41 #include <inet/common.h>
     42 
     43 #ifdef __cplusplus
     44 extern "C" {
     45 #endif
     46 
     47 #define	SMB_IO_MAX_SIZE 32
     48 #define	SMB_MAX_PIPENAMELEN 32
     49 
     50 #define	SMB_WINPIPE_DOOR_DOWN_PATH "/var/run/winpipe_doordown"
     51 
     52 #define	SMB_DOWNCALLINFO_MAGIC	0x19121969
     53 #define	SMB_MLSVC_DOOR_VERSION 1
     54 
     55 #define	SMB_RPC_FLUSH_MAGIC 0x123456CC
     56 #define	SMB_RPC_TRANSACT 1
     57 #define	SMB_RPC_READ	 2
     58 #define	SMB_RPC_WRITE	 3
     59 #define	SMB_RPC_FLUSH	 4
     60 
     61 typedef struct {
     62 	uint64_t md_tid;	/* caller's thread id */
     63 	uint16_t md_version;	/* version number, start with 1 */
     64 	uint16_t md_call_type;	/* transact, read, write, flush */
     65 	uint32_t md_length;	/* max bytes to return */
     66 	uint64_t md_reserved;
     67 } mlsvc_door_hdr_t;
     68 
     69 typedef struct {
     70 	uint32_t sp_pipeid;
     71 	char	 sp_pipename[SMB_MAX_PIPENAMELEN];
     72 	int32_t  sp_datalen;
     73 	char	 sp_data[1]; /* any size buffer */
     74 } smb_pipe_t;
     75 
     76 void smb_downcall_service(void *, door_arg_t *, void (**)(void *, void *),
     77     void **, int *);
     78 
     79 #ifdef __cplusplus
     80 }
     81 #endif
     82 
     83 #endif /* _SMB_WINPIPE_H_ */
     84