1*3910Sdougm /* 2*3910Sdougm * CDDL HEADER START 3*3910Sdougm * 4*3910Sdougm * The contents of this file are subject to the terms of the 5*3910Sdougm * Common Development and Distribution License (the "License"). 6*3910Sdougm * You may not use this file except in compliance with the License. 7*3910Sdougm * 8*3910Sdougm * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*3910Sdougm * or http://www.opensolaris.org/os/licensing. 10*3910Sdougm * See the License for the specific language governing permissions 11*3910Sdougm * and limitations under the License. 12*3910Sdougm * 13*3910Sdougm * When distributing Covered Code, include this CDDL HEADER in each 14*3910Sdougm * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*3910Sdougm * If applicable, add the following below this CDDL HEADER, with the 16*3910Sdougm * fields enclosed by brackets "[]" replaced with your own identifying 17*3910Sdougm * information: Portions Copyright [yyyy] [name of copyright owner] 18*3910Sdougm * 19*3910Sdougm * CDDL HEADER END 20*3910Sdougm */ 21*3910Sdougm 22*3910Sdougm /* 23*3910Sdougm * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24*3910Sdougm * Use is subject to license terms. 25*3910Sdougm */ 26*3910Sdougm 27*3910Sdougm /* 28*3910Sdougm * basic API declarations for share management 29*3910Sdougm */ 30*3910Sdougm 31*3910Sdougm #ifndef _LIBSHARE_NFS_H 32*3910Sdougm #define _LIBSHARE_NFS_H 33*3910Sdougm 34*3910Sdougm #pragma ident "%Z%%M% %I% %E% SMI" 35*3910Sdougm 36*3910Sdougm #ifdef __cplusplus 37*3910Sdougm extern "C" { 38*3910Sdougm #endif 39*3910Sdougm 40*3910Sdougm /* property names used by NFS */ 41*3910Sdougm #define SHOPT_RO "ro" 42*3910Sdougm #define SHOPT_RW "rw" 43*3910Sdougm 44*3910Sdougm #define SHOPT_SEC "sec" 45*3910Sdougm #define SHOPT_SECURE "secure" 46*3910Sdougm #define SHOPT_ROOT "root" 47*3910Sdougm #define SHOPT_ANON "anon" 48*3910Sdougm #define SHOPT_WINDOW "window" 49*3910Sdougm #define SHOPT_NOSUB "nosub" 50*3910Sdougm #define SHOPT_NOSUID "nosuid" 51*3910Sdougm #define SHOPT_ACLOK "aclok" 52*3910Sdougm #define SHOPT_PUBLIC "public" 53*3910Sdougm #define SHOPT_INDEX "index" 54*3910Sdougm #define SHOPT_LOG "log" 55*3910Sdougm #define SHOPT_CKSUM "cksum" 56*3910Sdougm 57*3910Sdougm /* 58*3910Sdougm * defined options types. These should be in a file rather than 59*3910Sdougm * compiled in. Until there is a plugin mechanism to add new types, 60*3910Sdougm * this is sufficient. 61*3910Sdougm */ 62*3910Sdougm #define OPT_TYPE_ANY 0 63*3910Sdougm #define OPT_TYPE_STRING 1 64*3910Sdougm #define OPT_TYPE_BOOLEAN 2 65*3910Sdougm #define OPT_TYPE_NUMBER 3 66*3910Sdougm #define OPT_TYPE_RANGE 4 67*3910Sdougm #define OPT_TYPE_USER 5 68*3910Sdougm #define OPT_TYPE_ACCLIST 6 69*3910Sdougm #define OPT_TYPE_DEPRECATED 7 70*3910Sdougm #define OPT_TYPE_SECURITY 8 71*3910Sdougm #define OPT_TYPE_PATH 9 72*3910Sdougm #define OPT_TYPE_FILE 10 73*3910Sdougm #define OPT_TYPE_LOGTAG 11 74*3910Sdougm #define OPT_TYPE_STRINGSET 12 75*3910Sdougm #define OPT_TYPE_DOMAIN 13 76*3910Sdougm #define OPT_TYPE_ONOFF 14 77*3910Sdougm #define OPT_TYPE_PROTOCOL 15 78*3910Sdougm 79*3910Sdougm #define OPT_SHARE_ONLY 1 80*3910Sdougm 81*3910Sdougm struct option_defs { 82*3910Sdougm char *tag; 83*3910Sdougm int index; 84*3910Sdougm int type; 85*3910Sdougm int share; /* share only option */ 86*3910Sdougm int (*check)(char *); 87*3910Sdougm }; 88*3910Sdougm 89*3910Sdougm /* 90*3910Sdougm * service bit mask values 91*3910Sdougm */ 92*3910Sdougm #define SVC_LOCKD 0x0001 93*3910Sdougm #define SVC_STATD 0x0002 94*3910Sdougm #define SVC_NFSD 0x0004 95*3910Sdougm #define SVC_MOUNTD 0x0008 96*3910Sdougm #define SVC_NFS4CBD 0x0010 97*3910Sdougm #define SVC_NFSMAPID 0x0020 98*3910Sdougm #define SVC_RQUOTAD 0x0040 99*3910Sdougm #define SVC_NFSLOGD 0x0080 100*3910Sdougm 101*3910Sdougm /* 102*3910Sdougm * place holder for future service -- will move to daemon_utils.h when 103*3910Sdougm * fully implemented. 104*3910Sdougm */ 105*3910Sdougm #define NFSLOGD "svc:/network/nfs/log:default" 106*3910Sdougm 107*3910Sdougm /* The NFS export structure flags for read/write modes */ 108*3910Sdougm #define NFS_RWMODES (M_RO|M_ROL|M_RW|M_RWL) 109*3910Sdougm 110*3910Sdougm /* other values */ 111*3910Sdougm /* max size of 64-bit integer in digits plus a bit extra */ 112*3910Sdougm #define MAXDIGITS 32 113*3910Sdougm 114*3910Sdougm /* external variable */ 115*3910Sdougm extern boolean_t nfsl_errs_to_syslog; 116*3910Sdougm 117*3910Sdougm /* imported functions */ 118*3910Sdougm extern int exportfs(char *, struct exportdata *); 119*3910Sdougm extern void _check_services(char **); 120*3910Sdougm extern int nfs_getseconfig_default(seconfig_t *); 121*3910Sdougm extern int nfs_getseconfig_byname(char *, seconfig_t *); 122*3910Sdougm extern bool_t nfs_get_root_principal(seconfig_t *, char *, caddr_t *); 123*3910Sdougm extern int nfsl_getconfig_list(nfsl_config_t **); 124*3910Sdougm extern void nfsl_freeconfig_list(nfsl_config_t **); 125*3910Sdougm extern nfsl_config_t *nfsl_findconfig(nfsl_config_t *, char *, int *); 126*3910Sdougm 127*3910Sdougm #ifdef __cplusplus 128*3910Sdougm } 129*3910Sdougm #endif 130*3910Sdougm 131*3910Sdougm #endif /* _LIBSHARE_NFS_H */ 132