1*a237e38eSth199096 /* 2*a237e38eSth199096 * CDDL HEADER START 3*a237e38eSth199096 * 4*a237e38eSth199096 * The contents of this file are subject to the terms of the 5*a237e38eSth199096 * Common Development and Distribution License (the "License"). 6*a237e38eSth199096 * You may not use this file except in compliance with the License. 7*a237e38eSth199096 * 8*a237e38eSth199096 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*a237e38eSth199096 * or http://www.opensolaris.org/os/licensing. 10*a237e38eSth199096 * See the License for the specific language governing permissions 11*a237e38eSth199096 * and limitations under the License. 12*a237e38eSth199096 * 13*a237e38eSth199096 * When distributing Covered Code, include this CDDL HEADER in each 14*a237e38eSth199096 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*a237e38eSth199096 * If applicable, add the following below this CDDL HEADER, with the 16*a237e38eSth199096 * fields enclosed by brackets "[]" replaced with your own identifying 17*a237e38eSth199096 * information: Portions Copyright [yyyy] [name of copyright owner] 18*a237e38eSth199096 * 19*a237e38eSth199096 * CDDL HEADER END 20*a237e38eSth199096 */ 21*a237e38eSth199096 22*a237e38eSth199096 /* 23*a237e38eSth199096 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 24*a237e38eSth199096 * Use is subject to license terms. 25*a237e38eSth199096 */ 26*a237e38eSth199096 27*a237e38eSth199096 #ifndef _SHAREFS_SHARE_H 28*a237e38eSth199096 #define _SHAREFS_SHARE_H 29*a237e38eSth199096 30*a237e38eSth199096 #pragma ident "%Z%%M% %I% %E% SMI" 31*a237e38eSth199096 32*a237e38eSth199096 #ifdef __cplusplus 33*a237e38eSth199096 extern "C" { 34*a237e38eSth199096 #endif 35*a237e38eSth199096 36*a237e38eSth199096 /* 37*a237e38eSth199096 * struct share defines the format of an exported filesystem. 38*a237e38eSth199096 * 39*a237e38eSth199096 * It is also the interface between the userland tools and 40*a237e38eSth199096 * the kernel. 41*a237e38eSth199096 */ 42*a237e38eSth199096 typedef struct share { 43*a237e38eSth199096 char *sh_path; 44*a237e38eSth199096 char *sh_res; 45*a237e38eSth199096 char *sh_fstype; 46*a237e38eSth199096 char *sh_opts; 47*a237e38eSth199096 char *sh_descr; 48*a237e38eSth199096 size_t sh_size; 49*a237e38eSth199096 struct share *sh_next; 50*a237e38eSth199096 } share_t; 51*a237e38eSth199096 52*a237e38eSth199096 #ifdef _SYSCALL32 53*a237e38eSth199096 typedef struct share32 { 54*a237e38eSth199096 caddr32_t sh_path; 55*a237e38eSth199096 caddr32_t sh_res; 56*a237e38eSth199096 caddr32_t sh_fstype; 57*a237e38eSth199096 caddr32_t sh_opts; 58*a237e38eSth199096 caddr32_t sh_descr; 59*a237e38eSth199096 size32_t sh_size; 60*a237e38eSth199096 caddr32_t sh_next; 61*a237e38eSth199096 } share32_t; 62*a237e38eSth199096 #endif /* _SYSCALL32 */ 63*a237e38eSth199096 64*a237e38eSth199096 #define SHARETAB "/etc/dfs/sharetab" 65*a237e38eSth199096 #define MAXBUFSIZE 65536 66*a237e38eSth199096 67*a237e38eSth199096 /* 68*a237e38eSth199096 * Flavors of the system call. 69*a237e38eSth199096 */ 70*a237e38eSth199096 enum sharefs_sys_op { SHAREFS_ADD, SHAREFS_REMOVE, SHAREFS_REPLACE }; 71*a237e38eSth199096 72*a237e38eSth199096 #ifdef _KERNEL 73*a237e38eSth199096 74*a237e38eSth199096 extern int sharefs(enum sharefs_sys_op opcode, struct share *sh, 75*a237e38eSth199096 uint32_t iMaxLen); 76*a237e38eSth199096 77*a237e38eSth199096 #else 78*a237e38eSth199096 79*a237e38eSth199096 extern int sharefs(enum sharefs_sys_op opcode, struct share *sh); 80*a237e38eSth199096 81*a237e38eSth199096 #endif 82*a237e38eSth199096 83*a237e38eSth199096 #ifdef __cplusplus 84*a237e38eSth199096 } 85*a237e38eSth199096 #endif 86*a237e38eSth199096 87*a237e38eSth199096 #endif /* !_SHAREFS_SHARE_H */ 88