fmd_self.c revision 9dd0f810214fdc8e1af881a9a5c4b6927629ff9e
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <fmd_api.h>
#include <fmd_subr.h>
#include <fmd_string.h>
#include <fmd_protocol.h>
#include <fmd_module.h>
#include <fmd_error.h>
static struct {
} self_stats = {
};
typedef struct self_case {
char *sc_name;
} self_case_t;
static self_case_t *
{
return (scp);
}
static void
{
}
static fmd_case_t *
{
break;
}
return (cp);
}
/*ARGSUSED*/
static void
{
fmd_case_t *cp;
char *name;
int err = 0;
/*
* If we get an error report from another fmd module, then create a
* case for the module and add the ereport to it. The error is either
* from fmd_hdl_error() or from fmd_api_error(). If it is the latter,
* fmd_module_error() will send another event of class EFMD_MOD_FAIL
* when the module has failed, at which point we can solve the case.
* We can also close the case on EFMD_MOD_CONF (bad config file).
*/
}
return; /* module is still active, so keep case open */
return; /* case is already closed but error in _fini */
return;
}
/*
* If we get an I/O DDI ereport, drop it for now until the I/O DE is
* implemented and integrated. Existing drivers in O/N have bugs that
* will trigger these and we don't want this producing FMD_FLT_NOSUB.
*/
return; /* if we got a DDI ereport, drop it for now */
/*
* If we get any other type of event then it is of a class for which
* there are no subscribers. Some of these correspond to internal fmd
* errors, which we ignore. Otherwise we keep one case per class and
* use it to produce a message indicating that something is awry.
*/
return; /* if no agents are present just drop list.suspect */
return; /* if fmd itself produced the error just drop it */
return; /* if fmd itself produced the event just drop it */
return; /* case is already open against this class */
}
static void
{
}
static const fmd_hdl_ops_t self_ops = {
self_recv, /* fmdo_recv */
NULL, /* fmdo_timeout */
self_close, /* fmdo_close */
NULL, /* fmdo_stats */
NULL, /* fmdo_gc */
};
void
{
fmd_hdl_info_t info = {
};
/*
* Unlike other modules, fmd-self-diagnosis has some special needs that
* fall outside of what we want in the module API. Manually disable
* checkpointing for this module by tweaking the mod_stats values.
* The self-diagnosis world relates to fmd's running state and modules
* which all change when it restarts, so don't bother w/ checkpointing.
*/
return; /* failed to register with fmd */
}
void
{
}