fmd_scheme.h revision 25c6ff4b77fcddf4097ce78a8277275ca603b46c
/*
* 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
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _FMD_SCHEME_H
#define _FMD_SCHEME_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <libnvpair.h>
#include <pthread.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Scheme operations. These function pointers are filled in when the scheme
* is loaded. New operations must be added here as well as to the default
* operations declaration and initialization table in fmd_scheme.c.
*/
typedef struct fmd_scheme_ops {
int (*sop_init)(void);
void (*sop_fini)(void);
int (*sop_expand)(nvlist_t *);
int (*sop_present)(nvlist_t *);
int (*sop_replaced)(nvlist_t *);
int (*sop_service_state)(nvlist_t *);
int (*sop_unusable)(nvlist_t *);
typedef struct fmd_scheme_opd {
const char *opd_name; /* symbol name of scheme function */
typedef struct fmd_scheme {
char *sch_name; /* name of this scheme (fmri prefix) */
void *sch_dlp; /* libdl(3DL) shared library handle */
} fmd_scheme_t;
typedef struct fmd_scheme_hash {
char *sch_dirpath; /* directory path for schemes */
extern fmd_scheme_hash_t *fmd_scheme_hash_create(const char *, const char *);
extern void fmd_scheme_hash_destroy(fmd_scheme_hash_t *);
extern void fmd_scheme_hash_trygc(fmd_scheme_hash_t *);
#ifdef __cplusplus
}
#endif
#endif /* _FMD_SCHEME_H */