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