#ifndef _PSVC_OBJECTS_CLASS_H
#define _PSVC_OBJECTS_CLASS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <pthread.h>
#define NAMELEN 32
#define PATHLEN 256
typedef struct {
int32_t class;
int32_t subclass;
int32_t instance;
uint64_t features;
uint64_t addr_spec;
char state[32];
char previous_state[32];
char fault_id[32];
boolean_t present;
boolean_t previous_presence;
boolean_t enabled;
char label[32];
int32_t (*constructor)();
int32_t (*destructor)();
int32_t (*get_attr)();
int32_t (*set_attr)();
} EObj_t;
typedef struct {
EObj_t ld;
int32_t hw_lo_shut;
int32_t lo_warn;
int32_t lo_shut;
int32_t opt_temp;
int32_t hi_warn;
int32_t hi_shut;
int32_t hw_hi_shut;
} ETempSensor_t;
typedef struct {
EObj_t ld;
int16_t setpoint;
int16_t hysteresis;
int16_t loopgain;
int16_t loopbias;
float temp_differential[PSVC_MAXERRORS];
int16_t temp_differential_index;
} EFan_t;
typedef struct {
EObj_t ld;
} ESystem_t;
typedef struct {
EObj_t ld;
int32_t lo_warn;
int32_t lo_shut;
int32_t hi_warn;
int32_t hi_shut;
} EDigiSensor_t;
typedef struct {
EObj_t ld;
} EDigiControl_t;
typedef struct {
EObj_t ld;
} EBoolSensor_t;
typedef struct {
EObj_t ld;
} EGPIO8_t;
typedef struct {
EObj_t ld;
int16_t lit_count;
char color[32];
char is_locator[8];
char locator_name[32];
} ELed_t;
typedef struct {
EObj_t ld;
int32_t lo_warn;
int32_t lo_shut;
int32_t hi_warn;
int32_t hi_shut;
} EFanTach_t;
typedef struct {
EObj_t ld;
char switch_state[32];
} ESwitch_t;
typedef struct {
EObj_t ld;
} EKeySwitch_t;
typedef struct {
EObj_t ld;
int32_t (*get_temperature)();
int32_t (*get_fanspeed)();
int32_t (*get_bit)();
int32_t (*set_bit)();
int32_t (*get_port)();
int32_t (*set_port)();
int32_t (*get_reg)();
int32_t (*set_reg)();
int32_t (*get_output)();
int32_t (*set_output)();
int32_t (*get_input)();
} EPhysDev_t;
typedef struct {
uint8_t cell_type;
uint32_t size;
int64_t *table;
} ETable_t;
typedef struct {
char antecedent_id[NAMELEN];
int32_t ant_key;
char dependent_id[NAMELEN];
} EAssoc_t;
typedef struct {
char name[NAMELEN];
uint32_t count;
EAssoc_t *table;
} EAssocList_t;
typedef struct {
int32_t id;
char name[NAMELEN];
} EStringId_t;
typedef struct {
uint32_t controller;
uint32_t bus;
uint32_t addr;
uint32_t port;
char path[PATHLEN];
} EDevice_t;
typedef struct {
char name[NAMELEN];
int32_t key;
EObj_t *objp;
int32_t type;
} ENamePtr_t;
typedef struct {
ENamePtr_t *obj_tbl;
uint32_t obj_count;
uint32_t nextid;
} ETable_Array;
#define PSVC_OBJ 0
#define PSVC_TBL 1
#define PSVC_MAX_TABLE_ARRAYS 10
typedef struct {
ETable_Array tbl_arry[PSVC_MAX_TABLE_ARRAYS];
uint32_t total_obj_count;
EStringId_t *othr_tbl;
uint32_t othr_count;
EAssocList_t *assoc_tbl;
uint32_t assoc_count;
EDevice_t *dev_tbl;
uint32_t dev_count;
FILE *fp;
pthread_mutex_t mutex;
} EHdl_t;
static char *attr_str_tab[] = {
"_class",
"Subclass",
"Presence",
"Previous-presence",
"State",
"Previous-state",
"Enabled",
"FaultInformation",
"Features",
"Label",
"Fruid",
"Instance",
"Led-color",
"Lo-warn",
"Lo-shut",
"Hi-warn",
"Hi-shut",
"Opt-temp",
"Hw-hi-shut",
"Hw-lo-shut",
"Setpoint",
"Hysteresis",
"Loopgain",
"Loopbias",
"Temp_differential",
"Temp_differential_index",
"Sensor-value",
"Gpio-value",
"#Bits",
"Control-value",
"Led-state",
"Switch-state",
"Probe-result",
"Table_value",
"Assoc_id",
"Assoc_matches",
"Addr-spec",
"Object-id",
"Led-lit-count",
"FRU-info",
"IsLocator",
"LocatorName"
};
int ATTR_STR_TAB_SIZE = sizeof (attr_str_tab) / sizeof (char *);
#ifdef __cplusplus
}
#endif
#endif