10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*12967Sgavin.maltby@oracle.com * Common Development and Distribution License (the "License"). 6*12967Sgavin.maltby@oracle.com * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*12967Sgavin.maltby@oracle.com * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 230Sstevel@tonic-gate */ 240Sstevel@tonic-gate 250Sstevel@tonic-gate #ifndef _LIBRESTART_PRIV_H 260Sstevel@tonic-gate #define _LIBRESTART_PRIV_H 270Sstevel@tonic-gate 280Sstevel@tonic-gate #include <libscf.h> 290Sstevel@tonic-gate #include <librestart.h> 300Sstevel@tonic-gate 310Sstevel@tonic-gate #ifdef __cplusplus 320Sstevel@tonic-gate extern "C" { 330Sstevel@tonic-gate #endif 340Sstevel@tonic-gate 350Sstevel@tonic-gate #define RESTARTER_NAME_TYPE SCF_PROPERTY_TYPE 360Sstevel@tonic-gate #define RESTARTER_NAME_INSTANCE "inst" 370Sstevel@tonic-gate #define RESTARTER_NAME_STATE SCF_PROPERTY_STATE 380Sstevel@tonic-gate #define RESTARTER_NAME_NEXT_STATE SCF_PROPERTY_NEXT_STATE 390Sstevel@tonic-gate #define RESTARTER_NAME_AUX_STATE SCF_PROPERTY_AUX_STATE 400Sstevel@tonic-gate #define RESTARTER_NAME_ERROR "error" 41*12967Sgavin.maltby@oracle.com #define RESTARTER_NAME_REASON "reason" 420Sstevel@tonic-gate 430Sstevel@tonic-gate #define RESTARTER_CHANNEL_MASTER 0 440Sstevel@tonic-gate #define RESTARTER_CHANNEL_DELEGATE 1 450Sstevel@tonic-gate 460Sstevel@tonic-gate typedef struct instance_data { 470Sstevel@tonic-gate const char *i_fmri; 480Sstevel@tonic-gate int i_enabled; 490Sstevel@tonic-gate 500Sstevel@tonic-gate restarter_instance_state_t i_state; 510Sstevel@tonic-gate restarter_instance_state_t i_next_state; 520Sstevel@tonic-gate char *i_aux_state; 530Sstevel@tonic-gate 540Sstevel@tonic-gate ctid_t i_primary_ctid; 550Sstevel@tonic-gate ctid_t i_transient_ctid; 560Sstevel@tonic-gate 570Sstevel@tonic-gate int i_primary_ctid_stopped; 580Sstevel@tonic-gate int i_fault_count; 590Sstevel@tonic-gate int i_dirty; 600Sstevel@tonic-gate } instance_data_t; 610Sstevel@tonic-gate 620Sstevel@tonic-gate char *_restarter_get_channel_name(const char *, int); 630Sstevel@tonic-gate int _restarter_commit_states(scf_handle_t *, instance_data_t *, 640Sstevel@tonic-gate restarter_instance_state_t, restarter_instance_state_t, const char *); 650Sstevel@tonic-gate 660Sstevel@tonic-gate #ifdef __cplusplus 670Sstevel@tonic-gate } 680Sstevel@tonic-gate #endif 690Sstevel@tonic-gate 700Sstevel@tonic-gate #endif /* _LIBRESTART_PRIV_H */ 71