/usr/include/freeipmi/util/ipmi-sensor-and-event-code-tables-util.h is in libfreeipmi-dev 1.4.11-1.1ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | /*
* Copyright (C) 2003-2014 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef IPMI_SENSOR_AND_EVENT_CODE_TABLES_UTIL_H
#define IPMI_SENSOR_AND_EVENT_CODE_TABLES_UTIL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define IPMI_EVENT_READING_TYPE_CODE_CLASS_THRESHOLD 0x01
#define IPMI_EVENT_READING_TYPE_CODE_CLASS_GENERIC_DISCRETE 0x02
#define IPMI_EVENT_READING_TYPE_CODE_CLASS_SENSOR_SPECIFIC_DISCRETE 0x03
#define IPMI_EVENT_READING_TYPE_CODE_CLASS_OEM 0x04
#define IPMI_EVENT_READING_TYPE_CODE_CLASS_UNKNOWN 0x05
#define IPMI_GET_EVENT_MESSAGES_FLAGS_DEFAULT 0x0000
#define IPMI_GET_EVENT_MESSAGES_FLAGS_SHORT 0x0001
#define IPMI_GET_EVENT_MESSAGES_FLAGS_INTERPRET_OEM_DATA 0x0002
#define IPMI_GET_EVENT_MESSAGES_FLAGS_SENSOR_READING 0x0004
#define IPMI_GET_EVENT_MESSAGES_FLAGS_IGNORE_UNRECOGNIZED_EVENTS 0x0008
int ipmi_event_reading_type_code_class (uint8_t event_reading_type_code);
int ipmi_event_message_separator (const char *separator);
/* return length of string written into buffer on success, -1 on error */
int ipmi_get_generic_event_message (uint8_t event_reading_type_code,
unsigned int offset,
char *buf,
unsigned int buflen);
/* return length of string written into buffer on success, -1 on error */
/* this function is for sensor specific messages, sensors with event
* reading typo codes of 0x6F */
int ipmi_get_sensor_type_message (uint8_t sensor_type,
unsigned int offset,
char *buf,
unsigned int buflen);
/* return length of string written into buffer on success, -1 on error */
/* identical to above but returns "short" strings when appropriate */
int ipmi_get_generic_event_message_short (uint8_t event_reading_type_code,
unsigned int offset,
char *buf,
unsigned int buflen);
/* return length of string written into buffer on success, -1 on error */
/* identical to above but returns "short" strings when appropriate */
int ipmi_get_sensor_type_message_short (uint8_t sensor_type,
unsigned int offset,
char *buf,
unsigned int buflen);
/* return length of string written into buffer on success, -1 on error */
int ipmi_get_event_data2_message (uint8_t sensor_type,
unsigned int offset,
uint8_t event_data2,
char *buf,
unsigned int buflen);
/* return length of string written into buffer on success, -1 on error */
int ipmi_get_event_data3_message (uint8_t sensor_type,
unsigned int offset,
uint8_t event_data2,
uint8_t event_data3,
char *buf,
unsigned int buflen);
/* return length of string written into buffer on success, -1 on error */
/* this function is for OEM event reading type codes */
int ipmi_get_oem_generic_event_message (uint32_t manufacturer_id,
uint16_t product_id,
uint8_t event_reading_type_code,
unsigned int offset,
char *buf,
unsigned int buflen);
/* return length of string written into buffer on success, -1 on error */
/* this function is for sensor specific messages, sensors with event
* reading typo codes of 0x6F */
int ipmi_get_oem_sensor_type_message (uint32_t manufacturer_id,
uint16_t product_id,
uint8_t sensor_type,
uint8_t sensor_number,
unsigned int offset,
char *buf,
unsigned int buflen);
/* return length of string written into buffer on success, -1 on error */
/* this function is for string mappings from vendors that are specific
* to a event reading typo code and sensor type combination. */
int ipmi_get_oem_specific_message (uint32_t manufacturer_id,
uint16_t product_id,
uint8_t event_reading_type_code,
uint8_t sensor_type,
unsigned int offset,
char *buf,
unsigned int buflen);
/* return length of string written into buffer on success, -1 on error */
/* some vendors return values instead of event bitmasks in the
* sensor or SEL event, this is to handle this special case
*/
int ipmi_get_oem_event_bitmask_message (uint32_t manufacturer_id,
uint16_t product_id,
uint8_t event_reading_type_code,
uint8_t sensor_type,
uint16_t event_bitmask,
char *buf,
unsigned int buflen);
/* wrapper function to handle retrieval of an array of event messages.
* The array is NULL pointer terminated.
*
* collectively wraps
*
* ipmi_get_generic_event_message()
* ipmi_get_sensor_type_message()
*
* If flag IPMI_GET_EVENT_MESSAGES_FLAGS_SHORT is specified,
* ipmi_get_generic_event_message_short() and
* ipmi_get_sensor_type_message_short() are called respectively inplace
* of ipmi_get_generic_event_message() and ipmi_get_sensor_type_message().
*
* If flag IPMI_GET_EVENT_MESSAGES_FLAGS_INTERPRET_OEM_DATA is
* specified ipmi_get_oem_generic_event_message(),
* ipmi_get_oem_sensor_type_message(), and
* ipmi_get_oem_sensor_event_bitmask_message() are called respectively
* if necessary.
*
* If flag IPMI_GET_EVENT_MESSAGES_FLAGS_SENSOR_READING is
* specified ipmi_get_threshold_message() will be called for a
* sensor_event_bitmask instead of ipmi_get_generic_event_message() if
* it is a threshold sensor. Primarily used for event messages
* following a get sensor reading in which threshold event bitmasks
* are slightly different.
*
* If flag IPMI_GET_EVENT_MESSAGES_FLAG_IGNORE_UNRECOGNIZED_EVENTS is
* specified ipmi_get_threshold_message() will not store event strings
* for unrecognized events.
*
* If there are no event messages, and 'no_event_message_string' is
* non-NULL, it will be placed into 'event_messages' as the lone event
* message.
*
* Returns 0 on success, -1 on error. Number of messages allocated in
* 'event_messages' is returned in 'event_messages_count'.
*
* User responsible for clearing memory created in 'event_messages'.
*/
int ipmi_get_event_messages (uint8_t event_reading_type_code,
uint8_t sensor_type, /* ignored if not relevant for event_reading_type_code */
uint8_t sensor_number, /* ignored if not relevant for event_reading_type_code or sensor_type */
uint16_t event_bitmask,
uint32_t manufacturer_id, /* ignored if INTERPRET_OEM_DATA not set */
uint16_t product_id, /* ignored if INTERPRET_OEM_DATA not set */
char ***event_messages,
unsigned int *event_messages_count,
const char *no_event_message_string,
unsigned int flags);
#ifdef __cplusplus
}
#endif
#endif /* IPMI_SENSOR_AND_EVENT_CODE_TABLES_UTIL_H */
|