xref: /onnv-gate/usr/src/uts/common/sharefs/share.h (revision 4995:3e3d6de427e8)
13957Sth199096 /*
23957Sth199096  * CDDL HEADER START
33957Sth199096  *
43957Sth199096  * The contents of this file are subject to the terms of the
53957Sth199096  * Common Development and Distribution License (the "License").
63957Sth199096  * You may not use this file except in compliance with the License.
73957Sth199096  *
83957Sth199096  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
93957Sth199096  * or http://www.opensolaris.org/os/licensing.
103957Sth199096  * See the License for the specific language governing permissions
113957Sth199096  * and limitations under the License.
123957Sth199096  *
133957Sth199096  * When distributing Covered Code, include this CDDL HEADER in each
143957Sth199096  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
153957Sth199096  * If applicable, add the following below this CDDL HEADER, with the
163957Sth199096  * fields enclosed by brackets "[]" replaced with your own identifying
173957Sth199096  * information: Portions Copyright [yyyy] [name of copyright owner]
183957Sth199096  *
193957Sth199096  * CDDL HEADER END
203957Sth199096  */
213957Sth199096 
223957Sth199096 /*
233957Sth199096  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
243957Sth199096  * Use is subject to license terms.
253957Sth199096  */
263957Sth199096 
273957Sth199096 #ifndef _SHAREFS_SHARE_H
283957Sth199096 #define	_SHAREFS_SHARE_H
293957Sth199096 
303957Sth199096 #pragma ident	"%Z%%M%	%I%	%E% SMI"
313957Sth199096 
323957Sth199096 #ifdef __cplusplus
333957Sth199096 extern "C" {
343957Sth199096 #endif
353957Sth199096 
363957Sth199096 /*
373957Sth199096  * struct share defines the format of an exported filesystem.
383957Sth199096  *
393957Sth199096  * It is also the interface between the userland tools and
403957Sth199096  * the kernel.
413957Sth199096  */
423957Sth199096 typedef struct share {
433957Sth199096 	char		*sh_path;
443957Sth199096 	char		*sh_res;
453957Sth199096 	char		*sh_fstype;
463957Sth199096 	char		*sh_opts;
473957Sth199096 	char		*sh_descr;
483957Sth199096 	size_t		sh_size;
493957Sth199096 	struct share	*sh_next;
503957Sth199096 } share_t;
513957Sth199096 
523957Sth199096 #ifdef _SYSCALL32
533957Sth199096 typedef struct share32 {
543957Sth199096 	caddr32_t	sh_path;
553957Sth199096 	caddr32_t	sh_res;
563957Sth199096 	caddr32_t	sh_fstype;
573957Sth199096 	caddr32_t	sh_opts;
583957Sth199096 	caddr32_t	sh_descr;
593957Sth199096 	size32_t	sh_size;
603957Sth199096 	caddr32_t	sh_next;
613957Sth199096 } share32_t;
623957Sth199096 #endif /* _SYSCALL32 */
633957Sth199096 
643957Sth199096 #define	SHARETAB	"/etc/dfs/sharetab"
653957Sth199096 #define	MAXBUFSIZE	65536
663957Sth199096 
673957Sth199096 /*
683957Sth199096  * Flavors of the system call.
693957Sth199096  */
703957Sth199096 enum sharefs_sys_op { SHAREFS_ADD, SHAREFS_REMOVE, SHAREFS_REPLACE };
713957Sth199096 
723957Sth199096 #ifdef _KERNEL
733957Sth199096 
74*4995Sth199096 extern int sharefs(enum sharefs_sys_op opcode, struct share *sh,
75*4995Sth199096     uint32_t iMaxLen);
763957Sth199096 
773957Sth199096 #else
783957Sth199096 
79*4995Sth199096 extern int _sharefs(enum sharefs_sys_op opcode, struct share *sh);
803957Sth199096 
813957Sth199096 #endif
823957Sth199096 
833957Sth199096 #ifdef __cplusplus
843957Sth199096 }
853957Sth199096 #endif
863957Sth199096 
873957Sth199096 #endif /* !_SHAREFS_SHARE_H */
88