xref: /titanic_54/usr/src/cmd/sgs/include/rtc.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate #ifndef	_RTC_H
28*7c478bd9Sstevel@tonic-gate #define	_RTC_H
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate /*
33*7c478bd9Sstevel@tonic-gate  * Global include file for the runtime configuration support.
34*7c478bd9Sstevel@tonic-gate  */
35*7c478bd9Sstevel@tonic-gate #include <time.h>
36*7c478bd9Sstevel@tonic-gate #include <machdep.h>
37*7c478bd9Sstevel@tonic-gate 
38*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
39*7c478bd9Sstevel@tonic-gate extern "C" {
40*7c478bd9Sstevel@tonic-gate #endif
41*7c478bd9Sstevel@tonic-gate 
42*7c478bd9Sstevel@tonic-gate /*
43*7c478bd9Sstevel@tonic-gate  * Configuration header.
44*7c478bd9Sstevel@tonic-gate  */
45*7c478bd9Sstevel@tonic-gate typedef struct {
46*7c478bd9Sstevel@tonic-gate 	Word	ch_version;		/* version of config file */
47*7c478bd9Sstevel@tonic-gate 	Word	ch_cnflags;		/* configuration flags */
48*7c478bd9Sstevel@tonic-gate 	Word	ch_dlflags;		/* dldump() flags used */
49*7c478bd9Sstevel@tonic-gate 	Word	ch_app;			/* application that this config file */
50*7c478bd9Sstevel@tonic-gate 					/*	is specific to */
51*7c478bd9Sstevel@tonic-gate 	Word	ch_hash;		/* hash table offset */
52*7c478bd9Sstevel@tonic-gate 	Word	ch_obj;			/* object table offset */
53*7c478bd9Sstevel@tonic-gate 	Word	ch_str;			/* string table offset */
54*7c478bd9Sstevel@tonic-gate 	Word	ch_file;		/* file entries */
55*7c478bd9Sstevel@tonic-gate 	Word	ch_dir;			/* directory entries */
56*7c478bd9Sstevel@tonic-gate 	Word	ch_edlibpath;		/* ELF default library path offset */
57*7c478bd9Sstevel@tonic-gate 	Word	ch_adlibpath;		/* AOUT default library path offset */
58*7c478bd9Sstevel@tonic-gate 	Word	ch_eslibpath;		/* ELF secure library path offset */
59*7c478bd9Sstevel@tonic-gate 	Word	ch_aslibpath;		/* AOUT secure library path offset */
60*7c478bd9Sstevel@tonic-gate 	Lword	ch_resbgn;		/* memory reservation required to map */
61*7c478bd9Sstevel@tonic-gate 	Lword	ch_resend;		/*	alternative objects defined */
62*7c478bd9Sstevel@tonic-gate 					/*	by the configuration info */
63*7c478bd9Sstevel@tonic-gate 	Word	ch_env;			/* environment variables */
64*7c478bd9Sstevel@tonic-gate 	Word	ch_fltr;		/* filter table entries */
65*7c478bd9Sstevel@tonic-gate 	Word	ch_flte;		/* filtee table entries */
66*7c478bd9Sstevel@tonic-gate } Rtc_head;
67*7c478bd9Sstevel@tonic-gate 
68*7c478bd9Sstevel@tonic-gate #define	RTC_HDR_IGNORE	0x0001		/* ignore config information */
69*7c478bd9Sstevel@tonic-gate #define	RTC_HDR_ALTER	0x0002		/* alternative objects are defined - */
70*7c478bd9Sstevel@tonic-gate 					/*	these may exist without a */
71*7c478bd9Sstevel@tonic-gate 					/*	memory reservation (see -a) */
72*7c478bd9Sstevel@tonic-gate #define	RTC_HDR_64	0x0004		/* 64-bit objects used */
73*7c478bd9Sstevel@tonic-gate #define	RTC_HDR_UPM	0x0008		/* includes unified process model */
74*7c478bd9Sstevel@tonic-gate 
75*7c478bd9Sstevel@tonic-gate /*
76*7c478bd9Sstevel@tonic-gate  * Object descriptor.
77*7c478bd9Sstevel@tonic-gate  */
78*7c478bd9Sstevel@tonic-gate typedef struct {
79*7c478bd9Sstevel@tonic-gate 	Lword	co_info;		/* validation information */
80*7c478bd9Sstevel@tonic-gate 	Word	co_name;		/* object name (directory or file) */
81*7c478bd9Sstevel@tonic-gate 	Word	co_hash;		/* name hash value */
82*7c478bd9Sstevel@tonic-gate 	Half	co_id;			/* directory identifier */
83*7c478bd9Sstevel@tonic-gate 	Half	co_flags;		/* various flags */
84*7c478bd9Sstevel@tonic-gate 	Word	co_alter;		/* alternative object file */
85*7c478bd9Sstevel@tonic-gate } Rtc_obj;
86*7c478bd9Sstevel@tonic-gate 
87*7c478bd9Sstevel@tonic-gate #define	RTC_OBJ_DIRENT	0x0001		/* object defines a directory */
88*7c478bd9Sstevel@tonic-gate #define	RTC_OBJ_ALLENTS	0x0002		/* directory was scanned for all */
89*7c478bd9Sstevel@tonic-gate 					/*	containing objects */
90*7c478bd9Sstevel@tonic-gate #define	RTC_OBJ_NOEXIST	0x0004		/* object does not exist */
91*7c478bd9Sstevel@tonic-gate #define	RTC_OBJ_EXEC	0x0008		/* object identifies executable */
92*7c478bd9Sstevel@tonic-gate #define	RTC_OBJ_ALTER	0x0010		/* object has an alternate */
93*7c478bd9Sstevel@tonic-gate #define	RTC_OBJ_DUMP	0x0020		/* alternate created by dldump(3x) */
94*7c478bd9Sstevel@tonic-gate #define	RTC_OBJ_REALPTH	0x0040		/* object identifies real path */
95*7c478bd9Sstevel@tonic-gate #define	RTC_OBJ_NOALTER	0x0080		/* object can't have an alternate */
96*7c478bd9Sstevel@tonic-gate #define	RTC_OBJ_GROUP	0x0100		/* object was expanded as a group */
97*7c478bd9Sstevel@tonic-gate #define	RTC_OBJ_APP	0x0200		/* object indicates app which makes */
98*7c478bd9Sstevel@tonic-gate 					/*	configuration file specific */
99*7c478bd9Sstevel@tonic-gate #define	RTC_OBJ_CMDLINE	0x0400		/* object specified from command line */
100*7c478bd9Sstevel@tonic-gate #define	RTC_OBJ_FILTER	0x0800		/* object identifies a filter */
101*7c478bd9Sstevel@tonic-gate #define	RTC_OBJ_FILTEE	0x1000		/* object identifies a filtee */
102*7c478bd9Sstevel@tonic-gate #define	RTC_OBJ_OPTINAL	0x2000		/* object alternative is optional */
103*7c478bd9Sstevel@tonic-gate 
104*7c478bd9Sstevel@tonic-gate /*
105*7c478bd9Sstevel@tonic-gate  * Directory and file descriptors.  The configuration cache (cd_dir) points to
106*7c478bd9Sstevel@tonic-gate  * an array of directory descriptors, this in turn point to their associated
107*7c478bd9Sstevel@tonic-gate  * arrays of file descriptors.  Both of these provide sequential access for
108*7c478bd9Sstevel@tonic-gate  * configuration file validation (directory, and possible file stat()'s).
109*7c478bd9Sstevel@tonic-gate  */
110*7c478bd9Sstevel@tonic-gate typedef struct {
111*7c478bd9Sstevel@tonic-gate 	Word	cd_obj;			/* index to Rtc_obj */
112*7c478bd9Sstevel@tonic-gate 	Word	cd_file;		/* index to Rtc_file[] */
113*7c478bd9Sstevel@tonic-gate } Rtc_dir;
114*7c478bd9Sstevel@tonic-gate 
115*7c478bd9Sstevel@tonic-gate typedef	struct {
116*7c478bd9Sstevel@tonic-gate 	Word	cf_obj;			/* index to Rtc_obj */
117*7c478bd9Sstevel@tonic-gate } Rtc_file;
118*7c478bd9Sstevel@tonic-gate 
119*7c478bd9Sstevel@tonic-gate 
120*7c478bd9Sstevel@tonic-gate #define	RTC_VER_NONE	0
121*7c478bd9Sstevel@tonic-gate #define	RTC_VER_ONE	1		/* original version */
122*7c478bd9Sstevel@tonic-gate #define	RTC_VER_TWO	2		/* updated for -u use */
123*7c478bd9Sstevel@tonic-gate #define	RTC_VER_THREE	3		/* updated for -e/-E use */
124*7c478bd9Sstevel@tonic-gate #define	RTC_VER_FOUR	4		/* updated for filter/filtees */
125*7c478bd9Sstevel@tonic-gate #define	RTC_VER_CURRENT RTC_VER_FOUR
126*7c478bd9Sstevel@tonic-gate #define	RTC_VER_NUM	5
127*7c478bd9Sstevel@tonic-gate 
128*7c478bd9Sstevel@tonic-gate /*
129*7c478bd9Sstevel@tonic-gate  * Environment variable descriptor.  The configuration cache (ch_env) points to
130*7c478bd9Sstevel@tonic-gate  * an array of these descriptors.
131*7c478bd9Sstevel@tonic-gate  */
132*7c478bd9Sstevel@tonic-gate typedef struct {
133*7c478bd9Sstevel@tonic-gate 	Word	env_str;		/* index into string table */
134*7c478bd9Sstevel@tonic-gate 	Word	env_flags;		/* various flags */
135*7c478bd9Sstevel@tonic-gate } Rtc_env;
136*7c478bd9Sstevel@tonic-gate 
137*7c478bd9Sstevel@tonic-gate #define	RTC_ENV_REPLACE	0x0001		/* replaceable string definition */
138*7c478bd9Sstevel@tonic-gate #define	RTC_ENV_PERMANT	0x0002		/* permanent string definition */
139*7c478bd9Sstevel@tonic-gate #define	RTC_ENV_CONFIG	0x1000		/* string originates from config file */
140*7c478bd9Sstevel@tonic-gate 
141*7c478bd9Sstevel@tonic-gate /*
142*7c478bd9Sstevel@tonic-gate  * Filter descriptor.  The configuration cache (ch_flt) points to an array of
143*7c478bd9Sstevel@tonic-gate  * these descriptors.
144*7c478bd9Sstevel@tonic-gate  */
145*7c478bd9Sstevel@tonic-gate typedef struct {
146*7c478bd9Sstevel@tonic-gate 	Word	fr_filter;		/* filter name, and filtee string */
147*7c478bd9Sstevel@tonic-gate 	Word	fr_string;		/*	as indexs into string table */
148*7c478bd9Sstevel@tonic-gate 	Word	fr_filtee;		/* index into filtee array */
149*7c478bd9Sstevel@tonic-gate } Rtc_fltr;
150*7c478bd9Sstevel@tonic-gate 
151*7c478bd9Sstevel@tonic-gate typedef struct {
152*7c478bd9Sstevel@tonic-gate 	Word	fe_filtee;
153*7c478bd9Sstevel@tonic-gate } Rtc_flte;
154*7c478bd9Sstevel@tonic-gate 
155*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
156*7c478bd9Sstevel@tonic-gate }
157*7c478bd9Sstevel@tonic-gate #endif
158*7c478bd9Sstevel@tonic-gate 
159*7c478bd9Sstevel@tonic-gate #endif	/* _RTC_H */
160