This file is indexed.

/usr/include/freeipmi/cmds/ipmi-sensor-cmds.h is in libfreeipmi-dev 1.4.11-1ubuntu1.

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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
/*
 * 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_CMDS_H
#define IPMI_SENSOR_CMDS_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>
#include <freeipmi/fiid/fiid.h>

#define IPMI_SENSOR_GET_SENSOR_COUNT  0x00
#define IPMI_SENSOR_GET_SDR_COUNT     0x01

#define IPMI_SENSOR_STATIC_SENSOR_POPULATION  0x0
#define IPMI_SENSOR_DYNAMIC_SENSOR_POPULATION 0x1

/* achu: as of IPMI 2.0 hysteresis_mask reserved for future - write as 0xFF */
#define IPMI_SENSOR_HYSTERESIS_MASK   0xFF

#define IPMI_SENSOR_EVENT_MESSAGE_ACTION_DO_NOT_CHANGE_INDIVIDUAL_ENABLES 0x0
#define IPMI_SENSOR_EVENT_MESSAGE_ACTION_ENABLE_SELECTED_EVENT_MESSAGES 0x1
#define IPMI_SENSOR_EVENT_MESSAGE_ACTION_DISABLE_SELECTED_EVENT_MESSAGES 0x2

#define IPMI_SENSOR_EVENT_MESSAGE_ACTION_VALID(__val)                             \
  (((__val) == IPMI_SENSOR_EVENT_MESSAGE_ACTION_DO_NOT_CHANGE_INDIVIDUAL_ENABLES  \
    || (__val) == IPMI_SENSOR_EVENT_MESSAGE_ACTION_ENABLE_SELECTED_EVENT_MESSAGES \
    || (__val) == IPMI_SENSOR_EVENT_MESSAGE_ACTION_DISABLE_SELECTED_EVENT_MESSAGES) ? 1 : 0)

#define IPMI_SENSOR_SCANNING_ON_THIS_SENSOR_ENABLE   0x1
#define IPMI_SENSOR_SCANNING_ON_THIS_SENSOR_DISABLE  0x0

#define IPMI_SENSOR_SCANNING_ON_THIS_SENSOR_VALID(__val)  \
  (((__val) == IPMI_SENSOR_SCANNING_ON_THIS_SENSOR_ENABLE \
    || (__val) == IPMI_SENSOR_SCANNING_ON_THIS_SENSOR_DISABLE) ? 1 : 0)

#define IPMI_SENSOR_ALL_EVENT_MESSAGES_ENABLE   0x1
#define IPMI_SENSOR_ALL_EVENT_MESSAGES_DISABLE  0x0

#define IPMI_SENSOR_ALL_EVENT_MESSAGES_VALID(__val)  \
  (((__val) == IPMI_SENSOR_ALL_EVENT_MESSAGES_ENABLE \
    || (__val) == IPMI_SENSOR_ALL_EVENT_MESSAGES_DISABLE) ? 1 : 0)

#define IPMI_SENSOR_EVENT_FLAG_ENABLE  0x1
#define IPMI_SENSOR_EVENT_FLAG_DISABLE 0x0

#define IPMI_SENSOR_EVENT_FLAG_VALID(__val)  \
  (((__val) == IPMI_SENSOR_EVENT_FLAG_ENABLE \
    || (__val) == IPMI_SENSOR_EVENT_FLAG_DISABLE) ? 1 : 0)

/* achu: Yes, this one is backwards.  I don't know why */
#define IPMI_SENSOR_RE_ARM_ALL_EVENT_STATUS_ENABLED 0x0
#define IPMI_SENSOR_RE_ARM_ALL_EVENT_STATUS_DISABLED 0x1

#define IPMI_SENSOR_RE_ARM_ALL_EVENT_STATUS_VALID(__val) \
  (((__val) == IPMI_SENSOR_RE_ARM_ALL_EVENT_STATUS_ENABLED \
    || (__val) == IPMI_SENSOR_RE_ARM_ALL_EVENT_STATUS_DISABLED) ? 1 : 0)

/* achu: Yes, this one is backwards.  I don't know why */
#define IPMI_SENSOR_READING_STATE_UNAVAILABLE 0x1
#define IPMI_SENSOR_READING_STATE_AVAILABLE 0x0

#define IPMI_SENSOR_THRESHOLD_SET     0x1
#define IPMI_SENSOR_THRESHOLD_NOT_SET 0x0

#define IPMI_SENSOR_READING_OPERATION_WRITE_GIVEN_VALUE_TO_SENSOR_READING_BYTE 0x01
#define IPMI_SENSOR_READING_OPERATION_DONT_CHANGE_SENSOR_READING_BYTE          0x00

