/*
* 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 <strings.h>
#include <limits.h>
#include <unistd.h>
#include <stdlib.h>
#include <alloca.h>
#include <fmd_rpc_adm.h>
#include <fmd_rpc.h>
#include <fmd_module.h>
#include <fmd_ustat.h>
#include <fmd_error.h>
#include <fmd_asru.h>
#include <fmd_ckpt.h>
#include <fmd_case.h>
#include <fmd_fmri.h>
#include <fmd_idspace.h>
#include <fmd_xprt.h>
#include <fmd.h>
{
if (fmd_rpc_deny(req)) {
return (TRUE);
}
break;
}
/*
* If mod_info is NULL, the module is in the middle of loading:
* do not report its presence to observability tools yet.
*/
continue;
}
break;
}
}
return (TRUE);
}
{
if (fmd_rpc_deny(req)) {
return (TRUE);
}
return (TRUE);
}
} else if (errno == EFMD_HDL_ABORT) {
} else
return (TRUE);
}
{
if (fmd_rpc_deny(req)) {
return (TRUE);
}
return (TRUE);
}
return (TRUE);
}
/*
* Note: the bcopy() here is valid only if no FMD_TYPE_STRING stats
* are present in mp->mod_stats. We don't use any for the daemon-
* maintained stats and provide this function in order to reduce the
* overhead of the fmstat(1M) default view, where these minimal stats
* must be retrieved for all of the active modules.
*/
sizeof (fmd_modstat_t));
} else {
}
return (TRUE);
}
{
if (fmd_rpc_deny(req)) {
/*
* Note: the bcopy() here is valid only if no FMD_TYPE_STRING
* stats are present in fmd.d_stats (see definition in fmd.c).
*/
} else {
}
return (TRUE);
}
{
const char *p;
int err = 0;
if (fmd_rpc_deny(req)) {
*rvp = FMD_ADM_ERR_PERM;
return (TRUE);
}
/*
* Before we endure the expense of constructing a module and attempting
* to load it, do a quick check to see if the pathname is valid.
*/
return (TRUE);
}
else
switch (errno) {
case EFMD_MOD_LOADED:
break;
case EFMD_MOD_INIT:
break;
default:
break;
}
}
return (TRUE);
}
{
int err = 0;
if (fmd_rpc_deny(req))
return (TRUE);
}
{
int err = 0;
if (fmd_rpc_deny(req))
if (err == 0)
if (errno == EFMD_MOD_INIT)
else
}
return (TRUE);
}
{
int err = 0;
if (fmd_rpc_deny(req))
else {
}
return (TRUE);
}
/*
* Unlike our other RPC callbacks, fmd_adm_rsrclist_1 can return large amounts
* of data that may exceed the underlying RPC transport buffer size if the
* To minimize the likelihood of running out of RPC buffer space and having to
* fail the client request, fmd_adm_rsrclist_1 returns a snapshot of the
* relevant FMRI strings only: the client can use fmd_adm_rsrcinfo_1 on an
* individual FMRI if more information is needed. To further reduce the XDR
* overhead, the string list is represented as XDR-opaque data where the
* entire list is returned as a string table (e.g. "fmriA\0fmriB\0...").
*/
static void
{
void *p;
/*
* Skip the ASRU if this fault is marked as invisible.
* If rrl_all is false, we take a quick look at asru_flags with no lock
* held to see if the ASRU is not faulty. If so,
* we don't want to report it by default and can just skip this ASRU.
* This helps keep overhead low in the common case, as the call to
* fmd_asru_getstate() can be expensive depending on the scheme.
*/
return;
return;
return; /* error has occurred or resource is in 'ok' state */
/*
* Lock the ASRU and reallocate rrl_buf[] to be large enough to hold
* another string, doubling it as needed. Then copy the new string
* on to the end, and increment rrl_len to indicate the used space.
*/
else
} else {
break;
}
}
}
}
{
if (fmd_rpc_deny(req))
else
return (TRUE);
}
{
int state;
if (fmd_rpc_deny(req)) {
return (TRUE);
}
return (TRUE);
}
return (TRUE);
}
static void
char *uuid)
{
if (fmd_rpc_deny(req))
*errp = FMD_ADM_ERR_PERM;
else {
if (err == FARA_ERR_RSRCNOTR)
*errp = 0;
}
}
{
/*
* If anyone does an fmadm flush command, discard any resolved
* cases that were being retained for historic diagnosis.
*/
if (fmd_rpc_deny(req))
else {
fmd_asru_flush, &err);
fmd_asru_flush, &err);
fmd_asru_flush, &err);
fmd_asru_flush, &err);
}
return (TRUE);
}
{
return (TRUE);
}
{
return (TRUE);
}
{
return (TRUE);
}
static void
{
}
static void
{
}
{
void *p;
if (fmd_rpc_deny(req)) {
return (TRUE);
}
return (TRUE);
}
/* In the first pass, collect the overall length of the buffer. */
return (TRUE);
}
if (p) {
/* In the second pass, populate the buffer with data. */
rvp);
} else {
}
return (TRUE);
}
static void
{
return;
}
else
}
{
if (fmd_rpc_deny(req)) {
return (TRUE);
}
return (TRUE);
}
} else
return (TRUE);
}
/*ARGSUSED*/
{
return (FALSE);
}
{
int err = 0;
if (fmd_rpc_deny(req)) {
*rvp = FMD_ADM_ERR_PERM;
return (TRUE);
}
return (TRUE);
}
if (fmd_serd_eng_fired(sgp)) {
} else {
}
} else
return (TRUE);
}
{
if (fmd_rpc_deny(req)) {
*rvp = FMD_ADM_ERR_PERM;
return (TRUE);
}
} else {
return (TRUE);
}
/*
* To rotate a log file, grab d_log_lock as writer to make sure no
* one else can discover the current log pointer. Then try to rotate
* the log. If we're successful, release the old log pointer.
*/
do {
if (try > 1)
(void) pthread_rwlock_wrlock(lockp);
}
(void) pthread_rwlock_unlock(lockp);
*rvp = 0;
else if (errno == EFMD_LOG_ROTBUSY)
else
return (TRUE);
}
{
int err = 0;
if (fmd_rpc_deny(req))
else if (fmd_case_repair(cp) != 0) {
}
return (TRUE);
}
{
int err = 0;
if (fmd_rpc_deny(req))
else if (fmd_case_acquit(cp) != 0) {
}
return (TRUE);
}
void
{
void *p;
return;
/*
* skip invisible cases
*/
return;
/*
* Lock the case and reallocate rcl_buf[] to be large enough to hold
* another string, doubling it as needed. Then copy the new string
* on to the end, and increment rcl_len to indicate the used space.
*/
return;
else
} else {
break;
}
}
}
}
{
if (fmd_rpc_deny(req))
else
return (TRUE);
}
{
int err = 0;
if (fmd_rpc_deny(req)) {
return (TRUE);
}
return (TRUE);
}
return (TRUE);
}
if (err != 0)
return (TRUE);
}
/*ARGSUSED*/
static void
{
}
{
if (fmd_rpc_deny(req)) {
return (TRUE);
}
/*
* Since we're taking a snapshot of the transports, and these could
* change after we return our result, there's no need to hold any kind
* of lock between retrieving ids_count and taking the snapshot. We'll
* just capture up to a maximum of whatever ids_count value we sampled.
*/
return (TRUE);
}
return (TRUE);
}
{
if (fmd_rpc_deny(req)) {
return (TRUE);
}
sizeof (fmd_stat_t);
return (TRUE);
}
return (TRUE);
}
/*
* Grab the stats lock and bcopy the entire transport stats array in
* one shot. Then go back through and duplicate any string values.
*/
}
return (TRUE);
}
int
{
return (TRUE);
}
/*
* Custom XDR routine for our API structure fmd_stat_t. This function must
* match the definition of fmd_stat_t in <fmd_api.h> and must also match
*/
{
case FMD_TYPE_BOOL:
break;
case FMD_TYPE_INT32:
break;
case FMD_TYPE_UINT32:
break;
case FMD_TYPE_INT64:
break;
case FMD_TYPE_UINT64:
case FMD_TYPE_TIME:
case FMD_TYPE_SIZE:
break;
case FMD_TYPE_STRING:
break;
}
return (rv);
}