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