149b225e1SGavin Maltby /*
249b225e1SGavin Maltby  * CDDL HEADER START
349b225e1SGavin Maltby  *
449b225e1SGavin Maltby  * The contents of this file are subject to the terms of the
549b225e1SGavin Maltby  * Common Development and Distribution License (the "License").
649b225e1SGavin Maltby  * You may not use this file except in compliance with the License.
749b225e1SGavin Maltby  *
849b225e1SGavin Maltby  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
949b225e1SGavin Maltby  * or http://www.opensolaris.org/os/licensing.
1049b225e1SGavin Maltby  * See the License for the specific language governing permissions
1149b225e1SGavin Maltby  * and limitations under the License.
1249b225e1SGavin Maltby  *
1349b225e1SGavin Maltby  * When distributing Covered Code, include this CDDL HEADER in each
1449b225e1SGavin Maltby  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1549b225e1SGavin Maltby  * If applicable, add the following below this CDDL HEADER, with the
1649b225e1SGavin Maltby  * fields enclosed by brackets "[]" replaced with your own identifying
1749b225e1SGavin Maltby  * information: Portions Copyright [yyyy] [name of copyright owner]
1849b225e1SGavin Maltby  *
1949b225e1SGavin Maltby  * CDDL HEADER END
2049b225e1SGavin Maltby  */
2149b225e1SGavin Maltby 
2249b225e1SGavin Maltby /*
23*f6e214c7SGavin Maltby  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
2449b225e1SGavin Maltby  */
2549b225e1SGavin Maltby 
2649b225e1SGavin Maltby #include <sys/types.h>
2749b225e1SGavin Maltby 
2849b225e1SGavin Maltby #include "fmevt.h"
2949b225e1SGavin Maltby 
3049b225e1SGavin Maltby const fmd_prop_t fmevt_props[] = {
3149b225e1SGavin Maltby 	{ "protocol_forward_disable", FMD_TYPE_BOOL, "false" },
3249b225e1SGavin Maltby 	{ "outbound_channel", FMD_TYPE_STRING, FMD_SNOOP_CHANNEL },
3349b225e1SGavin Maltby 	{ "outbound_channel_depth", FMD_TYPE_INT32, "256" },
34*f6e214c7SGavin Maltby 	{ "user_priv_highval_channel", FMD_TYPE_STRING,
35*f6e214c7SGavin Maltby 	    FMEV_CHAN_USER_PRIV_HV },
36*f6e214c7SGavin Maltby 	{ "user_priv_lowval_channel", FMD_TYPE_STRING,
37*f6e214c7SGavin Maltby 	    FMEV_CHAN_USER_PRIV_LV },
38*f6e214c7SGavin Maltby 	{ "sidprefix", FMD_TYPE_STRING, "fmd" },
39*f6e214c7SGavin Maltby 	{ "inbound_postprocess_smf", FMD_TYPE_BOOL, "true" },
4049b225e1SGavin Maltby 	{ NULL, 0, NULL },
4149b225e1SGavin Maltby };
4249b225e1SGavin Maltby 
4349b225e1SGavin Maltby static const fmd_hdl_ops_t fmd_ops = {
4449b225e1SGavin Maltby 	fmevt_recv,	/* fmdo_recv */
4549b225e1SGavin Maltby 	NULL,		/* fmdo_timeout */
4649b225e1SGavin Maltby 	NULL,		/* fmdo_close */
4749b225e1SGavin Maltby 	NULL,		/* fmdo_stats */
4849b225e1SGavin Maltby 	NULL,		/* fmdo_gc */
4949b225e1SGavin Maltby 	NULL,		/* fmdo_send */
5049b225e1SGavin Maltby 	NULL		/* fmdo_topo */
5149b225e1SGavin Maltby };
5249b225e1SGavin Maltby 
5349b225e1SGavin Maltby static const fmd_hdl_info_t fmd_info = {
54*f6e214c7SGavin Maltby 	"External FM event transport", "0.2", &fmd_ops, fmevt_props
5549b225e1SGavin Maltby };
5649b225e1SGavin Maltby 
57*f6e214c7SGavin Maltby fmd_hdl_t *fmevt_hdl;
58*f6e214c7SGavin Maltby 
5949b225e1SGavin Maltby void
_fmd_init(fmd_hdl_t * hdl)6049b225e1SGavin Maltby _fmd_init(fmd_hdl_t *hdl)
6149b225e1SGavin Maltby {
6249b225e1SGavin Maltby 	/*
6349b225e1SGavin Maltby 	 * Register the handle, pulling in configuration from our
6449b225e1SGavin Maltby 	 * conf file.  This includes our event class subscriptions
6549b225e1SGavin Maltby 	 * for those events that we will forward out of fmd.
6649b225e1SGavin Maltby 	 */
6749b225e1SGavin Maltby 	if (fmd_hdl_register(hdl, FMD_API_VERSION, &fmd_info) != 0)
6849b225e1SGavin Maltby 		return;
6949b225e1SGavin Maltby 
70*f6e214c7SGavin Maltby 	fmevt_hdl = hdl;
71*f6e214c7SGavin Maltby 
7249b225e1SGavin Maltby 	fmevt_init_outbound(hdl);
73*f6e214c7SGavin Maltby 	fmevt_init_inbound(hdl);
7449b225e1SGavin Maltby }
7549b225e1SGavin Maltby 
7649b225e1SGavin Maltby void
_fmd_fini(fmd_hdl_t * hdl)7749b225e1SGavin Maltby _fmd_fini(fmd_hdl_t *hdl)
7849b225e1SGavin Maltby {
7949b225e1SGavin Maltby 	fmevt_fini_outbound(hdl);
80*f6e214c7SGavin Maltby 	fmevt_fini_inbound(hdl);
8149b225e1SGavin Maltby }
82