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 /* 2312483SAntonello.Cruz@Sun.COM * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 243910Sdougm */ 253910Sdougm 263910Sdougm /* 273910Sdougm * basic API declarations for share management 283910Sdougm */ 293910Sdougm 303910Sdougm #ifndef _LIBSHARE_NFS_H 313910Sdougm #define _LIBSHARE_NFS_H 323910Sdougm 333910Sdougm #ifdef __cplusplus 343910Sdougm extern "C" { 353910Sdougm #endif 363910Sdougm 373910Sdougm /* property names used by NFS */ 383910Sdougm #define SHOPT_RO "ro" 393910Sdougm #define SHOPT_RW "rw" 407961SNatalie.Li@Sun.COM #define SHOPT_NONE "none" 417961SNatalie.Li@Sun.COM #define SHOPT_ROOT_MAPPING "root_mapping" 423910Sdougm 433910Sdougm #define SHOPT_SEC "sec" 443910Sdougm #define SHOPT_SECURE "secure" 453910Sdougm #define SHOPT_ROOT "root" 463910Sdougm #define SHOPT_ANON "anon" 473910Sdougm #define SHOPT_WINDOW "window" 483910Sdougm #define SHOPT_NOSUB "nosub" 493910Sdougm #define SHOPT_NOSUID "nosuid" 503910Sdougm #define SHOPT_ACLOK "aclok" 513910Sdougm #define SHOPT_PUBLIC "public" 523910Sdougm #define SHOPT_INDEX "index" 533910Sdougm #define SHOPT_LOG "log" 543910Sdougm #define SHOPT_CKSUM "cksum" 5511323SVallish.Vaidyeshwara@Sun.COM #define SHOPT_NOACLFAB "noaclfab" 563910Sdougm 573910Sdougm /* 583910Sdougm * defined options types. These should be in a file rather than 593910Sdougm * compiled in. Until there is a plugin mechanism to add new types, 603910Sdougm * this is sufficient. 613910Sdougm */ 623910Sdougm #define OPT_TYPE_ANY 0 633910Sdougm #define OPT_TYPE_STRING 1 643910Sdougm #define OPT_TYPE_BOOLEAN 2 653910Sdougm #define OPT_TYPE_NUMBER 3 663910Sdougm #define OPT_TYPE_RANGE 4 673910Sdougm #define OPT_TYPE_USER 5 683910Sdougm #define OPT_TYPE_ACCLIST 6 693910Sdougm #define OPT_TYPE_DEPRECATED 7 703910Sdougm #define OPT_TYPE_SECURITY 8 713910Sdougm #define OPT_TYPE_PATH 9 723910Sdougm #define OPT_TYPE_FILE 10 733910Sdougm #define OPT_TYPE_LOGTAG 11 743910Sdougm #define OPT_TYPE_STRINGSET 12 753910Sdougm #define OPT_TYPE_DOMAIN 13 763910Sdougm #define OPT_TYPE_ONOFF 14 773910Sdougm #define OPT_TYPE_PROTOCOL 15 783910Sdougm 793910Sdougm #define OPT_SHARE_ONLY 1 803910Sdougm 813910Sdougm struct option_defs { 823910Sdougm char *tag; 833910Sdougm int index; 843910Sdougm int type; 853910Sdougm int share; /* share only option */ 866214Sdougm int (*check)(sa_handle_t, char *); 873910Sdougm }; 883910Sdougm 893910Sdougm /* 903910Sdougm * service bit mask values 913910Sdougm */ 923910Sdougm #define SVC_LOCKD 0x0001 933910Sdougm #define SVC_STATD 0x0002 943910Sdougm #define SVC_NFSD 0x0004 953910Sdougm #define SVC_MOUNTD 0x0008 963910Sdougm #define SVC_NFS4CBD 0x0010 973910Sdougm #define SVC_NFSMAPID 0x0020 983910Sdougm #define SVC_RQUOTAD 0x0040 993910Sdougm #define SVC_NFSLOGD 0x0080 10011291SRobert.Thurlow@Sun.COM #define SVC_REPARSED 0x0100 101*13080SPavan.Mettu@Oracle.COM #define SVC_CLIENT 0x0200 102*13080SPavan.Mettu@Oracle.COM 103*13080SPavan.Mettu@Oracle.COM /* 104*13080SPavan.Mettu@Oracle.COM * NFS Restart/Refresh options 105*13080SPavan.Mettu@Oracle.COM */ 106*13080SPavan.Mettu@Oracle.COM #define NFSD_REFRESH 0x0001 107*13080SPavan.Mettu@Oracle.COM #define NFSD_RESTART 0x0002 108*13080SPavan.Mettu@Oracle.COM #define NLOCKMGR_REFESH 0x0003 109*13080SPavan.Mettu@Oracle.COM #define NLOCKMGR_RESTART 0x0004 110*13080SPavan.Mettu@Oracle.COM #define MAPID_REFRESH 0x0005 111*13080SPavan.Mettu@Oracle.COM #define MAPID_RESTART 0x0006 1123910Sdougm 1133910Sdougm /* 1143910Sdougm * place holder for future service -- will move to daemon_utils.h when 1153910Sdougm * fully implemented. 1163910Sdougm */ 1173910Sdougm #define NFSLOGD "svc:/network/nfs/log:default" 1183910Sdougm 1193910Sdougm /* The NFS export structure flags for read/write modes */ 1203910Sdougm #define NFS_RWMODES (M_RO|M_ROL|M_RW|M_RWL) 1213910Sdougm 1223910Sdougm /* other values */ 1233910Sdougm /* max size of 64-bit integer in digits plus a bit extra */ 1243910Sdougm #define MAXDIGITS 32 1253910Sdougm 1263910Sdougm /* external variable */ 1273910Sdougm extern boolean_t nfsl_errs_to_syslog; 1283910Sdougm 1293910Sdougm /* imported functions */ 1303910Sdougm extern int exportfs(char *, struct exportdata *); 1313910Sdougm extern int nfs_getseconfig_default(seconfig_t *); 1323910Sdougm extern int nfs_getseconfig_byname(char *, seconfig_t *); 1333910Sdougm extern bool_t nfs_get_root_principal(seconfig_t *, char *, caddr_t *); 1343910Sdougm extern int nfsl_getconfig_list(nfsl_config_t **); 1353910Sdougm extern void nfsl_freeconfig_list(nfsl_config_t **); 1363910Sdougm extern nfsl_config_t *nfsl_findconfig(nfsl_config_t *, char *, int *); 1373910Sdougm 1383910Sdougm #ifdef __cplusplus 1393910Sdougm } 1403910Sdougm #endif 1413910Sdougm 1423910Sdougm #endif /* _LIBSHARE_NFS_H */ 143