#define IPMI_SENSOR_READING_OPERATION_VALID(__val) \
  (((__val) == IPMI_SENSOR_READING_OPERATION_WRITE_GIVEN_VALUE_TO_SENSOR_READING_BYTE \
    || (__val) == IPMI_SENSOR_READING_OPERATION_DONT_CHANGE_SENSOR_READING_BYTE) ? 1 : 0)

#define IPMI_ASSERTION_DEASSERTION_EVENT_STATUS_BITS_OPERATION_CLEAR_EVENT_STATUS_BITS       0x03
#define IPMI_ASSERTION_DEASSERTION_EVENT_STATUS_BITS_OPERATION_SET_EVENT_STATUS_BITS         0x02
#define IPMI_ASSERTION_DEASSERTION_EVENT_STATUS_BITS_OPERATION_WRITE_EVENT_STATUS_BITS       0x01
#define IPMI_ASSERTION_DEASSERTION_EVENT_STATUS_BITS_OPERATION_DONT_CHANGE_EVENT_STATUS_BITS 0x00

#define IPMI_ASSERTION_DEASSERTION_EVENT_STATUS_BITS_OPERATION_VALID(__val) \
  (((__val) == IPMI_ASSERTION_DEASSERTION_EVENT_STATUS_BITS_OPERATION_CLEAR_EVENT_STATUS_BITS \
    || (__val) == IPMI_ASSERTION_DEASSERTION_EVENT_STATUS_BITS_OPERATION_SET_EVENT_STATUS_BITS \
    || (__val) == IPMI_ASSERTION_DEASSERTION_EVENT_STATUS_BITS_OPERATION_WRITE_EVENT_STATUS_BITS \
    || (__val) == IPMI_ASSERTION_DEASSERTION_EVENT_STATUS_BITS_OPERATION_DONT_CHANGE_EVENT_STATUS_BITS) ? 1 : 0)

#define IPMI_EVENT_DATA_BYTES_OPERATION_WRITE_EVENT_DATA_BYTES_EXCLUDING_EVENT_OFFSET 0x02
#define IPMI_EVENT_DATA_BYTES_OPERATION_WRITE_EVENT_DATA_BYTES_INCLUDING_EVENT_OFFSET 0x01
#define IPMI_EVENT_DATA_BYTES_OPERATION_DONT_WRITE_EVENT_DATA_BYTES                   0x00

#define IPMI_EVENT_DATA_BYTES_OPERATION_VALID(__val) \
  (((__val) == IPMI_EVENT_DATA_BYTES_OPERATION_WRITE_EVENT_DATA_BYTES_EXCLUDING_EVENT_OFFSET \
    || (__val) == IPMI_EVENT_DATA_BYTES_OPERATION_WRITE_EVENT_DATA_BYTES_INCLUDING_EVENT_OFFSET \
    || (__val) == IPMI_EVENT_DATA_BYTES_OPERATION_DONT_WRITE_EVENT_DATA_BYTES) ? 1 : 0)

/* 
 * fill* functions return 0 on success, -1 on error.
 *
 * obj_cmd_rq must be for the fill function's respective fiid
 * template request.
 *
 * see freeipmi/templates/ for template definitions 
 */

extern fiid_template_t tmpl_cmd_get_device_sdr_info_rq;
extern fiid_template_t tmpl_cmd_get_device_sdr_info_rs;

extern fiid_template_t tmpl_cmd_get_device_sdr_rq;
extern fiid_template_t tmpl_cmd_get_device_sdr_rs;

extern fiid_template_t tmpl_cmd_get_sensor_reading_factors_rq;
extern fiid_template_t tmpl_cmd_get_sensor_reading_factors_rs;

extern fiid_template_t tmpl_cmd_set_sensor_hysteresis_rq;
extern fiid_template_t tmpl_cmd_set_sensor_hysteresis_rs;

extern fiid_template_t tmpl_cmd_get_sensor_hysteresis_rq;
extern fiid_template_t tmpl_cmd_get_sensor_hysteresis_rs;

extern fiid_template_t tmpl_cmd_set_sensor_thresholds_rq;
extern fiid_template_t tmpl_cmd_set_sensor_thresholds_rs;

extern fiid_template_t tmpl_cmd_get_sensor_thresholds_rq;
extern fiid_template_t tmpl_cmd_get_sensor_thresholds_rs;

extern fiid_template_t tmpl_cmd_set_sensor_event_enable_rq;
extern fiid_template_t tmpl_cmd_set_sensor_event_enable_threshold_rq;
extern fiid_template_t tmpl_cmd_set_sensor_event_enable_discrete_rq;
extern fiid_template_t tmpl_cmd_set_sensor_event_enable_rs;

