topo_fmri.c revision 0eb822a1c0c2bea495647510b75f77f0e57633eb
/*
* 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 <string.h>
#include <limits.h>
#include <fm/topo_mod.h>
#include <topo_alloc.h>
#include <topo_error.h>
#include <topo_method.h>
#include <topo_subr.h>
#include <topo_string.h>
/*ARGSUSED*/
static int
{
topo_strerror(err));
return (-1);
}
/*ARGSUSED*/
static nvlist_t *
{
topo_strerror(err));
return (NULL);
}
int
{
TOPO_METH_NVL2STR, out));
TOPO_METH_NVL2STR, out));
TOPO_METH_NVL2STR, out));
TOPO_METH_NVL2STR, out));
return (0);
}
int
int *err)
{
TOPO_METH_STR2NVL, in));
*f = '\0'; /* strip trailing FMRI path */
TOPO_METH_STR2NVL, in));
in));
in));
TOPO_METH_STR2NVL, in));
return (0);
}
/* ARGSUSED */
static int
{
int err;
return (present);
}
return (present);
}
int
{
int ret = 0;
char *scheme;
return (ret);
TOPO_METH_PRESENT, out));
TOPO_METH_PRESENT, out));
return (present);
}
return (present);
}
int
{
int rc;
char *scheme;
out));
out));
out));
return (rc);
}
int
{
int rc;
char *scheme;
return (rc);
}
int
{
char *scheme;
TOPO_METH_EXPAND, out));
TOPO_METH_EXPAND, out));
return (0);
}
struct rsrc {
int rs_err;
int rs_flag;
};
/*ARGSUSED*/
static int
{
return (-1);
return (0);
} else {
return (-1);
return (0);
}
}
int
{
struct rsrc r;
r.rs_flag = 0;
r.rs_err = 0;
}
return (0);
}
int
int *err)
{
struct rsrc r;
r.rs_flag = 1;
r.rs_err = 0;
}
return (0);
}
int
{
int rc;
return (0);
NULL));
in));
return (rc);
}
struct topo_lookup {
int tl_ret;
void *tl_pdata;
};
static int
{
int rc;
return (TOPO_WALK_ERR);
if (rc == 0)
return (TOPO_WALK_NEXT);
else if (rc == -1)
return (TOPO_WALK_ERR);
return (TOPO_WALK_TERMINATE);
}
int
{
int err;
char *scheme;
struct topo_lookup tl;
"topo_fmri_invoke", NULL));
if (err == TOPO_WALK_ERR) {
return (-1);
}
return (0);
}
/*
* topo_fmri_create
*
* If possible, creates an FMRI of the requested version in the
* requested scheme. Args are passed as part of the inputs to the
* fmri-create method of the scheme.
*/
nvlist_t *
{
TOPO_METH_FMRI, NULL));
TOPO_METH_FMRI, NULL));
TOPO_METH_FMRI, ins));
}
TOPO_METH_FMRI, ins));
}
if (topo_method_invoke(rnode,
}
return (out);
}