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