17c478bdstevel@tonic-gate/*
27c478bdstevel@tonic-gate * CDDL HEADER START
37c478bdstevel@tonic-gate *
47c478bdstevel@tonic-gate * The contents of this file are subject to the terms of the
570cbfe4Philippe Jung * Common Development and Distribution License (the "License").
670cbfe4Philippe Jung * You may not use this file except in compliance with the License.
77c478bdstevel@tonic-gate *
87c478bdstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bdstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
107c478bdstevel@tonic-gate * See the License for the specific language governing permissions
117c478bdstevel@tonic-gate * and limitations under the License.
127c478bdstevel@tonic-gate *
137c478bdstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
147c478bdstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bdstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
167c478bdstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
177c478bdstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bdstevel@tonic-gate *
197c478bdstevel@tonic-gate * CDDL HEADER END
207c478bdstevel@tonic-gate */
211f6eb02Liane Praza
227c478bdstevel@tonic-gate/*
23b56bf88Antonello Cruz * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
243db3a6bAndrew Stormont * Copyright 2016 RackTop Systems.
25f18d878Jerry Jelinek * Copyright (c) 2012, Joyent, Inc. All rights reserved.
267c478bdstevel@tonic-gate */
277c478bdstevel@tonic-gate
287c478bdstevel@tonic-gate#ifndef	_LIBSCF_H
297c478bdstevel@tonic-gate#define	_LIBSCF_H
307c478bdstevel@tonic-gate
317c478bdstevel@tonic-gate
327c478bdstevel@tonic-gate#include <stddef.h>
33f6e214cGavin Maltby#include <libnvpair.h>
347c478bdstevel@tonic-gate
35d2a7078Richard Lowe#ifndef NATIVE_BUILD
36d2a7078Richard Lowe#include <sys/secflags.h>
37d2a7078Richard Lowe#endif	/* NATIVE_BUILD */
38d2a7078Richard Lowe#include <sys/types.h>
39d2a7078Richard Lowe
407c478bdstevel@tonic-gate#ifdef	__cplusplus
417c478bdstevel@tonic-gateextern "C" {
427c478bdstevel@tonic-gate#endif
437c478bdstevel@tonic-gate
443db3a6bAndrew Stormonttypedef unsigned long scf_version_t;
453db3a6bAndrew Stormont#define	SCF_VERSION		1UL
467c478bdstevel@tonic-gate
477c478bdstevel@tonic-gate/*
487c478bdstevel@tonic-gate * Opaque structures
497c478bdstevel@tonic-gate */
507c478bdstevel@tonic-gatetypedef struct scf_handle scf_handle_t;
517c478bdstevel@tonic-gatetypedef struct scf_scope scf_scope_t;
527c478bdstevel@tonic-gatetypedef struct scf_service scf_service_t;
537c478bdstevel@tonic-gatetypedef struct scf_instance scf_instance_t;
547c478bdstevel@tonic-gatetypedef struct scf_propertygroup scf_propertygroup_t;
557c478bdstevel@tonic-gatetypedef struct scf_property scf_property_t;
567c478bdstevel@tonic-gate
577c478bdstevel@tonic-gatetypedef struct scf_snapshot scf_snapshot_t;
587c478bdstevel@tonic-gatetypedef struct scf_snaplevel scf_snaplevel_t;
597c478bdstevel@tonic-gate
607c478bdstevel@tonic-gatetypedef struct scf_transaction scf_transaction_t;
617c478bdstevel@tonic-gatetypedef struct scf_transaction_entry scf_transaction_entry_t;
627c478bdstevel@tonic-gatetypedef struct scf_value scf_value_t;
637c478bdstevel@tonic-gate
647c478bdstevel@tonic-gatetypedef struct scf_iter scf_iter_t;
657c478bdstevel@tonic-gate
661f6eb02Liane Prazatypedef struct scf_pg_tmpl scf_pg_tmpl_t;
671f6eb02Liane Prazatypedef struct scf_prop_tmpl scf_prop_tmpl_t;
681f6eb02Liane Prazatypedef struct scf_tmpl_errors scf_tmpl_errors_t;
691f6eb02Liane Praza
707c478bdstevel@tonic-gatetypedef struct scf_simple_app_props scf_simple_app_props_t;
717c478bdstevel@tonic-gatetypedef struct scf_simple_prop scf_simple_prop_t;
727c478bdstevel@tonic-gate
737c478bdstevel@tonic-gate/*
747c478bdstevel@tonic-gate * Types
757c478bdstevel@tonic-gate */
767c478bdstevel@tonic-gatetypedef enum {
777c478bdstevel@tonic-gate	SCF_TYPE_INVALID = 0,
787c478bdstevel@tonic-gate
797c478bdstevel@tonic-gate	SCF_TYPE_BOOLEAN,
807c478bdstevel@tonic-gate	SCF_TYPE_COUNT,
817c478bdstevel@tonic-gate	SCF_TYPE_INTEGER,
827c478bdstevel@tonic-gate	SCF_TYPE_TIME,
837c478bdstevel@tonic-gate	SCF_TYPE_ASTRING,
847c478bdstevel@tonic-gate	SCF_TYPE_OPAQUE,
857c478bdstevel@tonic-gate
867c478bdstevel@tonic-gate	SCF_TYPE_USTRING = 100,
877c478bdstevel@tonic-gate
887c478bdstevel@tonic-gate	SCF_TYPE_URI = 200,
897c478bdstevel@tonic-gate	SCF_TYPE_FMRI,
907c478bdstevel@tonic-gate
917c478bdstevel@tonic-gate	SCF_TYPE_HOST = 300,
927c478bdstevel@tonic-gate	SCF_TYPE_HOSTNAME,
937c478bdstevel@tonic-gate	SCF_TYPE_NET_ADDR_V4,
94b56bf88Antonello Cruz	SCF_TYPE_NET_ADDR_V6,
95b56bf88Antonello Cruz	SCF_TYPE_NET_ADDR
967c478bdstevel@tonic-gate} scf_type_t;
977c478bdstevel@tonic-gate
984f5c6faAndrew Stormont/*
994f5c6faAndrew Stormont * Values returned by scf_type_to_string
1004f5c6faAndrew Stormont */
1014f5c6faAndrew Stormont#define	SCF_TYPE_STRING_BOOLEAN		"boolean"
1024f5c6faAndrew Stormont#define	SCF_TYPE_STRING_COUNT		"count"
1034f5c6faAndrew Stormont#define	SCF_TYPE_STRING_INTEGER		"integer"
1044f5c6faAndrew Stormont#define	SCF_TYPE_STRING_TIME		"time"
1054f5c6faAndrew Stormont#define	SCF_TYPE_STRING_ASTRING		"astring"
1064f5c6faAndrew Stormont#define	SCF_TYPE_STRING_OPAQUE		"opaque"
1074f5c6faAndrew Stormont#define	SCF_TYPE_STRING_USTRING		"ustring"
1084f5c6faAndrew Stormont#define	SCF_TYPE_STRING_URI		"uri"
1094f5c6faAndrew Stormont#define	SCF_TYPE_STRING_FMRI		"fmri"
1104f5c6faAndrew Stormont#define	SCF_TYPE_STRING_HOST		"host"
1114f5c6faAndrew Stormont#define	SCF_TYPE_STRING_HOSTNAME	"hostname"
1124f5c6faAndrew Stormont#define	SCF_TYPE_STRING_NET_ADDR	"net_address"
1134f5c6faAndrew Stormont#define	SCF_TYPE_STRING_NET_ADDR_V4	"net_address_v4"
1144f5c6faAndrew Stormont#define	SCF_TYPE_STRING_NET_ADDR_V6	"net_address_v6"
1154f5c6faAndrew Stormont
1161f6eb02Liane Prazatypedef struct scf_time {
1171f6eb02Liane Praza	int64_t		t_seconds;
1181f6eb02Liane Praza	int32_t		t_ns;
1191f6eb02Liane Praza} scf_time_t;
1201f6eb02Liane Praza
1211f6eb02Liane Praza/*
1221f6eb02Liane Praza * There is no explicit initializer for this structure.  Functions
1231f6eb02Liane Praza * which set or populate this structure assume that it is either
1241f6eb02Liane Praza * uninitialized or destroyed.
1251f6eb02Liane Praza */
1261f6eb02Liane Prazatypedef struct scf_values {
1271f6eb02Liane Praza	scf_type_t		value_type;
1281f6eb02Liane Praza	void			*reserved;	/* reserved for future use */
1291f6eb02Liane Praza	int			value_count;
1301f6eb02Liane Praza	char			**values_as_strings;
1311f6eb02Liane Praza	union {
1321f6eb02Liane Praza		uint64_t	*v_count;
1331f6eb02Liane Praza		uint8_t		*v_boolean;
1341f6eb02Liane Praza		int64_t		*v_integer;
1351f6eb02Liane Praza		char		**v_astring;
1361f6eb02Liane Praza		char		**v_ustring;
1371f6eb02Liane Praza		char		**v_opaque;
1381f6eb02Liane Praza		scf_time_t	*v_time;
1391f6eb02Liane Praza	} values;
1401f6eb02Liane Praza} scf_values_t;
1411f6eb02Liane Praza
1421f6eb02Liane Prazatypedef struct scf_count_ranges {
1431f6eb02Liane Praza	int		scr_num_ranges;
1441f6eb02Liane Praza	uint64_t	*scr_min;
1451f6eb02Liane Praza	uint64_t	*scr_max;
1461f6eb02Liane Praza} scf_count_ranges_t;
1471f6eb02Liane Praza
1481f6eb02Liane Prazatypedef struct scf_int_ranges {
1491f6eb02Liane Praza	int		sir_num_ranges;
1501f6eb02Liane Praza	int64_t		*sir_min;
1511f6eb02Liane Praza	int64_t		*sir_max;
1521f6eb02Liane Praza} scf_int_ranges_t;
1531f6eb02Liane Praza
1547c478bdstevel@tonic-gate/*
1557c478bdstevel@tonic-gate * Return codes
1567c478bdstevel@tonic-gate */
1577c478bdstevel@tonic-gate#define	SCF_SUCCESS			0
1587c478bdstevel@tonic-gate#define	SCF_COMPLETE			1
1597c478bdstevel@tonic-gate#define	SCF_FAILED			-1
1607c478bdstevel@tonic-gate
1617c478bdstevel@tonic-gatetypedef enum scf_error {
1627c478bdstevel@tonic-gate	SCF_ERROR_NONE = 1000,		/* no error */
1637c478bdstevel@tonic-gate	SCF_ERROR_NOT_BOUND,		/* handle not bound */
1647c478bdstevel@tonic-gate	SCF_ERROR_NOT_SET,		/* cannot use unset argument */
1657c478bdstevel@tonic-gate	SCF_ERROR_NOT_FOUND,		/* nothing of that name found */
1667c478bdstevel@tonic-gate	SCF_ERROR_TYPE_MISMATCH,	/* type does not match value */
1677c478bdstevel@tonic-gate	SCF_ERROR_IN_USE,		/* cannot modify while in-use */
1687c478bdstevel@tonic-gate	SCF_ERROR_CONNECTION_BROKEN,	/* repository connection gone */
1697c478bdstevel@tonic-gate	SCF_ERROR_INVALID_ARGUMENT,	/* bad argument */
1707c478bdstevel@tonic-gate	SCF_ERROR_NO_MEMORY,		/* no memory available */
1717c478bdstevel@tonic-gate	SCF_ERROR_CONSTRAINT_VIOLATED,	/* required constraint not met */
1727c478bdstevel@tonic-gate	SCF_ERROR_EXISTS,		/* object already exists */
1737c478bdstevel@tonic-gate	SCF_ERROR_NO_SERVER,		/* repository server unavailable */
1747c478bdstevel@tonic-gate	SCF_ERROR_NO_RESOURCES,		/* server has insufficient resources */
1757c478bdstevel@tonic-gate	SCF_ERROR_PERMISSION_DENIED,	/* insufficient privileges for action */
1767c478bdstevel@tonic-gate	SCF_ERROR_BACKEND_ACCESS,	/* backend refused access */
1777c478bdstevel@tonic-gate	SCF_ERROR_HANDLE_MISMATCH,	/* mismatched SCF handles */
1787c478bdstevel@tonic-gate	SCF_ERROR_HANDLE_DESTROYED,	/* object bound to destroyed handle */
1797c478bdstevel@tonic-gate	SCF_ERROR_VERSION_MISMATCH,	/* incompatible SCF version */
1807c478bdstevel@tonic-gate	SCF_ERROR_BACKEND_READONLY,	/* backend is read-only */
1817c478bdstevel@tonic-gate	SCF_ERROR_DELETED,		/* object has been deleted */
1821f6eb02Liane Praza	SCF_ERROR_TEMPLATE_INVALID,	/* template data is invalid */
1837c478bdstevel@tonic-gate
1847c478bdstevel@tonic-gate	SCF_ERROR_CALLBACK_FAILED = 1080, /* user callback function failed */
1857c478bdstevel@tonic-gate
1867c478bdstevel@tonic-gate	SCF_ERROR_INTERNAL = 1101	/* internal error */
1877c478bdstevel@tonic-gate} scf_error_t;
1887c478bdstevel@tonic-gate
1897c478bdstevel@tonic-gate/*
1901f6eb02Liane Praza * This enum MUST be kept in sync with
1911f6eb02Liane Praza * struct _scf_tmpl_error_desc em_desc() in scf_tmpl.c
1921f6eb02Liane Praza */
1931f6eb02Liane Prazatypedef enum scf_tmpl_error_type {
1941f6eb02Liane Praza	SCF_TERR_MISSING_PG,		/* property group missing */
1951f6eb02Liane Praza	SCF_TERR_WRONG_PG_TYPE,		/* property group type incorrect */
1961f6eb02Liane Praza	SCF_TERR_MISSING_PROP,		/* missing required property */
1971f6eb02Liane Praza	SCF_TERR_WRONG_PROP_TYPE,	/* property type incorrect */
1981f6eb02Liane Praza	SCF_TERR_CARDINALITY_VIOLATION,	/* wrong number of values */
1991f6eb02Liane Praza	SCF_TERR_VALUE_CONSTRAINT_VIOLATED, /* constraint violated for value */
2001f6eb02Liane Praza	SCF_TERR_RANGE_VIOLATION,	/* value violated specified range */
2011f6eb02Liane Praza	SCF_TERR_PG_REDEFINE,		/* global or restarter pg_pattern */
2021f6eb02Liane Praza					/* redefined by the instance */
2031f6eb02Liane Praza	SCF_TERR_PROP_TYPE_MISMATCH,	/* property and value type mismatch */
2041f6eb02Liane Praza	SCF_TERR_VALUE_OUT_OF_RANGE,	/* value is out of range in template */
2051f6eb02Liane Praza	SCF_TERR_INVALID_VALUE,		/* value is not valid for the */
2061f6eb02Liane Praza					/* template */
2071f6eb02Liane Praza	SCF_TERR_PG_PATTERN_CONFLICT,	/* pg_pattern conflicts with higher */
2081f6eb02Liane Praza					/* level definition */
2091f6eb02Liane Praza	SCF_TERR_PROP_PATTERN_CONFLICT,	/* prop_pattern conflicts with higher */
2101f6eb02Liane Praza					/* level definition */
2111f6eb02Liane Praza	SCF_TERR_GENERAL_REDEFINE,	/* global or restarter template */
2121f6eb02Liane Praza					/* redefined */
2131f6eb02Liane Praza	SCF_TERR_INCLUDE_VALUES,	/* No supporting constraints or */
2141f6eb02Liane Praza					/* values for include_values */
2151f6eb02Liane Praza	SCF_TERR_PG_PATTERN_INCOMPLETE,	/* Required pg_pattern is missing */
2161f6eb02Liane Praza					/* name or type attribute. */
2171f6eb02Liane Praza	SCF_TERR_PROP_PATTERN_INCOMPLETE    /* Required prop_pattern is */
2181f6eb02Liane Praza					    /* missing a type attribute. */
2191f6eb02Liane Praza} scf_tmpl_error_type_t;
2201f6eb02Liane Praza
2211f6eb02Liane Prazatypedef struct scf_tmpl_error scf_tmpl_error_t;
2221f6eb02Liane Praza
2231f6eb02Liane Praza/*
224d2a7078Richard Lowe * This unfortunately needs to be public, because consumers of librestart must
225d2a7078Richard Lowe * deal with it
226d2a7078Richard Lowe */
227d2a7078Richard Lowetypedef struct {
228d2a7078Richard Lowe#ifndef NATIVE_BUILD
229d2a7078Richard Lowe	secflagdelta_t ss_default;
230d2a7078Richard Lowe	secflagdelta_t ss_lower;
231d2a7078Richard Lowe	secflagdelta_t ss_upper;
232d2a7078Richard Lowe#else
233d2a7078Richard Lowe	/*
234d2a7078Richard Lowe	 * This is never used, but is necessary for bootstrapping.
235d2a7078Richard Lowe	 * Not even the size matters.
236d2a7078Richard Lowe	 */
237d2a7078Richard Lowe	void *ss_default;
238d2a7078Richard Lowe	void *ss_lower;
239d2a7078Richard Lowe	void *ss_upper;
240d2a7078Richard Lowe#endif /* NATIVE_BUILD */
241d2a7078Richard Lowe} scf_secflags_t;
242d2a7078Richard Lowe
243d2a7078Richard Lowe/*
2441f6eb02Liane Praza * scf_tmpl_strerror() human readable flag
2451f6eb02Liane Praza */
2461f6eb02Liane Praza#define	SCF_TMPL_STRERROR_HUMAN	0x1
2471f6eb02Liane Praza
2481f6eb02Liane Praza/*
2497c478bdstevel@tonic-gate * Standard services
2507c478bdstevel@tonic-gate */
2513db3a6bAndrew Stormont#define	SCF_SERVICE_CONFIGD	"svc:/system/svc/repository:default"
2523db3a6bAndrew Stormont#define	SCF_INSTANCE_GLOBAL	"svc:/system/svc/global:default"
2533db3a6bAndrew Stormont#define	SCF_SERVICE_GLOBAL	"svc:/system/svc/global"
2543db3a6bAndrew Stormont#define	SCF_SERVICE_STARTD	"svc:/system/svc/restarter:default"
2553db3a6bAndrew Stormont#define	SCF_INSTANCE_EMI	"svc:/system/early-manifest-import:default"
2563db3a6bAndrew Stormont#define	SCF_INSTANCE_FS_MINIMAL	"svc:/system/filesystem/minimal:default"
2573db3a6bAndrew Stormont#define	SCF_INSTANCE_MI		"svc:/system/manifest-import:default"
2587c478bdstevel@tonic-gate
2597c478bdstevel@tonic-gate/*
2607c478bdstevel@tonic-gate * Major milestones
2617c478bdstevel@tonic-gate */
2623db3a6bAndrew Stormont#define	SCF_MILESTONE_SINGLE_USER	"svc:/milestone/single-user:default"
2633db3a6bAndrew Stormont#define	SCF_MILESTONE_MULTI_USER	"svc:/milestone/multi-user:default"
2647c478bdstevel@tonic-gate#define	SCF_MILESTONE_MULTI_USER_SERVER \
2653db3a6bAndrew Stormont	"svc:/milestone/multi-user-server:default"
2667c478bdstevel@tonic-gate
2677c478bdstevel@tonic-gate/*
2687c478bdstevel@tonic-gate * standard scope names
2697c478bdstevel@tonic-gate */
2703db3a6bAndrew Stormont#define	SCF_SCOPE_LOCAL			"localhost"
2717c478bdstevel@tonic-gate
2727c478bdstevel@tonic-gate/*
2737c478bdstevel@tonic-gate * Property group types
2747c478bdstevel@tonic-gate */
2753db3a6bAndrew Stormont#define	SCF_GROUP_APPLICATION		"application"
2763db3a6bAndrew Stormont#define	SCF_GROUP_FRAMEWORK		"framework"
2773db3a6bAndrew Stormont#define	SCF_GROUP_DEPENDENCY		"dependency"
2783db3a6bAndrew Stormont#define	SCF_GROUP_METHOD		"method"
2793db3a6bAndrew Stormont#define	SCF_GROUP_TEMPLATE		"template"
2803db3a6bAndrew Stormont#define	SCF_GROUP_TEMPLATE_PG_PATTERN	"template_pg_pattern"
2813db3a6bAndrew Stormont#define	SCF_GROUP_TEMPLATE_PROP_PATTERN	"template_prop_pattern"
2827c478bdstevel@tonic-gate
2837c478bdstevel@tonic-gate/*
2847c478bdstevel@tonic-gate * Dependency types
2857c478bdstevel@tonic-gate */
2863db3a6bAndrew Stormont#define	SCF_DEP_REQUIRE_ALL		"require_all"
2873db3a6bAndrew Stormont#define	SCF_DEP_REQUIRE_ANY		"require_any"
2883db3a6bAndrew Stormont#define	SCF_DEP_EXCLUDE_ALL		"exclude_all"
2893db3a6bAndrew Stormont#define	SCF_DEP_OPTIONAL_ALL		"optional_all"
2907c478bdstevel@tonic-gate
2913db3a6bAndrew Stormont#define	SCF_DEP_RESET_ON_ERROR		"error"
2923db3a6bAndrew Stormont#define	SCF_DEP_RESET_ON_RESTART	"restart"
2933db3a6bAndrew Stormont#define	SCF_DEP_RESET_ON_REFRESH	"refresh"
2943db3a6bAndrew Stormont#define	SCF_DEP_RESET_ON_NONE		"none"
2957c478bdstevel@tonic-gate
2967c478bdstevel@tonic-gate/*
2977c478bdstevel@tonic-gate * Standard property group names
2987c478bdstevel@tonic-gate */
2993db3a6bAndrew Stormont#define	SCF_PG_GENERAL			"general"
3003db3a6bAndrew Stormont#define	SCF_PG_GENERAL_OVR		"general_ovr"
3013db3a6bAndrew Stormont#define	SCF_PG_RESTARTER		"restarter"
3023db3a6bAndrew Stormont#define	SCF_PG_RESTARTER_ACTIONS	"restarter_actions"
3033db3a6bAndrew Stormont#define	SCF_PG_METHOD_CONTEXT		"method_context"
3043db3a6bAndrew Stormont#define	SCF_PG_APP_DEFAULT		"application"
3053db3a6bAndrew Stormont#define	SCF_PG_DEPENDENTS		"dependents"
3063db3a6bAndrew Stormont#define	SCF_PG_OPTIONS			"options"
3073db3a6bAndrew Stormont#define	SCF_PG_OPTIONS_OVR		"options_ovr"
3083db3a6bAndrew Stormont#define	SCF_PG_STARTD			"startd"
3093db3a6bAndrew Stormont#define	SCF_PG_STARTD_PRIVATE		"svc-startd-private"
3103db3a6bAndrew Stormont#define	SCF_PG_DEATHROW			"deathrow"
3113db3a6bAndrew Stormont#define	SCF_PG_MANIFESTFILES		"manifestfiles"
3127c478bdstevel@tonic-gate
3137c478bdstevel@tonic-gate/*
3141f6eb02Liane Praza * Template property group names and prefixes
3157c478bdstevel@tonic-gate */
3163db3a6bAndrew Stormont#define	SCF_PG_TM_COMMON_NAME		"tm_common_name"
3173db3a6bAndrew Stormont#define	SCF_PG_TM_DESCRIPTION		"tm_description"
3187c478bdstevel@tonic-gate
3193db3a6bAndrew Stormont#define	SCF_PG_TM_MAN_PREFIX		"tm_man_"
3203db3a6bAndrew Stormont#define	SCF_PG_TM_DOC_PREFIX		"tm_doc_"
3217c478bdstevel@tonic-gate
3227c478bdstevel@tonic-gate/*
3237c478bdstevel@tonic-gate * Standard property names
3247c478bdstevel@tonic-gate */
3253db3a6bAndrew Stormont#define	SCF_PROPERTY_ACTIVE_POSTFIX		"active"
3263db3a6bAndrew Stormont#define	SCF_PROPERTY_AUX_STATE			"auxiliary_state"
3273db3a6bAndrew Stormont#define	SCF_PROPERTY_AUX_FMRI			"auxiliary_fmri"
3283db3a6bAndrew Stormont#define	SCF_PROPERTY_AUX_TTY			"auxiliary_tty"
3293db3a6bAndrew Stormont#define	SCF_PROPERTY_CONTRACT			"contract"
3303db3a6bAndrew Stormont#define	SCF_PROPERTY_COREFILE_PATTERN		"corefile_pattern"
3313db3a6bAndrew Stormont#define	SCF_PROPERTY_DEGRADED			"degraded"
3323db3a6bAndrew Stormont#define	SCF_PROPERTY_DEGRADE_IMMEDIATE		"degrade_immediate"
3333db3a6bAndrew Stormont#define	SCF_PROPERTY_DODUMP			"do_dump"
3343db3a6bAndrew Stormont#define	SCF_PROPERTY_DURATION			"duration"
3353db3a6bAndrew Stormont#define	SCF_PROPERTY_ENABLED			"enabled"
3363db3a6bAndrew Stormont#define	SCF_PROPERTY_DEATHROW			"deathrow"
3373db3a6bAndrew Stormont#define	SCF_PROPERTY_ENTITY_STABILITY		"entity_stability"
3383db3a6bAndrew Stormont#define	SCF_PROPERTY_ENTITIES			"entities"
3393db3a6bAndrew Stormont#define	SCF_PROPERTY_EXEC			"exec"
3403db3a6bAndrew Stormont#define	SCF_PROPERTY_GROUP			"group"
3413db3a6bAndrew Stormont#define	SCF_PROPERTY_GROUPING			"grouping"
3423db3a6bAndrew Stormont#define	SCF_PROPERTY_IGNORE			"ignore_error"
343f18d878Jerry Jelinek#define	SCF_PROPERTY_INTERNAL_SEPARATORS	"internal_separators"
3443db3a6bAndrew Stormont#define	SCF_PROPERTY_LIMIT_PRIVILEGES		"limit_privileges"
3453db3a6bAndrew Stormont#define	SCF_PROPERTY_MAINT_OFF			"maint_off"
3463db3a6bAndrew Stormont#define	SCF_PROPERTY_MAINT_ON			"maint_on"
3473db3a6bAndrew Stormont#define	SCF_PROPERTY_MAINT_ON_IMMEDIATE		"maint_on_immediate"
3483db3a6bAndrew Stormont#define	SCF_PROPERTY_MAINT_ON_IMMTEMP		"maint_on_immtemp"
3493db3a6bAndrew Stormont#define	SCF_PROPERTY_MAINT_ON_TEMPORARY		"maint_on_temporary"
3503db3a6bAndrew Stormont#define	SCF_PROPERTY_METHOD_PID			"method_pid"
3513db3a6bAndrew Stormont#define	SCF_PROPERTY_MILESTONE			"milestone"
3523db3a6bAndrew Stormont#define	SCF_PROPERTY_NEED_SESSION		"need_session"
3533db3a6bAndrew Stormont#define	SCF_PROPERTY_NEXT_STATE			"next_state"
3543db3a6bAndrew Stormont#define	SCF_PROPERTY_PACKAGE			"package"
3553db3a6bAndrew Stormont#define	SCF_PROPERTY_PRIVILEGES			"privileges"
3563db3a6bAndrew Stormont#define	SCF_PROPERTY_PROFILE			"profile"
3573db3a6bAndrew Stormont#define	SCF_PROPERTY_PROJECT			"project"
3583db3a6bAndrew Stormont#define	SCF_PROPERTY_REFRESH			"refresh"
3593db3a6bAndrew Stormont#define	SCF_PROPERTY_RESOURCE_POOL		"resource_pool"
3603db3a6bAndrew Stormont#define	SCF_PROPERTY_ENVIRONMENT		"environment"
3613db3a6bAndrew Stormont#define	SCF_PROPERTY_RESTART			"restart"
3623db3a6bAndrew Stormont#define	SCF_PROPERTY_RESTARTER			"restarter"
3633db3a6bAndrew Stormont#define	SCF_PROPERTY_RESTART_INTERVAL		"restart_interval"
3643db3a6bAndrew Stormont#define	SCF_PROPERTY_RESTART_ON			"restart_on"
3653db3a6bAndrew Stormont#define	SCF_PROPERTY_RESTORE			"restore"
3663db3a6bAndrew Stormont#define	SCF_PROPERTY_SECFLAGS			"security_flags"
3673db3a6bAndrew Stormont#define	SCF_PROPERTY_SINGLE_INSTANCE		"single_instance"
3683db3a6bAndrew Stormont#define	SCF_PROPERTY_START_METHOD_TIMESTAMP	"start_method_timestamp"
3693db3a6bAndrew Stormont#define	SCF_PROPERTY_START_METHOD_WAITSTATUS	"start_method_waitstatus"
3703db3a6bAndrew Stormont#define	SCF_PROPERTY_START_PID			"start_pid"
3713db3a6bAndrew Stormont#define	SCF_PROPERTY_STATE			"state"
3723db3a6bAndrew Stormont#define	SCF_PROPERTY_STABILITY			"stability"
3733db3a6bAndrew Stormont#define	SCF_PROPERTY_STATE_TIMESTAMP		"state_timestamp"
3743db3a6bAndrew Stormont#define	SCF_PROPERTY_SUPP_GROUPS		"supp_groups"
3753db3a6bAndrew Stormont#define	SCF_PROPERTY_TIMEOUT			"timeout_seconds"
3763db3a6bAndrew Stormont#define	SCF_PROPERTY_TIMEOUT_RETRY		"timeout_retry"
3773db3a6bAndrew Stormont#define	SCF_PROPERTY_TRANSIENT_CONTRACT		"transient_contract"
3783db3a6bAndrew Stormont#define	SCF_PROPERTY_TYPE			"type"
3793db3a6bAndrew Stormont#define	SCF_PROPERTY_USE_PROFILE		"use_profile"
3803db3a6bAndrew Stormont#define	SCF_PROPERTY_USER			"user"
3813db3a6bAndrew Stormont#define	SCF_PROPERTY_UTMPX_PREFIX		"utmpx_prefix"
3823db3a6bAndrew Stormont#define	SCF_PROPERTY_WORKING_DIRECTORY		"working_directory"
3837c478bdstevel@tonic-gate
3847c478bdstevel@tonic-gate/*
3857c478bdstevel@tonic-gate * Template property names
3867c478bdstevel@tonic-gate */
3873db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_CARDINALITY_MIN		"cardinality_min"
3883db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_CARDINALITY_MAX		"cardinality_max"
3893db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_CHOICES_INCLUDE_VALUES	"choices_include_values"
3903db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_CHOICES_NAME		"choices_name"
3913db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_CHOICES_RANGE		"choices_range"
3923db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_CONSTRAINT_NAME		"constraint_name"
393f18d878Jerry Jelinek#define	SCF_PROPERTY_TM_CONSTRAINT_RANGE	"constraint_range"
3943db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_MANPATH			"manpath"
3953db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_NAME			"name"
3963db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_PG_PATTERN		"pg_pattern"
3973db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_REQUIRED		"required"
3983db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_SECTION			"section"
3993db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_TARGET			"target"
4003db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_TITLE			"title"
4013db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_TYPE			"type"
4023db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_URI			"uri"
4033db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_VALUE_PREFIX		"value_"
4043db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_VALUES_NAME		"values_name"
4053db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_VISIBILITY		"visibility"
4063db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_COMMON_NAME_PREFIX	"common_name_"
4073db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_DESCRIPTION_PREFIX	"description_"
4083db3a6bAndrew Stormont#define	SCF_PROPERTY_TM_UNITS_PREFIX		"units_"
4091f6eb02Liane Praza
4101f6eb02Liane Praza/*
4111f6eb02Liane Praza * Templates wildcard string
4121f6eb02Liane Praza */
4133db3a6bAndrew Stormont#define	SCF_TMPL_WILDCARD		"*"
4147c478bdstevel@tonic-gate
4157c478bdstevel@tonic-gate/*
4167c478bdstevel@tonic-gate * Strings used by restarters for state and next_state properties.
4177c478bdstevel@tonic-gate * MAX_SCF_STATE_STRING holds the max length of a state string, including the
4187c478bdstevel@tonic-gate * terminating null.
4197c478bdstevel@tonic-gate */
4207c478bdstevel@tonic-gate
4217c478bdstevel@tonic-gate#define	MAX_SCF_STATE_STRING_SZ		14
4227c478bdstevel@tonic-gate
4233db3a6bAndrew Stormont#define	SCF_STATE_STRING_NONE		"none"
4243db3a6bAndrew Stormont#define	SCF_STATE_STRING_UNINIT		"uninitialized"
4253db3a6bAndrew Stormont#define	SCF_STATE_STRING_MAINT		"maintenance"
4263db3a6bAndrew Stormont#define	SCF_STATE_STRING_OFFLINE	"offline"
4273db3a6bAndrew Stormont#define	SCF_STATE_STRING_DISABLED	"disabled"
4283db3a6bAndrew Stormont#define	SCF_STATE_STRING_ONLINE		"online"
4293db3a6bAndrew Stormont#define	SCF_STATE_STRING_DEGRADED	"degraded"
4303db3a6bAndrew Stormont#define	SCF_STATE_STRING_LEGACY		"legacy_run"
4317c478bdstevel@tonic-gate
4327c478bdstevel@tonic-gate#define	SCF_STATE_UNINIT		0x00000001
4337c478bdstevel@tonic-gate#define	SCF_STATE_MAINT			0x00000002
4347c478bdstevel@tonic-gate#define	SCF_STATE_OFFLINE		0x00000004
4357c478bdstevel@tonic-gate#define	SCF_STATE_DISABLED		0x00000008
4367c478bdstevel@tonic-gate#define	SCF_STATE_ONLINE		0x00000010
4377c478bdstevel@tonic-gate#define	SCF_STATE_DEGRADED		0x00000020
4387c478bdstevel@tonic-gate#define	SCF_STATE_ALL			0x0000003F
4397c478bdstevel@tonic-gate
440f6e214cGavin Maltby/*
441f6e214cGavin Maltby * software fma svc-transition class
442f6e214cGavin Maltby */
443f6e214cGavin Maltby#define	SCF_NOTIFY_PARAMS_VERSION	0X0
4443db3a6bAndrew Stormont#define	SCF_NOTIFY_NAME_FMRI		"fmri"
4453db3a6bAndrew Stormont#define	SCF_NOTIFY_NAME_VERSION		"version"
4463db3a6bAndrew Stormont#define	SCF_NOTIFY_NAME_TSET		"tset"
4473db3a6bAndrew Stormont#define	SCF_NOTIFY_PG_POSTFIX		"fmnotify"
4483db3a6bAndrew Stormont#define	SCF_NOTIFY_PARAMS		"notify-params"
4493db3a6bAndrew Stormont#define	SCF_NOTIFY_PARAMS_INST		"svc:/system/fm/notify-params:default"
4503db3a6bAndrew Stormont#define	SCF_SVC_TRANSITION_CLASS	"ireport.os.smf.state-transition"
4513db3a6bAndrew Stormont#define	SCF_NOTIFY_PARAMS_PG_TYPE	"notify_params"
452f6e214cGavin Maltby
453f6e214cGavin Maltby/*
454f6e214cGavin Maltby * Useful transition macros
455f6e214cGavin Maltby */
456f6e214cGavin Maltby#define	SCF_TRANS_SHIFT_INITIAL_STATE(s)	((s) << 16)
457f6e214cGavin Maltby#define	SCF_TRANSITION_ALL \
458f6e214cGavin Maltby	(SCF_TRANS_SHIFT_INITIAL_STATE(SCF_STATE_ALL) | SCF_STATE_ALL)
459f6e214cGavin Maltby#define	SCF_TRANS(f, t)	(SCF_TRANS_SHIFT_INITIAL_STATE(f) | (t))
460f6e214cGavin Maltby#define	SCF_TRANS_VALID(t)	(!((t) & ~SCF_TRANSITION_ALL))
461f6e214cGavin Maltby#define	SCF_TRANS_INITIAL_STATE(t)	((t) >> 16 & SCF_STATE_ALL)
462f6e214cGavin Maltby#define	SCF_TRANS_FINAL_STATE(t)	((t) & SCF_STATE_ALL)
463f6e214cGavin Maltby
464f6e214cGavin Maltby/*
465f6e214cGavin Maltby * Prefixes for states in state transition notification
466f6e214cGavin Maltby */
4673db3a6bAndrew Stormont#define	SCF_STN_PREFIX_FROM		"from-"
4683db3a6bAndrew Stormont#define	SCF_STN_PREFIX_TO		"to-"
469f6e214cGavin Maltby
4707c478bdstevel@tonic-gate#define	SCF_PG_FLAG_NONPERSISTENT	0x1
4717c478bdstevel@tonic-gate
4727c478bdstevel@tonic-gate#define	SCF_TRACE_LIBRARY		0x1
4737c478bdstevel@tonic-gate#define	SCF_TRACE_DAEMON		0x2
4747c478bdstevel@tonic-gate
4757c478bdstevel@tonic-gate#define	SMF_IMMEDIATE			0x1
4767c478bdstevel@tonic-gate#define	SMF_TEMPORARY			0x2
4777c478bdstevel@tonic-gate#define	SMF_AT_NEXT_BOOT		0x4
4787c478bdstevel@tonic-gate
4797c478bdstevel@tonic-gatescf_error_t scf_error(void);
4807c478bdstevel@tonic-gateconst char *scf_strerror(scf_error_t);
4817c478bdstevel@tonic-gate
4827c478bdstevel@tonic-gatessize_t scf_limit(uint32_t code);
4837c478bdstevel@tonic-gate#define	SCF_LIMIT_MAX_NAME_LENGTH	-2000U
4847c478bdstevel@tonic-gate#define	SCF_LIMIT_MAX_VALUE_LENGTH	-2001U
4857c478bdstevel@tonic-gate#define	SCF_LIMIT_MAX_PG_TYPE_LENGTH	-2002U
4867c478bdstevel@tonic-gate#define	SCF_LIMIT_MAX_FMRI_LENGTH	-2003U
4877c478bdstevel@tonic-gate
4887c478bdstevel@tonic-gatescf_handle_t *scf_handle_create(scf_version_t);
4897c478bdstevel@tonic-gate
4907c478bdstevel@tonic-gateint scf_handle_decorate(scf_handle_t *, const char *, scf_value_t *);
4917c478bdstevel@tonic-gate#define	SCF_DECORATE_CLEAR	((scf_value_t *)0)
4927c478bdstevel@tonic-gate
4937c478bdstevel@tonic-gateint scf_handle_bind(scf_handle_t *);
4947c478bdstevel@tonic-gateint scf_handle_unbind(scf_handle_t *);
4957c478bdstevel@tonic-gatevoid scf_handle_destroy(scf_handle_t *);
4967c478bdstevel@tonic-gate
4977c478bdstevel@tonic-gateint scf_type_base_type(scf_type_t type, scf_type_t *out);
4981f6eb02Liane Prazaconst char *scf_type_to_string(scf_type_t);
4991f6eb02Liane Prazascf_type_t scf_string_to_type(const char *);
5007c478bdstevel@tonic-gate
5017c478bdstevel@tonic-gate/* values */
5027c478bdstevel@tonic-gatescf_value_t *scf_value_create(scf_handle_t *);
5037c478bdstevel@tonic-gatescf_handle_t *scf_value_handle(const scf_value_t *);
5047c478bdstevel@tonic-gatevoid scf_value_destroy(scf_value_t *);
5057c478bdstevel@tonic-gate
5067c478bdstevel@tonic-gatescf_type_t scf_value_base_type(const scf_value_t *);
5077c478bdstevel@tonic-gatescf_type_t scf_value_type(const scf_value_t *);
5087c478bdstevel@tonic-gateint scf_value_is_type(const scf_value_t *, scf_type_t);
5097c478bdstevel@tonic-gate
5107c478bdstevel@tonic-gatevoid scf_value_reset(scf_value_t *);
5117c478bdstevel@tonic-gate
5127c478bdstevel@tonic-gateint scf_value_get_boolean(const scf_value_t *, uint8_t *);
5137c478bdstevel@tonic-gateint scf_value_get_count(const scf_value_t *, uint64_t *);
5147c478bdstevel@tonic-gateint scf_value_get_integer(const scf_value_t *, int64_t *);
5157c478bdstevel@tonic-gateint scf_value_get_time(const scf_value_t *, int64_t *, int32_t *);
5167c478bdstevel@tonic-gatessize_t scf_value_get_astring(const scf_value_t *, char *, size_t);
5177c478bdstevel@tonic-gatessize_t scf_value_get_ustring(const scf_value_t *, char *, size_t);
5187c478bdstevel@tonic-gatessize_t scf_value_get_opaque(const scf_value_t *, void *, size_t);
5197c478bdstevel@tonic-gate
5207c478bdstevel@tonic-gatevoid scf_value_set_boolean(scf_value_t *, uint8_t);
5217c478bdstevel@tonic-gatevoid scf_value_set_count(scf_value_t *, uint64_t);
5227c478bdstevel@tonic-gatevoid scf_value_set_integer(scf_value_t *, int64_t);
5237c478bdstevel@tonic-gateint scf_value_set_time(scf_value_t *, int64_t, int32_t);
5247c478bdstevel@tonic-gateint scf_value_set_astring(scf_value_t *, const char *);
5257c478bdstevel@tonic-gateint scf_value_set_ustring(scf_value_t *, const char *);
5267c478bdstevel@tonic-gateint scf_value_set_opaque(scf_value_t *, const void *, size_t);
5277c478bdstevel@tonic-gate
5287c478bdstevel@tonic-gatessize_t scf_value_get_as_string(const scf_value_t *, char *, size_t);
5297c478bdstevel@tonic-gatessize_t scf_value_get_as_string_typed(const scf_value_t *, scf_type_t,
5307c478bdstevel@tonic-gate    char *, size_t);
5317c478bdstevel@tonic-gateint scf_value_set_from_string(scf_value_t *, scf_type_t, const char *);
5327c478bdstevel@tonic-gate
5337c478bdstevel@tonic-gatescf_iter_t *scf_iter_create(scf_handle_t *);
5347c478bdstevel@tonic-gatescf_handle_t *scf_iter_handle(const scf_iter_t *);
5357c478bdstevel@tonic-gatevoid scf_iter_reset(scf_iter_t *);
5367c478bdstevel@tonic-gatevoid scf_iter_destroy(scf_iter_t *);
5377c478bdstevel@tonic-gate
5387c478bdstevel@tonic-gateint scf_iter_handle_scopes(scf_iter_t *, const scf_handle_t *);
5397c478bdstevel@tonic-gateint scf_iter_scope_services(scf_iter_t *, const scf_scope_t *);
5407c478bdstevel@tonic-gateint scf_iter_service_instances(scf_iter_t *, const scf_service_t *);
5417c478bdstevel@tonic-gateint scf_iter_service_pgs(scf_iter_t *, const scf_service_t *);
5427c478bdstevel@tonic-gateint scf_iter_instance_pgs(scf_iter_t *, const scf_instance_t *);
5437c478bdstevel@tonic-gateint scf_iter_instance_pgs_composed(scf_iter_t *, const scf_instance_t *,
5447c478bdstevel@tonic-gate    const scf_snapshot_t *);
5457c478bdstevel@tonic-gateint scf_iter_service_pgs_typed(scf_iter_t *, const scf_service_t *,
5467c478bdstevel@tonic-gate    const char *);
5477c478bdstevel@tonic-gateint scf_iter_instance_pgs_typed(scf_iter_t *, const scf_instance_t *,
5487c478bdstevel@tonic-gate    const char *);
5497c478bdstevel@tonic-gateint scf_iter_instance_pgs_typed_composed(scf_iter_t *, const scf_instance_t *,
5507c478bdstevel@tonic-gate    const scf_snapshot_t *, const char *);
5517c478bdstevel@tonic-gateint scf_iter_snaplevel_pgs(scf_iter_t *, const scf_snaplevel_t *);
5527c478bdstevel@tonic-gateint scf_iter_snaplevel_pgs_typed(scf_iter_t *, const scf_snaplevel_t *,
5537c478bdstevel@tonic-gate    const char *);
5547c478bdstevel@tonic-gateint scf_iter_instance_snapshots(scf_iter_t *, const scf_instance_t *);
5557c478bdstevel@tonic-gateint scf_iter_pg_properties(scf_iter_t *, const scf_propertygroup_t *);
5567c478bdstevel@tonic-gateint scf_iter_property_values(scf_iter_t *, const scf_property_t *);
5577c478bdstevel@tonic-gate
5587c478bdstevel@tonic-gateint scf_iter_next_scope(scf_iter_t *, scf_scope_t *);
5597c478bdstevel@tonic-gateint scf_iter_next_service(scf_iter_t *, scf_service_t *);
5607c478bdstevel@tonic-gateint scf_iter_next_instance(scf_iter_t *, scf_instance_t *);
5617c478bdstevel@tonic-gateint scf_iter_next_pg(scf_iter_t *, scf_propertygroup_t *);
5627c478bdstevel@tonic-gateint scf_iter_next_property(scf_iter_t *, scf_property_t *);
5637c478bdstevel@tonic-gateint scf_iter_next_snapshot(scf_iter_t *, scf_snapshot_t *);
5647c478bdstevel@tonic-gateint scf_iter_next_value(scf_iter_t *, scf_value_t *);
5657c478bdstevel@tonic-gate
5667c478bdstevel@tonic-gatescf_scope_t *scf_scope_create(scf_handle_t *);
5677c478bdstevel@tonic-gatescf_handle_t *scf_scope_handle(const scf_scope_t *);
5687c478bdstevel@tonic-gate
5697c478bdstevel@tonic-gate/* XXX eventually remove this */
5707c478bdstevel@tonic-gate#define	scf_handle_get_local_scope(h, s) \
5717c478bdstevel@tonic-gate	scf_handle_get_scope((h), SCF_SCOPE_LOCAL, (s))
5727c478bdstevel@tonic-gate
5737c478bdstevel@tonic-gateint scf_handle_get_scope(scf_handle_t *, const char *, scf_scope_t *);
5747c478bdstevel@tonic-gatevoid scf_scope_destroy(scf_scope_t *);
5757c478bdstevel@tonic-gatessize_t scf_scope_get_name(const scf_scope_t *, char *, size_t);
5767c478bdstevel@tonic-gate
5777c478bdstevel@tonic-gatessize_t scf_scope_to_fmri(const scf_scope_t *, char *, size_t);
5787c478bdstevel@tonic-gate
5797c478bdstevel@tonic-gatescf_service_t *scf_service_create(scf_handle_t *);
5807c478bdstevel@tonic-gatescf_handle_t *scf_service_handle(const scf_service_t *);
5817c478bdstevel@tonic-gatevoid scf_service_destroy(scf_service_t *);
5827c478bdstevel@tonic-gateint scf_scope_get_parent(const scf_scope_t *, scf_scope_t *);
5837c478bdstevel@tonic-gatessize_t scf_service_get_name(const scf_service_t *, char *, size_t);
5847c478bdstevel@tonic-gatessize_t scf_service_to_fmri(const scf_service_t *, char *, size_t);
5857c478bdstevel@tonic-gateint scf_service_get_parent(const scf_service_t *, scf_scope_t *);
5867c478bdstevel@tonic-gateint scf_scope_get_service(const scf_scope_t *, const char *, scf_service_t *);
5877c478bdstevel@tonic-gateint scf_scope_add_service(const scf_scope_t *, const char *, scf_service_t *);
5887c478bdstevel@tonic-gateint scf_service_delete(scf_service_t *);
5897c478bdstevel@tonic-gate
5907c478bdstevel@tonic-gatescf_instance_t *scf_instance_create(scf_handle_t *);
5917c478bdstevel@tonic-gatescf_handle_t *scf_instance_handle(const scf_instance_t *);
5927c478bdstevel@tonic-gatevoid scf_instance_destroy(scf_instance_t *);
5937c478bdstevel@tonic-gatessize_t scf_instance_get_name(const scf_instance_t *, char *, size_t);
5947c478bdstevel@tonic-gatessize_t scf_instance_to_fmri(const scf_instance_t *, char *, size_t);
5957c478bdstevel@tonic-gateint scf_service_get_instance(const scf_service_t *, const char *,
5967c478bdstevel@tonic-gate    scf_instance_t *);
5977c478bdstevel@tonic-gateint scf_service_add_instance(const scf_service_t *, const char *,
5987c478bdstevel@tonic-gate    scf_instance_t *);
5997c478bdstevel@tonic-gateint scf_instance_delete(scf_instance_t *);
6007c478bdstevel@tonic-gate
6017c478bdstevel@tonic-gatescf_snapshot_t *scf_snapshot_create(scf_handle_t *);
6027c478bdstevel@tonic-gatescf_handle_t *scf_snapshot_handle(const scf_snapshot_t *);
6037c478bdstevel@tonic-gatevoid scf_snapshot_destroy(scf_snapshot_t *);
6047c478bdstevel@tonic-gatessize_t scf_snapshot_get_name(const scf_snapshot_t *, char *, size_t);
6057c478bdstevel@tonic-gateint scf_snapshot_get_parent(const scf_snapshot_t *, scf_instance_t *);
6067c478bdstevel@tonic-gateint scf_instance_get_snapshot(const scf_instance_t *, const char *,
6077c478bdstevel@tonic-gate    scf_snapshot_t *);
6087c478bdstevel@tonic-gateint scf_snapshot_update(scf_snapshot_t *);
6097c478bdstevel@tonic-gate
6107c478bdstevel@tonic-gatescf_snaplevel_t *scf_snaplevel_create(scf_handle_t *);
6117c478bdstevel@tonic-gatescf_handle_t *scf_snaplevel_handle(const scf_snaplevel_t *);
6127c478bdstevel@tonic-gatevoid scf_snaplevel_destroy(scf_snaplevel_t *);
6137c478bdstevel@tonic-gateint scf_snaplevel_get_parent(const scf_snaplevel_t *, scf_snapshot_t *);
6147c478bdstevel@tonic-gatessize_t scf_snaplevel_get_scope_name(const scf_snaplevel_t *, char *, size_t);
6157c478bdstevel@tonic-gatessize_t scf_snaplevel_get_service_name(const scf_snaplevel_t *, char *, size_t);
6167c478bdstevel@tonic-gatessize_t scf_snaplevel_get_instance_name(const scf_snaplevel_t *, char *,
6177c478bdstevel@tonic-gate    size_t);
6187c478bdstevel@tonic-gateint scf_snaplevel_get_pg(const scf_snaplevel_t *, const char *,
6197c478bdstevel@tonic-gate    scf_propertygroup_t *pg);
6207c478bdstevel@tonic-gateint scf_snapshot_get_base_snaplevel(const scf_snapshot_t *, scf_snaplevel_t *);
6217c478bdstevel@tonic-gateint scf_snaplevel_get_next_snaplevel(const scf_snaplevel_t *,
6227c478bdstevel@tonic-gate    scf_snaplevel_t *);
6237c478bdstevel@tonic-gate
6247c478bdstevel@tonic-gatescf_propertygroup_t *scf_pg_create(scf_handle_t *);
6257c478bdstevel@tonic-gatescf_handle_t *scf_pg_handle(const scf_propertygroup_t *);
6267c478bdstevel@tonic-gatevoid scf_pg_destroy(scf_propertygroup_t *);
6277c478bdstevel@tonic-gatessize_t scf_pg_to_fmri(const scf_propertygroup_t *,  char *, size_t);
6287c478bdstevel@tonic-gatessize_t scf_pg_get_name(const scf_propertygroup_t *, char *, size_t);
6297c478bdstevel@tonic-gatessize_t scf_pg_get_type(const scf_propertygroup_t *, char *, size_t);
6307c478bdstevel@tonic-gateint scf_pg_get_flags(const scf_propertygroup_t *, uint32_t *);
6317c478bdstevel@tonic-gateint scf_pg_get_parent_service(const scf_propertygroup_t *, scf_service_t *);
6327c478bdstevel@tonic-gateint scf_pg_get_parent_instance(const scf_propertygroup_t *, scf_instance_t *);
6337c478bdstevel@tonic-gateint scf_pg_get_parent_snaplevel(const scf_propertygroup_t *, scf_snaplevel_t *);
6347c478bdstevel@tonic-gateint scf_service_get_pg(const scf_service_t *, const char *,
6357c478bdstevel@tonic-gate    scf_propertygroup_t *);
6367c478bdstevel@tonic-gateint scf_instance_get_pg(const scf_instance_t *, const char *,
6377c478bdstevel@tonic-gate    scf_propertygroup_t *);
6387c478bdstevel@tonic-gateint scf_instance_get_pg_composed(const scf_instance_t *, const scf_snapshot_t *,
6397c478bdstevel@tonic-gate    const char *, scf_propertygroup_t *);
6407c478bdstevel@tonic-gateint scf_service_add_pg(const scf_service_t *,  const char *, const char *,
6417c478bdstevel@tonic-gate    uint32_t, scf_propertygroup_t *);
6427c478bdstevel@tonic-gateint scf_instance_add_pg(const scf_instance_t *,  const char *, const char *,
6437c478bdstevel@tonic-gate    uint32_t, scf_propertygroup_t *);
6447c478bdstevel@tonic-gateint scf_pg_delete(scf_propertygroup_t *);
6457c478bdstevel@tonic-gate
6467c478bdstevel@tonic-gateint scf_pg_get_underlying_pg(const scf_propertygroup_t *,
6477c478bdstevel@tonic-gate    scf_propertygroup_t *);
6487c478bdstevel@tonic-gateint scf_instance_get_parent(const scf_instance_t *, scf_service_t *);
6497c478bdstevel@tonic-gate
6507c478bdstevel@tonic-gateint scf_pg_update(scf_propertygroup_t *);
6517c478bdstevel@tonic-gate
6527c478bdstevel@tonic-gatescf_property_t *scf_property_create(scf_handle_t *);
6537c478bdstevel@tonic-gatescf_handle_t *scf_property_handle(const scf_property_t *);
6547c478bdstevel@tonic-gatevoid scf_property_destroy(scf_property_t *);
6557c478bdstevel@tonic-gateint scf_property_is_type(const scf_property_t *, scf_type_t);
6567c478bdstevel@tonic-gateint scf_property_type(const scf_property_t *, scf_type_t *);
6577c478bdstevel@tonic-gatessize_t scf_property_get_name(const scf_property_t *, char *, size_t);
6587c478bdstevel@tonic-gateint scf_property_get_value(const scf_property_t *, scf_value_t *);
6597c478bdstevel@tonic-gatessize_t scf_property_to_fmri(const scf_property_t *, char *, size_t);
6607c478bdstevel@tonic-gateint scf_pg_get_property(const scf_propertygroup_t *,  const char *,
6617c478bdstevel@tonic-gate    scf_property_t *);
6627c478bdstevel@tonic-gate
6637c478bdstevel@tonic-gatescf_transaction_t *scf_transaction_create(scf_handle_t *);
6647c478bdstevel@tonic-gatescf_handle_t *scf_transaction_handle(const scf_transaction_t *);
6657c478bdstevel@tonic-gateint scf_transaction_start(scf_transaction_t *, scf_propertygroup_t *);
6667c478bdstevel@tonic-gatevoid scf_transaction_destroy(scf_transaction_t *);
6677c478bdstevel@tonic-gatevoid scf_transaction_destroy_children(scf_transaction_t *);
6687c478bdstevel@tonic-gate
6697c478bdstevel@tonic-gatevoid scf_transaction_reset(scf_transaction_t *);
6707c478bdstevel@tonic-gatevoid scf_transaction_reset_all(scf_transaction_t *);
6717c478bdstevel@tonic-gate
6727c478bdstevel@tonic-gateint scf_transaction_commit(scf_transaction_t *);
6737c478bdstevel@tonic-gate
6747c478bdstevel@tonic-gatescf_transaction_entry_t *scf_entry_create(scf_handle_t *);
6757c478bdstevel@tonic-gatescf_handle_t *scf_entry_handle(const scf_transaction_entry_t *);
6767c478bdstevel@tonic-gatevoid scf_entry_reset(scf_transaction_entry_t *);
6777c478bdstevel@tonic-gatevoid scf_entry_destroy(scf_transaction_entry_t *);
6787c478bdstevel@tonic-gatevoid scf_entry_destroy_children(scf_transaction_entry_t *);
6797c478bdstevel@tonic-gate
6807c478bdstevel@tonic-gateint scf_transaction_property_change(scf_transaction_t *,
6817c478bdstevel@tonic-gate    scf_transaction_entry_t *, const char *, scf_type_t);
6827c478bdstevel@tonic-gateint scf_transaction_property_delete(scf_transaction_t *,
6837c478bdstevel@tonic-gate    scf_transaction_entry_t *, const char *);
6847c478bdstevel@tonic-gateint scf_transaction_property_new(scf_transaction_t *,
6857c478bdstevel@tonic-gate    scf_transaction_entry_t *, const char *, scf_type_t);
6867c478bdstevel@tonic-gateint scf_transaction_property_change_type(scf_transaction_t *,
6877c478bdstevel@tonic-gate    scf_transaction_entry_t *, const char *, scf_type_t);
6887c478bdstevel@tonic-gate
6897c478bdstevel@tonic-gateint scf_entry_add_value(scf_transaction_entry_t *, scf_value_t *);
6907c478bdstevel@tonic-gate
6917c478bdstevel@tonic-gateint scf_handle_decode_fmri(scf_handle_t *, const char *, scf_scope_t *,
6927c478bdstevel@tonic-gate    scf_service_t *, scf_instance_t *, scf_propertygroup_t *, scf_property_t *,
6937c478bdstevel@tonic-gate    int);
6947c478bdstevel@tonic-gate#define	SCF_DECODE_FMRI_EXACT			0x00000001
6957c478bdstevel@tonic-gate#define	SCF_DECODE_FMRI_TRUNCATE		0x00000002
6967c478bdstevel@tonic-gate#define	SCF_DECODE_FMRI_REQUIRE_INSTANCE	0x00000004
6977c478bdstevel@tonic-gate#define	SCF_DECODE_FMRI_REQUIRE_NO_INSTANCE	0x00000008
6987c478bdstevel@tonic-gate
6997c478bdstevel@tonic-gatessize_t scf_myname(scf_handle_t *, char *, size_t);
7007c478bdstevel@tonic-gate
7017c478bdstevel@tonic-gate/*
7021f6eb02Liane Praza * Property group template interfaces.
7037c478bdstevel@tonic-gate */
7041f6eb02Liane Prazascf_pg_tmpl_t *scf_tmpl_pg_create(scf_handle_t *);
7051f6eb02Liane Prazavoid scf_tmpl_pg_destroy(scf_pg_tmpl_t *);
7061f6eb02Liane Prazavoid scf_tmpl_pg_reset(scf_pg_tmpl_t *);
7071f6eb02Liane Prazaint scf_tmpl_get_by_pg(scf_propertygroup_t *, scf_pg_tmpl_t *, int);
7081f6eb02Liane Prazaint scf_tmpl_get_by_pg_name(const char *, const char *,
7091f6eb02Liane Praza    const char *, const char *, scf_pg_tmpl_t *, int);
7101f6eb02Liane Prazaint scf_tmpl_iter_pgs(scf_pg_tmpl_t *, const char *, const char *,
7111f6eb02Liane Praza    const char *, int);
7121f6eb02Liane Praza#define	SCF_PG_TMPL_FLAG_REQUIRED	0x1
7131f6eb02Liane Praza#define	SCF_PG_TMPL_FLAG_EXACT		0x2
7141f6eb02Liane Praza#define	SCF_PG_TMPL_FLAG_CURRENT	0x4
7151f6eb02Liane Praza
7161f6eb02Liane Prazassize_t scf_tmpl_pg_name(const scf_pg_tmpl_t *, char **);
7171f6eb02Liane Prazassize_t scf_tmpl_pg_common_name(const scf_pg_tmpl_t *, const char *, char **);
7181f6eb02Liane Prazassize_t scf_tmpl_pg_description(const scf_pg_tmpl_t *, const char *, char **);
7191f6eb02Liane Prazassize_t scf_tmpl_pg_type(const scf_pg_tmpl_t *, char **);
7201f6eb02Liane Praza
7211f6eb02Liane Prazassize_t scf_tmpl_pg_target(const scf_pg_tmpl_t *, char **);
7221f6eb02Liane Praza#define	SCF_TM_TARGET_ALL		((const char *)"all")
7231f6eb02Liane Praza#define	SCF_TM_TARGET_DELEGATE		((const char *)"delegate")
7241f6eb02Liane Praza#define	SCF_TM_TARGET_INSTANCE		((const char *)"instance")
7251f6eb02Liane Praza#define	SCF_TM_TARGET_THIS		((const char *)"this")
7261f6eb02Liane Praza
7271f6eb02Liane Prazaint scf_tmpl_pg_required(const scf_pg_tmpl_t *, uint8_t *);
7287c478bdstevel@tonic-gate
7291f6eb02Liane Praza/*
7301f6eb02Liane Praza * Property template interfaces.
7311f6eb02Liane Praza */
7321f6eb02Liane Prazascf_prop_tmpl_t *scf_tmpl_prop_create(scf_handle_t *);
7331f6eb02Liane Prazavoid scf_tmpl_prop_destroy(scf_prop_tmpl_t *);
7341f6eb02Liane Prazavoid scf_tmpl_prop_reset(scf_prop_tmpl_t *);
7351f6eb02Liane Prazaint scf_tmpl_get_by_prop(scf_pg_tmpl_t *, const char *,
7361f6eb02Liane Praza    scf_prop_tmpl_t *, int);
7371f6eb02Liane Prazaint scf_tmpl_iter_props(scf_pg_tmpl_t *, scf_prop_tmpl_t *, int);
7381f6eb02Liane Praza#define	SCF_PROP_TMPL_FLAG_REQUIRED	0x1
7391f6eb02Liane Praza
7401f6eb02Liane Prazassize_t scf_tmpl_prop_name(const scf_prop_tmpl_t *, char **);
7411f6eb02Liane Prazaint scf_tmpl_prop_type(const scf_prop_tmpl_t *, scf_type_t *);
7421f6eb02Liane Prazaint scf_tmpl_prop_required(const scf_prop_tmpl_t *, uint8_t *);
7431f6eb02Liane Prazassize_t scf_tmpl_prop_common_name(const scf_prop_tmpl_t *, const char *,
7441f6eb02Liane Praza    char **);
7451f6eb02Liane Prazassize_t scf_tmpl_prop_description(const scf_prop_tmpl_t *, const char *,
7461f6eb02Liane Praza    char **);
7471f6eb02Liane Prazassize_t scf_tmpl_prop_units(const scf_prop_tmpl_t *, const char *, char **);
7481f6eb02Liane Prazaint scf_tmpl_prop_cardinality(const scf_prop_tmpl_t *prop, uint64_t *,
7491f6eb02Liane Praza    uint64_t *);
7501f6eb02Liane Prazaint scf_tmpl_prop_internal_seps(const scf_prop_tmpl_t *, scf_values_t *);
7511f6eb02Liane Praza
7521f6eb02Liane Prazaint scf_tmpl_prop_visibility(const scf_prop_tmpl_t *, uint8_t *);
7531f6eb02Liane Praza#define	SCF_TMPL_VISIBILITY_HIDDEN		1
7541f6eb02Liane Praza#define	SCF_TMPL_VISIBILITY_READONLY		2
7551f6eb02Liane Praza#define	SCF_TMPL_VISIBILITY_READWRITE		3
7561f6eb02Liane Praza
7571f6eb02Liane Prazaconst char *scf_tmpl_visibility_to_string(uint8_t);
7581f6eb02Liane Praza#define	SCF_TM_VISIBILITY_HIDDEN	((const char *)"hidden")
7591f6eb02Liane Praza#define	SCF_TM_VISIBILITY_READONLY	((const char *)"readonly")
7601f6eb02Liane Praza#define	SCF_TM_VISIBILITY_READWRITE	((const char *)"readwrite")
7611f6eb02Liane Praza
7621f6eb02Liane Prazaint scf_tmpl_value_name_constraints(const scf_prop_tmpl_t *prop,
7631f6eb02Liane Praza    scf_values_t *vals);
7641f6eb02Liane Prazavoid scf_count_ranges_destroy(scf_count_ranges_t *);
7651f6eb02Liane Prazavoid scf_int_ranges_destroy(scf_int_ranges_t *);
7661f6eb02Liane Prazaint scf_tmpl_value_count_range_constraints(const scf_prop_tmpl_t *,
7671f6eb02Liane Praza    scf_count_ranges_t *);
7681f6eb02Liane Prazaint scf_tmpl_value_int_range_constraints(const scf_prop_tmpl_t *,
7691f6eb02Liane Praza    scf_int_ranges_t *);
7701f6eb02Liane Prazaint scf_tmpl_value_count_range_choices(const scf_prop_tmpl_t *,
7711f6eb02Liane Praza    scf_count_ranges_t *);
7721f6eb02Liane Prazaint scf_tmpl_value_int_range_choices(const scf_prop_tmpl_t *,
7731f6eb02Liane Praza    scf_int_ranges_t *);
7741f6eb02Liane Prazaint scf_tmpl_value_name_choices(const scf_prop_tmpl_t *prop,
7751f6eb02Liane Praza    scf_values_t *vals);
7761f6eb02Liane Praza
7771f6eb02Liane Prazavoid scf_values_destroy(scf_values_t *);
7781f6eb02Liane Praza
7791f6eb02Liane Prazassize_t scf_tmpl_value_common_name(const scf_prop_tmpl_t *, const char *,
7801f6eb02Liane Praza    const char *, char **);
7811f6eb02Liane Prazassize_t scf_tmpl_value_description(const scf_prop_tmpl_t *, const char *,
7821f6eb02Liane Praza    const char *, char **);
7831f6eb02Liane Praza
7841f6eb02Liane Prazaint scf_tmpl_value_in_constraint(const scf_prop_tmpl_t *pt, scf_value_t *value,
7851f6eb02Liane Praza    scf_tmpl_errors_t **errs);
7861f6eb02Liane Praza
7871f6eb02Liane Praza/*
7881f6eb02Liane Praza * Template validation interfaces
7891f6eb02Liane Praza */
7901f6eb02Liane Prazaint scf_tmpl_validate_fmri(scf_handle_t *, const char *,
7911f6eb02Liane Praza    const char *, scf_tmpl_errors_t **, int);
7921f6eb02Liane Praza#define	SCF_TMPL_VALIDATE_FLAG_CURRENT	0x1
7931f6eb02Liane Praza
7941f6eb02Liane Prazavoid scf_tmpl_errors_destroy(scf_tmpl_errors_t *errs);
7951f6eb02Liane Prazascf_tmpl_error_t *scf_tmpl_next_error(scf_tmpl_errors_t *);
7961f6eb02Liane Prazavoid scf_tmpl_reset_errors(scf_tmpl_errors_t *errs);
7971f6eb02Liane Prazaint scf_tmpl_strerror(scf_tmpl_error_t *err, char *s, size_t n, int flag);
7981f6eb02Liane Prazaint scf_tmpl_error_source_fmri(const scf_tmpl_error_t *, char **);
7991f6eb02Liane Prazaint scf_tmpl_error_type(const scf_tmpl_error_t *, scf_tmpl_error_type_t *);
8001f6eb02Liane Prazaint scf_tmpl_error_pg_tmpl(const scf_tmpl_error_t *, char **, char **);
8011f6eb02Liane Prazaint scf_tmpl_error_pg(const scf_tmpl_error_t *, char **, char **);
8021f6eb02Liane Prazaint scf_tmpl_error_prop_tmpl(const scf_tmpl_error_t *, char **, char **);
8031f6eb02Liane Prazaint scf_tmpl_error_prop(const scf_tmpl_error_t *, char **, char **);
8041f6eb02Liane Prazaint scf_tmpl_error_value(const scf_tmpl_error_t *, char **);
8051f6eb02Liane Praza
8061f6eb02Liane Praza/*
8071f6eb02Liane Praza * Simplified calls
8081f6eb02Liane Praza */
8097c478bdstevel@tonic-gateint smf_enable_instance(const char *, int);
8107c478bdstevel@tonic-gateint smf_disable_instance(const char *, int);
8117c478bdstevel@tonic-gateint smf_refresh_instance(const char *);
8127c478bdstevel@tonic-gateint smf_restart_instance(const char *);
8137c478bdstevel@tonic-gateint smf_maintain_instance(const char *, int);
8147c478bdstevel@tonic-gateint smf_degrade_instance(const char *, int);
8157c478bdstevel@tonic-gateint smf_restore_instance(const char *);
8167c478bdstevel@tonic-gatechar *smf_get_state(const char *);
8177c478bdstevel@tonic-gate
8187c478bdstevel@tonic-gateint scf_simple_walk_instances(uint_t, void *,
8197c478bdstevel@tonic-gate    int (*inst_callback)(scf_handle_t *, scf_instance_t *, void *));
8207c478bdstevel@tonic-gate
8217c478bdstevel@tonic-gatescf_simple_prop_t *scf_simple_prop_get(scf_handle_t *, const char *,
8227c478bdstevel@tonic-gate    const char *, const char *);
8237c478bdstevel@tonic-gatevoid scf_simple_prop_free(scf_simple_prop_t *);
8247c478bdstevel@tonic-gatescf_simple_app_props_t *scf_simple_app_props_get(scf_handle_t *, const char *);
8257c478bdstevel@tonic-gatevoid scf_simple_app_props_free(scf_simple_app_props_t *);
8267c478bdstevel@tonic-gateconst scf_simple_prop_t *scf_simple_app_props_next(
8277c478bdstevel@tonic-gate    const scf_simple_app_props_t *, scf_simple_prop_t *);
8287c478bdstevel@tonic-gateconst scf_simple_prop_t *scf_simple_app_props_search(
8297c478bdstevel@tonic-gate    const scf_simple_app_props_t *, const char *, const char *);
8307c478bdstevel@tonic-gatessize_t scf_simple_prop_numvalues(const scf_simple_prop_t *);
8317c478bdstevel@tonic-gatescf_type_t scf_simple_prop_type(const scf_simple_prop_t *);
8327c478bdstevel@tonic-gatechar *scf_simple_prop_name(const scf_simple_prop_t *);
8337c478bdstevel@tonic-gatechar *scf_simple_prop_pgname(const scf_simple_prop_t *);
8347c478bdstevel@tonic-gateuint8_t *scf_simple_prop_next_boolean(scf_simple_prop_t *);
8357c478bdstevel@tonic-gateuint64_t *scf_simple_prop_next_count(scf_simple_prop_t *);
8367c478bdstevel@tonic-gateint64_t *scf_simple_prop_next_integer(scf_simple_prop_t *);
8377c478bdstevel@tonic-gateint64_t *scf_simple_prop_next_time(scf_simple_prop_t *, int32_t *);
8387c478bdstevel@tonic-gatechar *scf_simple_prop_next_astring(scf_simple_prop_t *);
8397c478bdstevel@tonic-gatechar *scf_simple_prop_next_ustring(scf_simple_prop_t *);
8407c478bdstevel@tonic-gatevoid *scf_simple_prop_next_opaque(scf_simple_prop_t *, size_t *);
8417c478bdstevel@tonic-gatevoid scf_simple_prop_next_reset(scf_simple_prop_t *);
8427c478bdstevel@tonic-gate
8437c478bdstevel@tonic-gate/*
844f6e214cGavin Maltby * smf_state_from_string()
845f6e214cGavin Maltby * return SCF_STATE_* value for the input
846f6e214cGavin Maltby * -1 on error. String "all" maps to SCF_STATE_ALL macro
847f6e214cGavin Maltby */
848f6e214cGavin Maltbyint32_t smf_state_from_string(const char *);
849f6e214cGavin Maltby
850f6e214cGavin Maltby/*
851f6e214cGavin Maltby * smf_state_to_string()
852f6e214cGavin Maltby * return SCF_STATE_STRING* value for the input
853f6e214cGavin Maltby * NULL on error.
854f6e214cGavin Maltby */
855f6e214cGavin Maltbyconst char *smf_state_to_string(int32_t);
856f6e214cGavin Maltby
857f6e214cGavin Maltby/*
858f6e214cGavin Maltby * Notification interfaces
859f6e214cGavin Maltby */
860f6e214cGavin Maltbyint smf_notify_set_params(const char *, nvlist_t *);
861f6e214cGavin Maltbyint smf_notify_get_params(nvlist_t **, nvlist_t *);
862f6e214cGavin Maltbyint smf_notify_del_params(const char *, const char *, int32_t);
863f6e214cGavin Maltby
864f6e214cGavin Maltby/*
8657c478bdstevel@tonic-gate * SMF exit status definitions
866f18d878Jerry Jelinek *
867f18d878Jerry Jelinek * The SMF_EXIT_NODAEMON exit status should be used when a method does not
868f18d878Jerry Jelinek * need to run any persistent process. This indicates success, abandons the
869f18d878Jerry Jelinek * contract, and allows dependencies to be met.
8707c478bdstevel@tonic-gate */
8717c478bdstevel@tonic-gate#define	SMF_EXIT_OK		  0
872f18d878Jerry Jelinek#define	SMF_EXIT_NODAEMON	 94
8737c478bdstevel@tonic-gate#define	SMF_EXIT_ERR_FATAL	 95
8747c478bdstevel@tonic-gate#define	SMF_EXIT_ERR_CONFIG	 96
8757c478bdstevel@tonic-gate#define	SMF_EXIT_MON_DEGRADE	 97
8767c478bdstevel@tonic-gate#define	SMF_EXIT_MON_OFFLINE	 98
8777c478bdstevel@tonic-gate#define	SMF_EXIT_ERR_NOSMF	 99
8787c478bdstevel@tonic-gate#define	SMF_EXIT_ERR_PERM	100
8797c478bdstevel@tonic-gate
8807c478bdstevel@tonic-gate#ifdef	__cplusplus
8817c478bdstevel@tonic-gate}
8827c478bdstevel@tonic-gate#endif
8837c478bdstevel@tonic-gate
8847c478bdstevel@tonic-gate#endif	/* _LIBSCF_H */
885