2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _LIBRESTART_PRIV_H
2N/A#define _LIBRESTART_PRIV_H
2N/A
2N/A#include <libscf.h>
2N/A#include <librestart.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A#define RESTARTER_NAME_TYPE SCF_PROPERTY_TYPE
2N/A#define RESTARTER_NAME_INSTANCE "inst"
2N/A#define RESTARTER_NAME_STATE SCF_PROPERTY_STATE
2N/A#define RESTARTER_NAME_NEXT_STATE SCF_PROPERTY_NEXT_STATE
2N/A#define RESTARTER_NAME_AUX_STATE SCF_PROPERTY_AUX_STATE
2N/A#define RESTARTER_NAME_ERROR "error"
2N/A#define RESTARTER_NAME_REASON "reason"
2N/A#define RESTARTER_NAME_CUSTOM_SHORT SCF_PROPERTY_AUX_STATE_CUSTOM
2N/A#define RESTARTER_NAME_CUSTOM_LONG SCF_PROPERTY_AUX_REASON
2N/A#define RESTARTER_NAME_CUSTOM_TEXTDOMAIN SCF_PROPERTY_AUX_TEXTDOMAIN
2N/A
2N/A#define RESTARTER_CHANNEL_MASTER 0
2N/A#define RESTARTER_CHANNEL_DELEGATE 1
2N/A
2N/Atypedef struct instance_data {
2N/A const char *i_fmri;
2N/A int i_enabled;
2N/A
2N/A restarter_instance_state_t i_state;
2N/A restarter_instance_state_t i_next_state;
2N/A char *i_aux_state;
2N/A
2N/A ctid_t i_primary_ctid;
2N/A ctid_t i_transient_ctid;
2N/A
2N/A int i_primary_ctid_stopped;
2N/A int i_fault_count;
2N/A int i_dirty;
2N/A} instance_data_t;
2N/A
2N/Achar *_restarter_get_channel_name(const char *, int);
2N/Aint _restarter_commit_states(scf_handle_t *, instance_data_t *,
2N/A restarter_instance_state_t, restarter_instance_state_t, const char *);
2N/Aint _restarter_commit_states_custom(scf_handle_t *h, instance_data_t *id,
2N/A restarter_instance_state_t, restarter_instance_state_t,
2N/A const char *, const char *, const char *);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _LIBRESTART_PRIV_H */