xref: /titanic_54/usr/src/cmd/svc/svccfg/svccfg.h (revision 9e9ae1fc5a2cf0c35d578ad826dff4763cd0a605)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
237c478bd9Sstevel@tonic-gate  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef	_CMD_SVCCFG_H
287c478bd9Sstevel@tonic-gate #define	_CMD_SVCCFG_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #include <sys/types.h>
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #include <libxml/tree.h>
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate #include <libscf.h>
377c478bd9Sstevel@tonic-gate #include <libtecla.h>
387c478bd9Sstevel@tonic-gate #include <libuutil.h>
397c478bd9Sstevel@tonic-gate 
407c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
417c478bd9Sstevel@tonic-gate extern "C" {
427c478bd9Sstevel@tonic-gate #endif
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate /* Command scope bits for command tab completion */
457c478bd9Sstevel@tonic-gate #define	CS_SCOPE	0x01
467c478bd9Sstevel@tonic-gate #define	CS_SVC		0x02
477c478bd9Sstevel@tonic-gate #define	CS_INST		0x04
487c478bd9Sstevel@tonic-gate #define	CS_SNAP		0x08
497c478bd9Sstevel@tonic-gate #define	CS_GLOBAL	0x0f
507c478bd9Sstevel@tonic-gate 
517c478bd9Sstevel@tonic-gate /* Flags for lscf_bundle_import() & co. */
527c478bd9Sstevel@tonic-gate #define	SCI_NOREFRESH	0x01		/* Don't refresh instances */
537c478bd9Sstevel@tonic-gate #define	SCI_GENERALLAST 0x04		/* Add general property group last */
547c478bd9Sstevel@tonic-gate #define	SCI_NOENABLED	0x08		/* Don't import general/enabled. */
557c478bd9Sstevel@tonic-gate #define	SCI_FRESH	0x10		/* Freshly imported service */
567c478bd9Sstevel@tonic-gate #define	SCI_FORCE	0x20		/* Override-import. */
577c478bd9Sstevel@tonic-gate #define	SCI_KEEP	0x40		/* Don't delete when SCI_FORCEing */
587c478bd9Sstevel@tonic-gate 
597c478bd9Sstevel@tonic-gate #ifdef lint
607c478bd9Sstevel@tonic-gate extern int yyerror(const char *);
617c478bd9Sstevel@tonic-gate extern int yyparse(void);
627c478bd9Sstevel@tonic-gate #endif /* lint */
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate extern int lex_lineno;
657c478bd9Sstevel@tonic-gate 
667c478bd9Sstevel@tonic-gate #define	MANIFEST_DTD_PATH	"/usr/share/lib/xml/dtd/service_bundle.dtd.1"
677c478bd9Sstevel@tonic-gate /*
687c478bd9Sstevel@tonic-gate  * The following list must be kept in the same order as that of
697c478bd9Sstevel@tonic-gate  * lxml_prop_types[]
707c478bd9Sstevel@tonic-gate  */
717c478bd9Sstevel@tonic-gate typedef enum element {
727c478bd9Sstevel@tonic-gate 	SC_ASTRING = 0x0, SC_BOOLEAN, SC_COMMON_NAME, SC_COUNT,
737c478bd9Sstevel@tonic-gate 	SC_INSTANCE_CREATE_DEFAULT, SC_DEPENDENCY, SC_DEPENDENT, SC_DESCRIPTION,
747c478bd9Sstevel@tonic-gate 	SC_DOC_LINK, SC_DOCUMENTATION, SC_ENABLED, SC_EXEC_METHOD, SC_FMRI,
757c478bd9Sstevel@tonic-gate 	SC_HOST, SC_HOSTNAME, SC_INSTANCE, SC_INTEGER, SC_LOCTEXT, SC_MANPAGE,
767c478bd9Sstevel@tonic-gate 	SC_METHOD_CONTEXT, SC_METHOD_CREDENTIAL, SC_METHOD_PROFILE,
777c478bd9Sstevel@tonic-gate 	SC_METHOD_ENVIRONMENT, SC_METHOD_ENVVAR, SC_NET_ADDR_V4, SC_NET_ADDR_V6,
787c478bd9Sstevel@tonic-gate 	SC_OPAQUE, SC_PROPERTY, SC_PROPERTY_GROUP, SC_PROPVAL, SC_RESTARTER,
797c478bd9Sstevel@tonic-gate 	SC_SERVICE, SC_SERVICE_BUNDLE, SC_SERVICE_FMRI, SC_INSTANCE_SINGLE,
807c478bd9Sstevel@tonic-gate 	SC_STABILITY, SC_TEMPLATE, SC_TIME, SC_URI, SC_USTRING, SC_VALUE_NODE,
817c478bd9Sstevel@tonic-gate 	SC_XI_FALLBACK, SC_XI_INCLUDE
827c478bd9Sstevel@tonic-gate } element_t;
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate typedef enum bundle_type {
857c478bd9Sstevel@tonic-gate 	SVCCFG_UNKNOWN_BUNDLE, SVCCFG_MANIFEST, SVCCFG_PROFILE, SVCCFG_ARCHIVE
867c478bd9Sstevel@tonic-gate } bundle_type_t;
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate typedef struct bundle {
897c478bd9Sstevel@tonic-gate 	uu_list_t	*sc_bundle_services;
907c478bd9Sstevel@tonic-gate 
917c478bd9Sstevel@tonic-gate 	xmlChar		*sc_bundle_name;
927c478bd9Sstevel@tonic-gate 	bundle_type_t	sc_bundle_type;
937c478bd9Sstevel@tonic-gate } bundle_t;
947c478bd9Sstevel@tonic-gate 
957c478bd9Sstevel@tonic-gate typedef enum service_type {
967c478bd9Sstevel@tonic-gate 	SVCCFG_UNKNOWN_SERVICE = 0x0, SVCCFG_SERVICE, SVCCFG_RESTARTER,
977c478bd9Sstevel@tonic-gate 	SVCCFG_MILESTONE
987c478bd9Sstevel@tonic-gate } service_type_t;
997c478bd9Sstevel@tonic-gate 
1007c478bd9Sstevel@tonic-gate typedef enum entity_type {
1017c478bd9Sstevel@tonic-gate 	SVCCFG_SERVICE_OBJECT = 0x0, SVCCFG_INSTANCE_OBJECT,
1027c478bd9Sstevel@tonic-gate 	SVCCFG_TEMPLATE_OBJECT
1037c478bd9Sstevel@tonic-gate } entity_type_t;
1047c478bd9Sstevel@tonic-gate 
1057c478bd9Sstevel@tonic-gate enum import_state {
1067c478bd9Sstevel@tonic-gate 	IMPORT_NONE = 0,
1077c478bd9Sstevel@tonic-gate 	IMPORT_PREVIOUS,
1087c478bd9Sstevel@tonic-gate 	IMPORT_PROP_BEGUN,
1097c478bd9Sstevel@tonic-gate 	IMPORT_PROP_DONE,
1107c478bd9Sstevel@tonic-gate 	IMPORT_COMPLETE,
1117c478bd9Sstevel@tonic-gate 	IMPORT_REFRESHED
1127c478bd9Sstevel@tonic-gate };
1137c478bd9Sstevel@tonic-gate 
1147c478bd9Sstevel@tonic-gate typedef struct entity {
1157c478bd9Sstevel@tonic-gate 	uu_list_node_t	sc_node;
1167c478bd9Sstevel@tonic-gate 	entity_type_t sc_etype;
1177c478bd9Sstevel@tonic-gate 
1187c478bd9Sstevel@tonic-gate 	/* Common fields to all entities. */
1197c478bd9Sstevel@tonic-gate 	const char	*sc_name;
1207c478bd9Sstevel@tonic-gate 	const char	*sc_fmri;
1217c478bd9Sstevel@tonic-gate 	uu_list_t	*sc_pgroups;
1227c478bd9Sstevel@tonic-gate 	uu_list_t	*sc_dependents;
1237c478bd9Sstevel@tonic-gate 	struct entity	*sc_parent;
1247c478bd9Sstevel@tonic-gate 	enum import_state  sc_import_state;
1257c478bd9Sstevel@tonic-gate 	int		sc_seen;
1267c478bd9Sstevel@tonic-gate 
1277c478bd9Sstevel@tonic-gate 	union {
1287c478bd9Sstevel@tonic-gate 		struct {
1297c478bd9Sstevel@tonic-gate 			uu_list_t	*sc_service_instances;
1307c478bd9Sstevel@tonic-gate 			service_type_t	sc_service_type;
1317c478bd9Sstevel@tonic-gate 			uint_t		sc_service_version;
1327c478bd9Sstevel@tonic-gate 
1337c478bd9Sstevel@tonic-gate 			struct entity *sc_service_template;
1347c478bd9Sstevel@tonic-gate 		} sc_service;
1357c478bd9Sstevel@tonic-gate 		struct {
1367c478bd9Sstevel@tonic-gate 			uint_t		sc_instance_dummy;
1377c478bd9Sstevel@tonic-gate 		} sc_instance;
1387c478bd9Sstevel@tonic-gate 		struct {
1397c478bd9Sstevel@tonic-gate 			uint_t		sc_template_dummy;
1407c478bd9Sstevel@tonic-gate 		} sc_template;
1417c478bd9Sstevel@tonic-gate 	} sc_u;
1427c478bd9Sstevel@tonic-gate } entity_t;
1437c478bd9Sstevel@tonic-gate 
1447c478bd9Sstevel@tonic-gate typedef struct pgroup {
1457c478bd9Sstevel@tonic-gate 	uu_list_node_t	sc_node;
1467c478bd9Sstevel@tonic-gate 	uu_list_t	*sc_pgroup_props;
1477c478bd9Sstevel@tonic-gate 
1487c478bd9Sstevel@tonic-gate 	const char	*sc_pgroup_name;
1497c478bd9Sstevel@tonic-gate 	const char	*sc_pgroup_type;
1507c478bd9Sstevel@tonic-gate 	uint_t		sc_pgroup_flags;
1517c478bd9Sstevel@tonic-gate 	struct entity	*sc_parent;
1527c478bd9Sstevel@tonic-gate 
1537c478bd9Sstevel@tonic-gate 	int		sc_pgroup_delete;
1547c478bd9Sstevel@tonic-gate 	int		sc_pgroup_override;
1557c478bd9Sstevel@tonic-gate 	const char	*sc_pgroup_fmri;	/* Used for dependents */
1567c478bd9Sstevel@tonic-gate 
1577c478bd9Sstevel@tonic-gate 	int		sc_pgroup_seen;
1587c478bd9Sstevel@tonic-gate } pgroup_t;
1597c478bd9Sstevel@tonic-gate 
1607c478bd9Sstevel@tonic-gate typedef struct property {
1617c478bd9Sstevel@tonic-gate 	uu_list_node_t	sc_node;
1627c478bd9Sstevel@tonic-gate 	uu_list_t	*sc_property_values;
1637c478bd9Sstevel@tonic-gate 
1647c478bd9Sstevel@tonic-gate 	char		*sc_property_name;
1657c478bd9Sstevel@tonic-gate 	scf_type_t	sc_value_type;
1667c478bd9Sstevel@tonic-gate 
1677c478bd9Sstevel@tonic-gate 	int		sc_property_override;
1687c478bd9Sstevel@tonic-gate 	int		sc_seen;
1697c478bd9Sstevel@tonic-gate } property_t;
1707c478bd9Sstevel@tonic-gate 
1717c478bd9Sstevel@tonic-gate typedef struct value {
1727c478bd9Sstevel@tonic-gate 	uu_list_node_t	sc_node;
1737c478bd9Sstevel@tonic-gate 
1747c478bd9Sstevel@tonic-gate 	scf_type_t	sc_type;
1757c478bd9Sstevel@tonic-gate 
1767c478bd9Sstevel@tonic-gate 	void (*sc_free)(struct value *);
1777c478bd9Sstevel@tonic-gate 
1787c478bd9Sstevel@tonic-gate 	union {
1797c478bd9Sstevel@tonic-gate 		uint64_t	sc_count;
1807c478bd9Sstevel@tonic-gate 		int64_t		sc_integer;
1817c478bd9Sstevel@tonic-gate 		char		*sc_string;
1827c478bd9Sstevel@tonic-gate 	} sc_u;
1837c478bd9Sstevel@tonic-gate } value_t;
1847c478bd9Sstevel@tonic-gate 
1857c478bd9Sstevel@tonic-gate typedef struct scf_callback {
1867c478bd9Sstevel@tonic-gate 	scf_handle_t	*sc_handle;
1877c478bd9Sstevel@tonic-gate 	void		*sc_parent;	/* immediate parent: scope, service,  */
1887c478bd9Sstevel@tonic-gate 					/* instance, property group, property */
1897c478bd9Sstevel@tonic-gate 	scf_transaction_t *sc_trans;
1907c478bd9Sstevel@tonic-gate 	int		sc_service;	/* True if sc_parent is a service. */
1917c478bd9Sstevel@tonic-gate 	uint_t		sc_flags;
1927c478bd9Sstevel@tonic-gate 	pgroup_t	*sc_general;	/* pointer to general property group */
1937c478bd9Sstevel@tonic-gate 
1947c478bd9Sstevel@tonic-gate 	const char	*sc_source_fmri;
1957c478bd9Sstevel@tonic-gate 	const char	*sc_target_fmri;
1967c478bd9Sstevel@tonic-gate 	int		sc_err;
1977c478bd9Sstevel@tonic-gate } scf_callback_t;
1987c478bd9Sstevel@tonic-gate 
1997c478bd9Sstevel@tonic-gate #ifndef NDEBUG
2007c478bd9Sstevel@tonic-gate #define	bad_error(func, err)	{					\
2017c478bd9Sstevel@tonic-gate 	(void) fprintf(stderr, "%s:%d: %s() failed with unexpected "	\
2027c478bd9Sstevel@tonic-gate 	    "error %d.  Aborting.\n", __FILE__, __LINE__, (func), (err)); \
2037c478bd9Sstevel@tonic-gate 	abort();							\
2047c478bd9Sstevel@tonic-gate }
2057c478bd9Sstevel@tonic-gate #else
2067c478bd9Sstevel@tonic-gate #define	bad_error(func, err)	abort()
2077c478bd9Sstevel@tonic-gate #endif
2087c478bd9Sstevel@tonic-gate 
2097c478bd9Sstevel@tonic-gate #define	SC_CMD_LINE		0x0
2107c478bd9Sstevel@tonic-gate #define	SC_CMD_FILE		0x1
2117c478bd9Sstevel@tonic-gate #define	SC_CMD_EOF		0x2
2127c478bd9Sstevel@tonic-gate #define	SC_CMD_IACTIVE		0x4
2137c478bd9Sstevel@tonic-gate #define	SC_CMD_DONT_EXIT	0x8
2147c478bd9Sstevel@tonic-gate 
2157c478bd9Sstevel@tonic-gate typedef struct engine_state {
2167c478bd9Sstevel@tonic-gate 	uint_t		sc_cmd_flags;
2177c478bd9Sstevel@tonic-gate 	FILE		*sc_cmd_file;
2187c478bd9Sstevel@tonic-gate 	uint_t		sc_cmd_lineno;
2197c478bd9Sstevel@tonic-gate 	const char	*sc_cmd_filename;
2207c478bd9Sstevel@tonic-gate 	char		*sc_cmd_buf;
2217c478bd9Sstevel@tonic-gate 	size_t		sc_cmd_bufsz;
2227c478bd9Sstevel@tonic-gate 	off_t		sc_cmd_bufoff;
2237c478bd9Sstevel@tonic-gate 	GetLine		*sc_gl;
2247c478bd9Sstevel@tonic-gate 
2257c478bd9Sstevel@tonic-gate 	pid_t		sc_repo_pid;
2267c478bd9Sstevel@tonic-gate 	const char	*sc_repo_filename;
2277c478bd9Sstevel@tonic-gate 	const char	*sc_repo_doordir;
2287c478bd9Sstevel@tonic-gate 	const char	*sc_repo_doorname;
2297c478bd9Sstevel@tonic-gate 	const char	*sc_repo_server;
2307c478bd9Sstevel@tonic-gate } engine_state_t;
2317c478bd9Sstevel@tonic-gate 
2327c478bd9Sstevel@tonic-gate extern engine_state_t *est;
2337c478bd9Sstevel@tonic-gate 
2347c478bd9Sstevel@tonic-gate typedef struct string_list {
2357c478bd9Sstevel@tonic-gate 	uu_list_node_t	node;
2367c478bd9Sstevel@tonic-gate 	char		*str;
2377c478bd9Sstevel@tonic-gate } string_list_t;
2387c478bd9Sstevel@tonic-gate 
2397c478bd9Sstevel@tonic-gate extern uu_list_pool_t *string_pool;
2407c478bd9Sstevel@tonic-gate 
2417c478bd9Sstevel@tonic-gate struct help_message {
2427c478bd9Sstevel@tonic-gate 	int		token;
2437c478bd9Sstevel@tonic-gate 	const char	*message;
2447c478bd9Sstevel@tonic-gate };
2457c478bd9Sstevel@tonic-gate 
2467c478bd9Sstevel@tonic-gate extern struct help_message help_messages[];
2477c478bd9Sstevel@tonic-gate 
2487c478bd9Sstevel@tonic-gate extern scf_handle_t *g_hndl;	/* global repcached connection handle */
2497c478bd9Sstevel@tonic-gate extern int g_exitcode;
2507c478bd9Sstevel@tonic-gate extern int g_verbose;
2517c478bd9Sstevel@tonic-gate 
2527c478bd9Sstevel@tonic-gate extern ssize_t max_scf_fmri_len;
2537c478bd9Sstevel@tonic-gate extern ssize_t max_scf_name_len;
2547c478bd9Sstevel@tonic-gate extern ssize_t max_scf_value_len;
2557c478bd9Sstevel@tonic-gate extern ssize_t max_scf_pg_type_len;
2567c478bd9Sstevel@tonic-gate 
2577c478bd9Sstevel@tonic-gate /* Common strings */
2587c478bd9Sstevel@tonic-gate extern const char * const name_attr;
2597c478bd9Sstevel@tonic-gate extern const char * const type_attr;
2607c478bd9Sstevel@tonic-gate extern const char * const value_attr;
2617c478bd9Sstevel@tonic-gate extern const char * const enabled_attr;
2627c478bd9Sstevel@tonic-gate extern const char * const scf_pg_general;
2637c478bd9Sstevel@tonic-gate extern const char * const scf_group_framework;
2647c478bd9Sstevel@tonic-gate extern const char * const true;
2657c478bd9Sstevel@tonic-gate extern const char * const false;
2667c478bd9Sstevel@tonic-gate 
2677c478bd9Sstevel@tonic-gate #define	uu_list_append(list, elem)	uu_list_insert_before(list, NULL, elem)
2687c478bd9Sstevel@tonic-gate #define	uu_list_prepend(list, elem)	uu_list_insert_after(list, NULL, elem)
2697c478bd9Sstevel@tonic-gate 
2707c478bd9Sstevel@tonic-gate void *safe_malloc(size_t);
2717c478bd9Sstevel@tonic-gate char *safe_strdup(const char *);
2727c478bd9Sstevel@tonic-gate void warn(const char *, ...);
2737c478bd9Sstevel@tonic-gate void synerr(int);
2747c478bd9Sstevel@tonic-gate void semerr(const char *, ...);
2757c478bd9Sstevel@tonic-gate 
2767c478bd9Sstevel@tonic-gate void internal_init(void);
2777c478bd9Sstevel@tonic-gate void internal_dump(bundle_t *);
2787c478bd9Sstevel@tonic-gate 
2797c478bd9Sstevel@tonic-gate int value_cmp(const void *, const void *, void *);
2807c478bd9Sstevel@tonic-gate 
2817c478bd9Sstevel@tonic-gate bundle_t *internal_bundle_new(void);
2827c478bd9Sstevel@tonic-gate void internal_bundle_free(bundle_t *);
2837c478bd9Sstevel@tonic-gate entity_t *internal_service_new(const char *);
2847c478bd9Sstevel@tonic-gate void internal_service_free(entity_t *);
2857c478bd9Sstevel@tonic-gate entity_t *internal_instance_new(const char *);
2867c478bd9Sstevel@tonic-gate void internal_instance_free(entity_t *);
2877c478bd9Sstevel@tonic-gate entity_t *internal_template_new(void);
2887c478bd9Sstevel@tonic-gate pgroup_t *internal_pgroup_new(void);
2897c478bd9Sstevel@tonic-gate void internal_pgroup_free(pgroup_t *);
2907c478bd9Sstevel@tonic-gate pgroup_t *internal_pgroup_find(entity_t *, const char *, const char *);
2917c478bd9Sstevel@tonic-gate pgroup_t *internal_dependent_find(entity_t *, const char *);
2927c478bd9Sstevel@tonic-gate pgroup_t *internal_pgroup_find_or_create(entity_t *, const char *,
2937c478bd9Sstevel@tonic-gate     const char *);
2947c478bd9Sstevel@tonic-gate property_t *internal_property_new(void);
2957c478bd9Sstevel@tonic-gate void internal_property_free(property_t *);
2967c478bd9Sstevel@tonic-gate property_t *internal_property_find(pgroup_t *, const char *);
2977c478bd9Sstevel@tonic-gate property_t *internal_property_create(const char *, scf_type_t, uint_t, ...);
2987c478bd9Sstevel@tonic-gate value_t *internal_value_new(void);
2997c478bd9Sstevel@tonic-gate 
3007c478bd9Sstevel@tonic-gate int internal_attach_service(bundle_t *, entity_t *);
3017c478bd9Sstevel@tonic-gate int internal_attach_entity(entity_t *, entity_t *);
3027c478bd9Sstevel@tonic-gate int internal_attach_pgroup(entity_t *, pgroup_t *);
3037c478bd9Sstevel@tonic-gate int internal_attach_dependent(entity_t *, pgroup_t *);
3047c478bd9Sstevel@tonic-gate int internal_attach_property(pgroup_t *, property_t *);
3057c478bd9Sstevel@tonic-gate void internal_attach_value(property_t *, value_t *);
3067c478bd9Sstevel@tonic-gate 
3077c478bd9Sstevel@tonic-gate int load_init(void);
3087c478bd9Sstevel@tonic-gate void load_fini(void);
3097c478bd9Sstevel@tonic-gate int load_pg_attrs(const scf_propertygroup_t *, pgroup_t **);
3107c478bd9Sstevel@tonic-gate int load_pg(const scf_propertygroup_t *, pgroup_t **, const char *,
3117c478bd9Sstevel@tonic-gate     const char *);
3127c478bd9Sstevel@tonic-gate int prop_equal(property_t *, property_t *, const char *, const char *, int);
313*9e9ae1fcSbustos int pg_attrs_equal(const pgroup_t *, const pgroup_t *, const char *, int);
3147c478bd9Sstevel@tonic-gate int pg_equal(pgroup_t *, pgroup_t *);
3157c478bd9Sstevel@tonic-gate 
3167c478bd9Sstevel@tonic-gate void lscf_cleanup(void);
3177c478bd9Sstevel@tonic-gate void lscf_prep_hndl(void);
3187c478bd9Sstevel@tonic-gate void lscf_init(void);
3197c478bd9Sstevel@tonic-gate int lscf_bundle_import(bundle_t *, const char *, uint_t);
3207c478bd9Sstevel@tonic-gate int lscf_bundle_apply(bundle_t *);
3217c478bd9Sstevel@tonic-gate void lscf_delete(const char *, int);
3227c478bd9Sstevel@tonic-gate void lscf_list(const char *);
3237c478bd9Sstevel@tonic-gate void lscf_select(const char *);
3247c478bd9Sstevel@tonic-gate void lscf_unselect();
3257c478bd9Sstevel@tonic-gate void lscf_get_selection_str(char *, size_t);
3267c478bd9Sstevel@tonic-gate void lscf_add(const char *);
3277c478bd9Sstevel@tonic-gate void lscf_listpg(const char *);
3287c478bd9Sstevel@tonic-gate void lscf_addpg(const char *, const char *, const char *);
3297c478bd9Sstevel@tonic-gate void lscf_delpg(char *);
3307c478bd9Sstevel@tonic-gate void lscf_listprop(const char *);
3317c478bd9Sstevel@tonic-gate void lscf_addprop(char *, const char *, const uu_list_t *);
3327c478bd9Sstevel@tonic-gate void lscf_delprop(char *);
3337c478bd9Sstevel@tonic-gate void lscf_listsnap();
3347c478bd9Sstevel@tonic-gate void lscf_selectsnap(const char *);
3357c478bd9Sstevel@tonic-gate void lscf_revert(const char *);
3367c478bd9Sstevel@tonic-gate char *filename_to_propname(const char *);
3377c478bd9Sstevel@tonic-gate int lscf_retrieve_hash(const char *, unsigned char *);
3387c478bd9Sstevel@tonic-gate int lscf_store_hash(const char *, unsigned char *);
3397c478bd9Sstevel@tonic-gate CPL_MATCH_FN(complete_select);
3407c478bd9Sstevel@tonic-gate CPL_MATCH_FN(complete_command);
3417c478bd9Sstevel@tonic-gate 
3427c478bd9Sstevel@tonic-gate int lxml_init(void);
3437c478bd9Sstevel@tonic-gate int lxml_get_bundle_file(bundle_t *, const char *, int);
3447c478bd9Sstevel@tonic-gate 
3457c478bd9Sstevel@tonic-gate void engine_init(void);
3467c478bd9Sstevel@tonic-gate int engine_exec_cmd(void);
3477c478bd9Sstevel@tonic-gate int engine_exec(char *);
3487c478bd9Sstevel@tonic-gate int add_cmd_matches(WordCompletion *, const char *, int, uint32_t);
3497c478bd9Sstevel@tonic-gate int engine_interp(void);
3507c478bd9Sstevel@tonic-gate int engine_source(const char *, boolean_t);
3517c478bd9Sstevel@tonic-gate int engine_import(uu_list_t *);
3527c478bd9Sstevel@tonic-gate void help(int);
3537c478bd9Sstevel@tonic-gate 
3547c478bd9Sstevel@tonic-gate int engine_cmd_getc(engine_state_t *);
3557c478bd9Sstevel@tonic-gate int engine_cmd_ungetc(engine_state_t *, char);
3567c478bd9Sstevel@tonic-gate void engine_cmd_nputs(engine_state_t *, char *, size_t);
3577c478bd9Sstevel@tonic-gate 
3587c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3597c478bd9Sstevel@tonic-gate }
3607c478bd9Sstevel@tonic-gate #endif
3617c478bd9Sstevel@tonic-gate 
3627c478bd9Sstevel@tonic-gate #endif	/* _CMD_SVCCFG_H */
363