midlevel.c revision 94501b61e12c24a6ea3abf427022ca0d4a302f3b
/*
* 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 "libscf_impl.h"
#include <libuutil.h>
#include <stdio.h>
#include <strings.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <libgen.h>
#include "midlevel_impl.h"
#ifndef NDEBUG
uu_warn("%s:%d: %s failed with unexpected error %d. Aborting.\n", \
abort(); \
}
#else
#endif
/* Path to speedy files area must end with a slash */
#define SMF_SPEEDY_FILES_PATH "/etc/svc/volatile/"
/*
* Internal private function that creates and binds a handle.
*/
static scf_handle_t *
handle_create(void)
{
scf_handle_t *h;
h = scf_handle_create(SCF_VERSION);
if (h == NULL)
return (NULL);
if (scf_handle_bind(h) == -1) {
return (NULL);
}
return (h);
}
/*
* Given a base service FMRI and the names of a property group and property,
* assemble_fmri() merges them into a property FMRI. Note that if the base
* FMRI is NULL, assemble_fmri() gets the base FMRI from scf_myname().
*/
static char *
const char *prop)
{
char *fmri_buf;
(void) scf_set_error(SCF_ERROR_INVALID_ARGUMENT);
return (NULL);
}
else
return (NULL);
} else {
}
(void) scf_set_error(SCF_ERROR_NO_MEMORY);
return (NULL);
}
return (NULL);
}
} else {
}
else
return (fmri_buf);
}
/*
* Given a property, this function allocates and fills an scf_simple_prop_t
* with the data it contains.
*/
static scf_simple_prop_t *
scf_handle_t *h)
{
int iterret, i;
(void) scf_set_error(SCF_ERROR_NO_MEMORY);
return (NULL);
}
else
(void) scf_set_error(SCF_ERROR_NO_MEMORY);
return (NULL);
}
(void) scf_set_error(SCF_ERROR_NO_MEMORY);
return (NULL);
}
goto error3;
goto error3;
goto error3;
}
goto error1;
numvals++) {
goto error1;
}
case SCF_TYPE_BOOLEAN:
if (scf_value_get_boolean(val,
goto error1;
break;
case SCF_TYPE_COUNT:
if (scf_value_get_count(val,
goto error1;
break;
case SCF_TYPE_INTEGER:
if (scf_value_get_integer(val,
goto error1;
break;
case SCF_TYPE_TIME:
if (scf_value_get_time(val,
goto error1;
break;
case SCF_TYPE_ASTRING:
-1)
goto error1;
NULL) {
(void) scf_set_error(SCF_ERROR_NO_MEMORY);
goto error1;
}
if (scf_value_get_astring(val,
goto error1;
}
break;
case SCF_TYPE_USTRING:
case SCF_TYPE_HOST:
case SCF_TYPE_HOSTNAME:
case SCF_TYPE_NET_ADDR_V4:
case SCF_TYPE_NET_ADDR_V6:
case SCF_TYPE_URI:
case SCF_TYPE_FMRI:
-1)
goto error1;
NULL) {
(void) scf_set_error(SCF_ERROR_NO_MEMORY);
goto error1;
}
if (scf_value_get_ustring(val,
goto error1;
}
break;
case SCF_TYPE_OPAQUE:
-1)
goto error1;
(void) scf_set_error(SCF_ERROR_NO_MEMORY);
goto error1;
}
if (scf_value_get_opaque(val,
valsize) == -1) {
goto error1;
}
break;
default:
(void) scf_set_error(SCF_ERROR_INTERNAL);
goto error1;
}
}
if (iterret == -1) {
if (scf_error() != SCF_ERROR_CONNECTION_BROKEN)
(void) scf_set_error(SCF_ERROR_INTERNAL);
goto error1;
}
(void) scf_value_destroy(val);
return (ret);
/*
* Exit point for a successful call. Below this line are exit points
* for failures at various stages during the function.
*/
goto error2;
case SCF_TYPE_ASTRING:
case SCF_TYPE_USTRING:
case SCF_TYPE_HOST:
case SCF_TYPE_HOSTNAME:
case SCF_TYPE_NET_ADDR_V4:
case SCF_TYPE_NET_ADDR_V6:
case SCF_TYPE_URI:
case SCF_TYPE_FMRI: {
for (i = 0; i < numvals; i++) {
}
break;
}
case SCF_TYPE_OPAQUE: {
for (i = 0; i < numvals; i++) {
}
break;
}
default:
break;
}
(void) scf_value_destroy(val);
return (NULL);
}
/*
* insert_app_props iterates over a property iterator, getting all the
* properties from a property group, and adding or overwriting them into
* a simple_app_props_t. This is used by scf_simple_app_props_get to provide
* insert_app_props iterates over a single property group.
*/
static int
scf_handle_t *h)
{
int propiter_ret;
if (scf_error() == SCF_ERROR_NOT_SET)
(void) scf_set_error(SCF_ERROR_INTERNAL);
return (-1);
}
found = 0;
found = 1;
return (-1);
else
} else {
}
}
if (!found) {
NULL)
return (-1);
else
}
}
if (propiter_ret == -1) {
if (scf_error() != SCF_ERROR_CONNECTION_BROKEN)
(void) scf_set_error(SCF_ERROR_INTERNAL);
return (-1);
}
return (0);
}
/*
* Sets up e in tx to set pname's values. Returns 0 on success or -1 on
* failure, with scf_error() set to
* SCF_ERROR_HANDLE_MISMATCH - tx & e are derived from different handles
* SCF_ERROR_INVALID_ARGUMENT - pname or ty are invalid
* SCF_ERROR_NOT_BOUND - handle is not bound
* SCF_ERROR_CONNECTION_BROKEN - connection was broken
* SCF_ERROR_NOT_SET - tx has not been started
* SCF_ERROR_DELETED - the pg tx was started on was deleted
*/
static int
{
for (;;) {
return (0);
switch (scf_error()) {
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
case SCF_ERROR_DELETED:
default:
return (-1);
case SCF_ERROR_NOT_FOUND:
break;
}
return (0);
switch (scf_error()) {
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
case SCF_ERROR_DELETED:
default:
return (-1);
case SCF_ERROR_EXISTS:
break;
}
}
}
static int
{
scf_value_t *v = NULL;
scf_handle_t *h = NULL;
int ret = -1;
return (-1);
(v = scf_value_create(h)) == NULL)
goto out;
scf_property_get_value(eprop, v) ||
scf_value_get_boolean(v, &enabled))
goto out;
out:
return (ret);
}
/*
* instance and the desired state for the enabled bit in the instance's
* named property group. If the group doesn't exist, it's created with the
* given flags. Called by smf_{dis,en}able_instance().
*/
static int
{
scf_value_t *v = NULL;
scf_handle_t *h = NULL;
int ret = -1;
int committed;
uint8_t b;
return (-1);
(v = scf_value_create(h)) == NULL ||
goto out;
get:
if (scf_error() != SCF_ERROR_NOT_FOUND)
goto out;
if (scf_error() != SCF_ERROR_EXISTS)
goto out;
goto get;
}
}
if (scf_error() != SCF_ERROR_NOT_FOUND)
goto out;
else
goto set;
}
/*
* If it's already set the way we want, forgo the transaction.
*/
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
/* Misconfigured, so set anyway. */
goto set;
default:
goto out;
}
}
if (scf_value_get_boolean(v, &b) == -1) {
if (scf_error() != SCF_ERROR_TYPE_MISMATCH)
goto out;
goto set;
}
if (b == desired) {
ret = 0;
goto out;
}
set:
do {
goto out;
SCF_TYPE_BOOLEAN) != 0) {
switch (scf_error()) {
case SCF_ERROR_DELETED:
default:
goto out;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
bad_error("transaction_property_set",
scf_error());
}
}
goto out;
if (committed == -1)
goto out;
if (committed == 0) { /* out-of-sync */
goto out;
}
} while (committed == 0);
ret = 0;
out:
return (ret);
}
static int
{
scf_handle_t *h = NULL;
int ret = -1;
int committed;
return (-1);
goto out;
goto error;
do {
SCF_PROPERTY_ENABLED) == -1 ||
goto error;
goto error;
} while (committed == 0);
ret = 0;
goto out;
switch (scf_error()) {
case SCF_ERROR_DELETED:
case SCF_ERROR_NOT_FOUND:
/* success */
ret = 0;
}
out:
return (ret);
}
/*
* Returns 0 on success or -1 on failure. On failure leaves scf_error() set to
* SCF_ERROR_HANDLE_DESTROYED - inst's handle has been destroyed
* SCF_ERROR_NOT_BOUND - inst's handle is not bound
* SCF_ERROR_CONNECTION_BROKEN - the repository connection was broken
* SCF_ERROR_NOT_SET - inst is not set
* SCF_ERROR_DELETED - inst was deleted
* SCF_ERROR_PERMISSION_DENIED
* SCF_ERROR_BACKEND_ACCESS
* SCF_ERROR_BACKEND_READONLY
*/
static int
{
scf_handle_t *h;
scf_value_t *v = NULL;
int64_t t;
(v = scf_value_create(h)) == NULL ||
goto out;
get:
switch (scf_error()) {
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
case SCF_ERROR_DELETED:
default:
goto out;
case SCF_ERROR_NOT_FOUND:
break;
}
/* Try creating the restarter_actions property group. */
add:
switch (scf_error()) {
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
case SCF_ERROR_DELETED:
case SCF_ERROR_BACKEND_ACCESS:
default:
goto out;
case SCF_ERROR_EXISTS:
goto get;
}
}
}
for (;;) {
switch (scf_error()) {
default:
goto out;
case SCF_ERROR_DELETED:
goto add;
case SCF_ERROR_NOT_FOUND:
break;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
}
} else if (scf_property_get_value(prop, v) != 0) {
switch (scf_error()) {
default:
goto out;
case SCF_ERROR_DELETED:
goto add;
case SCF_ERROR_NOT_FOUND:
break;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
bad_error("scf_property_get_value",
scf_error());
}
} else if (scf_value_get_integer(v, &t) != 0) {
} else if (t > timestamp) {
break;
}
switch (scf_error()) {
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_BACKEND_ACCESS:
default:
goto out;
case SCF_ERROR_DELETED:
goto add;
case SCF_ERROR_NOT_SET:
case SCF_ERROR_IN_USE:
}
}
SCF_TYPE_INTEGER) != 0) {
switch (scf_error()) {
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_DELETED:
default:
goto out;
case SCF_ERROR_NOT_SET:
bad_error("transaction_property_set",
scf_error());
}
}
if (trans == 1)
break;
if (trans != 0) {
switch (scf_error()) {
case SCF_ERROR_BACKEND_ACCESS:
default:
goto out;
case SCF_ERROR_DELETED:
goto add;
case SCF_ERROR_NOT_BOUND:
case SCF_ERROR_NOT_SET:
bad_error("scf_transaction_commit",
scf_error());
}
}
if (scf_pg_update(pg) != 0) {
switch (scf_error()) {
default:
goto out;
case SCF_ERROR_DELETED:
goto add;
case SCF_ERROR_NOT_SET:
case SCF_ERROR_NOT_BOUND:
}
}
}
ret = 0;
out:
return (ret);
}
static int
{
scf_handle_t *h;
int ret = -1;
h = handle_create();
if (h == NULL)
return (-1);
inst = scf_instance_create(h);
NULL, SCF_DECODE_FMRI_EXACT) == 0)
else if (scf_error() == SCF_ERROR_CONSTRAINT_VIOLATED)
(void) scf_set_error(SCF_ERROR_INVALID_ARGUMENT);
}
return (ret);
}
/*
* get_inst_state() gets the state string from an instance, and returns
* the SCF_STATE_* constant that coincides with the instance's current state.
*/
static int
{
char state[MAX_SCF_STATE_STRING_SZ];
int ret = -1;
goto out;
/* Pull the state property from the instance */
if (scf_error() != SCF_ERROR_CONNECTION_BROKEN)
(void) scf_set_error(SCF_ERROR_INTERNAL);
goto out;
}
(void) scf_set_error(SCF_ERROR_INTERNAL);
goto out;
}
}
out:
(void) scf_value_destroy(val);
return (ret);
}
/*
* Sets an instance to be enabled or disabled after reboot, using the
* temporary (overriding) general_ovr property group to reflect the
* present state, if it is different.
*/
static int
{
int enabled;
int persistent;
int ret = -1;
if (scf_error() != SCF_ERROR_NOT_FOUND)
goto out;
}
if (persistent != desired) {
/*
* Temporarily store the present enabled state.
*/
goto out;
}
}
if (persistent != desired)
goto out;
else
ret = 0;
out:
return (ret);
}
static int
{
int ret = -1;
scf_handle_t *h;
(void) scf_set_error(SCF_ERROR_INVALID_ARGUMENT);
return (ret);
}
if ((h = handle_create()) == NULL)
return (ret);
return (ret);
}
SCF_DECODE_FMRI_EXACT) == -1) {
if (scf_error() == SCF_ERROR_CONSTRAINT_VIOLATED)
(void) scf_set_error(SCF_ERROR_INVALID_ARGUMENT);
goto out;
}
if (flags & SMF_AT_NEXT_BOOT) {
} else {
goto out;
/*
* Make the persistent value effective by deleting the
* temporary one.
*/
if (flags & SMF_TEMPORARY)
ret = 0;
else
}
out:
return (ret);
}
int
{
}
int
{
}
int
{
}
int
smf_refresh_instance(const char *instance)
{
}
int
smf_restart_instance(const char *instance)
{
}
int
{
if (flags & SMF_TEMPORARY)
return (set_inst_action(instance,
(flags & SMF_IMMEDIATE) ?
else
return (set_inst_action(instance,
(flags & SMF_IMMEDIATE) ?
}
int
{
const char *state_str;
if (flags & SMF_TEMPORARY)
return (scf_set_error(SCF_ERROR_INVALID_ARGUMENT));
SCF_PROPERTY_STATE)) == NULL)
return (SCF_FAILED);
return (SCF_FAILED);
}
return (scf_set_error(SCF_ERROR_CONSTRAINT_VIOLATED));
}
}
int
smf_restore_instance(const char *instance)
{
const char *state_str;
int ret;
SCF_PROPERTY_STATE)) == NULL)
return (SCF_FAILED);
return (SCF_FAILED);
}
} else {
}
return (ret);
}
char *
smf_get_state(const char *instance)
{
const char *state_str;
char *ret;
SCF_PROPERTY_STATE)) == NULL)
return (NULL);
return (NULL);
}
(void) scf_set_error(SCF_ERROR_NO_MEMORY);
return (ret);
}
int
{
scf_handle_t *h = NULL;
int ret = SCF_FAILED;
int svc_iter_ret, inst_iter_ret;
int inst_state;
if ((h = handle_create()) == NULL)
return (ret);
goto out;
/*
* Get the local scope, and set up nested iteration through every
* local service, and every instance of every service.
*/
goto out;
goto out;
while ((inst_iter_ret =
/*
* If get_inst_state fails from an internal error,
* IE, being unable to get the property group or
* property containing the state of the instance,
* we continue instead of failing, as this might just
* be an improperly configured instance.
*/
if (scf_error() == SCF_ERROR_INTERNAL) {
continue;
} else {
goto out;
}
}
SCF_SUCCESS) {
(void) scf_set_error(
goto out;
}
}
}
if (inst_iter_ret == -1)
goto out;
}
if (svc_iter_ret != -1)
ret = SCF_SUCCESS;
out:
return (ret);
}
const char *propname)
{
scf_handle_t *h = NULL;
/* If the user passed in a handle, use it. */
h = hin;
}
return (NULL);
if (local_h)
return (NULL);
}
goto error1;
SCF_DECODE_FMRI_REQUIRE_INSTANCE) == -1) {
switch (scf_error()) {
/*
* If the property isn't found in the instance, we grab the
* underlying service, create an FMRI out of it, and then
* query the datastore again at the service level for the
* property.
*/
case SCF_ERROR_NOT_FOUND:
goto error1;
-1) {
(void) scf_set_error(SCF_ERROR_INTERNAL);
goto error1;
}
goto error1;
goto error1;
goto error1;
}
break;
(void) scf_set_error(SCF_ERROR_INVALID_ARGUMENT);
default:
goto error1;
}
}
/*
* At this point, we've successfully pulled the property from the
* datastore, and simply need to copy its innards into an
* scf_simple_prop_t.
*/
goto error1;
if (local_h)
return (ret);
/*
* Exit point for a successful call. Below this line are exit points
* for failures at various stages during the function.
*/
if (local_h)
return (NULL);
}
void
{
int i;
return;
case SCF_TYPE_OPAQUE: {
for (i = 0; i < prop->pr_numvalues; i++) {
}
break;
}
case SCF_TYPE_ASTRING:
case SCF_TYPE_USTRING:
case SCF_TYPE_HOST:
case SCF_TYPE_HOSTNAME:
case SCF_TYPE_NET_ADDR_V4:
case SCF_TYPE_NET_ADDR_V6:
case SCF_TYPE_URI:
case SCF_TYPE_FMRI: {
for (i = 0; i < prop->pr_numvalues; i++) {
}
break;
}
default:
break;
}
}
{
scf_handle_t *h = NULL;
int pgiter_ret, propiter_ret;
/* If the user passed in a handle, use it. */
h = hin;
}
return (NULL);
if (local_h)
return (NULL);
}
if (local_h)
(void) scf_set_error(SCF_ERROR_NO_MEMORY);
return (NULL);
}
if (local_h)
return (NULL);
}
} else {
}
(void) scf_set_error(SCF_ERROR_INTERNAL);
return (NULL);
}
goto error2;
SCF_DECODE_FMRI_REQUIRE_INSTANCE) == -1) {
if (scf_error() == SCF_ERROR_CONSTRAINT_VIOLATED)
(void) scf_set_error(SCF_ERROR_INVALID_ARGUMENT);
goto error2;
}
(void) scf_set_error(SCF_ERROR_NO_MEMORY);
goto error2;
}
0) {
if (scf_error() != SCF_ERROR_CONNECTION_BROKEN)
(void) scf_set_error(SCF_ERROR_INTERNAL);
goto error1;
}
(void) scf_set_error(SCF_ERROR_NO_MEMORY);
goto error1;
}
} else {
/* This is the first iteration */
}
(void) scf_set_error(SCF_ERROR_NO_MEMORY);
goto error1;
}
if (scf_error() == SCF_ERROR_NOT_SET)
(void) scf_set_error(SCF_ERROR_INTERNAL);
goto error1;
}
if (scf_error() != SCF_ERROR_CONNECTION_BROKEN)
(void) scf_set_error(SCF_ERROR_INTERNAL);
goto error1;
}
== 1) {
0) {
if (scf_error() == SCF_ERROR_NOT_SET)
(void) scf_set_error(
goto error1;
}
goto error1;
} else {
/* This is the first iteration */
goto error1;
}
}
if (propiter_ret == -1) {
if (scf_error() != SCF_ERROR_CONNECTION_BROKEN)
(void) scf_set_error(SCF_ERROR_INTERNAL);
goto error1;
}
}
if (pgiter_ret == -1) {
if (scf_error() != SCF_ERROR_CONNECTION_BROKEN)
(void) scf_set_error(SCF_ERROR_INTERNAL);
goto error1;
}
/*
* At this point, we've filled the scf_simple_app_props_t with all the
* properties at the service level. Now we iterate over all the
* properties at the instance level, overwriting any duplicate
*/
!= 0) {
if (scf_error() != SCF_ERROR_CONNECTION_BROKEN)
(void) scf_set_error(SCF_ERROR_INTERNAL);
goto error1;
}
found = 0;
/*
* Find either the end of the list, so we can append the
* property group, or an existing property group that matches
*/
if (scf_error() == SCF_ERROR_NOT_SET)
(void) scf_set_error(SCF_ERROR_INTERNAL);
goto error1;
}
found = 1;
break;
}
break;
}
if (scf_error() != SCF_ERROR_CONNECTION_BROKEN)
(void) scf_set_error(SCF_ERROR_INTERNAL);
goto error1;
}
if (found) {
/*
* insert_app_props inserts or overwrites the
* properties in thispg.
*/
goto error1;
} else {
/*
* If the property group wasn't found, we're adding
* a newly allocated property group to the end of the
* list.
*/
(void) scf_set_error(SCF_ERROR_NO_MEMORY);
goto error1;
}
goto error1;
}
} else {
}
while ((propiter_ret =
namelen) < 0) {
if (scf_error() == SCF_ERROR_NOT_SET)
(void) scf_set_error(
goto error1;
}
NULL)
goto error1;
} else {
/* This is the first iteration */
NULL)
goto error1;
}
}
if (propiter_ret == -1) {
if (scf_error() != SCF_ERROR_CONNECTION_BROKEN)
(void) scf_set_error(
goto error1;
}
}
}
if (pgiter_ret == -1) {
if (scf_error() != SCF_ERROR_CONNECTION_BROKEN)
(void) scf_set_error(SCF_ERROR_INTERNAL);
goto error1;
}
if (local_h)
return (NULL);
return (ret);
/*
* Exit point for a successful call. Below this line are exit points
* for failures at various stages during the function.
*/
if (local_h)
return (NULL);
}
void
{
return;
}
}
}
const scf_simple_prop_t *
{
struct scf_simple_pg *this;
(void) scf_set_error(SCF_ERROR_NOT_SET);
return (NULL);
}
/*
* We're looking for the first property in this block if last is
* NULL
*/
/* An empty pglist is legal, it just means no properties */
(void) scf_set_error(SCF_ERROR_NONE);
return (NULL);
}
/*
* Walk until we find a pg with a property in it, or we run
* out of property groups.
*/
(void) scf_set_error(SCF_ERROR_NONE);
return (NULL);
}
return (this->pg_proplist);
}
/*
* If last isn't NULL, then return the next prop in the property group,
* or walk the property groups until we find another property, or
* run out of property groups.
*/
(void) scf_set_error(SCF_ERROR_NONE);
return (NULL);
}
(void) scf_set_error(SCF_ERROR_NONE);
return (NULL);
}
return (this->pg_proplist);
}
const scf_simple_prop_t *
{
struct scf_simple_pg *pg;
(void) scf_set_error(SCF_ERROR_NOT_SET);
return (NULL);
}
/*
* If pgname is NULL, we're searching the default application
* property group, otherwise we look for the specified group.
*/
} else {
}
(void) scf_set_error(SCF_ERROR_NOT_FOUND);
return (NULL);
}
(void) scf_set_error(SCF_ERROR_NOT_FOUND);
return (NULL);
}
return (prop);
}
void
{
return;
}
{
return (scf_set_error(SCF_ERROR_NOT_SET));
return (prop->pr_numvalues);
}
{
return (scf_set_error(SCF_ERROR_NOT_SET));
}
char *
{
(void) scf_set_error(SCF_ERROR_NOT_SET);
return (NULL);
}
return (prop->pr_propname);
}
char *
{
(void) scf_set_error(SCF_ERROR_NOT_SET);
return (NULL);
}
}
static union scf_simple_prop_val *
{
(void) scf_set_error(SCF_ERROR_NOT_SET);
return (NULL);
}
case SCF_TYPE_USTRING:
case SCF_TYPE_HOST:
case SCF_TYPE_HOSTNAME:
case SCF_TYPE_NET_ADDR_V4:
case SCF_TYPE_NET_ADDR_V6:
case SCF_TYPE_URI:
case SCF_TYPE_FMRI: {
if (type != SCF_TYPE_USTRING) {
(void) scf_set_error(SCF_ERROR_TYPE_MISMATCH);
return (NULL);
}
break;
}
default: {
(void) scf_set_error(SCF_ERROR_TYPE_MISMATCH);
return (NULL);
}
break;
}
}
(void) scf_set_error(SCF_ERROR_NONE);
return (NULL);
}
}
uint8_t *
{
union scf_simple_prop_val *ret;
return (NULL);
}
uint64_t *
{
union scf_simple_prop_val *ret;
return (NULL);
}
int64_t *
{
union scf_simple_prop_val *ret;
return (NULL);
}
int64_t *
{
union scf_simple_prop_val *ret;
return (NULL);
}
char *
{
union scf_simple_prop_val *ret;
return (NULL);
}
char *
{
union scf_simple_prop_val *ret;
return (NULL);
}
void *
{
union scf_simple_prop_val *ret;
*length = 0;
return (NULL);
}
}
/*
* Generate a filename based on the fmri and the given name and return
* it in the buffer of MAXPATHLEN provided by the caller.
* If temp_filename is non-zero, also generate a temporary, unique filename
* and return it in the temp buffer of MAXPATHLEN provided by the caller.
* The path to the generated pathname is also created.
* Given fmri should begin with a scheme such as "svc:".
* Returns
* 0 on success
* -1 if filename would exceed MAXPATHLEN or
* -2 if unable to create directory to filename path
*/
int
char *temp_filename)
{
int len;
if (len > MAXPATHLEN)
return (-1);
/* Construct directory name first - speedy path ends in slash */
/* errno is set */
return (-2);
}
if (temp_filename) {
}
return (0);
}