extern fiid_template_t tmpl_cmd_get_sensor_event_enable_rq;
extern fiid_template_t tmpl_cmd_get_sensor_event_enable_rs;
extern fiid_template_t tmpl_cmd_get_sensor_event_enable_threshold_rs;
extern fiid_template_t tmpl_cmd_get_sensor_event_enable_discrete_rs;

extern fiid_template_t tmpl_cmd_re_arm_sensor_events_rq;
extern fiid_template_t tmpl_cmd_re_arm_sensor_events_threshold_rq;
extern fiid_template_t tmpl_cmd_re_arm_sensor_events_discrete_rq;
extern fiid_template_t tmpl_cmd_re_arm_sensor_events_rs;

extern fiid_template_t tmpl_cmd_get_sensor_event_status_rq;
extern fiid_template_t tmpl_cmd_get_sensor_event_status_rs;
extern fiid_template_t tmpl_cmd_get_sensor_event_status_threshold_rs;
extern fiid_template_t tmpl_cmd_get_sensor_event_status_discerete_rs;

extern fiid_template_t tmpl_cmd_get_sensor_reading_rq;
extern fiid_template_t tmpl_cmd_get_sensor_reading_rs;
extern fiid_template_t tmpl_cmd_get_sensor_reading_threshold_rs;
extern fiid_template_t tmpl_cmd_get_sensor_reading_discrete_rs;

extern fiid_template_t tmpl_cmd_set_sensor_type_rq;
extern fiid_template_t tmpl_cmd_set_sensor_type_rs;

extern fiid_template_t tmpl_cmd_get_sensor_type_rq;
extern fiid_template_t tmpl_cmd_get_sensor_type_rs;

extern fiid_template_t tmpl_cmd_set_sensor_reading_and_event_status_rq;
extern fiid_template_t tmpl_cmd_set_sensor_reading_and_event_status_threshold_rq;
extern fiid_template_t tmpl_cmd_set_sensor_reading_and_event_status_discrete_rq;
extern fiid_template_t tmpl_cmd_set_sensor_reading_and_event_status_event_fields_rq;
extern fiid_template_t tmpl_cmd_set_sensor_reading_and_event_status_threshold_event_fields_rq;
extern fiid_template_t tmpl_cmd_set_sensor_reading_and_event_status_discrete_event_fields_rq;
extern fiid_template_t tmpl_cmd_set_sensor_reading_and_event_status_rs;

/* achu: as of IPMI 2.0 hysteresis_mask reserved for future - write as 0xFF */
int fill_cmd_set_sensor_hysteresis (uint8_t sensor_number,
                                    uint8_t hysteresis_mask,
                                    uint8_t positive_going_threshold_hysteresis_value,
                                    uint8_t negative_going_threshold_hysteresis_value,
                                    fiid_obj_t obj_cmd_rq);

/* achu: as of IPMI 2.0 hysteresis_mask reserved for future - write as 0xFF */
int fill_cmd_get_sensor_hysteresis (uint8_t sensor_number,
                                    uint8_t hysteresis_mask,
                                    fiid_obj_t obj_cmd_rq);

int fill_cmd_set_sensor_thresholds (uint8_t sensor_number,
                                    const uint8_t *lower_non_critical_threshold,
                                    const uint8_t *lower_critical_threshold,
                                    const uint8_t *lower_non_recoverable_threshold,
                                    const uint8_t *upper_non_critical_threshold,
                                    const uint8_t *upper_critical_threshold,
                                    const uint8_t *upper_non_recoverable_threshold,
                                    fiid_obj_t obj_cmd_rq);

int fill_cmd_get_sensor_thresholds (uint8_t sensor_number, fiid_obj_t obj_cmd_rq);

int fill_cmd_set_sensor_event_enable (uint8_t sensor_number,
                                      uint8_t event_message_action,
                                      uint8_t scanning_on_this_sensor,
                                      uint8_t all_event_messages,
                                      uint16_t assertion_event_bitmask,
                                      uint16_t deassertion_event_bitmask,
                                      fiid_obj_t obj_cmd_rq);

