fix SEL decoding for generic events

This commit is contained in:
Duncan Laurie 2003-11-26 16:34:14 +00:00
parent 897e1c6a20
commit 5c337dcdf6
3 changed files with 13 additions and 27 deletions

View File

@ -2,7 +2,7 @@ dnl
dnl autoconf for ipmitool dnl autoconf for ipmitool
dnl dnl
AC_INIT([src/ipmitool.c]) AC_INIT([src/ipmitool.c])
AM_INIT_AUTOMAKE([ipmitool], [1.5.5]) AM_INIT_AUTOMAKE([ipmitool], [1.5.6])
AM_CONFIG_HEADER([config.h]) AM_CONFIG_HEADER([config.h])
AC_CONFIG_SRCDIR([src/ipmitool.c]) AC_CONFIG_SRCDIR([src/ipmitool.c])
AC_PREREQ(2.50) AC_PREREQ(2.50)

View File

@ -1,3 +1,10 @@
ipmitool (1.5.5) unstable; urgency=low
* Add -U option for setting LAN username
* Fix -v usage for plugin interfaces
-- Duncan Laurie <duncan@sun.com> Tue, 25 Nov 2003 15:10:48 -0700
ipmitool (1.5.4) unstable; urgency=low ipmitool (1.5.4) unstable; urgency=low
* Put interface plugin API into library * Put interface plugin API into library

View File

@ -83,40 +83,19 @@ ipmi_get_event_type(unsigned char code)
static const char * static const char *
ipmi_get_event_desc(struct sel_event_record * rec) ipmi_get_event_desc(struct sel_event_record * rec)
{ {
int class; unsigned char code, offset;
unsigned char offset = 0;
unsigned char code = 0;
struct ipmi_event_sensor_types *evt; struct ipmi_event_sensor_types *evt;
class = ipmi_get_event_class(rec->event_type); if (rec->event_type == 0x6f) {
if (class < 0) evt = sensor_specific_types;
return "Invalid Class";
switch (class) {
case IPMI_EVENT_CLASS_DISCRETE:
if (rec->event_type == 0x6f)
evt = sensor_specific_types;
else
evt = generic_event_types;
code = rec->sensor_type; code = rec->sensor_type;
break; } else {
case IPMI_EVENT_CLASS_DIGITAL:
evt = generic_event_types; evt = generic_event_types;
code = rec->sensor_type; code = rec->event_type;
break;
case IPMI_EVENT_CLASS_THRESHOLD:
evt = generic_event_types;
code = 0x01;
break;
default:
return "Unknown Class";
} }
offset = rec->event_data[0] & 0xf; offset = rec->event_data[0] & 0xf;
if (verbose > 2)
printf("offset: 0x%02x\n", offset);
while (evt->type) { while (evt->type) {
if (evt->code == code && evt->offset == offset) if (evt->code == code && evt->offset == offset)
return evt->desc; return evt->desc;