mirror of
https://github.com/ipmitool/ipmitool.git
synced 2026-01-23 07:04:21 +08:00
export a couple functions for ipmievd,
better handling of description string
This commit is contained in:
parent
69501d7827
commit
0603bd8f98
@ -381,5 +381,8 @@ static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unu
|
|||||||
|
|
||||||
int ipmi_sel_main(struct ipmi_intf *, int, char **);
|
int ipmi_sel_main(struct ipmi_intf *, int, char **);
|
||||||
void ipmi_sel_print_std_entry(struct sel_event_record * evt);
|
void ipmi_sel_print_std_entry(struct sel_event_record * evt);
|
||||||
|
void ipmi_sel_print_std_entry_verbose(struct sel_event_record * evt);
|
||||||
|
void ipmi_get_event_desc(struct sel_event_record * rec, char ** desc);
|
||||||
|
const char * ipmi_sel_get_sensor_type(unsigned char code);
|
||||||
|
|
||||||
#endif /* IPMI_SEL_H */
|
#endif /* IPMI_SEL_H */
|
||||||
|
|||||||
@ -109,7 +109,7 @@ ipmi_sel_timestamp_time(uint32_t stamp)
|
|||||||
return tbuf;
|
return tbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
ipmi_get_event_desc(struct sel_event_record * rec, char ** desc)
|
ipmi_get_event_desc(struct sel_event_record * rec, char ** desc)
|
||||||
{
|
{
|
||||||
unsigned char code, offset;
|
unsigned char code, offset;
|
||||||
@ -143,7 +143,7 @@ ipmi_get_event_desc(struct sel_event_record * rec, char ** desc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
const char *
|
||||||
ipmi_sel_get_sensor_type(unsigned char code)
|
ipmi_sel_get_sensor_type(unsigned char code)
|
||||||
{
|
{
|
||||||
struct ipmi_event_sensor_types *st = sensor_specific_types;
|
struct ipmi_event_sensor_types *st = sensor_specific_types;
|
||||||
@ -339,9 +339,13 @@ ipmi_sel_print_std_entry(struct sel_event_record * evt)
|
|||||||
printf(",");
|
printf(",");
|
||||||
else
|
else
|
||||||
printf(" | ");
|
printf(" | ");
|
||||||
|
|
||||||
ipmi_get_event_desc(evt, &description);
|
ipmi_get_event_desc(evt, &description);
|
||||||
printf("%s\n", description ? description : "");
|
if (description) {
|
||||||
|
printf("%s", description);
|
||||||
free(description);
|
free(description);
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -593,6 +597,8 @@ ipmi_sel_clear(struct ipmi_intf * intf)
|
|||||||
unsigned short reserve_id;
|
unsigned short reserve_id;
|
||||||
unsigned char msg_data[6];
|
unsigned char msg_data[6];
|
||||||
|
|
||||||
|
ipmi_intf_session_set_privlvl(intf, IPMI_SESSION_PRIV_ADMIN);
|
||||||
|
|
||||||
reserve_id = ipmi_sel_reserve(intf);
|
reserve_id = ipmi_sel_reserve(intf);
|
||||||
if (reserve_id == 0)
|
if (reserve_id == 0)
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user