1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2013, Joyent, Inc. All rights reserved.
*/
#ifndef _LIBSCF_PRIV_H
#define _LIBSCF_PRIV_H
#include <libscf.h>
#include <unistd.h>
#if !defined(NATIVE_BUILD)
#include <sys/secflags.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* NOTE
*
* The contents of this file are private to the implementation of Solaris
* and are subject to change at any time without notice.
*/
#define SCF_PG_GENERAL_TYPE SCF_GROUP_FRAMEWORK
#define SCF_PG_GENERAL_FLAGS 0
#define SCF_PG_GENERAL_OVR_TYPE SCF_GROUP_FRAMEWORK
#define SCF_PG_GENERAL_OVR_FLAGS SCF_PG_FLAG_NONPERSISTENT
#define SCF_PG_DEATHROW_TYPE SCF_GROUP_FRAMEWORK
#define SCF_PG_DEATHROW_FLAGS SCF_PG_FLAG_NONPERSISTENT
#define SCF_PG_OPTIONS_TYPE SCF_GROUP_FRAMEWORK
#define SCF_PG_OPTIONS_FLAGS 0
#define SCF_PG_OPTIONS_OVR_TYPE SCF_GROUP_FRAMEWORK
#define SCF_PG_OPTIONS_OVR_FLAGS SCF_PG_FLAG_NONPERSISTENT
#define SCF_PG_RESTARTER_TYPE SCF_GROUP_FRAMEWORK
#define SCF_PG_RESTARTER_FLAGS SCF_PG_FLAG_NONPERSISTENT
#define SCF_PG_RESTARTER_ACTIONS_TYPE SCF_GROUP_FRAMEWORK
#define SCF_PG_RESTARTER_ACTIONS_FLAGS SCF_PG_FLAG_NONPERSISTENT
#define SCF_PROPERTY_CLEAR ((const char *)"maint_off")
#define SCF_PROPERTY_MAINTENANCE ((const char *)"maint_on")
#define SCF_PROPERTY_LOGFILE ((const char *)"logfile")
#define SCF_PROPERTY_ALT_LOGFILE ((const char *)"alt_logfile")
#define SCF_LEGACY_SERVICE ((const char *)"smf/legacy_run")
#define SCF_LEGACY_PROPERTY_NAME ((const char *)"name")
#define SCF_LEGACY_PROPERTY_INODE ((const char *)"inode")
#define SCF_LEGACY_PROPERTY_SUFFIX ((const char *)"suffix")
#define SCF_FMRI_TYPE_SVC 0x1
#define SCF_FMRI_TYPE_FILE 0x2
/*
* Strings for use in constructing FMRIs
*/
#define SCF_FMRI_SVC_PREFIX "svc:"
#define SCF_FMRI_FILE_PREFIX "file:"
#define SCF_FMRI_SCOPE_PREFIX "//"
#define SCF_FMRI_LOCAL_SCOPE "localhost"
#define SCF_FMRI_SCOPE_SUFFIX "@localhost"
#define SCF_FMRI_SERVICE_PREFIX "/"
#define SCF_FMRI_INSTANCE_PREFIX ":"
#define SCF_FMRI_PROPERTYGRP_PREFIX "/:properties/"
#define SCF_FMRI_PROPERTY_PREFIX "/"
#define SCF_FMRI_LEGACY_PREFIX "lrc:"
/*
* sulogin Service FMRI
*/
#define SVC_SULOGIN_FMRI ((const char *)"svc:/system/sulogin")
typedef struct scf_decoration_info {
const char *sdi_name;
scf_type_t sdi_type;
scf_value_t *sdi_value; /* can be SCF_DECORATE_CLEAR */
} scf_decoration_info_t;
typedef int (*scf_decoration_func)(const scf_decoration_info_t *, void *);
/*
* calls a callback function for each decoration on the handle. If the
* callback returns 0, the iteration stops and returns 0. If the callback
* returns a non-zero value, the iteration continues. After full completion,
* 1 is returned. On error, -1 is returned.
*/
int _scf_handle_decorations(scf_handle_t *, scf_decoration_func *,
scf_value_t *, void *);
/*
* wait for a change to the propertygroup -- may return early.
* For now, only one of these can be outstanding at a time.
*
* The second argument is how long, in seconds, to wait for a response.
*
* Returns SCF_COMPLETE on timeout, -1 on error, and SCF_SUCCESS in every
* other case. You must call scf_pg_update() to see if the object has
* actually changed.
*/
int _scf_pg_wait(scf_propertygroup_t *, int);
/*
* set up notifications for changes to a class of property groups (by name
* and type)
*
* Only one thread can be sleeping in _scf_notify_wait() -- others will
* fail. Deletions give an fmri in the output path.
*
* These do not survive unbind()->bind() -- in fact, that is currently the
* only way to clear them.
*/
int _scf_notify_add_pgname(scf_handle_t *, const char *);
int _scf_notify_add_pgtype(scf_handle_t *, const char *);
int _scf_notify_wait(scf_propertygroup_t *, char *, size_t);
/*
* Internal interfaces for snapshot creation:
* _scf_snapshot_take_new(), _scf_snapshot_take_new_named(), and
* _scf_snapshot_take_attach() create a set of snaplevels
* containing frozen versions of both the instance's property groups and
* its parent service's property groups. _scf_snapshot_take_new() and
* _scf_snapshot_take_new_named() create a new snapshot to which the
* new snaplevels are attached, while _scf_snapshot_take_attach()
* attaches the new snaplevels to a pre-existing snapshot.
*
* _scf_snapshot_take_new_named() records the passed in names into the
* snaplevel instead of the instance and service name. This creates
* an inconsistency, which should be resolved by using
* _scf_snapshot_attach() to attach the new snaplevels to a snapshot
* underneath the appropriate instance. The first snapshot can
* then be deleted.
*
* _scf_snapshot_attach(snap1, snap2) points snap2 at the snaplevels
* pointed to by snap1. After a call to either
* _scf_snapshot_take_attach(snap1, snap2) or
* _scf_snapshot_attach(inst, snap), scf_snapshot_update() will be
* required for any open references to snap or snap2 to see the new
* snaplevels.
*
* _scf_snapshot_delete() deletes the snapshot object. While
* snaplevels, being only loosely connected to snapshots, stay
* around until they are no longer referenced, any references *through
* this snapshot object* will be invalidated.
*
* _scf_snapshot_take_new() can fail with at least _HANDLE_MISMATCH,
* _CONNECTION_BROKEN, _INVALID_ARGUMENT, _NO_RESOURCES, _PERMISSION_DENIED,
* _NOT_SET, _EXISTS.
*
* _scf_snapshot_take_new_named() can fail with at least _HANDLE_MISMATCH,
* _CONNECTION_BROKEN, _INVALID_ARGUMENT, _NO_RESOURCES, _PERMISSION_DENIED,
* _NOT_SET, _EXISTS.
*
* _scf_snapshot_take_attach() can fail with _CONNECTION_BROKEN, _NOT_SET,
* _PERMISSION_DENIED, _NO_RESOURCES, _INVALID_ARGUMENT.
*
* _scf_snapshot_attach() can fail with _HANDLE_MISMATCH, _CONNECTION_BROKEN,
* _NOT_SET, _NO_RESOURCES, _PERMISSION_DENIED.
*/
int _scf_snapshot_take_new(scf_instance_t *, const char *, scf_snapshot_t *);
int _scf_snapshot_take_new_named(scf_instance_t *,
const char *, const char *, const char *, scf_snapshot_t *);
int _scf_snapshot_take_attach(scf_instance_t *, scf_snapshot_t *);
int _scf_snapshot_attach(scf_snapshot_t *, scf_snapshot_t *);
int _scf_snapshot_delete(scf_snapshot_t *);
/*
* Destructively portions up the first argument into the different portions
* of a svc: fmri, and returns pointers to the applicable portions. Omitted
* portions are set to NULL, except for the scope, which is set to the
* default local scope if not specified.
*
* Parsing is attempted in the order of: svc:, file:. The identified type
* of the service is returned in the second argument and may take a value
* of: SCF_FMRI_TYPE_SVC or SCF_FMRI_TYPE_FILE.
*
* Note that some of the returned pointers (in particular the scope) may not
* point into the passed buffer.
*/
int scf_parse_fmri(char *, int *, const char **, const char **, const char **,
const char **, const char **);
int scf_parse_svc_fmri(char *, const char **, const char **, const char **,
const char **, const char **);
int scf_parse_file_fmri(char *fmri, const char **scope, const char **path);
ssize_t scf_canonify_fmri(const char *, char *, size_t);
int _smf_refresh_instance_i(scf_instance_t *);
typedef struct scf_simple_handle {
scf_handle_t *h;
scf_snapshot_t *snap;
scf_instance_t *inst;
scf_propertygroup_t *running_pg;
scf_propertygroup_t *editing_pg;
} scf_simple_handle_t;
void scf_simple_handle_destroy(scf_simple_handle_t *);
scf_simple_handle_t *scf_general_pg_setup(const char *, const char *);
scf_transaction_t *scf_transaction_setup(scf_simple_handle_t *);
int scf_transaction_restart(scf_simple_handle_t *, scf_transaction_t *);
int scf_read_count_property(scf_simple_handle_t *, char *, uint64_t *);
int scf_set_count_property(scf_transaction_t *, char *, uint64_t, boolean_t);
/*
* Walks all the instances matching a given fmri list. Each fmri in the array
* can be one of the following:
*
* - Full instance name
* - Full service name
* - Full property group or property name
* - Partial service or instance name
* - A globbed pattern
*
* The matching rules for partial fmris are a slightly more complex. We allow
* for any substring anchored at the end of the instance or service name,
* provided it begins with a complete element in the fmri. For example, given
* the fmri "svc:/system/filesystem/local:default", any of the following would
* be acceptable matches: 'default', 'local', 'local:default',
* 'filesystem/local'. The following would not be acceptable:
* 'system/filesystem', 'filesystem/loc', 'system/local'. Possible flag values:
*
* SCF_WALK_MULTIPLE Allow individual arguments to correspond to
* multiple instances.
*
* SCF_WALK_LEGACY Walk legacy services (indicated by a non-NULL
* propery group).
*
* SCF_WALK_SERVICE If the user specifies a service, pass the
* service to the callback without iterating over
* its instances.
*
* SCF_WALK_PROPERTY Allow FMRIs which match property groups or
* individual properties. Incompatible with
* SCF_WALK_LEGACY.
*
* SCF_WALK_NOINSTANCE Walk only services. Must be used in
* conjunction with SCF_WALK_SERVICE.
*
* SCF_WALK_EXPLICIT Walk only services if the match is exact
* else return instances. Must be used in
* conjunction with SCF_WALK_SERVICE.
*
* SCF_WALK_UNIPARTIAL Can be combined with SCF_WALK_MULTIPLE
* so that an error is returned if a partial
* fmri matches multiple instances, unless
* a wildcard match is also used.
*
* If no arguments are given, then all instances in the service graph are
* walked.
*
* The second to last parameter is set to UU_EXIT_FATAL if one of the arguments
* is an invalid FMRI or matches multiple FMRIs when SCF_WALK_MULTIPLE is not
* set.
*
* The last parameter is a user-supplied error function that is called when
* reporting invalid arguments.
*/
#define SCF_WALK_MULTIPLE 0x01
#define SCF_WALK_LEGACY 0x02
#define SCF_WALK_SERVICE 0x04
#define SCF_WALK_PROPERTY 0x08
#define SCF_WALK_NOINSTANCE 0x10
#define SCF_WALK_EXPLICIT 0x20
#define SCF_WALK_UNIPARTIAL 0x40
/*
* The default locations of the repository dbs
*/
#define REPOSITORY_DB "/etc/svc/repository.db"
#define NONPERSIST_DB "/etc/svc/volatile/svc_nonpersist.db"
#define FAST_REPOSITORY_DB "/etc/svc/volatile/fast_repository.db"
#define REPOSITORY_CHECKPOINT "/etc/svc/volatile/checkpoint_repository.db"
typedef struct scf_walkinfo {
const char *fmri;
scf_scope_t *scope;
scf_service_t *svc;
scf_instance_t *inst;
scf_propertygroup_t *pg;
scf_property_t *prop;
int count; /* svcprop special */
} scf_walkinfo_t;
typedef int (*scf_walk_callback)(void *, scf_walkinfo_t *);
scf_error_t scf_walk_fmri(scf_handle_t *, int, char **, int,
scf_walk_callback, void *, int *, void (*)(const char *, ...));
/*
* Requests a backup of the repository with a particular name, which
* can be any alphabetic string. Only privileged users can do this.
*
* Can fail with:
* _NOT_BOUND, _CONNECTION_BROKEN, _PERMISSION_DENIED, _INVALID_ARGUMENT,
* _INTERNAL (path too long, or the backup failed for an odd reason),
* _BACKEND_READONLY (filesystem is still read-only)
*/
int _scf_request_backup(scf_handle_t *, const char *);
/*
* Repository switch client
*/
int _scf_repository_switch(scf_handle_t *, int);
/*
* Determines whether a property group requires authorization to read; this
* does not in any way reflect whether the caller has that authorization.
* To determine that, the caller must attempt to read the value of one of the
* group's properties.
*
* Can fail with:
* _NOT_BOUND, _CONNECTION_BROKEN, _INVALID_ARGUMENT, _INTERNAL,
* _NO_RESOURCES, _CONSTRAINT_VIOLATED, _DELETED.
*/
int _scf_pg_is_read_protected(const scf_propertygroup_t *, boolean_t *);
/*
* Sets annotation data for SMF audit logging. Once this function has been
* set, the next audit record will be preceded by an ADT_smf_annotation
* with the information provided in this function. This function is used
* to mark operations which comprise multiple primitive operations such as
* svccfg import.
*/
int _scf_set_annotation(scf_handle_t *h, const char *operation,
const char *file);
/*
* scf_pattern_t
*/
typedef struct scf_pattern {
enum {
PATTERN_INVALID, /* Uninitialized state */
PATTERN_EXACT,
PATTERN_GLOB,
PATTERN_PARTIAL
} sp_type;
char *sp_arg; /* Original argument */
struct scf_match *sp_matches; /* List of matches */
int sp_matchcount; /* # of matches */
} scf_pattern_t;
int scf_cmp_pattern(char *, scf_pattern_t *);
int gen_filenms_from_fmri(const char *, const char *, char *, char *);
/*
* Interfaces for bulk access to SMF-stored configuration.
*
* Each scf_propvec_t represents a single property to be read (with
* scf_read_propvec) or written (with scf_write_propvec).
*
* The fields of a scf_propvec_t have the following meanings:
*
* pv_prop - the name of the property
* pv_desc - a description string (optional; to be consumed by the caller)
* pv_type - the type of the property
* pv_ptr - where to store the data read, or a pointer to the data to
* be written
* pv_aux - additional data influencing the interpretation of pv_ptr
*
* The meaning of pv_ptr and pv_aux depends on the type of property. For:
*
* boolean - if pv_aux is 0, pv_ptr is a pointer to a boolean_t
* if pv_aux is non-0, pv_ptr is a pointer to a uint64_t,
* where pv_aux indicates the bit holding the truth value.
* count - pv_ptr is a pointer to a uint64_t; pv_aux is unused
* integer - pv_ptr is a pointer to an int64_t; pv_aux is unused
* time - pv_ptr is a pointer to an scf_time_t; pv_aux is unused
* opaque - pv_ptr is a pointer to an scf_opaque_t; pv_aux is unused
* strings - (scf_read_propvec) pv_ptr is a pointer to a char *
* (scf_write_propvec) pv_ptr is a pointer to an array of char
* (both) pv_aux is unused
*/
typedef struct {
void *so_addr;
size_t so_size;
} scf_opaque_t;
typedef struct {
const char *pv_prop;
const char *pv_desc;
scf_type_t pv_type;
void *pv_ptr;
uint64_t pv_aux;
} scf_propvec_t;
void scf_clean_propvec(scf_propvec_t *);
int scf_read_propvec(const char *, const char *, boolean_t, scf_propvec_t *,
scf_propvec_t **);
int scf_write_propvec(const char *, const char *, scf_propvec_t *,
scf_propvec_t **);
scf_tmpl_errors_t *_scf_create_errors(const char *, int);
int _scf_tmpl_add_error(scf_tmpl_errors_t *errs, scf_tmpl_error_type_t type,
const char *pg_name, const char *prop_name,
const char *ev1, const char *ev2, const char *actual,
const char *tmpl_fmri, const char *tmpl_pg_name, const char *tmpl_pg_type,
const char *tmpl_prop_name, const char *tmpl_prop_type);
int _scf_tmpl_error_set_prefix(scf_tmpl_errors_t *, const char *);
/*
* Templates definitions
*/
/*
* For CARDINALITY_VIOLATION and RANGE_VIOLATION, te_ev1 holds
* the min value and te_ev2 holds the max value
*
* For MISSING_PG te_ev1 should hold the expected pg_name and
* expected2 holds the expected pg_type.
*
* For SCF_TERR_PG_PATTERN_CONFLICT and SCF_TERR_GENERAL_REDEFINE te_ev1 is
* the FMRI holding the conflicting pg_pattern. te_ev2 is the name of the
* conflicting pg_pattern, and actual is the type of the conflicting
* pg_pattern.
*
* SCF_TERR_PROP_PATTERN_CONFLICT te_ev1 is the FMRI holding the
* conflicting prop_pattern. te_ev2 is the name of the conflicting
* prop_pattern, and actual is the type of the conflicting prop_pattern.
*
* For SCF_TERR_INCLUDE_VALUES te_ev1 is the type specified for the
* include_values element.
*
* For all other errors, te_ev1 should hold the expected value and
* te_ev2 is ignored
*
* te_actual holds the current value of the property
*/
struct scf_tmpl_error {
scf_tmpl_errors_t *te_errs;
scf_tmpl_error_type_t te_type;
const char *te_pg_name;
const char *te_prop_name;
const char *te_ev1;
const char *te_ev2;
const char *te_actual;
const char *te_tmpl_fmri;
const char *te_tmpl_pg_name;
const char *te_tmpl_pg_type;
const char *te_tmpl_prop_name;
const char *te_tmpl_prop_type;
};
/*
* The pg_pattern element has two optional attributes that play a part in
* selecting the appropriate prefix for the name of the pg_pattern property
* group. The two attributes are name and type. The appropriate prefix
* encodes the presence are absence of these attributes.
*
* SCF_PG_TM_PG_PATTERN_PREFIX neither attribute
* SCF_PG_TM_PG_PATTERN_N_PREFIX name only
* SCF_PG_TM_PG_PATTERN_T_PREFIX type only
* SCF_PG_TM_PG_PATTERN_NT_PREFIX both name and type
*/
#define SCF_PG_TM_PG_PAT_BASE "tm_pgpat"
#define SCF_PG_TM_PG_PATTERN_PREFIX ((const char *)SCF_PG_TM_PG_PAT_BASE \
"_")
#define SCF_PG_TM_PG_PATTERN_N_PREFIX ((const char *)SCF_PG_TM_PG_PAT_BASE \
"n_")
#define SCF_PG_TM_PG_PATTERN_T_PREFIX ((const char *)SCF_PG_TM_PG_PAT_BASE \
"t_")
#define SCF_PG_TM_PG_PATTERN_NT_PREFIX ((const char *)SCF_PG_TM_PG_PAT_BASE \
"nt_")
#define SCF_PG_TM_PROP_PATTERN_PREFIX ((const char *)"tm_proppat_")
/*
* Pad character to use when encoding strings for property names.
*/
#define SCF_ENCODE32_PAD ('-')
/*
* Functions for base 32 encoding/decoding
*/
int scf_decode32(const char *, size_t, char *, size_t, size_t *, char);
int scf_encode32(const char *, size_t, char *, size_t, size_t *, char);
/*
* handy functions
*/
/*
* _scf_sanitize_locale
* Make sure a locale string has only alpha-numeric or '_' characters
*/
void _scf_sanitize_locale(char *);
/*
* _scf_read_tmpl_prop_type_as_string()
* Handy function to get template property type as a string
*/
char *_scf_read_tmpl_prop_type_as_string(const scf_prop_tmpl_t *);
/*
* _scf_read_single_astring_from_pg()
* Given a property group (pg) and a property name (pn), this function
* retrives an astring value from pg/pn.
*/
char *_scf_read_single_astring_from_pg(scf_propertygroup_t *, const char *);
/*
* scf_instance_delete_prop()
* Given instance, property group, and property, delete the property.
*/
int
scf_instance_delete_prop(scf_instance_t *, const char *, const char *);
/*
* Functions to extract boot config information from FMRI_BOOT_CONFIG
*/
void scf_get_boot_config(uint8_t *);
void scf_get_boot_config_ovr(uint8_t *);
int scf_is_fastboot_default(void);
/*
* Set value of "config_ovr/fastreboot_default".
*/
int scf_fastreboot_default_set_transient(boolean_t);
/*
* scf_is_compatible_type()
* Return true if the second type is the same type, or a subtype of the
* first.
*/
int scf_is_compatible_type(scf_type_t, scf_type_t);
/*
* Check an array of services and enable any that don't have the
* "application/auto_enable" property set to "false", which is
* the interface to turn off this behaviour (see PSARC 2004/739).
*/
void _check_services(char **);
/*
* _scf_handle_create_and_bind()
* convenience function that creates and binds a handle
*/
scf_handle_t *_scf_handle_create_and_bind(scf_version_t);
/*
* _smf_refresh_all_instances()
* refresh all intances of a service
* return SCF_SUCCESS or SCF_FAILED on _PERMISSION_DENIED, _BACKEND_ACCESS
* or _BACKEND_READONLY.
*/
int _smf_refresh_all_instances(scf_service_t *);
/*
* _scf_get_fma_notify_params()
* Specialized fuction to get fma notifitation parameters
*/
int _scf_get_fma_notify_params(const char *, nvlist_t *, int);
/*
* _scf_get_svc_notify_params()
* Specialized function to get SMF state transition notification parameters
*/
int _scf_get_svc_notify_params(const char *, nvlist_t *, int32_t, int, int);
/*
* _scf_notify_get_params()
* Specialized function to get notification parametes from a pg into an
* nvlist_t
*/
int _scf_notify_get_params(scf_propertygroup_t *, nvlist_t *);
#if !defined(NATIVE_BUILD)
int scf_default_secflags(scf_handle_t *, scf_secflags_t *);
#endif
#define SCF_NOTIFY_PARAMS_SOURCE_NAME ((const char *)"preference_source")
#ifdef __cplusplus
}
#endif
#endif /* _LIBSCF_PRIV_H */
|