Print this page
smf: switch to a tri-state for process-security properties true=on,false=off,nil=default


  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  24  */
  25 
  26 #ifndef _LIBSCF_H
  27 #define _LIBSCF_H
  28 
  29 
  30 #include <stddef.h>
  31 #include <sys/types.h>
  32 #include <libnvpair.h>
  33 





  34 #ifdef  __cplusplus
  35 extern "C" {
  36 #endif
  37 
  38 typedef struct scf_version *scf_version_t;
  39 #define SCF_VERSION     ((scf_version_t)1UL)
  40 
  41 /*
  42  * Opaque structures
  43  */
  44 typedef struct scf_handle scf_handle_t;
  45 typedef struct scf_scope scf_scope_t;
  46 typedef struct scf_service scf_service_t;
  47 typedef struct scf_instance scf_instance_t;
  48 typedef struct scf_propertygroup scf_propertygroup_t;
  49 typedef struct scf_property scf_property_t;
  50 
  51 typedef struct scf_snapshot scf_snapshot_t;
  52 typedef struct scf_snaplevel scf_snaplevel_t;
  53 


 180         SCF_TERR_VALUE_OUT_OF_RANGE,    /* value is out of range in template */
 181         SCF_TERR_INVALID_VALUE,         /* value is not valid for the */
 182                                         /* template */
 183         SCF_TERR_PG_PATTERN_CONFLICT,   /* pg_pattern conflicts with higher */
 184                                         /* level definition */
 185         SCF_TERR_PROP_PATTERN_CONFLICT, /* prop_pattern conflicts with higher */
 186                                         /* level definition */
 187         SCF_TERR_GENERAL_REDEFINE,      /* global or restarter template */
 188                                         /* redefined */
 189         SCF_TERR_INCLUDE_VALUES,        /* No supporting constraints or */
 190                                         /* values for include_values */
 191         SCF_TERR_PG_PATTERN_INCOMPLETE, /* Required pg_pattern is missing */
 192                                         /* name or type attribute. */
 193         SCF_TERR_PROP_PATTERN_INCOMPLETE    /* Required prop_pattern is */
 194                                             /* missing a type attribute. */
 195 } scf_tmpl_error_type_t;
 196 
 197 typedef struct scf_tmpl_error scf_tmpl_error_t;
 198 
 199 /*




















 200  * scf_tmpl_strerror() human readable flag
 201  */
 202 #define SCF_TMPL_STRERROR_HUMAN 0x1
 203 
 204 /*
 205  * Standard services
 206  */
 207 #define SCF_SERVICE_CONFIGD     ((const char *) \
 208                                     "svc:/system/svc/repository:default")
 209 #define SCF_INSTANCE_GLOBAL     ((const char *) \
 210                                     "svc:/system/svc/global:default")
 211 #define SCF_SERVICE_GLOBAL      ((const char *) \
 212                                     "svc:/system/svc/global")
 213 #define SCF_SERVICE_STARTD      ((const char *) \
 214                                     "svc:/system/svc/restarter:default")
 215 #define SCF_INSTANCE_EMI        ((const char *) \
 216                                     "svc:/system/early-manifest-import:default")
 217 #define SCF_INSTANCE_FS_MINIMAL ((const char *) \
 218                                     "svc:/system/filesystem/minimal:default")
 219 #define SCF_INSTANCE_MI         ((const char *) \




  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  24  */
  25 
  26 #ifndef _LIBSCF_H
  27 #define _LIBSCF_H
  28 
  29 
  30 #include <stddef.h>

  31 #include <libnvpair.h>
  32 
  33 #ifndef NATIVE_BUILD
  34 #include <sys/secflags.h>
  35 #endif  /* NATIVE_BUILD */
  36 #include <sys/types.h>
  37 
  38 #ifdef  __cplusplus
  39 extern "C" {
  40 #endif
  41 
  42 typedef struct scf_version *scf_version_t;
  43 #define SCF_VERSION     ((scf_version_t)1UL)
  44 
  45 /*
  46  * Opaque structures
  47  */
  48 typedef struct scf_handle scf_handle_t;
  49 typedef struct scf_scope scf_scope_t;
  50 typedef struct scf_service scf_service_t;
  51 typedef struct scf_instance scf_instance_t;
  52 typedef struct scf_propertygroup scf_propertygroup_t;
  53 typedef struct scf_property scf_property_t;
  54 
  55 typedef struct scf_snapshot scf_snapshot_t;
  56 typedef struct scf_snaplevel scf_snaplevel_t;
  57 


 184         SCF_TERR_VALUE_OUT_OF_RANGE,    /* value is out of range in template */
 185         SCF_TERR_INVALID_VALUE,         /* value is not valid for the */
 186                                         /* template */
 187         SCF_TERR_PG_PATTERN_CONFLICT,   /* pg_pattern conflicts with higher */
 188                                         /* level definition */
 189         SCF_TERR_PROP_PATTERN_CONFLICT, /* prop_pattern conflicts with higher */
 190                                         /* level definition */
 191         SCF_TERR_GENERAL_REDEFINE,      /* global or restarter template */
 192                                         /* redefined */
 193         SCF_TERR_INCLUDE_VALUES,        /* No supporting constraints or */
 194                                         /* values for include_values */
 195         SCF_TERR_PG_PATTERN_INCOMPLETE, /* Required pg_pattern is missing */
 196                                         /* name or type attribute. */
 197         SCF_TERR_PROP_PATTERN_INCOMPLETE    /* Required prop_pattern is */
 198                                             /* missing a type attribute. */
 199 } scf_tmpl_error_type_t;
 200 
 201 typedef struct scf_tmpl_error scf_tmpl_error_t;
 202 
 203 /*
 204  * This unfortunately needs to be public, because consumers of librestart must
 205  * deal with it
 206  */
 207 typedef struct {
 208 #ifndef NATIVE_BUILD
 209         secflagdelta_t ss_default;
 210         secflagdelta_t ss_lower;
 211         secflagdelta_t ss_upper;
 212 #else
 213         /*
 214          * This is never used, but is necessary for bootstrapping.
 215          * Not even the size matters.
 216          */
 217         void *ss_default;
 218         void *ss_lower;
 219         void *ss_upper;
 220 #endif /* NATIVE_BUILD */
 221 } scf_secflags_t;
 222 
 223 /*
 224  * scf_tmpl_strerror() human readable flag
 225  */
 226 #define SCF_TMPL_STRERROR_HUMAN 0x1
 227 
 228 /*
 229  * Standard services
 230  */
 231 #define SCF_SERVICE_CONFIGD     ((const char *) \
 232                                     "svc:/system/svc/repository:default")
 233 #define SCF_INSTANCE_GLOBAL     ((const char *) \
 234                                     "svc:/system/svc/global:default")
 235 #define SCF_SERVICE_GLOBAL      ((const char *) \
 236                                     "svc:/system/svc/global")
 237 #define SCF_SERVICE_STARTD      ((const char *) \
 238                                     "svc:/system/svc/restarter:default")
 239 #define SCF_INSTANCE_EMI        ((const char *) \
 240                                     "svc:/system/early-manifest-import:default")
 241 #define SCF_INSTANCE_FS_MINIMAL ((const char *) \
 242                                     "svc:/system/filesystem/minimal:default")
 243 #define SCF_INSTANCE_MI         ((const char *) \