13910Sdougm /* 23910Sdougm * CDDL HEADER START 33910Sdougm * 43910Sdougm * The contents of this file are subject to the terms of the 53910Sdougm * Common Development and Distribution License (the "License"). 63910Sdougm * You may not use this file except in compliance with the License. 73910Sdougm * 83910Sdougm * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 93910Sdougm * or http://www.opensolaris.org/os/licensing. 103910Sdougm * See the License for the specific language governing permissions 113910Sdougm * and limitations under the License. 123910Sdougm * 133910Sdougm * When distributing Covered Code, include this CDDL HEADER in each 143910Sdougm * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 153910Sdougm * If applicable, add the following below this CDDL HEADER, with the 163910Sdougm * fields enclosed by brackets "[]" replaced with your own identifying 173910Sdougm * information: Portions Copyright [yyyy] [name of copyright owner] 183910Sdougm * 193910Sdougm * CDDL HEADER END 203910Sdougm */ 213910Sdougm 223910Sdougm /* 2311291SRobert.Thurlow@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 243910Sdougm * Use is subject to license terms. 253910Sdougm */ 263910Sdougm 273910Sdougm /* 283910Sdougm * basic API declarations for share management 293910Sdougm */ 303910Sdougm 313910Sdougm #ifndef _LIBSHARE_NFS_H 323910Sdougm #define _LIBSHARE_NFS_H 333910Sdougm 343910Sdougm #ifdef __cplusplus 353910Sdougm extern "C" { 363910Sdougm #endif 373910Sdougm 383910Sdougm /* property names used by NFS */ 393910Sdougm #define SHOPT_RO "ro" 403910Sdougm #define SHOPT_RW "rw" 417961SNatalie.Li@Sun.COM #define SHOPT_NONE "none" 427961SNatalie.Li@Sun.COM #define SHOPT_ROOT_MAPPING "root_mapping" 433910Sdougm 443910Sdougm #define SHOPT_SEC "sec" 453910Sdougm #define SHOPT_SECURE "secure" 463910Sdougm #define SHOPT_ROOT "root" 473910Sdougm #define SHOPT_ANON "anon" 483910Sdougm #define SHOPT_WINDOW "window" 493910Sdougm #define SHOPT_NOSUB "nosub" 503910Sdougm #define SHOPT_NOSUID "nosuid" 513910Sdougm #define SHOPT_ACLOK "aclok" 523910Sdougm #define SHOPT_PUBLIC "public" 533910Sdougm #define SHOPT_INDEX "index" 543910Sdougm #define SHOPT_LOG "log" 553910Sdougm #define SHOPT_CKSUM "cksum" 56*11323SVallish.Vaidyeshwara@Sun.COM #define SHOPT_NOACLFAB "noaclfab" 573910Sdougm 583910Sdougm /* 593910Sdougm * defined options types. These should be in a file rather than 603910Sdougm * compiled in. Until there is a plugin mechanism to add new types, 613910Sdougm * this is sufficient. 623910Sdougm */ 633910Sdougm #define OPT_TYPE_ANY 0 643910Sdougm #define OPT_TYPE_STRING 1 653910Sdougm #define OPT_TYPE_BOOLEAN 2 663910Sdougm #define OPT_TYPE_NUMBER 3 673910Sdougm #define OPT_TYPE_RANGE 4 683910Sdougm #define OPT_TYPE_USER 5 693910Sdougm #define OPT_TYPE_ACCLIST 6 703910Sdougm #define OPT_TYPE_DEPRECATED 7 713910Sdougm #define OPT_TYPE_SECURITY 8 723910Sdougm #define OPT_TYPE_PATH 9 733910Sdougm #define OPT_TYPE_FILE 10 743910Sdougm #define OPT_TYPE_LOGTAG 11 753910Sdougm #define OPT_TYPE_STRINGSET 12 763910Sdougm #define OPT_TYPE_DOMAIN 13 773910Sdougm #define OPT_TYPE_ONOFF 14 783910Sdougm #define OPT_TYPE_PROTOCOL 15 793910Sdougm 803910Sdougm #define OPT_SHARE_ONLY 1 813910Sdougm 823910Sdougm struct option_defs { 833910Sdougm char *tag; 843910Sdougm int index; 853910Sdougm int type; 863910Sdougm int share; /* share only option */ 876214Sdougm int (*check)(sa_handle_t, char *); 883910Sdougm }; 893910Sdougm 903910Sdougm /* 913910Sdougm * service bit mask values 923910Sdougm */ 933910Sdougm #define SVC_LOCKD 0x0001 943910Sdougm #define SVC_STATD 0x0002 953910Sdougm #define SVC_NFSD 0x0004 963910Sdougm #define SVC_MOUNTD 0x0008 973910Sdougm #define SVC_NFS4CBD 0x0010 983910Sdougm #define SVC_NFSMAPID 0x0020 993910Sdougm #define SVC_RQUOTAD 0x0040 1003910Sdougm #define SVC_NFSLOGD 0x0080 10111291SRobert.Thurlow@Sun.COM #define SVC_REPARSED 0x0100 1023910Sdougm 1033910Sdougm /* 1043910Sdougm * place holder for future service -- will move to daemon_utils.h when 1053910Sdougm * fully implemented. 1063910Sdougm */ 1073910Sdougm #define NFSLOGD "svc:/network/nfs/log:default" 1083910Sdougm 1093910Sdougm /* The NFS export structure flags for read/write modes */ 1103910Sdougm #define NFS_RWMODES (M_RO|M_ROL|M_RW|M_RWL) 1113910Sdougm 1123910Sdougm /* other values */ 1133910Sdougm /* max size of 64-bit integer in digits plus a bit extra */ 1143910Sdougm #define MAXDIGITS 32 1153910Sdougm 1163910Sdougm /* external variable */ 1173910Sdougm extern boolean_t nfsl_errs_to_syslog; 1183910Sdougm 1193910Sdougm /* imported functions */ 1203910Sdougm extern int exportfs(char *, struct exportdata *); 1213910Sdougm extern void _check_services(char **); 1223910Sdougm extern int nfs_getseconfig_default(seconfig_t *); 1233910Sdougm extern int nfs_getseconfig_byname(char *, seconfig_t *); 1243910Sdougm extern bool_t nfs_get_root_principal(seconfig_t *, char *, caddr_t *); 1253910Sdougm extern int nfsl_getconfig_list(nfsl_config_t **); 1263910Sdougm extern void nfsl_freeconfig_list(nfsl_config_t **); 1273910Sdougm extern nfsl_config_t *nfsl_findconfig(nfsl_config_t *, char *, int *); 1283910Sdougm 1293910Sdougm #ifdef __cplusplus 1303910Sdougm } 1313910Sdougm #endif 1323910Sdougm 1333910Sdougm #endif /* _LIBSHARE_NFS_H */ 134