int fill_cmd_set_sensor_event_enable_threshold (uint8_t sensor_number,
                                                uint8_t event_message_action,
                                                uint8_t scanning_on_this_sensor,
                                                uint8_t all_event_messages,
                                                uint8_t assertion_event_lower_non_critical_going_low,
                                                uint8_t assertion_event_lower_non_critical_going_high,
                                                uint8_t assertion_event_lower_critical_going_low,
                                                uint8_t assertion_event_lower_critical_going_high,
                                                uint8_t assertion_event_lower_non_recoverable_going_low,
                                                uint8_t assertion_event_lower_non_recoverable_going_high,
                                                uint8_t assertion_event_upper_non_critical_going_low,
                                                uint8_t assertion_event_upper_non_critical_going_high,
                                                uint8_t assertion_event_upper_critical_going_low,
                                                uint8_t assertion_event_upper_critical_going_high,
                                                uint8_t assertion_event_upper_non_recoverable_going_low,
                                                uint8_t assertion_event_upper_non_recoverable_going_high,
                                                uint8_t deassertion_event_lower_non_critical_going_low,
                                                uint8_t deassertion_event_lower_non_critical_going_high,
                                                uint8_t deassertion_event_lower_critical_going_low,
                                                uint8_t deassertion_event_lower_critical_going_high,
                                                uint8_t deassertion_event_lower_non_recoverable_going_low,
                                                uint8_t deassertion_event_lower_non_recoverable_going_high,
                                                uint8_t deassertion_event_upper_non_critical_going_low,
                                                uint8_t deassertion_event_upper_non_critical_going_high,
                                                uint8_t deassertion_event_upper_critical_going_low,
                                                uint8_t deassertion_event_upper_critical_going_high,
                                                uint8_t deassertion_event_upper_non_recoverable_going_low,
                                                uint8_t deassertion_event_upper_non_recoverable_going_high,
                                                fiid_obj_t obj_cmd_rq);

int fill_cmd_set_sensor_event_enable_discrete (uint8_t sensor_number,
                                               uint8_t event_message_action,
                                               uint8_t scanning_on_this_sensor,
                                               uint8_t all_event_messages,
                                               uint8_t assertion_event_state_bit_0,
                                               uint8_t assertion_event_state_bit_1,
                                               uint8_t assertion_event_state_bit_2,
                                               uint8_t assertion_event_state_bit_3,
                                               uint8_t assertion_event_state_bit_4,
                                               uint8_t assertion_event_state_bit_5,
                                               uint8_t assertion_event_state_bit_6,
                                               uint8_t assertion_event_state_bit_7,
                                               uint8_t assertion_event_state_bit_8,
                                               uint8_t assertion_event_state_bit_9,
                                               uint8_t assertion_event_state_bit_10,
                                               uint8_t assertion_event_state_bit_11,
                                               uint8_t assertion_event_state_bit_12,
                                               uint8_t assertion_event_state_bit_13,
                                               uint8_t assertion_event_state_bit_14,
                                               uint8_t deassertion_event_state_bit_0,
                                               uint8_t deassertion_event_state_bit_1,
                                               uint8_t deassertion_event_state_bit_2,
                                               uint8_t deassertion_event_state_bit_3,
                                               uint8_t deassertion_event_state_bit_4,
                                               uint8_t deassertion_event_state_bit_5,
                                               uint8_t deassertion_event_state_bit_6,
                                               uint8_t deassertion_event_state_bit_7,
                                               uint8_t deassertion_event_state_bit_8,
                                               uint8_t deassertion_event_state_bit_9,
                                               uint8_t deassertion_event_state_bit_10,
                                               uint8_t deassertion_event_state_bit_11,
                                               uint8_t deassertion_event_state_bit_12,
                                               uint8_t deassertion_event_state_bit_13,
                                               uint8_t deassertion_event_state_bit_14,
                                               fiid_obj_t obj_cmd_rq);

int fill_cmd_get_sensor_event_enable (uint8_t sensor_number, fiid_obj_t obj_cmd_rq);

int fill_cmd_re_arm_sensor_events (uint8_t sensor_number,
				   uint8_t re_arm_all_event_status_from_this_sensor,
				   uint16_t *re_arm_assertion_event,
				   uint16_t *re_arm_deassertion_event,
				   fiid_obj_t obj_cmd_rq);

int fill_cmd_get_sensor_reading (uint8_t sensor_number, fiid_obj_t obj_cmd_rq);

int fill_cmd_set_sensor_reading_and_event_status (uint8_t sensor_number,
						  uint8_t sensor_reading_operation,
						  uint8_t deassertion_bits_operation,
						  uint8_t assertion_bits_operation,
						  uint8_t event_data_bytes_operation,
						  uint8_t sensor_reading,
						  uint16_t assertion_event_bitmask,
						  uint16_t deassertion_event_bitmask,
						  uint8_t event_data1,
						  uint8_t event_data2,
						  uint8_t event_data3,
						  fiid_obj_t obj_cmd_rq);

#ifdef __cplusplus
}
#endif

#endif /* IPMI_SENSOR_CMDS_H */