/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Disk & Indicator Monitor configuration file support routines
*/
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <limits.h>
#include <pthread.h>
#include "disk_monitor.h"
#include "util.h"
#include "topo_gather.h"
extern log_class_t g_verbose;
const char *
{
switch (state & ~HPS_FAULTED) {
default:
case HPS_UNKNOWN:
return ("Unknown");
case HPS_ABSENT:
return ("Absent");
case HPS_PRESENT:
return ("Present");
case HPS_CONFIGURED:
return ("Configured");
case HPS_UNCONFIGURED:
return ("Unconfigured");
}
}
void
{
switch (err) {
"defined");
break;
"defined");
break;
case E_INVALID_STATE_CHANGE:
break;
case E_IND_MULTIPLY_DEFINED:
"Multiple Indicator definitions (name & state) detected");
break;
case E_IND_ACTION_REDUNDANT:
"specified");
break;
case E_IND_ACTION_CONFLICT:
"same Indicator) found");
break;
case E_IND_MISSING_FAULT_ON:
break;
case E_IND_MISSING_FAULT_OFF:
break;
BAY_IND_ACTION " property",
? '+' : '-',
break;
"(%s -> %s)",
break;
default:
break;
}
}
static int
{
long val;
errno = 0;
return (-1);
return (-1);
}
return (0);
}
const char *
{
char *str;
return ((const char *)str);
else
return (NULL);
}
int
{
return (-1);
}
nvlist_t *
{
return (NULL);
}
return (NULL);
}
return (nvlp);
}
{
return (newindicator);
}
void
{
else {
}
}
}
void
{
if (indp->ind_instr_spec)
}
}
{
return (lap);
}
void
{
else {
}
}
}
void
{
/* Free the whole list */
}
}
{
return (lrp);
}
void
{
else {
}
}
}
void
{
/* Free the whole list */
if (lrp->action_list)
}
}
dm_fru_t *
{
return (frup);
}
void
{
}
{
else
if (app_props)
else
dmp->state_change_count = 0;
return (dmp);
}
void
{
/* Free the whole list */
if (dmp->indrule_list)
}
}
static cfgdata_t *
{
return (NULL);
}
return (cdp);
}
static void
{
}
}
void
{
} else {
}
}
static void
{
}
{
char *buf;
int len;
/*
* Check indicator actions for conflicts
*/
case ENOENT:
break;
case 0:
break;
default:
break;
}
/* Look for the opposite action. If found, that's an error */
case ENOENT:
break;
case 0:
break;
default:
break;
}
}
return (rv);
}
{
char *buf;
int len;
/*
* Check inds for multiple definitions (same identifier or same action)
*/
/* Keep track of the +/-FAULT for checking later */
case ENOENT:
break;
case 0:
break;
default:
break;
}
}
/*
* Make sure we have a -FAULT and +FAULT
*/
if (!fault_on)
else if (!fault_off)
return (rv);
}
{
/*
* Ensure that no two rules have the same state transitions.
*/
case 0:
break;
case ENOENT:
break;
default:
break;
}
}
return (rv);
}
{
char *buf;
int len;
/*
* Ensure that every indicator action referenced in each ruleset
* exists in the indicator list given.
*/
}
case 0: /* Normal case */
break;
case ENOENT:
rv =
break;
default:
break;
}
}
}
return (rv);
}
{
/*
* The following are valid transitions:
*
* HPS_ABSENT -> HPS_PRESENT
* HPS_ABSENT -> HPS_CONFIGURED
* HPS_PRESENT -> HPS_CONFIGURED
* HPS_PRESENT -> HPS_ABSENT
* HPS_CONFIGURED -> HPS_UNCONFIGURED
* HPS_CONFIGURED -> HPS_ABSENT
* HPS_UNCONFIGURED -> HPS_ABSENT
* HPS_UNCONFIGURED -> HPS_CONFIGURED
*
*/
return (E_INVALID_STATE_CHANGE);
s2 != HPS_ABSENT))
return (E_INVALID_STATE_CHANGE);
s2 != HPS_ABSENT))
return (E_INVALID_STATE_CHANGE);
s2 != HPS_CONFIGURED))
return (E_INVALID_STATE_CHANGE);
else
return (E_NO_ERROR);
}
static void
{
char plusminus;
}
}
static void
{
char plusminus;
? '+' : '-';
}
}
}
static void
{
}
}
static void
{
}
static void
{
}
}
}
}
static void
{
/* First, print the properties, then the disks */
}
int
config_init(void)
{
if (init_configuration_from_topo() == 0) {
return (0);
}
return (-1);
}
int
{
int err, i = 0;
/* Pull in the properties from the DE configuration file */
case FMD_TYPE_UINT32:
case FMD_TYPE_INT32:
break;
case FMD_TYPE_UINT64:
case FMD_TYPE_INT64:
break;
case FMD_TYPE_STRING:
break;
}
if (intfound) {
} else if (strfound) {
}
if (strfound) {
}
i++;
}
return (err);
}
void
config_fini(void)
{
config_data = NULL;
}
nvlist_t *
dm_global_proplist(void)
{
return (config_data->props);
}