/*
* 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 <unistd.h>
#include <stdio.h>
#include <string.h>
#include <libnvpair.h>
#include "out.h"
#include "stats.h"
#include "alloc.h"
#include "stable.h"
#include "literals.h"
#include "lut.h"
#include "esclex.h"
#include "tree.h"
#include "ipath.h"
#include "itree.h"
#include "iexpr.h"
#include "ptree.h"
#include "check.h"
#include "version.h"
#include "fme.h"
#include "eval.h"
#include "config.h"
#include "platform.h"
/*
* eversholt diagnosis engine (eft.so) main entry points
*/
int Verbose;
int Estats;
char **Efts;
/* stuff exported by yacc-generated parsers */
extern void yyparse(void);
extern int yydebug;
extern void literals_init(void);
extern void literals_fini(void);
struct eftsubr {
const char *prefix;
} eftsubrs[] = {
{ "ereport.", fme_receive_external_report },
{ "list.repaired", fme_receive_repair_list },
};
/*ARGSUSED*/
static void
{
break;
sp++;
}
} else {
"eft_recv: event class \"%s\" does not match our "
"subscriptions", class);
}
}
/*ARGSUSED*/
static void
{
return;
}
static void
{
}
/*
* The "serd_override" property allows the N and T parameters of specified serd
* engines to be overridden. The property is a string consisting of one or more
* space separated triplets. Each triplet is of the form "name,N,T" where "name"
* is the name of the serd engine and N and T are the new paremeters to use.
* For example "serd.io.device.nonfatal,5,3h" would set the parameters for the
* serd.io.device.nonfatal engine to 5 in 3 hours.
*/
};
/*ARGSUSED*/
static void
{
}
eft_recv, /* fmdo_recv */
eft_timeout, /* fmdo_timeout */
eft_close, /* fmdo_close */
NULL, /* fmdo_stats */
NULL, /* fmdo_gc */
NULL, /* fmdo_send */
eft_topo_change /* fmdo_topo_change */
};
#define str(s) #s
"eft diagnosis engine",
};
/*
* ename_strdup -- like strdup but ename comes in and class string goes out
*/
static char *
{
int len;
char *buf;
/* calculate length of buffer required */
len = 0;
buf[0] = '\0';
/* now build the string */
while (np) {
if (np)
}
return (buf);
}
/*ARGSUSED*/
static void
{
}
/*ARGSUSED*/
static void
{
}
/*
* Call all of the _fini() routines to clean up the exiting DE
*/
void
call_finis(void)
{
fme_fini();
itree_fini();
ipath_fini();
iexpr_fini();
istat_fini();
serd_fini();
lex_free();
check_fini();
tree_fini();
lut_fini();
stable_fini();
stats_fini();
out_fini();
alloc_fini();
}
/*ARGSUSED*/
static void
{
}
void
{
int count;
char *fname;
/* keep handle for routines like out() which need it */
/* set up out(O_ALTFP) first things so it is available for debug */
alloc_init();
out_init("eft");
}
(void) setlinebuf(fp);
}
stable_init(0);
lut_init();
tree_init();
ipath_init();
iexpr_init();
check_init();
/*
* If we read no .eft files, we can't do any
* diagnosing, so we just unload ourselves
*/
if (stats_counter_value(Filecount) == 0) {
(void) lex_fini();
call_finis();
return;
}
yyparse();
(void) lex_fini();
tree_report();
if (count = out_errcount())
/* subscribe to events we expect to consume */
/* subscribe to repair events so we can clear state on repair */
/* open dictionaries referenced by all .eft files */
}
}
/*ARGSUSED*/
void
{
call_finis();
}