/*
* 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 <libscf.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include "asr.h"
#include "asr_nvl.h"
static void
{
(void) asr_error(
}
/*
* Stores properties retrieved from SCF in a linked list
*/
typedef struct asr_scf_prop
{
/*
* Creates an allocated property structure along with data for the
* internal entry and value handles using the supplied SCF handle.
*/
static asr_scf_prop_t *
{
sizeof (asr_scf_prop_t))) == NULL) {
(void) asr_set_errno(EASR_NOMEM);
return (NULL);
}
return (NULL);
}
return (NULL);
}
return (prop);
}
/*
* Frees a single SCF property item and returns the next item.
*/
static asr_scf_prop_t *
{
return (NULL);
return (next);
}
/*
* Frees the entire SCF property list including the SCF allocated internal
* handles.
*/
static void
{
}
}
/*
* Adds, removes or modifies the previous SCF properties in the old list to
* match the new properties in supplied list. Non-zero is returned if there is
* an error, otherwise the transaction is setup and can be completed. The
* returned properties that are part of the transaction need to be released
* after the transaction is completed.
*/
static int
{
int err = 0;
char *property;
const char *, scf_type_t) = scf_transaction_property_change;
continue;
continue;
switch (type) {
case DATA_TYPE_STRING:
{
continue;
}
break;
}
case DATA_TYPE_INT64:
{
continue;
}
break;
}
case DATA_TYPE_UINT64:
{
continue;
}
break;
}
case DATA_TYPE_BOOLEAN_VALUE:
{
continue;
}
break;
}
case DATA_TYPE_HRTIME:
{
continue;
}
break;
}
default:
err = -1;
}
EASR_NOMEM, "Failed to allocate SMF property");
break;
}
!= 0) {
break;
}
!= 0) {
break;
}
}
/*
* Remove properties that are in the old list but not in the new list
*/
continue;
continue;
continue;
EASR_NOMEM, "Failed to allocate SMF property");
break;
}
if ((err = scf_transaction_property_delete(
break;
}
}
if (err) {
}
return (err);
}
/*
* Update and save SCF properties from the old values to new data.
*/
int
{
int err;
goto finally;
}
if ((err = scf_handle_decode_fmri(
goto finally;
}
goto finally;
}
goto finally;
}
}
goto finally;
}
goto finally;
}
goto finally;
}
goto finally;
}
}
}
(void) smf_refresh_instance(fmri);
return (err);
}
/*
* Adds a single SCF property into an nvlist string property.
*/
static int
{
int err;
return (-1);
if (num == 0)
return (0);
sizeof (pname)) {
return (-1);
}
switch (type) {
case SCF_TYPE_BOOLEAN:
{
(scf_simple_prop_t *)prop);
break;
}
case SCF_TYPE_COUNT:
{
(scf_simple_prop_t *)prop);
break;
}
case SCF_TYPE_INTEGER:
{
(scf_simple_prop_t *)prop);
break;
}
case SCF_TYPE_TIME:
{
break;
}
case SCF_TYPE_ASTRING:
{
(scf_simple_prop_t *)prop);
break;
}
case SCF_TYPE_OPAQUE:
{
err = -1;
break;
}
default:
{
err = -1;
}
}
return (err);
}
/*
* Loads in ASR configuration name value pairs from the given service FMRI
* Note: This library configuration doesn't support array values.
*/
int
{
int err = 0;
return (ASR_FAILURE);
}
while (prop) {
if (numv) {
if (err) {
break;
}
}
}
return (err);
}