libfmnotify.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 <alloca.h>
#include "libfmnotify.h"
/*ARGSUSED*/
void
{
}
static void
{
}
/* PRINTFLIKE2 */
void
{
char timestamp[64];
}
}
void
{
}
/* PRINTFLIKE2 */
void
{
char timestamp[64];
}
/* PRINTFLIKE2 */
void
{
char timestamp[64];
}
void
{
else if (pid > 0)
exit(0);
(void) setsid();
(void) close(0);
(void) close(1);
/*
* service log
*/
}
/*
* This function returns a pointer to the specified SMF property group for the
* specified SMF service. The caller is responsible for freeing the property
* group. On failure, the function returns NULL.
*/
static scf_propertygroup_t *
const char *pgname)
{
goto get_pg_done;
}
else
return (ret);
}
int
{
char strval[255];
int ret = -1;
return (ret);
goto astring_done;
}
goto astring_done;
}
scf_strerror(scf_error()));
goto astring_done;
}
ret = 0;
return (ret);
}
int
{
int ret = -1;
return (ret);
goto bool_done;
}
goto bool_done;
}
scf_strerror(scf_error()));
goto bool_done;
}
ret = 0;
return (ret);
}
char *
{
char *svcname;
return (NULL);
}
return (NULL);
}
}
int
{
int ret = 1;
return (-1);
}
if (ret == SCF_ERROR_NOT_FOUND) {
"for this event");
goto pref_done;
} else {
goto pref_done;
}
}
&nelem) != 0) {
ret = 1;
goto pref_done;
}
*nprefs = 0;
for (int i = 0; i < nelem; i++) {
++*nprefs;
}
}
if (*nprefs == 0) {
mech);
goto pref_done;
}
ret = 0;
return (ret);
}
static int
{
for (int i = 0; i < nelem; i++)
return (1);
return (0);
}
/*
* This function takes a single string list and splits it into
* an string array (analogous to PERL split)
*
* The caller is responsible for freeing the array.
*/
int
{
size++;
return (-1);
}
if (size == 1)
else {
}
return (0);
}
/*
* This function merges two string arrays into a single array, removing any
* duplicates
*
* The caller is responsible for freeing the merged array.
*/
int
{
char **tmparr;
int uniq = -1;
for (int j = 0; j < n2; j++)
for (int j = 0; j < uniq; j++) {
if (tmparr[j])
}
return (-1);
}
return (uniq);
}
void
{
}
/*
* This function joins all the strings in a string array into a single string
* Each element will be delimited by a comma
*
* The caller is responsible for freeing the joined string.
*/
int
{
char *jbuf;
int i;
/*
* First, figure out how much space we need to allocate to store the
* joined string.
*/
for (i = 0; i < arrsz; i++)
return (-1);
}
for (i = 1; i < arrsz; i++)
return (0);
}
void
{
nvlist_free(arr[i]);
}
/*
* This function takes a dictionary name and event class and then uses
* libdiagcode to compute the MSG ID. We need this for looking up messages
* for the committed ireport.* events. For FMA list.* events, the MSG ID is
* is contained in the event payload.
*/
int
{
char *dirpath;
const char *key[2];
int ret = 0;
return (-1);
}
ret = -1;
}
return (ret);
}
/*
* This function takes an event and extracts the bits of the event payload that
* are of interest to notification daemons and conveniently tucks them into a
* single struct.
*
* The caller is responsible for freeing ev_info and any contained strings and
* nvlists. A convenience function, nd_free_event_info(), is provided for this
* purpose.
*/
int
{
return (-1);
}
/*
* Hold event; class and payload will be valid for as long as
* we hold the event.
*/
/*
* Lookup the MSGID, event description and severity and KA URL
*
* For FMA list.* events we just pull it out of the the event nvlist.
* For all other events we call a utility function that computes the
* diagcode using the dict name and class.
*/
== 0) {
} else
if (!evi->ei_severity)
else {
return (-1);
}
return (-1);
}
return (-1);
}
}
return (0);
}
static void
{
}
void
{
}