xref: /titanic_51/usr/src/lib/librestart/common/librestart_priv.h (revision 69bb4bb45c98da60d21839c4dc3c01ea1be60585)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_LIBRESTART_PRIV_H
28 #define	_LIBRESTART_PRIV_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <libscf.h>
33 #include <librestart.h>
34 
35 #ifdef	__cplusplus
36 extern "C" {
37 #endif
38 
39 #define	RESTARTER_NAME_TYPE		SCF_PROPERTY_TYPE
40 #define	RESTARTER_NAME_INSTANCE		"inst"
41 #define	RESTARTER_NAME_STATE		SCF_PROPERTY_STATE
42 #define	RESTARTER_NAME_NEXT_STATE	SCF_PROPERTY_NEXT_STATE
43 #define	RESTARTER_NAME_AUX_STATE	SCF_PROPERTY_AUX_STATE
44 #define	RESTARTER_NAME_ERROR		"error"
45 
46 #define	RESTARTER_CHANNEL_MASTER	0
47 #define	RESTARTER_CHANNEL_DELEGATE	1
48 
49 typedef struct instance_data {
50 	const char			*i_fmri;
51 	int				i_enabled;
52 
53 	restarter_instance_state_t	i_state;
54 	restarter_instance_state_t	i_next_state;
55 	char				*i_aux_state;
56 
57 	ctid_t				i_primary_ctid;
58 	ctid_t				i_transient_ctid;
59 
60 	int				i_primary_ctid_stopped;
61 	int				i_fault_count;
62 	int				i_dirty;
63 } instance_data_t;
64 
65 char *_restarter_get_channel_name(const char *, int);
66 int _restarter_commit_states(scf_handle_t *, instance_data_t *,
67     restarter_instance_state_t, restarter_instance_state_t, const char *);
68 
69 #ifdef	__cplusplus
70 }
71 #endif
72 
73 #endif	/* _LIBRESTART_PRIV_H */
74