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/*
549ec3fff108310966327d1dc9004551b63210b7dougm * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
6185db853e024a486ff8837e6784dd290d866112dougm * Use is subject to license terms.
6185db853e024a486ff8837e6784dd290d866112dougm */
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm/*
6185db853e024a486ff8837e6784dd290d866112dougm * basic API declarations for share management
6185db853e024a486ff8837e6784dd290d866112dougm */
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm#ifndef _SCFUTIL_H
6185db853e024a486ff8837e6784dd290d866112dougm#define _SCFUTIL_H
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm#pragma ident "%Z%%M% %I% %E% SMI"
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm#ifdef __cplusplus
6185db853e024a486ff8837e6784dd290d866112dougmextern "C" {
6185db853e024a486ff8837e6784dd290d866112dougm#endif
6185db853e024a486ff8837e6784dd290d866112dougm#include <libxml/tree.h>
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougmtypedef struct scfutilhandle {
6185db853e024a486ff8837e6784dd290d866112dougm scf_handle_t *handle;
6185db853e024a486ff8837e6784dd290d866112dougm int scf_state;
6185db853e024a486ff8837e6784dd290d866112dougm scf_service_t *service;
6185db853e024a486ff8837e6784dd290d866112dougm scf_scope_t *scope;
6185db853e024a486ff8837e6784dd290d866112dougm scf_transaction_t *trans;
6185db853e024a486ff8837e6784dd290d866112dougm scf_transaction_entry_t *entry;
6185db853e024a486ff8837e6784dd290d866112dougm scf_propertygroup_t *pg;
6185db853e024a486ff8837e6784dd290d866112dougm scf_instance_t *instance;
6185db853e024a486ff8837e6784dd290d866112dougm} scfutilhandle_t;
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm#define SCH_STATE_UNINIT 0
6185db853e024a486ff8837e6784dd290d866112dougm#define SCH_STATE_INITIALIZING 1
6185db853e024a486ff8837e6784dd290d866112dougm#define SCH_STATE_INIT 2
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougmextern void sa_scf_fini(scfutilhandle_t *);
6185db853e024a486ff8837e6784dd290d866112dougmextern scfutilhandle_t *sa_scf_init();
1d1813a7a7c570174c2b6adc372045307b266117dougmextern int sa_get_config(scfutilhandle_t *, xmlNodePtr, sa_handle_t);
6185db853e024a486ff8837e6784dd290d866112dougmextern int sa_get_instance(scfutilhandle_t *, char *);
6185db853e024a486ff8837e6784dd290d866112dougmextern int sa_create_instance(scfutilhandle_t *, char *);
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm/*
6185db853e024a486ff8837e6784dd290d866112dougm * Shares are held in a property group with name of the form
6185db853e024a486ff8837e6784dd290d866112dougm * S-<GUID>. The total length of the name is 38 characters.
6185db853e024a486ff8837e6784dd290d866112dougm */
6185db853e024a486ff8837e6784dd290d866112dougm#define SA_SHARE_PG_PREFIX "S-"
6185db853e024a486ff8837e6784dd290d866112dougm#define SA_SHARE_PG_PREFIXLEN 2
6185db853e024a486ff8837e6784dd290d866112dougm#define SA_SHARE_PG_LEN 38
6185db853e024a486ff8837e6784dd290d866112dougm#define SA_SHARE_UUID_BUFLEN 64
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm/*
6185db853e024a486ff8837e6784dd290d866112dougm * service instance related defines
6185db853e024a486ff8837e6784dd290d866112dougm */
6185db853e024a486ff8837e6784dd290d866112dougm#define SA_GROUP_SVC_NAME "network/shares/group"
6185db853e024a486ff8837e6784dd290d866112dougm#define SA_GROUP_INST_LEN 256
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm#ifdef __cplusplus
6185db853e024a486ff8837e6784dd290d866112dougm}
6185db853e024a486ff8837e6784dd290d866112dougm#endif
6185db853e024a486ff8837e6784dd290d866112dougm
6185db853e024a486ff8837e6784dd290d866112dougm#endif /* _SCFUTIL_H */