Print this page
7484 Garbage in libscf.h makes dumb compilers cry
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Sam Zaydel <szaydel@racktopsystems.com>
Reviewed by: Kim Shrier <kshrier@racktopsystems.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libscf/inc/libscf.h
          +++ new/usr/src/lib/libscf/inc/libscf.h
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2016 RackTop Systems.
  24   25   */
  25   26  
  26   27  #ifndef _LIBSCF_H
  27   28  #define _LIBSCF_H
  28   29  
  29   30  
  30   31  #include <stddef.h>
  31   32  #include <libnvpair.h>
  32   33  
  33   34  #ifndef NATIVE_BUILD
  34   35  #include <sys/secflags.h>
  35   36  #endif  /* NATIVE_BUILD */
  36   37  #include <sys/types.h>
  37   38  
  38   39  #ifdef  __cplusplus
  39   40  extern "C" {
  40   41  #endif
  41   42  
  42      -typedef struct scf_version *scf_version_t;
  43      -#define SCF_VERSION     ((scf_version_t)1UL)
       43 +typedef unsigned long scf_version_t;
       44 +#define SCF_VERSION             1UL
  44   45  
  45   46  /*
  46   47   * Opaque structures
  47   48   */
  48   49  typedef struct scf_handle scf_handle_t;
  49   50  typedef struct scf_scope scf_scope_t;
  50   51  typedef struct scf_service scf_service_t;
  51   52  typedef struct scf_instance scf_instance_t;
  52   53  typedef struct scf_propertygroup scf_propertygroup_t;
  53   54  typedef struct scf_property scf_property_t;
↓ open down ↓ 167 lines elided ↑ open up ↑
 221  222  } scf_secflags_t;
 222  223  
 223  224  /*
 224  225   * scf_tmpl_strerror() human readable flag
 225  226   */
 226  227  #define SCF_TMPL_STRERROR_HUMAN 0x1
 227  228  
 228  229  /*
 229  230   * Standard services
 230  231   */
 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 *) \
 244      -                                    "svc:/system/manifest-import:default")
      232 +#define SCF_SERVICE_CONFIGD     "svc:/system/svc/repository:default"
      233 +#define SCF_INSTANCE_GLOBAL     "svc:/system/svc/global:default"
      234 +#define SCF_SERVICE_GLOBAL      "svc:/system/svc/global"
      235 +#define SCF_SERVICE_STARTD      "svc:/system/svc/restarter:default"
      236 +#define SCF_INSTANCE_EMI        "svc:/system/early-manifest-import:default"
      237 +#define SCF_INSTANCE_FS_MINIMAL "svc:/system/filesystem/minimal:default"
      238 +#define SCF_INSTANCE_MI         "svc:/system/manifest-import:default"
 245  239  
 246  240  /*
 247  241   * Major milestones
 248  242   */
 249      -#define SCF_MILESTONE_SINGLE_USER \
 250      -        ((const char *) "svc:/milestone/single-user:default")
 251      -#define SCF_MILESTONE_MULTI_USER \
 252      -        ((const char *) "svc:/milestone/multi-user:default")
      243 +#define SCF_MILESTONE_SINGLE_USER       "svc:/milestone/single-user:default"
      244 +#define SCF_MILESTONE_MULTI_USER        "svc:/milestone/multi-user:default"
 253  245  #define SCF_MILESTONE_MULTI_USER_SERVER \
 254      -        ((const char *) "svc:/milestone/multi-user-server:default")
      246 +        "svc:/milestone/multi-user-server:default"
 255  247  
 256  248  /*
 257  249   * standard scope names
 258  250   */
 259      -#define SCF_SCOPE_LOCAL                 ((const char *)"localhost")
      251 +#define SCF_SCOPE_LOCAL                 "localhost"
 260  252  
 261  253  /*
 262  254   * Property group types
 263  255   */
 264      -#define SCF_GROUP_APPLICATION           ((const char *)"application")
 265      -#define SCF_GROUP_FRAMEWORK             ((const char *)"framework")
 266      -#define SCF_GROUP_DEPENDENCY            ((const char *)"dependency")
 267      -#define SCF_GROUP_METHOD                ((const char *)"method")
 268      -#define SCF_GROUP_TEMPLATE              ((const char *)"template")
 269      -#define SCF_GROUP_TEMPLATE_PG_PATTERN   ((const char *)"template_pg_pattern")
 270      -#define SCF_GROUP_TEMPLATE_PROP_PATTERN ((const char *)"template_prop_pattern")
      256 +#define SCF_GROUP_APPLICATION           "application"
      257 +#define SCF_GROUP_FRAMEWORK             "framework"
      258 +#define SCF_GROUP_DEPENDENCY            "dependency"
      259 +#define SCF_GROUP_METHOD                "method"
      260 +#define SCF_GROUP_TEMPLATE              "template"
      261 +#define SCF_GROUP_TEMPLATE_PG_PATTERN   "template_pg_pattern"
      262 +#define SCF_GROUP_TEMPLATE_PROP_PATTERN "template_prop_pattern"
 271  263  
 272  264  /*
 273  265   * Dependency types
 274  266   */
 275      -#define SCF_DEP_REQUIRE_ALL             ((const char *)"require_all")
 276      -#define SCF_DEP_REQUIRE_ANY             ((const char *)"require_any")
 277      -#define SCF_DEP_EXCLUDE_ALL             ((const char *)"exclude_all")
 278      -#define SCF_DEP_OPTIONAL_ALL            ((const char *)"optional_all")
 279      -
 280      -#define SCF_DEP_RESET_ON_ERROR          ((const char *)"error")
 281      -#define SCF_DEP_RESET_ON_RESTART        ((const char *)"restart")
 282      -#define SCF_DEP_RESET_ON_REFRESH        ((const char *)"refresh")
 283      -#define SCF_DEP_RESET_ON_NONE           ((const char *)"none")
      267 +#define SCF_DEP_REQUIRE_ALL             "require_all"
      268 +#define SCF_DEP_REQUIRE_ANY             "require_any"
      269 +#define SCF_DEP_EXCLUDE_ALL             "exclude_all"
      270 +#define SCF_DEP_OPTIONAL_ALL            "optional_all"
      271 +
      272 +#define SCF_DEP_RESET_ON_ERROR          "error"
      273 +#define SCF_DEP_RESET_ON_RESTART        "restart"
      274 +#define SCF_DEP_RESET_ON_REFRESH        "refresh"
      275 +#define SCF_DEP_RESET_ON_NONE           "none"
 284  276  
 285  277  /*
 286  278   * Standard property group names
 287  279   */
 288      -#define SCF_PG_GENERAL                  ((const char *)"general")
 289      -#define SCF_PG_GENERAL_OVR              ((const char *)"general_ovr")
 290      -#define SCF_PG_RESTARTER                ((const char *)"restarter")
 291      -#define SCF_PG_RESTARTER_ACTIONS        ((const char *)"restarter_actions")
 292      -#define SCF_PG_METHOD_CONTEXT           ((const char *)"method_context")
 293      -#define SCF_PG_APP_DEFAULT              ((const char *)"application")
 294      -#define SCF_PG_DEPENDENTS               ((const char *)"dependents")
 295      -#define SCF_PG_OPTIONS                  ((const char *)"options")
 296      -#define SCF_PG_OPTIONS_OVR              ((const char *)"options_ovr")
 297      -#define SCF_PG_STARTD                   ((const char *)"startd")
 298      -#define SCF_PG_STARTD_PRIVATE           ((const char *)"svc-startd-private")
 299      -#define SCF_PG_DEATHROW                 ((const char *)"deathrow")
 300      -#define SCF_PG_MANIFESTFILES            ((const char *)"manifestfiles")
      280 +#define SCF_PG_GENERAL                  "general"
      281 +#define SCF_PG_GENERAL_OVR              "general_ovr"
      282 +#define SCF_PG_RESTARTER                "restarter"
      283 +#define SCF_PG_RESTARTER_ACTIONS        "restarter_actions"
      284 +#define SCF_PG_METHOD_CONTEXT           "method_context"
      285 +#define SCF_PG_APP_DEFAULT              "application"
      286 +#define SCF_PG_DEPENDENTS               "dependents"
      287 +#define SCF_PG_OPTIONS                  "options"
      288 +#define SCF_PG_OPTIONS_OVR              "options_ovr"
      289 +#define SCF_PG_STARTD                   "startd"
      290 +#define SCF_PG_STARTD_PRIVATE           "svc-startd-private"
      291 +#define SCF_PG_DEATHROW                 "deathrow"
      292 +#define SCF_PG_MANIFESTFILES            "manifestfiles"
 301  293  
 302  294  /*
 303  295   * Template property group names and prefixes
 304  296   */
 305      -#define SCF_PG_TM_COMMON_NAME           ((const char *)"tm_common_name")
 306      -#define SCF_PG_TM_DESCRIPTION           ((const char *)"tm_description")
      297 +#define SCF_PG_TM_COMMON_NAME           "tm_common_name"
      298 +#define SCF_PG_TM_DESCRIPTION           "tm_description"
 307  299  
 308      -#define SCF_PG_TM_MAN_PREFIX            ((const char *)"tm_man_")
 309      -#define SCF_PG_TM_DOC_PREFIX            ((const char *)"tm_doc_")
      300 +#define SCF_PG_TM_MAN_PREFIX            "tm_man_"
      301 +#define SCF_PG_TM_DOC_PREFIX            "tm_doc_"
 310  302  
 311  303  /*
 312  304   * Standard property names
 313  305   */
 314      -#define SCF_PROPERTY_ACTIVE_POSTFIX     ((const char *)"active")
 315      -#define SCF_PROPERTY_AUX_STATE          ((const char *)"auxiliary_state")
 316      -#define SCF_PROPERTY_AUX_FMRI           ((const char *)"auxiliary_fmri")
 317      -#define SCF_PROPERTY_AUX_TTY            ((const char *)"auxiliary_tty")
 318      -#define SCF_PROPERTY_CONTRACT           ((const char *)"contract")
 319      -#define SCF_PROPERTY_COREFILE_PATTERN   ((const char *)"corefile_pattern")
 320      -#define SCF_PROPERTY_DEGRADED           ((const char *)"degraded")
 321      -#define SCF_PROPERTY_DEGRADE_IMMEDIATE  ((const char *)"degrade_immediate")
 322      -#define SCF_PROPERTY_DODUMP             ((const char *)"do_dump")
 323      -#define SCF_PROPERTY_DURATION           ((const char *)"duration")
 324      -#define SCF_PROPERTY_ENABLED            ((const char *)"enabled")
 325      -#define SCF_PROPERTY_DEATHROW           ((const char *)"deathrow")
 326      -#define SCF_PROPERTY_ENTITY_STABILITY   ((const char *)"entity_stability")
 327      -#define SCF_PROPERTY_ENTITIES           ((const char *)"entities")
 328      -#define SCF_PROPERTY_EXEC               ((const char *)"exec")
 329      -#define SCF_PROPERTY_GROUP              ((const char *)"group")
 330      -#define SCF_PROPERTY_GROUPING           ((const char *)"grouping")
 331      -#define SCF_PROPERTY_IGNORE             ((const char *)"ignore_error")
 332      -#define SCF_PROPERTY_INTERNAL_SEPARATORS ((const char *)"internal_separators")
 333      -#define SCF_PROPERTY_LIMIT_PRIVILEGES   ((const char *)"limit_privileges")
 334      -#define SCF_PROPERTY_MAINT_OFF          ((const char *)"maint_off")
 335      -#define SCF_PROPERTY_MAINT_ON           ((const char *)"maint_on")
 336      -#define SCF_PROPERTY_MAINT_ON_IMMEDIATE ((const char *)"maint_on_immediate")
 337      -#define SCF_PROPERTY_MAINT_ON_IMMTEMP   ((const char *)"maint_on_immtemp")
 338      -#define SCF_PROPERTY_MAINT_ON_TEMPORARY ((const char *)"maint_on_temporary")
 339      -#define SCF_PROPERTY_METHOD_PID         ((const char *)"method_pid")
 340      -#define SCF_PROPERTY_MILESTONE          ((const char *)"milestone")
 341      -#define SCF_PROPERTY_NEED_SESSION       ((const char *)"need_session")
 342      -#define SCF_PROPERTY_NEXT_STATE         ((const char *)"next_state")
 343      -#define SCF_PROPERTY_PACKAGE            ((const char *)"package")
 344      -#define SCF_PROPERTY_PRIVILEGES         ((const char *)"privileges")
 345      -#define SCF_PROPERTY_PROFILE            ((const char *)"profile")
 346      -#define SCF_PROPERTY_PROJECT            ((const char *)"project")
 347      -#define SCF_PROPERTY_REFRESH            ((const char *)"refresh")
 348      -#define SCF_PROPERTY_RESOURCE_POOL      ((const char *)"resource_pool")
 349      -#define SCF_PROPERTY_ENVIRONMENT        ((const char *)"environment")
 350      -#define SCF_PROPERTY_RESTART            ((const char *)"restart")
 351      -#define SCF_PROPERTY_RESTARTER          ((const char *)"restarter")
 352      -#define SCF_PROPERTY_RESTART_INTERVAL   ((const char *)"restart_interval")
 353      -#define SCF_PROPERTY_RESTART_ON         ((const char *)"restart_on")
 354      -#define SCF_PROPERTY_RESTORE            ((const char *)"restore")
 355      -#define SCF_PROPERTY_SECFLAGS           ((const char *)"security_flags")
 356      -#define SCF_PROPERTY_SINGLE_INSTANCE    ((const char *)"single_instance")
 357      -#define SCF_PROPERTY_START_METHOD_TIMESTAMP     \
 358      -        ((const char *)"start_method_timestamp")
 359      -#define SCF_PROPERTY_START_METHOD_WAITSTATUS    \
 360      -        ((const char *)"start_method_waitstatus")
 361      -#define SCF_PROPERTY_START_PID          ((const char *)"start_pid")
 362      -#define SCF_PROPERTY_STATE              ((const char *)"state")
 363      -#define SCF_PROPERTY_STABILITY          ((const char *)"stability")
 364      -#define SCF_PROPERTY_STATE_TIMESTAMP    ((const char *)"state_timestamp")
 365      -#define SCF_PROPERTY_SUPP_GROUPS        ((const char *)"supp_groups")
 366      -#define SCF_PROPERTY_TIMEOUT            ((const char *)"timeout_seconds")
 367      -#define SCF_PROPERTY_TIMEOUT_RETRY      ((const char *)"timeout_retry")
 368      -#define SCF_PROPERTY_TRANSIENT_CONTRACT ((const char *)"transient_contract")
 369      -#define SCF_PROPERTY_TYPE               ((const char *)"type")
 370      -#define SCF_PROPERTY_USE_PROFILE        ((const char *)"use_profile")
 371      -#define SCF_PROPERTY_USER               ((const char *)"user")
 372      -#define SCF_PROPERTY_UTMPX_PREFIX       ((const char *)"utmpx_prefix")
 373      -#define SCF_PROPERTY_WORKING_DIRECTORY  ((const char *)"working_directory")
      306 +#define SCF_PROPERTY_ACTIVE_POSTFIX             "active"
      307 +#define SCF_PROPERTY_AUX_STATE                  "auxiliary_state"
      308 +#define SCF_PROPERTY_AUX_FMRI                   "auxiliary_fmri"
      309 +#define SCF_PROPERTY_AUX_TTY                    "auxiliary_tty"
      310 +#define SCF_PROPERTY_CONTRACT                   "contract"
      311 +#define SCF_PROPERTY_COREFILE_PATTERN           "corefile_pattern"
      312 +#define SCF_PROPERTY_DEGRADED                   "degraded"
      313 +#define SCF_PROPERTY_DEGRADE_IMMEDIATE          "degrade_immediate"
      314 +#define SCF_PROPERTY_DODUMP                     "do_dump"
      315 +#define SCF_PROPERTY_DURATION                   "duration"
      316 +#define SCF_PROPERTY_ENABLED                    "enabled"
      317 +#define SCF_PROPERTY_DEATHROW                   "deathrow"
      318 +#define SCF_PROPERTY_ENTITY_STABILITY           "entity_stability"
      319 +#define SCF_PROPERTY_ENTITIES                   "entities"
      320 +#define SCF_PROPERTY_EXEC                       "exec"
      321 +#define SCF_PROPERTY_GROUP                      "group"
      322 +#define SCF_PROPERTY_GROUPING                   "grouping"
      323 +#define SCF_PROPERTY_IGNORE                     "ignore_error"
      324 +#define SCF_PROPERTY_INTERNAL_SEPARATORS        "internal_separators"
      325 +#define SCF_PROPERTY_LIMIT_PRIVILEGES           "limit_privileges"
      326 +#define SCF_PROPERTY_MAINT_OFF                  "maint_off"
      327 +#define SCF_PROPERTY_MAINT_ON                   "maint_on"
      328 +#define SCF_PROPERTY_MAINT_ON_IMMEDIATE         "maint_on_immediate"
      329 +#define SCF_PROPERTY_MAINT_ON_IMMTEMP           "maint_on_immtemp"
      330 +#define SCF_PROPERTY_MAINT_ON_TEMPORARY         "maint_on_temporary"
      331 +#define SCF_PROPERTY_METHOD_PID                 "method_pid"
      332 +#define SCF_PROPERTY_MILESTONE                  "milestone"
      333 +#define SCF_PROPERTY_NEED_SESSION               "need_session"
      334 +#define SCF_PROPERTY_NEXT_STATE                 "next_state"
      335 +#define SCF_PROPERTY_PACKAGE                    "package"
      336 +#define SCF_PROPERTY_PRIVILEGES                 "privileges"
      337 +#define SCF_PROPERTY_PROFILE                    "profile"
      338 +#define SCF_PROPERTY_PROJECT                    "project"
      339 +#define SCF_PROPERTY_REFRESH                    "refresh"
      340 +#define SCF_PROPERTY_RESOURCE_POOL              "resource_pool"
      341 +#define SCF_PROPERTY_ENVIRONMENT                "environment"
      342 +#define SCF_PROPERTY_RESTART                    "restart"
      343 +#define SCF_PROPERTY_RESTARTER                  "restarter"
      344 +#define SCF_PROPERTY_RESTART_INTERVAL           "restart_interval"
      345 +#define SCF_PROPERTY_RESTART_ON                 "restart_on"
      346 +#define SCF_PROPERTY_RESTORE                    "restore"
      347 +#define SCF_PROPERTY_SECFLAGS                   "security_flags"
      348 +#define SCF_PROPERTY_SINGLE_INSTANCE            "single_instance"
      349 +#define SCF_PROPERTY_START_METHOD_TIMESTAMP     "start_method_timestamp"
      350 +#define SCF_PROPERTY_START_METHOD_WAITSTATUS    "start_method_waitstatus"
      351 +#define SCF_PROPERTY_START_PID                  "start_pid"
      352 +#define SCF_PROPERTY_STATE                      "state"
      353 +#define SCF_PROPERTY_STABILITY                  "stability"
      354 +#define SCF_PROPERTY_STATE_TIMESTAMP            "state_timestamp"
      355 +#define SCF_PROPERTY_SUPP_GROUPS                "supp_groups"
      356 +#define SCF_PROPERTY_TIMEOUT                    "timeout_seconds"
      357 +#define SCF_PROPERTY_TIMEOUT_RETRY              "timeout_retry"
      358 +#define SCF_PROPERTY_TRANSIENT_CONTRACT         "transient_contract"
      359 +#define SCF_PROPERTY_TYPE                       "type"
      360 +#define SCF_PROPERTY_USE_PROFILE                "use_profile"
      361 +#define SCF_PROPERTY_USER                       "user"
      362 +#define SCF_PROPERTY_UTMPX_PREFIX               "utmpx_prefix"
      363 +#define SCF_PROPERTY_WORKING_DIRECTORY          "working_directory"
 374  364  
 375  365  /*
 376  366   * Template property names
 377  367   */
 378      -#define SCF_PROPERTY_TM_CARDINALITY_MIN ((const char *)"cardinality_min")
 379      -#define SCF_PROPERTY_TM_CARDINALITY_MAX ((const char *)"cardinality_max")
 380      -#define SCF_PROPERTY_TM_CHOICES_INCLUDE_VALUES ((const char *) \
 381      -                                            "choices_include_values")
 382      -#define SCF_PROPERTY_TM_CHOICES_NAME    ((const char *)"choices_name")
 383      -#define SCF_PROPERTY_TM_CHOICES_RANGE   ((const char *)"choices_range")
 384      -#define SCF_PROPERTY_TM_CONSTRAINT_NAME ((const char *)"constraint_name")
 385      -#define SCF_PROPERTY_TM_CONSTRAINT_RANGE ((const char *)"constraint_range")
 386      -#define SCF_PROPERTY_TM_MANPATH         ((const char *)"manpath")
 387      -#define SCF_PROPERTY_TM_NAME            ((const char *)"name")
 388      -#define SCF_PROPERTY_TM_PG_PATTERN      ((const char *)"pg_pattern")
 389      -#define SCF_PROPERTY_TM_REQUIRED        ((const char *)"required")
 390      -#define SCF_PROPERTY_TM_SECTION         ((const char *)"section")
 391      -#define SCF_PROPERTY_TM_TARGET          ((const char *)"target")
 392      -#define SCF_PROPERTY_TM_TITLE           ((const char *)"title")
 393      -#define SCF_PROPERTY_TM_TYPE            ((const char *)"type")
 394      -#define SCF_PROPERTY_TM_URI             ((const char *)"uri")
 395      -#define SCF_PROPERTY_TM_VALUE_PREFIX    ((const char *)"value_")
 396      -#define SCF_PROPERTY_TM_VALUES_NAME     ((const char *)"values_name")
 397      -#define SCF_PROPERTY_TM_VISIBILITY      ((const char *)"visibility")
 398      -#define SCF_PROPERTY_TM_COMMON_NAME_PREFIX      ((const char *)"common_name_")
 399      -#define SCF_PROPERTY_TM_DESCRIPTION_PREFIX      ((const char *)"description_")
 400      -#define SCF_PROPERTY_TM_UNITS_PREFIX            ((const char *)"units_")
      368 +#define SCF_PROPERTY_TM_CARDINALITY_MIN         "cardinality_min"
      369 +#define SCF_PROPERTY_TM_CARDINALITY_MAX         "cardinality_max"
      370 +#define SCF_PROPERTY_TM_CHOICES_INCLUDE_VALUES  "choices_include_values"
      371 +#define SCF_PROPERTY_TM_CHOICES_NAME            "choices_name"
      372 +#define SCF_PROPERTY_TM_CHOICES_RANGE           "choices_range"
      373 +#define SCF_PROPERTY_TM_CONSTRAINT_NAME         "constraint_name"
      374 +#define SCF_PROPERTY_TM_CONSTRAINT_RANGE        "constraint_range"
      375 +#define SCF_PROPERTY_TM_MANPATH                 "manpath"
      376 +#define SCF_PROPERTY_TM_NAME                    "name"
      377 +#define SCF_PROPERTY_TM_PG_PATTERN              "pg_pattern"
      378 +#define SCF_PROPERTY_TM_REQUIRED                "required"
      379 +#define SCF_PROPERTY_TM_SECTION                 "section"
      380 +#define SCF_PROPERTY_TM_TARGET                  "target"
      381 +#define SCF_PROPERTY_TM_TITLE                   "title"
      382 +#define SCF_PROPERTY_TM_TYPE                    "type"
      383 +#define SCF_PROPERTY_TM_URI                     "uri"
      384 +#define SCF_PROPERTY_TM_VALUE_PREFIX            "value_"
      385 +#define SCF_PROPERTY_TM_VALUES_NAME             "values_name"
      386 +#define SCF_PROPERTY_TM_VISIBILITY              "visibility"
      387 +#define SCF_PROPERTY_TM_COMMON_NAME_PREFIX      "common_name_"
      388 +#define SCF_PROPERTY_TM_DESCRIPTION_PREFIX      "description_"
      389 +#define SCF_PROPERTY_TM_UNITS_PREFIX            "units_"
 401  390  
 402  391  /*
 403  392   * Templates wildcard string
 404  393   */
 405      -#define SCF_TMPL_WILDCARD       ((const char *)"*")
      394 +#define SCF_TMPL_WILDCARD               "*"
 406  395  
 407  396  /*
 408  397   * Strings used by restarters for state and next_state properties.
 409  398   * MAX_SCF_STATE_STRING holds the max length of a state string, including the
 410  399   * terminating null.
 411  400   */
 412  401  
 413  402  #define MAX_SCF_STATE_STRING_SZ         14
 414  403  
 415      -#define SCF_STATE_STRING_NONE           ((const char *)"none")
 416      -#define SCF_STATE_STRING_UNINIT         ((const char *)"uninitialized")
 417      -#define SCF_STATE_STRING_MAINT          ((const char *)"maintenance")
 418      -#define SCF_STATE_STRING_OFFLINE        ((const char *)"offline")
 419      -#define SCF_STATE_STRING_DISABLED       ((const char *)"disabled")
 420      -#define SCF_STATE_STRING_ONLINE         ((const char *)"online")
 421      -#define SCF_STATE_STRING_DEGRADED       ((const char *)"degraded")
 422      -#define SCF_STATE_STRING_LEGACY         ((const char *)"legacy_run")
      404 +#define SCF_STATE_STRING_NONE           "none"
      405 +#define SCF_STATE_STRING_UNINIT         "uninitialized"
      406 +#define SCF_STATE_STRING_MAINT          "maintenance"
      407 +#define SCF_STATE_STRING_OFFLINE        "offline"
      408 +#define SCF_STATE_STRING_DISABLED       "disabled"
      409 +#define SCF_STATE_STRING_ONLINE         "online"
      410 +#define SCF_STATE_STRING_DEGRADED       "degraded"
      411 +#define SCF_STATE_STRING_LEGACY         "legacy_run"
 423  412  
 424  413  #define SCF_STATE_UNINIT                0x00000001
 425  414  #define SCF_STATE_MAINT                 0x00000002
 426  415  #define SCF_STATE_OFFLINE               0x00000004
 427  416  #define SCF_STATE_DISABLED              0x00000008
 428  417  #define SCF_STATE_ONLINE                0x00000010
 429  418  #define SCF_STATE_DEGRADED              0x00000020
 430  419  #define SCF_STATE_ALL                   0x0000003F
 431  420  
 432  421  /*
 433  422   * software fma svc-transition class
 434  423   */
 435  424  #define SCF_NOTIFY_PARAMS_VERSION       0X0
 436      -#define SCF_NOTIFY_NAME_FMRI            ((const char *)"fmri")
 437      -#define SCF_NOTIFY_NAME_VERSION         ((const char *)"version")
 438      -#define SCF_NOTIFY_NAME_TSET            ((const char *)"tset")
 439      -#define SCF_NOTIFY_PG_POSTFIX           ((const char *)"fmnotify")
 440      -#define SCF_NOTIFY_PARAMS               ((const char *)"notify-params")
 441      -#define SCF_NOTIFY_PARAMS_INST \
 442      -        ((const char *)"svc:/system/fm/notify-params:default")
 443      -#define SCF_SVC_TRANSITION_CLASS \
 444      -        ((const char *)"ireport.os.smf.state-transition")
 445      -#define SCF_NOTIFY_PARAMS_PG_TYPE       ((const char *)"notify_params")
      425 +#define SCF_NOTIFY_NAME_FMRI            "fmri"
      426 +#define SCF_NOTIFY_NAME_VERSION         "version"
      427 +#define SCF_NOTIFY_NAME_TSET            "tset"
      428 +#define SCF_NOTIFY_PG_POSTFIX           "fmnotify"
      429 +#define SCF_NOTIFY_PARAMS               "notify-params"
      430 +#define SCF_NOTIFY_PARAMS_INST          "svc:/system/fm/notify-params:default"
      431 +#define SCF_SVC_TRANSITION_CLASS        "ireport.os.smf.state-transition"
      432 +#define SCF_NOTIFY_PARAMS_PG_TYPE       "notify_params"
 446  433  
 447  434  /*
 448  435   * Useful transition macros
 449  436   */
 450  437  #define SCF_TRANS_SHIFT_INITIAL_STATE(s)        ((s) << 16)
 451  438  #define SCF_TRANSITION_ALL \
 452  439          (SCF_TRANS_SHIFT_INITIAL_STATE(SCF_STATE_ALL) | SCF_STATE_ALL)
 453  440  #define SCF_TRANS(f, t) (SCF_TRANS_SHIFT_INITIAL_STATE(f) | (t))
 454  441  #define SCF_TRANS_VALID(t)      (!((t) & ~SCF_TRANSITION_ALL))
 455  442  #define SCF_TRANS_INITIAL_STATE(t)      ((t) >> 16 & SCF_STATE_ALL)
 456  443  #define SCF_TRANS_FINAL_STATE(t)        ((t) & SCF_STATE_ALL)
 457  444  
 458  445  /*
 459  446   * Prefixes for states in state transition notification
 460  447   */
 461      -#define SCF_STN_PREFIX_FROM             ((const char *)"from-")
 462      -#define SCF_STN_PREFIX_TO               ((const char *)"to-")
      448 +#define SCF_STN_PREFIX_FROM             "from-"
      449 +#define SCF_STN_PREFIX_TO               "to-"
 463  450  
 464  451  #define SCF_PG_FLAG_NONPERSISTENT       0x1
 465  452  
 466  453  #define SCF_TRACE_LIBRARY               0x1
 467  454  #define SCF_TRACE_DAEMON                0x2
 468  455  
 469  456  #define SMF_IMMEDIATE                   0x1
 470  457  #define SMF_TEMPORARY                   0x2
 471  458  #define SMF_AT_NEXT_BOOT                0x4
 472  459  
↓ open down ↓ 401 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX