xref: /onnv-gate/usr/src/lib/libscf/common/libscf_impl.h (revision 1219:f89f56c2d9ac)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
22*1219Sraf 
230Sstevel@tonic-gate /*
24*1219Sraf  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
250Sstevel@tonic-gate  * Use is subject to license terms.
260Sstevel@tonic-gate  */
270Sstevel@tonic-gate 
280Sstevel@tonic-gate #ifndef	_LIBSCF_IMPL_H
290Sstevel@tonic-gate #define	_LIBSCF_IMPL_H
300Sstevel@tonic-gate 
310Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #ifndef NATIVE_BUILD
34*1219Sraf #include "c_synonyms.h"
350Sstevel@tonic-gate #endif
360Sstevel@tonic-gate 
370Sstevel@tonic-gate #include <libscf.h>
380Sstevel@tonic-gate #include <libscf_priv.h>
390Sstevel@tonic-gate 
400Sstevel@tonic-gate #ifdef	__cplusplus
410Sstevel@tonic-gate extern "C" {
420Sstevel@tonic-gate #endif
430Sstevel@tonic-gate 
440Sstevel@tonic-gate #define	SCF_FMRI_SVC_PREFIX		"svc:"
450Sstevel@tonic-gate #define	SCF_FMRI_FILE_PREFIX		"file:"
460Sstevel@tonic-gate #define	SCF_FMRI_SCOPE_PREFIX		"//"
470Sstevel@tonic-gate #define	SCF_FMRI_LOCAL_SCOPE		"localhost"
480Sstevel@tonic-gate #define	SCF_FMRI_SCOPE_SUFFIX		"@localhost"
490Sstevel@tonic-gate #define	SCF_FMRI_SERVICE_PREFIX		"/"
500Sstevel@tonic-gate #define	SCF_FMRI_INSTANCE_PREFIX	":"
510Sstevel@tonic-gate #define	SCF_FMRI_PROPERTYGRP_PREFIX	"/:properties/"
520Sstevel@tonic-gate #define	SCF_FMRI_PROPERTY_PREFIX	"/"
530Sstevel@tonic-gate /*
540Sstevel@tonic-gate  * This macro must be extended if additional FMRI prefixes are defined
550Sstevel@tonic-gate  */
560Sstevel@tonic-gate #define	SCF_FMRI_PREFIX_MAX_LEN		(sizeof (SCF_FMRI_SVC_PREFIX) > \
570Sstevel@tonic-gate 					    sizeof (SCF_FMRI_FILE_PREFIX) ? \
580Sstevel@tonic-gate 					    sizeof (SCF_FMRI_SVC_PREFIX) - 1 : \
590Sstevel@tonic-gate 					    sizeof (SCF_FMRI_FILE_PREFIX) - 1)
600Sstevel@tonic-gate 
610Sstevel@tonic-gate int scf_setup_error(void);
620Sstevel@tonic-gate int scf_set_error(scf_error_t);			/* returns -1 */
630Sstevel@tonic-gate 
640Sstevel@tonic-gate typedef enum {
650Sstevel@tonic-gate 	SCF_MSG_ARGTOOLONG,
660Sstevel@tonic-gate 	SCF_MSG_PATTERN_NOINSTANCE,
670Sstevel@tonic-gate 	SCF_MSG_PATTERN_NOINSTSVC,
680Sstevel@tonic-gate 	SCF_MSG_PATTERN_NOSERVICE,
690Sstevel@tonic-gate 	SCF_MSG_PATTERN_NOENTITY,
700Sstevel@tonic-gate 	SCF_MSG_PATTERN_MULTIMATCH,
710Sstevel@tonic-gate 	SCF_MSG_PATTERN_POSSIBLE,
720Sstevel@tonic-gate 	SCF_MSG_PATTERN_LEGACY
730Sstevel@tonic-gate } scf_msg_t;
740Sstevel@tonic-gate 
750Sstevel@tonic-gate const char *scf_get_msg(scf_msg_t);
760Sstevel@tonic-gate 
770Sstevel@tonic-gate #ifdef	__cplusplus
780Sstevel@tonic-gate }
790Sstevel@tonic-gate #endif
800Sstevel@tonic-gate 
810Sstevel@tonic-gate #endif	/* _LIBSCF_IMPL_H */
82