xref: /titanic_51/usr/src/cmd/saf/structs.h (revision dcda19f50b2b80bfc622fff718ac04fb0e1cb670)
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 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
23 /*	  All Rights Reserved  	*/
24 
25 
26 #ident	"%Z%%M%	%I%	%E% SMI"       /* SVr4.0 1.5*/
27 
28 
29 /*
30  * REQUIRES: sac.h misc.h
31  */
32 
33 
34 /*
35  * error messages
36  */
37 
38 struct errmsg {
39 	char *e_str;			/* error string */
40 	int e_exitcode;			/* and associated exit status */
41 };
42 
43 
44 /*
45  * everything we need to know about a port monitor
46  */
47 
48 struct	sactab {
49 	long	sc_flags;		/* flags */
50 	pid_t	sc_pid;			/* pid of PM */
51 	int	sc_rsmax;		/* max # of restarts */
52 	int	sc_rscnt;		/* # of restarts */
53 	int	sc_fd;			/* _pmpipe fd */
54 	int	sc_ok;			/* true if responded to last sanity poll */
55 	int	sc_valid;		/* true if entry is "current" */
56 	char	*sc_cmd;		/* command */
57 	char	*sc_comment;		/* comment associated with entry */
58 	struct	sactab	*sc_next;	/* next in list */
59 	short	sc_exit;		/* exit status */
60 	char	sc_maxclass;		/* largest class instruction this PM
61 					   understands.  This is currently
62 					   a place holder for future messages */
63 	unchar	sc_sstate;		/* SAC's idea of PM's state */
64 	unchar	sc_lstate;		/* SAC's idea of last valid state -
65 					   used for failure recovery - note:
66 					   SAC will set this field to ENABLED,
67 					   DISABLED, or NOTRUNNING as appropriate */
68 	unchar	sc_pstate;		/* PM's last reported state - note:
69 					   SAC will set this field to STARTING,
70 					   NOTRUNNING, or FAILED as appropriate */
71 	char	sc_tag[PMTAGSIZE + 1];	/* port monitor tag */
72 	char	sc_type[PMTYPESIZE + 1];/* port monitor type */
73 	char	sc_utid[IDLEN];		/* utmp id of PM */
74 };
75 
76 /*
77  * defn's for sc_sstate, sc_pstate, and sc_lstate
78  */
79 
80 # define NOTRUNNING	0	/* PM not running */
81 # define STARTING	1	/* PM is starting, must be same as PM_STARTING */
82 # define ENABLED	2	/* PM is enabled, must be same as PM_ENABLED */
83 # define DISABLED	3	/* PM is disabled, must be same as PM_DISABLED */
84 # define STOPPING	4	/* PM is stopping, must be same as PM_STOPPING */
85 # define FAILED		5	/* PM has failed */
86 # define UNKNOWN	6	/* in recovery, state unknown */
87 
88 /*
89  * defn's for sc_flags
90  */
91 
92 # define D_FLAG	0x1
93 # define X_FLAG	0x2
94