Print this page
12721 would like svcadm disable -c
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libscf/inc/libscf.h
+++ new/usr/src/lib/libscf/inc/libscf.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
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 24 * Copyright 2016 RackTop Systems.
25 - * Copyright (c) 2012, Joyent, Inc. All rights reserved.
25 + * Copyright 2020 Joyent, Inc.
26 26 */
27 27
28 28 #ifndef _LIBSCF_H
29 29 #define _LIBSCF_H
30 30
31 31
32 32 #include <stddef.h>
33 33 #include <libnvpair.h>
34 34
35 35 #ifndef NATIVE_BUILD
36 36 #include <sys/secflags.h>
37 37 #endif /* NATIVE_BUILD */
38 38 #include <sys/types.h>
39 39
40 40 #ifdef __cplusplus
41 41 extern "C" {
42 42 #endif
43 43
44 44 typedef unsigned long scf_version_t;
45 45 #define SCF_VERSION 1UL
46 46
47 47 /*
48 48 * Opaque structures
49 49 */
50 50 typedef struct scf_handle scf_handle_t;
51 51 typedef struct scf_scope scf_scope_t;
52 52 typedef struct scf_service scf_service_t;
53 53 typedef struct scf_instance scf_instance_t;
54 54 typedef struct scf_propertygroup scf_propertygroup_t;
55 55 typedef struct scf_property scf_property_t;
56 56
57 57 typedef struct scf_snapshot scf_snapshot_t;
58 58 typedef struct scf_snaplevel scf_snaplevel_t;
59 59
60 60 typedef struct scf_transaction scf_transaction_t;
61 61 typedef struct scf_transaction_entry scf_transaction_entry_t;
62 62 typedef struct scf_value scf_value_t;
63 63
64 64 typedef struct scf_iter scf_iter_t;
65 65
66 66 typedef struct scf_pg_tmpl scf_pg_tmpl_t;
67 67 typedef struct scf_prop_tmpl scf_prop_tmpl_t;
68 68 typedef struct scf_tmpl_errors scf_tmpl_errors_t;
69 69
70 70 typedef struct scf_simple_app_props scf_simple_app_props_t;
71 71 typedef struct scf_simple_prop scf_simple_prop_t;
72 72
73 73 /*
74 74 * Types
75 75 */
76 76 typedef enum {
77 77 SCF_TYPE_INVALID = 0,
78 78
79 79 SCF_TYPE_BOOLEAN,
80 80 SCF_TYPE_COUNT,
81 81 SCF_TYPE_INTEGER,
82 82 SCF_TYPE_TIME,
83 83 SCF_TYPE_ASTRING,
84 84 SCF_TYPE_OPAQUE,
85 85
86 86 SCF_TYPE_USTRING = 100,
87 87
88 88 SCF_TYPE_URI = 200,
89 89 SCF_TYPE_FMRI,
90 90
91 91 SCF_TYPE_HOST = 300,
92 92 SCF_TYPE_HOSTNAME,
93 93 SCF_TYPE_NET_ADDR_V4,
94 94 SCF_TYPE_NET_ADDR_V6,
95 95 SCF_TYPE_NET_ADDR
96 96 } scf_type_t;
97 97
98 98 /*
99 99 * Values returned by scf_type_to_string
100 100 */
101 101 #define SCF_TYPE_STRING_BOOLEAN "boolean"
102 102 #define SCF_TYPE_STRING_COUNT "count"
103 103 #define SCF_TYPE_STRING_INTEGER "integer"
104 104 #define SCF_TYPE_STRING_TIME "time"
105 105 #define SCF_TYPE_STRING_ASTRING "astring"
106 106 #define SCF_TYPE_STRING_OPAQUE "opaque"
107 107 #define SCF_TYPE_STRING_USTRING "ustring"
108 108 #define SCF_TYPE_STRING_URI "uri"
109 109 #define SCF_TYPE_STRING_FMRI "fmri"
110 110 #define SCF_TYPE_STRING_HOST "host"
111 111 #define SCF_TYPE_STRING_HOSTNAME "hostname"
112 112 #define SCF_TYPE_STRING_NET_ADDR "net_address"
113 113 #define SCF_TYPE_STRING_NET_ADDR_V4 "net_address_v4"
114 114 #define SCF_TYPE_STRING_NET_ADDR_V6 "net_address_v6"
115 115
116 116 typedef struct scf_time {
117 117 int64_t t_seconds;
118 118 int32_t t_ns;
119 119 } scf_time_t;
120 120
121 121 /*
122 122 * There is no explicit initializer for this structure. Functions
123 123 * which set or populate this structure assume that it is either
124 124 * uninitialized or destroyed.
125 125 */
126 126 typedef struct scf_values {
127 127 scf_type_t value_type;
128 128 void *reserved; /* reserved for future use */
129 129 int value_count;
130 130 char **values_as_strings;
131 131 union {
132 132 uint64_t *v_count;
133 133 uint8_t *v_boolean;
134 134 int64_t *v_integer;
135 135 char **v_astring;
136 136 char **v_ustring;
137 137 char **v_opaque;
138 138 scf_time_t *v_time;
139 139 } values;
140 140 } scf_values_t;
141 141
142 142 typedef struct scf_count_ranges {
143 143 int scr_num_ranges;
144 144 uint64_t *scr_min;
145 145 uint64_t *scr_max;
146 146 } scf_count_ranges_t;
147 147
148 148 typedef struct scf_int_ranges {
149 149 int sir_num_ranges;
150 150 int64_t *sir_min;
151 151 int64_t *sir_max;
152 152 } scf_int_ranges_t;
153 153
154 154 /*
155 155 * Return codes
156 156 */
157 157 #define SCF_SUCCESS 0
158 158 #define SCF_COMPLETE 1
159 159 #define SCF_FAILED -1
160 160
161 161 typedef enum scf_error {
162 162 SCF_ERROR_NONE = 1000, /* no error */
163 163 SCF_ERROR_NOT_BOUND, /* handle not bound */
164 164 SCF_ERROR_NOT_SET, /* cannot use unset argument */
165 165 SCF_ERROR_NOT_FOUND, /* nothing of that name found */
166 166 SCF_ERROR_TYPE_MISMATCH, /* type does not match value */
167 167 SCF_ERROR_IN_USE, /* cannot modify while in-use */
168 168 SCF_ERROR_CONNECTION_BROKEN, /* repository connection gone */
169 169 SCF_ERROR_INVALID_ARGUMENT, /* bad argument */
170 170 SCF_ERROR_NO_MEMORY, /* no memory available */
171 171 SCF_ERROR_CONSTRAINT_VIOLATED, /* required constraint not met */
172 172 SCF_ERROR_EXISTS, /* object already exists */
173 173 SCF_ERROR_NO_SERVER, /* repository server unavailable */
174 174 SCF_ERROR_NO_RESOURCES, /* server has insufficient resources */
175 175 SCF_ERROR_PERMISSION_DENIED, /* insufficient privileges for action */
176 176 SCF_ERROR_BACKEND_ACCESS, /* backend refused access */
177 177 SCF_ERROR_HANDLE_MISMATCH, /* mismatched SCF handles */
178 178 SCF_ERROR_HANDLE_DESTROYED, /* object bound to destroyed handle */
179 179 SCF_ERROR_VERSION_MISMATCH, /* incompatible SCF version */
180 180 SCF_ERROR_BACKEND_READONLY, /* backend is read-only */
181 181 SCF_ERROR_DELETED, /* object has been deleted */
182 182 SCF_ERROR_TEMPLATE_INVALID, /* template data is invalid */
183 183
184 184 SCF_ERROR_CALLBACK_FAILED = 1080, /* user callback function failed */
185 185
186 186 SCF_ERROR_INTERNAL = 1101 /* internal error */
187 187 } scf_error_t;
188 188
189 189 /*
190 190 * This enum MUST be kept in sync with
191 191 * struct _scf_tmpl_error_desc em_desc() in scf_tmpl.c
192 192 */
193 193 typedef enum scf_tmpl_error_type {
194 194 SCF_TERR_MISSING_PG, /* property group missing */
195 195 SCF_TERR_WRONG_PG_TYPE, /* property group type incorrect */
196 196 SCF_TERR_MISSING_PROP, /* missing required property */
197 197 SCF_TERR_WRONG_PROP_TYPE, /* property type incorrect */
198 198 SCF_TERR_CARDINALITY_VIOLATION, /* wrong number of values */
199 199 SCF_TERR_VALUE_CONSTRAINT_VIOLATED, /* constraint violated for value */
200 200 SCF_TERR_RANGE_VIOLATION, /* value violated specified range */
201 201 SCF_TERR_PG_REDEFINE, /* global or restarter pg_pattern */
202 202 /* redefined by the instance */
203 203 SCF_TERR_PROP_TYPE_MISMATCH, /* property and value type mismatch */
204 204 SCF_TERR_VALUE_OUT_OF_RANGE, /* value is out of range in template */
205 205 SCF_TERR_INVALID_VALUE, /* value is not valid for the */
206 206 /* template */
207 207 SCF_TERR_PG_PATTERN_CONFLICT, /* pg_pattern conflicts with higher */
208 208 /* level definition */
209 209 SCF_TERR_PROP_PATTERN_CONFLICT, /* prop_pattern conflicts with higher */
210 210 /* level definition */
211 211 SCF_TERR_GENERAL_REDEFINE, /* global or restarter template */
212 212 /* redefined */
213 213 SCF_TERR_INCLUDE_VALUES, /* No supporting constraints or */
214 214 /* values for include_values */
215 215 SCF_TERR_PG_PATTERN_INCOMPLETE, /* Required pg_pattern is missing */
216 216 /* name or type attribute. */
217 217 SCF_TERR_PROP_PATTERN_INCOMPLETE /* Required prop_pattern is */
218 218 /* missing a type attribute. */
219 219 } scf_tmpl_error_type_t;
220 220
221 221 typedef struct scf_tmpl_error scf_tmpl_error_t;
222 222
223 223 /*
224 224 * This unfortunately needs to be public, because consumers of librestart must
225 225 * deal with it
226 226 */
227 227 typedef struct {
228 228 #ifndef NATIVE_BUILD
229 229 secflagdelta_t ss_default;
230 230 secflagdelta_t ss_lower;
231 231 secflagdelta_t ss_upper;
232 232 #else
233 233 /*
234 234 * This is never used, but is necessary for bootstrapping.
235 235 * Not even the size matters.
236 236 */
237 237 void *ss_default;
238 238 void *ss_lower;
239 239 void *ss_upper;
240 240 #endif /* NATIVE_BUILD */
241 241 } scf_secflags_t;
242 242
243 243 /*
244 244 * scf_tmpl_strerror() human readable flag
245 245 */
246 246 #define SCF_TMPL_STRERROR_HUMAN 0x1
247 247
248 248 /*
249 249 * Standard services
250 250 */
251 251 #define SCF_SERVICE_CONFIGD "svc:/system/svc/repository:default"
252 252 #define SCF_INSTANCE_GLOBAL "svc:/system/svc/global:default"
253 253 #define SCF_SERVICE_GLOBAL "svc:/system/svc/global"
254 254 #define SCF_SERVICE_STARTD "svc:/system/svc/restarter:default"
255 255 #define SCF_INSTANCE_EMI "svc:/system/early-manifest-import:default"
256 256 #define SCF_INSTANCE_FS_MINIMAL "svc:/system/filesystem/minimal:default"
257 257 #define SCF_INSTANCE_MI "svc:/system/manifest-import:default"
258 258
259 259 /*
260 260 * Major milestones
261 261 */
262 262 #define SCF_MILESTONE_SINGLE_USER "svc:/milestone/single-user:default"
263 263 #define SCF_MILESTONE_MULTI_USER "svc:/milestone/multi-user:default"
264 264 #define SCF_MILESTONE_MULTI_USER_SERVER \
265 265 "svc:/milestone/multi-user-server:default"
266 266
267 267 /*
268 268 * standard scope names
269 269 */
270 270 #define SCF_SCOPE_LOCAL "localhost"
271 271
272 272 /*
273 273 * Property group types
274 274 */
275 275 #define SCF_GROUP_APPLICATION "application"
276 276 #define SCF_GROUP_FRAMEWORK "framework"
277 277 #define SCF_GROUP_DEPENDENCY "dependency"
278 278 #define SCF_GROUP_METHOD "method"
279 279 #define SCF_GROUP_TEMPLATE "template"
280 280 #define SCF_GROUP_TEMPLATE_PG_PATTERN "template_pg_pattern"
281 281 #define SCF_GROUP_TEMPLATE_PROP_PATTERN "template_prop_pattern"
282 282
283 283 /*
284 284 * Dependency types
285 285 */
286 286 #define SCF_DEP_REQUIRE_ALL "require_all"
287 287 #define SCF_DEP_REQUIRE_ANY "require_any"
288 288 #define SCF_DEP_EXCLUDE_ALL "exclude_all"
289 289 #define SCF_DEP_OPTIONAL_ALL "optional_all"
290 290
291 291 #define SCF_DEP_RESET_ON_ERROR "error"
292 292 #define SCF_DEP_RESET_ON_RESTART "restart"
293 293 #define SCF_DEP_RESET_ON_REFRESH "refresh"
294 294 #define SCF_DEP_RESET_ON_NONE "none"
295 295
296 296 /*
297 297 * Standard property group names
298 298 */
299 299 #define SCF_PG_GENERAL "general"
300 300 #define SCF_PG_GENERAL_OVR "general_ovr"
301 301 #define SCF_PG_RESTARTER "restarter"
302 302 #define SCF_PG_RESTARTER_ACTIONS "restarter_actions"
303 303 #define SCF_PG_METHOD_CONTEXT "method_context"
304 304 #define SCF_PG_APP_DEFAULT "application"
305 305 #define SCF_PG_DEPENDENTS "dependents"
306 306 #define SCF_PG_OPTIONS "options"
307 307 #define SCF_PG_OPTIONS_OVR "options_ovr"
308 308 #define SCF_PG_STARTD "startd"
309 309 #define SCF_PG_STARTD_PRIVATE "svc-startd-private"
310 310 #define SCF_PG_DEATHROW "deathrow"
311 311 #define SCF_PG_MANIFESTFILES "manifestfiles"
312 312
313 313 /*
314 314 * Template property group names and prefixes
315 315 */
316 316 #define SCF_PG_TM_COMMON_NAME "tm_common_name"
317 317 #define SCF_PG_TM_DESCRIPTION "tm_description"
318 318
↓ open down ↓ |
283 lines elided |
↑ open up ↑ |
319 319 #define SCF_PG_TM_MAN_PREFIX "tm_man_"
320 320 #define SCF_PG_TM_DOC_PREFIX "tm_doc_"
321 321
322 322 /*
323 323 * Standard property names
324 324 */
325 325 #define SCF_PROPERTY_ACTIVE_POSTFIX "active"
326 326 #define SCF_PROPERTY_AUX_STATE "auxiliary_state"
327 327 #define SCF_PROPERTY_AUX_FMRI "auxiliary_fmri"
328 328 #define SCF_PROPERTY_AUX_TTY "auxiliary_tty"
329 +#define SCF_PROPERTY_COMMENT "comment"
329 330 #define SCF_PROPERTY_CONTRACT "contract"
330 331 #define SCF_PROPERTY_COREFILE_PATTERN "corefile_pattern"
331 332 #define SCF_PROPERTY_DEGRADED "degraded"
332 333 #define SCF_PROPERTY_DEGRADE_IMMEDIATE "degrade_immediate"
333 334 #define SCF_PROPERTY_DODUMP "do_dump"
334 335 #define SCF_PROPERTY_DURATION "duration"
335 336 #define SCF_PROPERTY_ENABLED "enabled"
336 337 #define SCF_PROPERTY_DEATHROW "deathrow"
337 338 #define SCF_PROPERTY_ENTITY_STABILITY "entity_stability"
338 339 #define SCF_PROPERTY_ENTITIES "entities"
339 340 #define SCF_PROPERTY_EXEC "exec"
340 341 #define SCF_PROPERTY_GROUP "group"
341 342 #define SCF_PROPERTY_GROUPING "grouping"
342 343 #define SCF_PROPERTY_IGNORE "ignore_error"
343 344 #define SCF_PROPERTY_INTERNAL_SEPARATORS "internal_separators"
344 345 #define SCF_PROPERTY_LIMIT_PRIVILEGES "limit_privileges"
345 346 #define SCF_PROPERTY_MAINT_OFF "maint_off"
346 347 #define SCF_PROPERTY_MAINT_ON "maint_on"
347 348 #define SCF_PROPERTY_MAINT_ON_IMMEDIATE "maint_on_immediate"
348 349 #define SCF_PROPERTY_MAINT_ON_IMMTEMP "maint_on_immtemp"
349 350 #define SCF_PROPERTY_MAINT_ON_TEMPORARY "maint_on_temporary"
350 351 #define SCF_PROPERTY_METHOD_PID "method_pid"
351 352 #define SCF_PROPERTY_MILESTONE "milestone"
352 353 #define SCF_PROPERTY_NEED_SESSION "need_session"
353 354 #define SCF_PROPERTY_NEXT_STATE "next_state"
354 355 #define SCF_PROPERTY_PACKAGE "package"
355 356 #define SCF_PROPERTY_PRIVILEGES "privileges"
356 357 #define SCF_PROPERTY_PROFILE "profile"
357 358 #define SCF_PROPERTY_PROJECT "project"
358 359 #define SCF_PROPERTY_REFRESH "refresh"
359 360 #define SCF_PROPERTY_RESOURCE_POOL "resource_pool"
360 361 #define SCF_PROPERTY_ENVIRONMENT "environment"
361 362 #define SCF_PROPERTY_RESTART "restart"
362 363 #define SCF_PROPERTY_RESTARTER "restarter"
363 364 #define SCF_PROPERTY_RESTART_INTERVAL "restart_interval"
364 365 #define SCF_PROPERTY_RESTART_ON "restart_on"
365 366 #define SCF_PROPERTY_RESTORE "restore"
366 367 #define SCF_PROPERTY_SECFLAGS "security_flags"
367 368 #define SCF_PROPERTY_SINGLE_INSTANCE "single_instance"
368 369 #define SCF_PROPERTY_START_METHOD_TIMESTAMP "start_method_timestamp"
369 370 #define SCF_PROPERTY_START_METHOD_WAITSTATUS "start_method_waitstatus"
370 371 #define SCF_PROPERTY_START_PID "start_pid"
371 372 #define SCF_PROPERTY_STATE "state"
372 373 #define SCF_PROPERTY_STABILITY "stability"
373 374 #define SCF_PROPERTY_STATE_TIMESTAMP "state_timestamp"
374 375 #define SCF_PROPERTY_SUPP_GROUPS "supp_groups"
375 376 #define SCF_PROPERTY_TIMEOUT "timeout_seconds"
376 377 #define SCF_PROPERTY_TIMEOUT_RETRY "timeout_retry"
377 378 #define SCF_PROPERTY_TRANSIENT_CONTRACT "transient_contract"
378 379 #define SCF_PROPERTY_TYPE "type"
379 380 #define SCF_PROPERTY_USE_PROFILE "use_profile"
380 381 #define SCF_PROPERTY_USER "user"
381 382 #define SCF_PROPERTY_UTMPX_PREFIX "utmpx_prefix"
382 383 #define SCF_PROPERTY_WORKING_DIRECTORY "working_directory"
383 384
384 385 /*
385 386 * Template property names
386 387 */
387 388 #define SCF_PROPERTY_TM_CARDINALITY_MIN "cardinality_min"
388 389 #define SCF_PROPERTY_TM_CARDINALITY_MAX "cardinality_max"
389 390 #define SCF_PROPERTY_TM_CHOICES_INCLUDE_VALUES "choices_include_values"
390 391 #define SCF_PROPERTY_TM_CHOICES_NAME "choices_name"
391 392 #define SCF_PROPERTY_TM_CHOICES_RANGE "choices_range"
392 393 #define SCF_PROPERTY_TM_CONSTRAINT_NAME "constraint_name"
393 394 #define SCF_PROPERTY_TM_CONSTRAINT_RANGE "constraint_range"
394 395 #define SCF_PROPERTY_TM_MANPATH "manpath"
395 396 #define SCF_PROPERTY_TM_NAME "name"
396 397 #define SCF_PROPERTY_TM_PG_PATTERN "pg_pattern"
397 398 #define SCF_PROPERTY_TM_REQUIRED "required"
398 399 #define SCF_PROPERTY_TM_SECTION "section"
399 400 #define SCF_PROPERTY_TM_TARGET "target"
400 401 #define SCF_PROPERTY_TM_TITLE "title"
401 402 #define SCF_PROPERTY_TM_TYPE "type"
402 403 #define SCF_PROPERTY_TM_URI "uri"
403 404 #define SCF_PROPERTY_TM_VALUE_PREFIX "value_"
404 405 #define SCF_PROPERTY_TM_VALUES_NAME "values_name"
405 406 #define SCF_PROPERTY_TM_VISIBILITY "visibility"
406 407 #define SCF_PROPERTY_TM_COMMON_NAME_PREFIX "common_name_"
407 408 #define SCF_PROPERTY_TM_DESCRIPTION_PREFIX "description_"
408 409 #define SCF_PROPERTY_TM_UNITS_PREFIX "units_"
409 410
410 411 /*
411 412 * Templates wildcard string
412 413 */
413 414 #define SCF_TMPL_WILDCARD "*"
414 415
415 416 /*
416 417 * Strings used by restarters for state and next_state properties.
417 418 * MAX_SCF_STATE_STRING holds the max length of a state string, including the
418 419 * terminating null.
419 420 */
420 421
421 422 #define MAX_SCF_STATE_STRING_SZ 14
422 423
423 424 #define SCF_STATE_STRING_NONE "none"
424 425 #define SCF_STATE_STRING_UNINIT "uninitialized"
425 426 #define SCF_STATE_STRING_MAINT "maintenance"
426 427 #define SCF_STATE_STRING_OFFLINE "offline"
427 428 #define SCF_STATE_STRING_DISABLED "disabled"
428 429 #define SCF_STATE_STRING_ONLINE "online"
429 430 #define SCF_STATE_STRING_DEGRADED "degraded"
430 431 #define SCF_STATE_STRING_LEGACY "legacy_run"
431 432
432 433 #define SCF_STATE_UNINIT 0x00000001
433 434 #define SCF_STATE_MAINT 0x00000002
434 435 #define SCF_STATE_OFFLINE 0x00000004
435 436 #define SCF_STATE_DISABLED 0x00000008
436 437 #define SCF_STATE_ONLINE 0x00000010
437 438 #define SCF_STATE_DEGRADED 0x00000020
438 439 #define SCF_STATE_ALL 0x0000003F
439 440
440 441 /*
441 442 * software fma svc-transition class
442 443 */
443 444 #define SCF_NOTIFY_PARAMS_VERSION 0X0
444 445 #define SCF_NOTIFY_NAME_FMRI "fmri"
445 446 #define SCF_NOTIFY_NAME_VERSION "version"
446 447 #define SCF_NOTIFY_NAME_TSET "tset"
447 448 #define SCF_NOTIFY_PG_POSTFIX "fmnotify"
448 449 #define SCF_NOTIFY_PARAMS "notify-params"
449 450 #define SCF_NOTIFY_PARAMS_INST "svc:/system/fm/notify-params:default"
450 451 #define SCF_SVC_TRANSITION_CLASS "ireport.os.smf.state-transition"
451 452 #define SCF_NOTIFY_PARAMS_PG_TYPE "notify_params"
452 453
453 454 /*
454 455 * Useful transition macros
455 456 */
456 457 #define SCF_TRANS_SHIFT_INITIAL_STATE(s) ((s) << 16)
457 458 #define SCF_TRANSITION_ALL \
458 459 (SCF_TRANS_SHIFT_INITIAL_STATE(SCF_STATE_ALL) | SCF_STATE_ALL)
459 460 #define SCF_TRANS(f, t) (SCF_TRANS_SHIFT_INITIAL_STATE(f) | (t))
460 461 #define SCF_TRANS_VALID(t) (!((t) & ~SCF_TRANSITION_ALL))
461 462 #define SCF_TRANS_INITIAL_STATE(t) ((t) >> 16 & SCF_STATE_ALL)
462 463 #define SCF_TRANS_FINAL_STATE(t) ((t) & SCF_STATE_ALL)
463 464
464 465 /*
465 466 * Prefixes for states in state transition notification
466 467 */
467 468 #define SCF_STN_PREFIX_FROM "from-"
468 469 #define SCF_STN_PREFIX_TO "to-"
469 470
470 471 #define SCF_PG_FLAG_NONPERSISTENT 0x1
471 472
472 473 #define SCF_TRACE_LIBRARY 0x1
473 474 #define SCF_TRACE_DAEMON 0x2
474 475
475 476 #define SMF_IMMEDIATE 0x1
476 477 #define SMF_TEMPORARY 0x2
477 478 #define SMF_AT_NEXT_BOOT 0x4
↓ open down ↓ |
139 lines elided |
↑ open up ↑ |
478 479
479 480 scf_error_t scf_error(void);
480 481 const char *scf_strerror(scf_error_t);
481 482
482 483 ssize_t scf_limit(uint32_t code);
483 484 #define SCF_LIMIT_MAX_NAME_LENGTH -2000U
484 485 #define SCF_LIMIT_MAX_VALUE_LENGTH -2001U
485 486 #define SCF_LIMIT_MAX_PG_TYPE_LENGTH -2002U
486 487 #define SCF_LIMIT_MAX_FMRI_LENGTH -2003U
487 488
489 +
490 +#define SCF_COMMENT_MAX_LENGTH (1024)
491 +
488 492 scf_handle_t *scf_handle_create(scf_version_t);
489 493
490 494 int scf_handle_decorate(scf_handle_t *, const char *, scf_value_t *);
491 495 #define SCF_DECORATE_CLEAR ((scf_value_t *)0)
492 496
493 497 int scf_handle_bind(scf_handle_t *);
494 498 int scf_handle_unbind(scf_handle_t *);
495 499 void scf_handle_destroy(scf_handle_t *);
496 500
497 501 int scf_type_base_type(scf_type_t type, scf_type_t *out);
498 502 const char *scf_type_to_string(scf_type_t);
499 503 scf_type_t scf_string_to_type(const char *);
500 504
501 505 /* values */
502 506 scf_value_t *scf_value_create(scf_handle_t *);
503 507 scf_handle_t *scf_value_handle(const scf_value_t *);
504 508 void scf_value_destroy(scf_value_t *);
505 509
506 510 scf_type_t scf_value_base_type(const scf_value_t *);
507 511 scf_type_t scf_value_type(const scf_value_t *);
508 512 int scf_value_is_type(const scf_value_t *, scf_type_t);
509 513
510 514 void scf_value_reset(scf_value_t *);
511 515
512 516 int scf_value_get_boolean(const scf_value_t *, uint8_t *);
513 517 int scf_value_get_count(const scf_value_t *, uint64_t *);
514 518 int scf_value_get_integer(const scf_value_t *, int64_t *);
515 519 int scf_value_get_time(const scf_value_t *, int64_t *, int32_t *);
516 520 ssize_t scf_value_get_astring(const scf_value_t *, char *, size_t);
517 521 ssize_t scf_value_get_ustring(const scf_value_t *, char *, size_t);
518 522 ssize_t scf_value_get_opaque(const scf_value_t *, void *, size_t);
519 523
520 524 void scf_value_set_boolean(scf_value_t *, uint8_t);
521 525 void scf_value_set_count(scf_value_t *, uint64_t);
522 526 void scf_value_set_integer(scf_value_t *, int64_t);
523 527 int scf_value_set_time(scf_value_t *, int64_t, int32_t);
524 528 int scf_value_set_astring(scf_value_t *, const char *);
525 529 int scf_value_set_ustring(scf_value_t *, const char *);
526 530 int scf_value_set_opaque(scf_value_t *, const void *, size_t);
527 531
528 532 ssize_t scf_value_get_as_string(const scf_value_t *, char *, size_t);
529 533 ssize_t scf_value_get_as_string_typed(const scf_value_t *, scf_type_t,
530 534 char *, size_t);
531 535 int scf_value_set_from_string(scf_value_t *, scf_type_t, const char *);
532 536
533 537 scf_iter_t *scf_iter_create(scf_handle_t *);
534 538 scf_handle_t *scf_iter_handle(const scf_iter_t *);
535 539 void scf_iter_reset(scf_iter_t *);
536 540 void scf_iter_destroy(scf_iter_t *);
537 541
538 542 int scf_iter_handle_scopes(scf_iter_t *, const scf_handle_t *);
539 543 int scf_iter_scope_services(scf_iter_t *, const scf_scope_t *);
540 544 int scf_iter_service_instances(scf_iter_t *, const scf_service_t *);
541 545 int scf_iter_service_pgs(scf_iter_t *, const scf_service_t *);
542 546 int scf_iter_instance_pgs(scf_iter_t *, const scf_instance_t *);
543 547 int scf_iter_instance_pgs_composed(scf_iter_t *, const scf_instance_t *,
544 548 const scf_snapshot_t *);
545 549 int scf_iter_service_pgs_typed(scf_iter_t *, const scf_service_t *,
546 550 const char *);
547 551 int scf_iter_instance_pgs_typed(scf_iter_t *, const scf_instance_t *,
548 552 const char *);
549 553 int scf_iter_instance_pgs_typed_composed(scf_iter_t *, const scf_instance_t *,
550 554 const scf_snapshot_t *, const char *);
551 555 int scf_iter_snaplevel_pgs(scf_iter_t *, const scf_snaplevel_t *);
552 556 int scf_iter_snaplevel_pgs_typed(scf_iter_t *, const scf_snaplevel_t *,
553 557 const char *);
554 558 int scf_iter_instance_snapshots(scf_iter_t *, const scf_instance_t *);
555 559 int scf_iter_pg_properties(scf_iter_t *, const scf_propertygroup_t *);
556 560 int scf_iter_property_values(scf_iter_t *, const scf_property_t *);
557 561
558 562 int scf_iter_next_scope(scf_iter_t *, scf_scope_t *);
559 563 int scf_iter_next_service(scf_iter_t *, scf_service_t *);
560 564 int scf_iter_next_instance(scf_iter_t *, scf_instance_t *);
561 565 int scf_iter_next_pg(scf_iter_t *, scf_propertygroup_t *);
562 566 int scf_iter_next_property(scf_iter_t *, scf_property_t *);
563 567 int scf_iter_next_snapshot(scf_iter_t *, scf_snapshot_t *);
564 568 int scf_iter_next_value(scf_iter_t *, scf_value_t *);
565 569
566 570 scf_scope_t *scf_scope_create(scf_handle_t *);
567 571 scf_handle_t *scf_scope_handle(const scf_scope_t *);
568 572
569 573 /* XXX eventually remove this */
570 574 #define scf_handle_get_local_scope(h, s) \
571 575 scf_handle_get_scope((h), SCF_SCOPE_LOCAL, (s))
572 576
573 577 int scf_handle_get_scope(scf_handle_t *, const char *, scf_scope_t *);
574 578 void scf_scope_destroy(scf_scope_t *);
575 579 ssize_t scf_scope_get_name(const scf_scope_t *, char *, size_t);
576 580
577 581 ssize_t scf_scope_to_fmri(const scf_scope_t *, char *, size_t);
578 582
579 583 scf_service_t *scf_service_create(scf_handle_t *);
580 584 scf_handle_t *scf_service_handle(const scf_service_t *);
581 585 void scf_service_destroy(scf_service_t *);
582 586 int scf_scope_get_parent(const scf_scope_t *, scf_scope_t *);
583 587 ssize_t scf_service_get_name(const scf_service_t *, char *, size_t);
584 588 ssize_t scf_service_to_fmri(const scf_service_t *, char *, size_t);
585 589 int scf_service_get_parent(const scf_service_t *, scf_scope_t *);
586 590 int scf_scope_get_service(const scf_scope_t *, const char *, scf_service_t *);
587 591 int scf_scope_add_service(const scf_scope_t *, const char *, scf_service_t *);
588 592 int scf_service_delete(scf_service_t *);
589 593
590 594 scf_instance_t *scf_instance_create(scf_handle_t *);
591 595 scf_handle_t *scf_instance_handle(const scf_instance_t *);
592 596 void scf_instance_destroy(scf_instance_t *);
593 597 ssize_t scf_instance_get_name(const scf_instance_t *, char *, size_t);
594 598 ssize_t scf_instance_to_fmri(const scf_instance_t *, char *, size_t);
595 599 int scf_service_get_instance(const scf_service_t *, const char *,
596 600 scf_instance_t *);
597 601 int scf_service_add_instance(const scf_service_t *, const char *,
598 602 scf_instance_t *);
599 603 int scf_instance_delete(scf_instance_t *);
600 604
601 605 scf_snapshot_t *scf_snapshot_create(scf_handle_t *);
602 606 scf_handle_t *scf_snapshot_handle(const scf_snapshot_t *);
603 607 void scf_snapshot_destroy(scf_snapshot_t *);
604 608 ssize_t scf_snapshot_get_name(const scf_snapshot_t *, char *, size_t);
605 609 int scf_snapshot_get_parent(const scf_snapshot_t *, scf_instance_t *);
606 610 int scf_instance_get_snapshot(const scf_instance_t *, const char *,
607 611 scf_snapshot_t *);
608 612 int scf_snapshot_update(scf_snapshot_t *);
609 613
610 614 scf_snaplevel_t *scf_snaplevel_create(scf_handle_t *);
611 615 scf_handle_t *scf_snaplevel_handle(const scf_snaplevel_t *);
612 616 void scf_snaplevel_destroy(scf_snaplevel_t *);
613 617 int scf_snaplevel_get_parent(const scf_snaplevel_t *, scf_snapshot_t *);
614 618 ssize_t scf_snaplevel_get_scope_name(const scf_snaplevel_t *, char *, size_t);
615 619 ssize_t scf_snaplevel_get_service_name(const scf_snaplevel_t *, char *, size_t);
616 620 ssize_t scf_snaplevel_get_instance_name(const scf_snaplevel_t *, char *,
617 621 size_t);
618 622 int scf_snaplevel_get_pg(const scf_snaplevel_t *, const char *,
619 623 scf_propertygroup_t *pg);
620 624 int scf_snapshot_get_base_snaplevel(const scf_snapshot_t *, scf_snaplevel_t *);
621 625 int scf_snaplevel_get_next_snaplevel(const scf_snaplevel_t *,
622 626 scf_snaplevel_t *);
623 627
624 628 scf_propertygroup_t *scf_pg_create(scf_handle_t *);
625 629 scf_handle_t *scf_pg_handle(const scf_propertygroup_t *);
626 630 void scf_pg_destroy(scf_propertygroup_t *);
627 631 ssize_t scf_pg_to_fmri(const scf_propertygroup_t *, char *, size_t);
628 632 ssize_t scf_pg_get_name(const scf_propertygroup_t *, char *, size_t);
629 633 ssize_t scf_pg_get_type(const scf_propertygroup_t *, char *, size_t);
630 634 int scf_pg_get_flags(const scf_propertygroup_t *, uint32_t *);
631 635 int scf_pg_get_parent_service(const scf_propertygroup_t *, scf_service_t *);
632 636 int scf_pg_get_parent_instance(const scf_propertygroup_t *, scf_instance_t *);
633 637 int scf_pg_get_parent_snaplevel(const scf_propertygroup_t *, scf_snaplevel_t *);
634 638 int scf_service_get_pg(const scf_service_t *, const char *,
635 639 scf_propertygroup_t *);
636 640 int scf_instance_get_pg(const scf_instance_t *, const char *,
637 641 scf_propertygroup_t *);
638 642 int scf_instance_get_pg_composed(const scf_instance_t *, const scf_snapshot_t *,
639 643 const char *, scf_propertygroup_t *);
640 644 int scf_service_add_pg(const scf_service_t *, const char *, const char *,
641 645 uint32_t, scf_propertygroup_t *);
642 646 int scf_instance_add_pg(const scf_instance_t *, const char *, const char *,
643 647 uint32_t, scf_propertygroup_t *);
644 648 int scf_pg_delete(scf_propertygroup_t *);
645 649
646 650 int scf_pg_get_underlying_pg(const scf_propertygroup_t *,
647 651 scf_propertygroup_t *);
648 652 int scf_instance_get_parent(const scf_instance_t *, scf_service_t *);
649 653
650 654 int scf_pg_update(scf_propertygroup_t *);
651 655
652 656 scf_property_t *scf_property_create(scf_handle_t *);
653 657 scf_handle_t *scf_property_handle(const scf_property_t *);
654 658 void scf_property_destroy(scf_property_t *);
655 659 int scf_property_is_type(const scf_property_t *, scf_type_t);
656 660 int scf_property_type(const scf_property_t *, scf_type_t *);
657 661 ssize_t scf_property_get_name(const scf_property_t *, char *, size_t);
658 662 int scf_property_get_value(const scf_property_t *, scf_value_t *);
659 663 ssize_t scf_property_to_fmri(const scf_property_t *, char *, size_t);
660 664 int scf_pg_get_property(const scf_propertygroup_t *, const char *,
661 665 scf_property_t *);
662 666
663 667 scf_transaction_t *scf_transaction_create(scf_handle_t *);
664 668 scf_handle_t *scf_transaction_handle(const scf_transaction_t *);
665 669 int scf_transaction_start(scf_transaction_t *, scf_propertygroup_t *);
666 670 void scf_transaction_destroy(scf_transaction_t *);
667 671 void scf_transaction_destroy_children(scf_transaction_t *);
668 672
669 673 void scf_transaction_reset(scf_transaction_t *);
670 674 void scf_transaction_reset_all(scf_transaction_t *);
671 675
672 676 int scf_transaction_commit(scf_transaction_t *);
673 677
674 678 scf_transaction_entry_t *scf_entry_create(scf_handle_t *);
675 679 scf_handle_t *scf_entry_handle(const scf_transaction_entry_t *);
676 680 void scf_entry_reset(scf_transaction_entry_t *);
677 681 void scf_entry_destroy(scf_transaction_entry_t *);
678 682 void scf_entry_destroy_children(scf_transaction_entry_t *);
679 683
680 684 int scf_transaction_property_change(scf_transaction_t *,
681 685 scf_transaction_entry_t *, const char *, scf_type_t);
682 686 int scf_transaction_property_delete(scf_transaction_t *,
683 687 scf_transaction_entry_t *, const char *);
684 688 int scf_transaction_property_new(scf_transaction_t *,
685 689 scf_transaction_entry_t *, const char *, scf_type_t);
686 690 int scf_transaction_property_change_type(scf_transaction_t *,
687 691 scf_transaction_entry_t *, const char *, scf_type_t);
688 692
689 693 int scf_entry_add_value(scf_transaction_entry_t *, scf_value_t *);
690 694
691 695 int scf_handle_decode_fmri(scf_handle_t *, const char *, scf_scope_t *,
692 696 scf_service_t *, scf_instance_t *, scf_propertygroup_t *, scf_property_t *,
693 697 int);
694 698 #define SCF_DECODE_FMRI_EXACT 0x00000001
695 699 #define SCF_DECODE_FMRI_TRUNCATE 0x00000002
696 700 #define SCF_DECODE_FMRI_REQUIRE_INSTANCE 0x00000004
697 701 #define SCF_DECODE_FMRI_REQUIRE_NO_INSTANCE 0x00000008
698 702
699 703 ssize_t scf_myname(scf_handle_t *, char *, size_t);
700 704
701 705 /*
702 706 * Property group template interfaces.
703 707 */
704 708 scf_pg_tmpl_t *scf_tmpl_pg_create(scf_handle_t *);
705 709 void scf_tmpl_pg_destroy(scf_pg_tmpl_t *);
706 710 void scf_tmpl_pg_reset(scf_pg_tmpl_t *);
707 711 int scf_tmpl_get_by_pg(scf_propertygroup_t *, scf_pg_tmpl_t *, int);
708 712 int scf_tmpl_get_by_pg_name(const char *, const char *,
709 713 const char *, const char *, scf_pg_tmpl_t *, int);
710 714 int scf_tmpl_iter_pgs(scf_pg_tmpl_t *, const char *, const char *,
711 715 const char *, int);
712 716 #define SCF_PG_TMPL_FLAG_REQUIRED 0x1
713 717 #define SCF_PG_TMPL_FLAG_EXACT 0x2
714 718 #define SCF_PG_TMPL_FLAG_CURRENT 0x4
715 719
716 720 ssize_t scf_tmpl_pg_name(const scf_pg_tmpl_t *, char **);
717 721 ssize_t scf_tmpl_pg_common_name(const scf_pg_tmpl_t *, const char *, char **);
718 722 ssize_t scf_tmpl_pg_description(const scf_pg_tmpl_t *, const char *, char **);
719 723 ssize_t scf_tmpl_pg_type(const scf_pg_tmpl_t *, char **);
720 724
721 725 ssize_t scf_tmpl_pg_target(const scf_pg_tmpl_t *, char **);
722 726 #define SCF_TM_TARGET_ALL ((const char *)"all")
723 727 #define SCF_TM_TARGET_DELEGATE ((const char *)"delegate")
724 728 #define SCF_TM_TARGET_INSTANCE ((const char *)"instance")
725 729 #define SCF_TM_TARGET_THIS ((const char *)"this")
726 730
727 731 int scf_tmpl_pg_required(const scf_pg_tmpl_t *, uint8_t *);
728 732
729 733 /*
730 734 * Property template interfaces.
731 735 */
732 736 scf_prop_tmpl_t *scf_tmpl_prop_create(scf_handle_t *);
733 737 void scf_tmpl_prop_destroy(scf_prop_tmpl_t *);
734 738 void scf_tmpl_prop_reset(scf_prop_tmpl_t *);
735 739 int scf_tmpl_get_by_prop(scf_pg_tmpl_t *, const char *,
736 740 scf_prop_tmpl_t *, int);
737 741 int scf_tmpl_iter_props(scf_pg_tmpl_t *, scf_prop_tmpl_t *, int);
738 742 #define SCF_PROP_TMPL_FLAG_REQUIRED 0x1
739 743
740 744 ssize_t scf_tmpl_prop_name(const scf_prop_tmpl_t *, char **);
741 745 int scf_tmpl_prop_type(const scf_prop_tmpl_t *, scf_type_t *);
742 746 int scf_tmpl_prop_required(const scf_prop_tmpl_t *, uint8_t *);
743 747 ssize_t scf_tmpl_prop_common_name(const scf_prop_tmpl_t *, const char *,
744 748 char **);
745 749 ssize_t scf_tmpl_prop_description(const scf_prop_tmpl_t *, const char *,
746 750 char **);
747 751 ssize_t scf_tmpl_prop_units(const scf_prop_tmpl_t *, const char *, char **);
748 752 int scf_tmpl_prop_cardinality(const scf_prop_tmpl_t *prop, uint64_t *,
749 753 uint64_t *);
750 754 int scf_tmpl_prop_internal_seps(const scf_prop_tmpl_t *, scf_values_t *);
751 755
752 756 int scf_tmpl_prop_visibility(const scf_prop_tmpl_t *, uint8_t *);
753 757 #define SCF_TMPL_VISIBILITY_HIDDEN 1
754 758 #define SCF_TMPL_VISIBILITY_READONLY 2
755 759 #define SCF_TMPL_VISIBILITY_READWRITE 3
756 760
757 761 const char *scf_tmpl_visibility_to_string(uint8_t);
758 762 #define SCF_TM_VISIBILITY_HIDDEN ((const char *)"hidden")
759 763 #define SCF_TM_VISIBILITY_READONLY ((const char *)"readonly")
760 764 #define SCF_TM_VISIBILITY_READWRITE ((const char *)"readwrite")
761 765
762 766 int scf_tmpl_value_name_constraints(const scf_prop_tmpl_t *prop,
763 767 scf_values_t *vals);
764 768 void scf_count_ranges_destroy(scf_count_ranges_t *);
765 769 void scf_int_ranges_destroy(scf_int_ranges_t *);
766 770 int scf_tmpl_value_count_range_constraints(const scf_prop_tmpl_t *,
767 771 scf_count_ranges_t *);
768 772 int scf_tmpl_value_int_range_constraints(const scf_prop_tmpl_t *,
769 773 scf_int_ranges_t *);
770 774 int scf_tmpl_value_count_range_choices(const scf_prop_tmpl_t *,
771 775 scf_count_ranges_t *);
772 776 int scf_tmpl_value_int_range_choices(const scf_prop_tmpl_t *,
773 777 scf_int_ranges_t *);
774 778 int scf_tmpl_value_name_choices(const scf_prop_tmpl_t *prop,
775 779 scf_values_t *vals);
776 780
777 781 void scf_values_destroy(scf_values_t *);
778 782
779 783 ssize_t scf_tmpl_value_common_name(const scf_prop_tmpl_t *, const char *,
780 784 const char *, char **);
781 785 ssize_t scf_tmpl_value_description(const scf_prop_tmpl_t *, const char *,
782 786 const char *, char **);
783 787
784 788 int scf_tmpl_value_in_constraint(const scf_prop_tmpl_t *pt, scf_value_t *value,
785 789 scf_tmpl_errors_t **errs);
786 790
787 791 /*
788 792 * Template validation interfaces
789 793 */
790 794 int scf_tmpl_validate_fmri(scf_handle_t *, const char *,
791 795 const char *, scf_tmpl_errors_t **, int);
792 796 #define SCF_TMPL_VALIDATE_FLAG_CURRENT 0x1
793 797
794 798 void scf_tmpl_errors_destroy(scf_tmpl_errors_t *errs);
795 799 scf_tmpl_error_t *scf_tmpl_next_error(scf_tmpl_errors_t *);
796 800 void scf_tmpl_reset_errors(scf_tmpl_errors_t *errs);
797 801 int scf_tmpl_strerror(scf_tmpl_error_t *err, char *s, size_t n, int flag);
798 802 int scf_tmpl_error_source_fmri(const scf_tmpl_error_t *, char **);
799 803 int scf_tmpl_error_type(const scf_tmpl_error_t *, scf_tmpl_error_type_t *);
800 804 int scf_tmpl_error_pg_tmpl(const scf_tmpl_error_t *, char **, char **);
801 805 int scf_tmpl_error_pg(const scf_tmpl_error_t *, char **, char **);
802 806 int scf_tmpl_error_prop_tmpl(const scf_tmpl_error_t *, char **, char **);
803 807 int scf_tmpl_error_prop(const scf_tmpl_error_t *, char **, char **);
804 808 int scf_tmpl_error_value(const scf_tmpl_error_t *, char **);
805 809
806 810 /*
807 811 * Simplified calls
808 812 */
809 813 int smf_enable_instance(const char *, int);
810 814 int smf_disable_instance(const char *, int);
811 815 int smf_refresh_instance(const char *);
812 816 int smf_restart_instance(const char *);
813 817 int smf_maintain_instance(const char *, int);
814 818 int smf_degrade_instance(const char *, int);
815 819 int smf_restore_instance(const char *);
816 820 char *smf_get_state(const char *);
817 821
818 822 int scf_simple_walk_instances(uint_t, void *,
819 823 int (*inst_callback)(scf_handle_t *, scf_instance_t *, void *));
820 824
821 825 scf_simple_prop_t *scf_simple_prop_get(scf_handle_t *, const char *,
822 826 const char *, const char *);
823 827 void scf_simple_prop_free(scf_simple_prop_t *);
824 828 scf_simple_app_props_t *scf_simple_app_props_get(scf_handle_t *, const char *);
825 829 void scf_simple_app_props_free(scf_simple_app_props_t *);
826 830 const scf_simple_prop_t *scf_simple_app_props_next(
827 831 const scf_simple_app_props_t *, scf_simple_prop_t *);
828 832 const scf_simple_prop_t *scf_simple_app_props_search(
829 833 const scf_simple_app_props_t *, const char *, const char *);
830 834 ssize_t scf_simple_prop_numvalues(const scf_simple_prop_t *);
831 835 scf_type_t scf_simple_prop_type(const scf_simple_prop_t *);
832 836 char *scf_simple_prop_name(const scf_simple_prop_t *);
833 837 char *scf_simple_prop_pgname(const scf_simple_prop_t *);
834 838 uint8_t *scf_simple_prop_next_boolean(scf_simple_prop_t *);
835 839 uint64_t *scf_simple_prop_next_count(scf_simple_prop_t *);
836 840 int64_t *scf_simple_prop_next_integer(scf_simple_prop_t *);
837 841 int64_t *scf_simple_prop_next_time(scf_simple_prop_t *, int32_t *);
838 842 char *scf_simple_prop_next_astring(scf_simple_prop_t *);
839 843 char *scf_simple_prop_next_ustring(scf_simple_prop_t *);
840 844 void *scf_simple_prop_next_opaque(scf_simple_prop_t *, size_t *);
841 845 void scf_simple_prop_next_reset(scf_simple_prop_t *);
842 846
843 847 /*
844 848 * smf_state_from_string()
845 849 * return SCF_STATE_* value for the input
846 850 * -1 on error. String "all" maps to SCF_STATE_ALL macro
847 851 */
848 852 int32_t smf_state_from_string(const char *);
849 853
850 854 /*
851 855 * smf_state_to_string()
852 856 * return SCF_STATE_STRING* value for the input
853 857 * NULL on error.
854 858 */
855 859 const char *smf_state_to_string(int32_t);
856 860
857 861 /*
858 862 * Notification interfaces
859 863 */
860 864 int smf_notify_set_params(const char *, nvlist_t *);
861 865 int smf_notify_get_params(nvlist_t **, nvlist_t *);
862 866 int smf_notify_del_params(const char *, const char *, int32_t);
863 867
864 868 /*
865 869 * SMF exit status definitions
866 870 *
867 871 * The SMF_EXIT_NODAEMON exit status should be used when a method does not
868 872 * need to run any persistent process. This indicates success, abandons the
869 873 * contract, and allows dependencies to be met.
870 874 */
871 875 #define SMF_EXIT_OK 0
872 876 #define SMF_EXIT_NODAEMON 94
873 877 #define SMF_EXIT_ERR_FATAL 95
874 878 #define SMF_EXIT_ERR_CONFIG 96
875 879 #define SMF_EXIT_MON_DEGRADE 97
876 880 #define SMF_EXIT_MON_OFFLINE 98
877 881 #define SMF_EXIT_ERR_NOSMF 99
878 882 #define SMF_EXIT_ERR_PERM 100
879 883
880 884 #ifdef __cplusplus
881 885 }
882 886 #endif
883 887
884 888 #endif /* _LIBSCF_H */
↓ open down ↓ |
387 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX