16185db85Sdougm /* 26185db85Sdougm * CDDL HEADER START 36185db85Sdougm * 46185db85Sdougm * The contents of this file are subject to the terms of the 56185db85Sdougm * Common Development and Distribution License (the "License"). 66185db85Sdougm * You may not use this file except in compliance with the License. 76185db85Sdougm * 86185db85Sdougm * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 96185db85Sdougm * or http://www.opensolaris.org/os/licensing. 106185db85Sdougm * See the License for the specific language governing permissions 116185db85Sdougm * and limitations under the License. 126185db85Sdougm * 136185db85Sdougm * When distributing Covered Code, include this CDDL HEADER in each 146185db85Sdougm * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 156185db85Sdougm * If applicable, add the following below this CDDL HEADER, with the 166185db85Sdougm * fields enclosed by brackets "[]" replaced with your own identifying 176185db85Sdougm * information: Portions Copyright [yyyy] [name of copyright owner] 186185db85Sdougm * 196185db85Sdougm * CDDL HEADER END 206185db85Sdougm */ 216185db85Sdougm 226185db85Sdougm /* 23549ec3ffSdougm * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 246185db85Sdougm * Use is subject to license terms. 256185db85Sdougm */ 266185db85Sdougm 276185db85Sdougm #ifndef _SHAREMGR_H 286185db85Sdougm #define _SHAREMGR_H 296185db85Sdougm 306185db85Sdougm #pragma ident "%Z%%M% %I% %E% SMI" 316185db85Sdougm 326185db85Sdougm #ifdef __cplusplus 336185db85Sdougm extern "C" { 346185db85Sdougm #endif 35549ec3ffSdougm #include <libshare.h> 366185db85Sdougm 376185db85Sdougm /* 386185db85Sdougm * shareadm internal interfaces 396185db85Sdougm */ 406185db85Sdougm 416185db85Sdougm typedef enum { 426185db85Sdougm USAGE_ADD_SHARE, 436185db85Sdougm USAGE_CREATE, 446185db85Sdougm USAGE_DELETE, 456185db85Sdougm USAGE_DISABLE, 466185db85Sdougm USAGE_ENABLE, 476185db85Sdougm USAGE_LIST, 486185db85Sdougm USAGE_MOVE_SHARE, 496185db85Sdougm USAGE_REMOVE_SHARE, 506185db85Sdougm USAGE_SET, 516185db85Sdougm USAGE_SET_SECURITY, 526185db85Sdougm USAGE_SET_SHARE, 536185db85Sdougm USAGE_SHOW, 546185db85Sdougm USAGE_SHARE, 556185db85Sdougm USAGE_START, 566185db85Sdougm USAGE_STOP, 576185db85Sdougm USAGE_UNSET, 586185db85Sdougm USAGE_UNSET_SECURITY, 596185db85Sdougm USAGE_UNSHARE 606185db85Sdougm } sa_usage_t; 616185db85Sdougm 626185db85Sdougm /* sharectl specific usage message values */ 636185db85Sdougm typedef enum { 646185db85Sdougm USAGE_CTL_GET, 656185db85Sdougm USAGE_CTL_SET, 666185db85Sdougm USAGE_CTL_STATUS 676185db85Sdougm } sc_usage_t; 686185db85Sdougm 696185db85Sdougm typedef struct sa_command { 706185db85Sdougm char *cmdname; 716185db85Sdougm int flags; 72549ec3ffSdougm int (*cmdfunc)(sa_handle_t, int, int, char **); 736185db85Sdougm int cmdidx; 746185db85Sdougm int priv; /* requires RBAC authorizations */ 756185db85Sdougm } sa_command_t; 766185db85Sdougm 776185db85Sdougm #define CMD_ALIAS 0x0001 786185db85Sdougm #define CMD_NODISPLAY 0x0002 /* don't display command */ 796185db85Sdougm 806185db85Sdougm #define SVC_AUTH_VALUE "value_authorization" 816185db85Sdougm #define SVC_AUTH_ACTION "action_authorization" 826185db85Sdougm #define SVC_SET 0x01 /* need value permissions */ 836185db85Sdougm #define SVC_ACTION 0x02 /* need action permissions */ 846185db85Sdougm 85f3861e1aSahl #define ZFS_SHAREALL "/usr/sbin/zfs share -a nfs" 866185db85Sdougm 876185db85Sdougm /* 886185db85Sdougm * functions/values for manipulating options 896185db85Sdougm */ 906185db85Sdougm #define OPT_ADD_OK 0 916185db85Sdougm #define OPT_ADD_SYNTAX -1 926185db85Sdougm #define OPT_ADD_SECURITY -2 936185db85Sdougm #define OPT_ADD_PROPERTY -3 946185db85Sdougm #define OPT_ADD_MEMORY -4 956185db85Sdougm 966185db85Sdougm /* option list structure */ 976185db85Sdougm struct options { 986185db85Sdougm struct options *next; 996185db85Sdougm char *optname; 1006185db85Sdougm char *optvalue; 1016185db85Sdougm }; 1026185db85Sdougm 1036185db85Sdougm /* general list structure */ 1046185db85Sdougm struct list { 1056185db85Sdougm struct list *next; 1066185db85Sdougm void *item; 1076185db85Sdougm void *itemdata; 108*da6c28aaSamw char *proto; 1096185db85Sdougm }; 1106185db85Sdougm 1116185db85Sdougm /* shareutil entry points */ 1126185db85Sdougm extern int add_opt(struct options **, char *, int); 1136185db85Sdougm 1146185db85Sdougm 1156185db85Sdougm #ifdef __cplusplus 1166185db85Sdougm } 1176185db85Sdougm #endif 1186185db85Sdougm 1196185db85Sdougm #endif /* _SHAREMGR_H */ 120