4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
24 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
31 #pragma ident "%Z%%M% %I% %E% SMI"
33 #include <sys/types.h>
39 struct fmd_conf_param
;
41 typedef struct fmd_conf_ops
{
42 int (*co_set
)(struct fmd_conf_param
*, const char *);
43 void (*co_get
)(const struct fmd_conf_param
*, void *);
44 int (*co_del
)(struct fmd_conf_param
*, const char *);
45 void (*co_free
)(struct fmd_conf_param
*);
48 typedef struct fmd_conf_formal
{
50 const fmd_conf_ops_t
*cf_ops
;
51 const char *cf_default
;
54 typedef struct fmd_conf_param
{
55 const fmd_conf_formal_t
*cp_formal
;
56 struct fmd_conf_param
*cp_next
;
64 typedef struct fmd_conf_defer
{
67 struct fmd_conf_defer
*cd_next
;
70 typedef struct fmd_conf
{
71 pthread_rwlock_t cf_lock
;
72 const fmd_conf_formal_t
*cf_argv
;
75 fmd_conf_param_t
*cf_params
;
76 fmd_conf_param_t
**cf_parhash
;
78 fmd_conf_defer_t
*cf_defer
;
81 typedef struct fmd_conf_verb
{
83 int (*cv_exec
)(fmd_conf_t
*, int, char *[]);
86 typedef struct fmd_conf_path
{
87 const char **cpa_argv
;
91 typedef struct fmd_conf_mode
{
97 extern int fmd_conf_mode_set(const fmd_conf_mode_t
*,
98 fmd_conf_param_t
*, const char *);
99 extern void fmd_conf_mode_get(const fmd_conf_param_t
*, void *);
101 extern int fmd_conf_notsup(fmd_conf_param_t
*, const char *);
102 extern void fmd_conf_nop(fmd_conf_param_t
*);
104 extern const fmd_conf_ops_t fmd_conf_bool
; /* int */
105 extern const fmd_conf_ops_t fmd_conf_int8
; /* int8_t */
106 extern const fmd_conf_ops_t fmd_conf_uint8
; /* uint8_t */
107 extern const fmd_conf_ops_t fmd_conf_int16
; /* int16_t */
108 extern const fmd_conf_ops_t fmd_conf_uint16
; /* uint16_t */
109 extern const fmd_conf_ops_t fmd_conf_int32
; /* int32_t */
110 extern const fmd_conf_ops_t fmd_conf_uint32
; /* uint32_t */
111 extern const fmd_conf_ops_t fmd_conf_int64
; /* int64_t */
112 extern const fmd_conf_ops_t fmd_conf_uint64
; /* uint64_t */
113 extern const fmd_conf_ops_t fmd_conf_string
; /* const char* */
114 extern const fmd_conf_ops_t fmd_conf_path
; /* fmd_conf_path_t* */
115 extern const fmd_conf_ops_t fmd_conf_list
; /* fmd_conf_path_t* */
116 extern const fmd_conf_ops_t fmd_conf_time
; /* hrtime_t */
117 extern const fmd_conf_ops_t fmd_conf_size
; /* uint64_t */
118 extern const fmd_conf_ops_t fmd_conf_signal
; /* int */
119 extern const fmd_conf_ops_t fmd_conf_parent
; /* any */
121 extern const char FMD_PROP_SUBSCRIPTIONS
[]; /* fmd_conf_list */
122 extern const char FMD_PROP_DICTIONARIES
[]; /* fmd_conf_list */
124 #define FMD_CONF_DEFER 0x1 /* permit deferred settings */
126 extern fmd_conf_t
*fmd_conf_open(const char *,
127 int, const fmd_conf_formal_t
*, uint_t
);
128 extern void fmd_conf_merge(fmd_conf_t
*, const char *);
129 extern void fmd_conf_propagate(fmd_conf_t
*, fmd_conf_t
*, const char *);
130 extern void fmd_conf_close(fmd_conf_t
*);
132 extern const char *fmd_conf_getnzstr(fmd_conf_t
*, const char *);
133 extern const fmd_conf_ops_t
*fmd_conf_gettype(fmd_conf_t
*, const char *);
134 extern int fmd_conf_getprop(fmd_conf_t
*, const char *, void *);
135 extern int fmd_conf_setprop(fmd_conf_t
*, const char *, const char *);
136 extern int fmd_conf_delprop(fmd_conf_t
*, const char *, const char *);
142 #endif /* _FMD_CONF_H */