/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* basic declarations for implementation of the share management
* libraries.
*/
#ifndef _LIBSHARE_IMPL_H
#define _LIBSHARE_IMPL_H
#include <libshare.h>
#include <libscf.h>
#include <scfutil.h>
#include <libzfs.h>
#include <sharefs/sharetab.h>
#ifdef __cplusplus
extern "C" {
#endif
/* directory to find plugin modules in */
/* default group name for dfstab file */
typedef void *sa_phandle_t;
struct sa_plugin_ops {
int (*sa_init)();
void (*sa_fini)();
sa_optionset_t); /* validate */
char *(*sa_get_proto_status)();
char *(*sa_space_alias)(char *);
int (*sa_command_help)();
int (*sa_delete_proto_section)(char *);
};
struct sa_proto_handle {
int sa_num_proto;
char **sa_proto;
};
typedef struct propertylist {
int pl_type;
union propval {
void *pl_void;
} pl_value;
/* internal version of sa_handle_t */
typedef struct sa_handle_impl {
} *sa_handle_impl_t;
extern int sa_proto_share(char *, sa_share_t);
extern int sa_proto_unshare(sa_share_t, char *, char *);
extern int sa_proto_security_prop(char *, char *);
extern int sa_proto_legacy_opts(char *, sa_group_t, char *);
extern int sa_proto_share_resource(char *, sa_resource_t);
extern int sa_proto_unshare_resource(char *, sa_resource_t);
/* internal utility functions */
extern void sa_free_derived_optionset(sa_optionset_t);
extern sa_optionset_t sa_get_all_security_types(void *, char *, int);
extern sa_security_t sa_get_derived_security(void *, char *, char *, int);
extern void sa_free_derived_security(sa_security_t);
extern sa_protocol_properties_t sa_create_protocol_properties(char *);
extern int sa_start_transaction(scfutilhandle_t *, char *);
extern void sa_abort_transaction(scfutilhandle_t *);
extern int sa_set_property(scfutilhandle_t *, char *, char *);
extern void sa_free_fstype(char *fstyp);
extern int sa_delete_instance(scfutilhandle_t *, char *);
extern int sa_create_pgroup(scfutilhandle_t *, char *);
extern int sa_delete_pgroup(scfutilhandle_t *, char *);
/* ZFS functions */
extern int sa_get_zfs_shares(sa_handle_t, char *);
extern int sa_zfs_update(sa_share_t);
void *, zfs_share_op_t);
char *proto);
/* plugin specific functions */
extern int proto_plugin_init();
extern void proto_plugin_fini();
extern int sa_proto_set_property(char *, sa_property_t);
extern int sa_proto_delete_legacy(char *, sa_share_t);
extern int sa_proto_update_legacy(char *, sa_share_t);
extern int sa_proto_rename_resource(sa_handle_t, char *,
sa_resource_t, char *);
#define PL_TYPE_PROPERTY 0
/* plugin handler only */
struct sa_proto_plugin {
void *plugin_handle;
};
#ifdef __cplusplus
}
#endif
#endif /* _LIBSHARE_IMPL_H */