libfru.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2000-2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _LIBFRU_H
#define _LIBFRU_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#define LIBFRU_VERSION 1
/* fru errno return types */
typedef enum
{
FRU_SUCCESS = 0,
} fru_errno_t;
/*
* Structures for libfru.c
*/
/* Fru Display Types */
/* Fru Data Types */
/* Fru Which Type */
/* Fru Iteration Types */
typedef enum { FRU_FIFO = 0, FRU_Circular,
/* Fru Handle Type */
typedef uint64_t fru_nodehdl_t;
/* Node Types */
typedef enum
{
} fru_node_t;
/* Sting list */
typedef struct {
unsigned int num;
char **strs;
typedef union
{
struct
{
unsigned encrypted : 1;
unsigned ignore_checksum : 1;
unsigned opaque : 1;
unsigned fixed : 1;
unsigned unused : 13;
unsigned field_perm : 3;
unsigned domain_perm : 3;
unsigned operations_perm : 3;
unsigned engineering_perm : 3;
unsigned repair_perm : 3;
} field;
#define FRU_SEGDESC_PERM_DELETE_MASK (1<<0)
#define FRU_SEGDESC_ALL_RO_MASK 0x000036db
/* segment descriptor field perm. */
#define SEGMENT_READ 4
#define SEGMENT_WRITE 2
#define SEGMENT_DELETE 1
typedef union
{
struct
{
unsigned : 7;
unsigned : 8;
unsigned : 8;
unsigned : 8;
} field;
#define FRU_SEGNAMELEN 2
typedef struct {
} fru_segdef_t;
/* Fru enumerations */
typedef struct {
char *text;
} fru_enum_t;
#define FRU_ELEMDEF_REV 1
typedef struct {
unsigned int enum_count; /* number of enum values in table */
/* the data_type */
unsigned int iteration_count;
char *example_string;
/* Data Source operations */
fru_errno_t fru_close_data_source(void);
/* Tree operations */
/* Node information functions */
/* Segment Operations */
/* Data operations */
unsigned int instance,
const char *field_path,
void **data,
char **found_path);
char *seg_name,
unsigned int instance,
const char *field_path,
void *data,
unsigned int instance,
const char *iter_path,
int *num_there,
char **found_path);
/* Tagged Element operations */
const char *element);
/* General library support */
/* Structure destroy functions */
/* Enum to String Conversions */
const char *get_displaytype_str(fru_displaytype_t e);
const char *get_datatype_str(fru_datatype_t e);
const char *get_which_str(fru_which_t e);
const char *get_itertype_str(fru_itertype_t e);
#ifdef __cplusplus
}
#endif
#endif /* _LIBFRU_H */