6185db853e024a486ff8837e6784dd290d866112dougm/*
6185db853e024a486ff8837e6784dd290d866112dougm * CDDL HEADER START
6185db853e024a486ff8837e6784dd290d866112dougm *
6185db853e024a486ff8837e6784dd290d866112dougm * The contents of this file are subject to the terms of the
6185db853e024a486ff8837e6784dd290d866112dougm * Common Development and Distribution License (the "License").
6185db853e024a486ff8837e6784dd290d866112dougm * You may not use this file except in compliance with the License.
6185db853e024a486ff8837e6784dd290d866112dougm *
6185db853e024a486ff8837e6784dd290d866112dougm * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
6185db853e024a486ff8837e6784dd290d866112dougm * or http://www.opensolaris.org/os/licensing.
6185db853e024a486ff8837e6784dd290d866112dougm * See the License for the specific language governing permissions
6185db853e024a486ff8837e6784dd290d866112dougm * and limitations under the License.
6185db853e024a486ff8837e6784dd290d866112dougm *
6185db853e024a486ff8837e6784dd290d866112dougm * When distributing Covered Code, include this CDDL HEADER in each
6185db853e024a486ff8837e6784dd290d866112dougm * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
6185db853e024a486ff8837e6784dd290d866112dougm * If applicable, add the following below this CDDL HEADER, with the
6185db853e024a486ff8837e6784dd290d866112dougm * fields enclosed by brackets "[]" replaced with your own identifying
6185db853e024a486ff8837e6784dd290d866112dougm * information: Portions Copyright [yyyy] [name of copyright owner]
6185db853e024a486ff8837e6784dd290d866112dougm *
6185db853e024a486ff8837e6784dd290d866112dougm * CDDL HEADER END
6185db853e024a486ff8837e6784dd290d866112dougm */
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm/*
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
6185db853e024a486ff8837e6784dd290d866112dougm * Use is subject to license terms.
6185db853e024a486ff8837e6784dd290d866112dougm */
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm#ifndef _SHAREMGR_H
6185db853e024a486ff8837e6784dd290d866112dougm#define _SHAREMGR_H
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm#pragma ident "%Z%%M% %I% %E% SMI"
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm#ifdef __cplusplus
6185db853e024a486ff8837e6784dd290d866112dougmextern "C" {
6185db853e024a486ff8837e6784dd290d866112dougm#endif
549ec3fff108310966327d1dc9004551b63210b7dougm#include <libshare.h>
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm/*
6185db853e024a486ff8837e6784dd290d866112dougm * shareadm internal interfaces
6185db853e024a486ff8837e6784dd290d866112dougm */
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougmtypedef enum {
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_ADD_SHARE,
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_CREATE,
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_DELETE,
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_DISABLE,
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_ENABLE,
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_LIST,
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_MOVE_SHARE,
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_REMOVE_SHARE,
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_SET,
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_SET_SECURITY,
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_SET_SHARE,
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_SHOW,
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_SHARE,
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_START,
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_STOP,
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_UNSET,
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_UNSET_SECURITY,
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_UNSHARE
6185db853e024a486ff8837e6784dd290d866112dougm} sa_usage_t;
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm/* sharectl specific usage message values */
6185db853e024a486ff8837e6784dd290d866112dougmtypedef enum {
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_CTL_GET,
6185db853e024a486ff8837e6784dd290d866112dougm USAGE_CTL_SET,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow USAGE_CTL_STATUS,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow USAGE_CTL_DELSECT
6185db853e024a486ff8837e6784dd290d866112dougm} sc_usage_t;
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougmtypedef struct sa_command {
6185db853e024a486ff8837e6784dd290d866112dougm char *cmdname;
6185db853e024a486ff8837e6784dd290d866112dougm int flags;
549ec3fff108310966327d1dc9004551b63210b7dougm int (*cmdfunc)(sa_handle_t, int, int, char **);
6185db853e024a486ff8837e6784dd290d866112dougm int cmdidx;
6185db853e024a486ff8837e6784dd290d866112dougm int priv; /* requires RBAC authorizations */
6185db853e024a486ff8837e6784dd290d866112dougm} sa_command_t;
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm#define CMD_ALIAS 0x0001
6185db853e024a486ff8837e6784dd290d866112dougm#define CMD_NODISPLAY 0x0002 /* don't display command */
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm#define SVC_AUTH_VALUE "value_authorization"
6185db853e024a486ff8837e6784dd290d866112dougm#define SVC_AUTH_ACTION "action_authorization"
6185db853e024a486ff8837e6784dd290d866112dougm#define SVC_SET 0x01 /* need value permissions */
6185db853e024a486ff8837e6784dd290d866112dougm#define SVC_ACTION 0x02 /* need action permissions */
6185db853e024a486ff8837e6784dd290d866112dougm
f3861e1a2ceec23a5b699c24d814b7775a9e0b52ahl#define ZFS_SHAREALL "/usr/sbin/zfs share -a nfs"
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm/*
6185db853e024a486ff8837e6784dd290d866112dougm * functions/values for manipulating options
6185db853e024a486ff8837e6784dd290d866112dougm */
6185db853e024a486ff8837e6784dd290d866112dougm#define OPT_ADD_OK 0
6185db853e024a486ff8837e6784dd290d866112dougm#define OPT_ADD_SYNTAX -1
6185db853e024a486ff8837e6784dd290d866112dougm#define OPT_ADD_SECURITY -2
6185db853e024a486ff8837e6784dd290d866112dougm#define OPT_ADD_PROPERTY -3
6185db853e024a486ff8837e6784dd290d866112dougm#define OPT_ADD_MEMORY -4
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm/* option list structure */
6185db853e024a486ff8837e6784dd290d866112dougmstruct options {
6185db853e024a486ff8837e6784dd290d866112dougm struct options *next;
6185db853e024a486ff8837e6784dd290d866112dougm char *optname;
6185db853e024a486ff8837e6784dd290d866112dougm char *optvalue;
6185db853e024a486ff8837e6784dd290d866112dougm};
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm/* general list structure */
6185db853e024a486ff8837e6784dd290d866112dougmstruct list {
6185db853e024a486ff8837e6784dd290d866112dougm struct list *next;
6185db853e024a486ff8837e6784dd290d866112dougm void *item;
6185db853e024a486ff8837e6784dd290d866112dougm void *itemdata;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw char *proto;
6185db853e024a486ff8837e6784dd290d866112dougm};
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm/* shareutil entry points */
549ec3fff108310966327d1dc9004551b63210b7dougmextern int add_opt(struct options **, char *, int);
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm#ifdef __cplusplus
6185db853e024a486ff8837e6784dd290d866112dougm}
6185db853e024a486ff8837e6784dd290d866112dougm#endif
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm#endif /* _SHAREMGR_H */