fps-transport.c revision f6e214c7418f43af38bd8c3a557e3d0a1d311cfa
/*
* 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
*/
/*
*/
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <fmd_module.h>
#include <fmd_scheme.h>
#include <fmd.h>
#include <libnvpair.h>
#include <libsysevent.h>
#include <errno.h>
#include <string.h>
#include <fpst-defines.h>
static const fmd_hdl_ops_t fps_ops = {
NULL, /* receive */
NULL, /* timeout */
NULL, /* close */
NULL, /* stats */
NULL /* gc */
};
static const fmd_hdl_info_t fmd_info = {
&fps_ops,
};
static struct sysev_stats {
} sysev_stats = {
{ "bad_class", FMD_TYPE_UINT64,
"events dropped due to invalid class" },
{ "bad_attr", FMD_TYPE_UINT64,
"events dropped due to invalid nvlist" },
};
static sysevent_subattr_t *subattr;
/*
* event_transfer(sysevent_t *ev, void *arg)
* takes a sysevent ev, extracts the nvlist of
* data for an ereport, and posts it to the fmd.
*/
/* ARGSUSED */
static int
{
" transport class %s\n", seq,
return (0);
}
} else {
return (EAGAIN);
}
" has an invalid payload.", seq);
}
return (0);
}
/*
* _fmd_fini(fmd_hdl_t *handle) is the
* module exit point. It unsubscribes
* and unbinds to FPS channel as well
* as closes fmd transport handle
*/
/* ARGSUSED */
void
{
(void) sysevent_evc_unbind(h_event);
}
}
/*
* _fmd_init(fmd_hdl_t *hdl) is the
* entry point into the module. It
* registers the handle hdl and
* subscribes to the fps sysevent channel.
*/
void
{
int ret = 0;
return;
}
}
"attributes: %s");
if (ret != 0) {
} else {
"Failed to subsrcibe to channel %s", CHANNEL);
}
}
}