4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  25  * Copyright (c) 2016 by Delphix. All rights reserved.
  26  */
  27 
  28 /*
  29  * basic API declarations for share management
  30  */
  31 
  32 #ifndef _LIBSHARE_H
  33 #define _LIBSHARE_H
  34 
  35 #ifdef  __cplusplus
  36 extern "C" {
  37 #endif
  38 
  39 #include <sys/types.h>
  40 #include <sys/nvpair.h>
  41 #include <libzfs.h>
  42 
  43 /*
  44  * Basic datatypes for most functions
 
 154 #define SA_FEATURE_ADD_PROPERTIES       0x0020  /* can add properties */
 155 #define SA_FEATURE_SERVER       0x0040  /* protocol supports server mode */
 156 
 157 /*
 158  * legacy files
 159  */
 160 
 161 #define SA_LEGACY_DFSTAB        "/etc/dfs/dfstab"
 162 #define SA_LEGACY_SHARETAB      "/etc/dfs/sharetab"
 163 
 164 /*
 165  * SMF related
 166  */
 167 
 168 #define SA_SVC_FMRI_BASE        "svc:/network/shares/group"
 169 
 170 /* initialization */
 171 extern sa_handle_t sa_init(int);
 172 extern sa_handle_t sa_init_arg(int, void *);
 173 extern void sa_fini(sa_handle_t);
 174 extern int sa_update_config(sa_handle_t);
 175 extern boolean_t sa_needs_refresh(sa_handle_t);
 176 extern char *sa_errorstr(int);
 177 
 178 /* protocol names */
 179 extern int sa_get_protocols(char ***);
 180 extern int sa_valid_protocol(char *);
 181 
 182 /* group control (create, remove, etc) */
 183 extern sa_group_t sa_create_group(sa_handle_t, char *, int *);
 184 extern int sa_remove_group(sa_group_t);
 185 extern sa_group_t sa_get_group(sa_handle_t, char *);
 186 extern sa_group_t sa_get_next_group(sa_group_t);
 187 extern char *sa_get_group_attr(sa_group_t, char *);
 188 extern int sa_set_group_attr(sa_group_t, char *, char *);
 189 extern sa_group_t sa_get_sub_group(sa_group_t);
 190 extern int sa_valid_group_name(char *);
 191 
 192 /* share control */
 193 extern sa_share_t sa_add_share(sa_group_t, char *, int, int *);
  
 | 
 
 
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
  25  * Copyright (c) 2016 by Delphix. All rights reserved.
  26  */
  27 
  28 /*
  29  * basic API declarations for share management
  30  */
  31 
  32 #ifndef _LIBSHARE_H
  33 #define _LIBSHARE_H
  34 
  35 #ifdef  __cplusplus
  36 extern "C" {
  37 #endif
  38 
  39 #include <sys/types.h>
  40 #include <sys/nvpair.h>
  41 #include <libzfs.h>
  42 
  43 /*
  44  * Basic datatypes for most functions
 
 154 #define SA_FEATURE_ADD_PROPERTIES       0x0020  /* can add properties */
 155 #define SA_FEATURE_SERVER       0x0040  /* protocol supports server mode */
 156 
 157 /*
 158  * legacy files
 159  */
 160 
 161 #define SA_LEGACY_DFSTAB        "/etc/dfs/dfstab"
 162 #define SA_LEGACY_SHARETAB      "/etc/dfs/sharetab"
 163 
 164 /*
 165  * SMF related
 166  */
 167 
 168 #define SA_SVC_FMRI_BASE        "svc:/network/shares/group"
 169 
 170 /* initialization */
 171 extern sa_handle_t sa_init(int);
 172 extern sa_handle_t sa_init_arg(int, void *);
 173 extern void sa_fini(sa_handle_t);
 174 extern int sa_service(sa_handle_t);
 175 
 176 extern int sa_update_config(sa_handle_t);
 177 extern boolean_t sa_needs_refresh(sa_handle_t);
 178 extern char *sa_errorstr(int);
 179 
 180 /* protocol names */
 181 extern int sa_get_protocols(char ***);
 182 extern int sa_valid_protocol(char *);
 183 
 184 /* group control (create, remove, etc) */
 185 extern sa_group_t sa_create_group(sa_handle_t, char *, int *);
 186 extern int sa_remove_group(sa_group_t);
 187 extern sa_group_t sa_get_group(sa_handle_t, char *);
 188 extern sa_group_t sa_get_next_group(sa_group_t);
 189 extern char *sa_get_group_attr(sa_group_t, char *);
 190 extern int sa_set_group_attr(sa_group_t, char *, char *);
 191 extern sa_group_t sa_get_sub_group(sa_group_t);
 192 extern int sa_valid_group_name(char *);
 193 
 194 /* share control */
 195 extern sa_share_t sa_add_share(sa_group_t, char *, int, int *);
  
 |