da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/*
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * CDDL HEADER START
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *
3e14f97f673e8a630f076077de35afdd43dc1587Roger A. Faulkner * The contents of this file are subject to the terms of the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * Common Development and Distribution License (the "License").
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * You may not use this file except in compliance with the License.
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * or http://www.opensolaris.org/os/licensing.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * See the License for the specific language governing permissions
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * and limitations under the License.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * When distributing Covered Code, include this CDDL HEADER in each
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * If applicable, add the following below this CDDL HEADER, with the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * fields enclosed by brackets "[]" replaced with your own identifying
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * information: Portions Copyright [yyyy] [name of copyright owner]
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * CDDL HEADER END
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/*
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/*
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * basic API declarations for share management
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#ifndef _LIBSHARE_NFS_H
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define _LIBSHARE_NFS_H
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#ifdef __cplusplus
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern "C" {
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/* property names used by NFS */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define SHOPT_RO "ro"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define SHOPT_RW "rw"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define SHOPT_NONE "none"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define SHOPT_ROOT_MAPPING "root_mapping"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define SHOPT_SEC "sec"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define SHOPT_SECURE "secure"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define SHOPT_ROOT "root"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define SHOPT_ANON "anon"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define SHOPT_WINDOW "window"
#define SHOPT_NOSUB "nosub"
#define SHOPT_NOSUID "nosuid"
#define SHOPT_ACLOK "aclok"
#define SHOPT_PUBLIC "public"
#define SHOPT_INDEX "index"
#define SHOPT_LOG "log"
#define SHOPT_CKSUM "cksum"
#define SHOPT_NOACLFAB "noaclfab"
#define SHOPT_UIDMAP "uidmap"
#define SHOPT_GIDMAP "gidmap"
/*
* defined options types. These should be in a file rather than
* compiled in. Until there is a plugin mechanism to add new types,
* this is sufficient.
*/
#define OPT_TYPE_ANY 0
#define OPT_TYPE_STRING 1
#define OPT_TYPE_BOOLEAN 2
#define OPT_TYPE_NUMBER 3
#define OPT_TYPE_RANGE 4
#define OPT_TYPE_USER 5
#define OPT_TYPE_ACCLIST 6
#define OPT_TYPE_DEPRECATED 7
#define OPT_TYPE_SECURITY 8
#define OPT_TYPE_PATH 9
#define OPT_TYPE_FILE 10
#define OPT_TYPE_LOGTAG 11
#define OPT_TYPE_STRINGSET 12
#define OPT_TYPE_DOMAIN 13
#define OPT_TYPE_ONOFF 14
#define OPT_TYPE_PROTOCOL 15
#define OPT_TYPE_MAPPING 16
#define OPT_SHARE_ONLY 1
struct option_defs {
char *tag;
int index;
int type;
int share; /* share only option */
int (*check)(sa_handle_t, char *);
};
/*
* service bit mask values
*/
#define SVC_LOCKD 0x0001
#define SVC_STATD 0x0002
#define SVC_NFSD 0x0004
#define SVC_MOUNTD 0x0008
#define SVC_NFS4CBD 0x0010
#define SVC_NFSMAPID 0x0020
#define SVC_RQUOTAD 0x0040
#define SVC_NFSLOGD 0x0080
#define SVC_REPARSED 0x0100
#define SVC_CLIENT 0x0200
/*
* NFS Restart/Refresh options
*/
#define NFSD_REFRESH 0x0001
#define NFSD_RESTART 0x0002
#define NLOCKMGR_REFESH 0x0003
#define NLOCKMGR_RESTART 0x0004
#define MAPID_REFRESH 0x0005
#define MAPID_RESTART 0x0006
/*
* place holder for future service -- will move to daemon_utils.h when
* fully implemented.
*/
#define NFSLOGD "svc:/network/nfs/log:default"
/* The NFS export structure flags for read/write modes */
#define NFS_RWMODES (M_RO|M_ROL|M_RW|M_RWL)
/* other values */
/* max size of 64-bit integer in digits plus a bit extra */
#define MAXDIGITS 32
/* external variable */
extern boolean_t nfsl_errs_to_syslog;
/* imported functions */
extern int exportfs(char *, struct exportdata *);
extern int nfs_getseconfig_default(seconfig_t *);
extern int nfs_getseconfig_byname(char *, seconfig_t *);
extern bool_t nfs_get_root_principal(seconfig_t *, char *, caddr_t *);
extern int nfsl_getconfig_list(nfsl_config_t **);
extern void nfsl_freeconfig_list(nfsl_config_t **);
extern nfsl_config_t *nfsl_findconfig(nfsl_config_t *, char *, int *);
#ifdef __cplusplus
}
#endif
#endif /* _LIBSHARE_NFS_H */