1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #include <sys/types.h>
28 
29 #include "fmevt.h"
30 
31 const fmd_prop_t fmevt_props[] = {
32 	{ "protocol_forward_disable", FMD_TYPE_BOOL, "false" },
33 	{ "outbound_channel", FMD_TYPE_STRING, FMD_SNOOP_CHANNEL },
34 	{ "outbound_channel_depth", FMD_TYPE_INT32, "256" },
35 	{ NULL, 0, NULL },
36 };
37 
38 static const fmd_hdl_ops_t fmd_ops = {
39 	fmevt_recv,	/* fmdo_recv */
40 	NULL,		/* fmdo_timeout */
41 	NULL,		/* fmdo_close */
42 	NULL,		/* fmdo_stats */
43 	NULL,		/* fmdo_gc */
44 	NULL,		/* fmdo_send */
45 	NULL		/* fmdo_topo */
46 };
47 
48 static const fmd_hdl_info_t fmd_info = {
49 	"External FM event transport", "0.1", &fmd_ops, fmevt_props
50 };
51 
52 void
53 _fmd_init(fmd_hdl_t *hdl)
54 {
55 	/*
56 	 * Register the handle, pulling in configuration from our
57 	 * conf file.  This includes our event class subscriptions
58 	 * for those events that we will forward out of fmd.
59 	 */
60 	if (fmd_hdl_register(hdl, FMD_API_VERSION, &fmd_info) != 0)
61 		return;
62 
63 	fmevt_init_outbound(hdl);
64 }
65 
66 void
67 _fmd_fini(fmd_hdl_t *hdl)
68 {
69 	fmevt_fini_outbound(hdl);
70 }
71