This file is indexed.

/usr/include/freeipmi/sdr-cache/ipmi-sdr-cache.h is in libfreeipmi-dev 0.8.12-3ubuntu1.

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
/*
   Copyright (C) 2003-2010 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 2, 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, write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.

*/
/*****************************************************************************\
 *  Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
 *  Copyright (C) 2006-2007 The Regents of the University of California.
 *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 *  Written by Albert Chu <chu11@llnl.gov>
 *  UCRL-CODE-222073
 *
 *  This file is part of Ipmimonitoring, an IPMI sensor monitoring
 *  library.  For details, see http://www.llnl.gov/linux/.
 *
 *  Ipmimonitoring 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 2 of the License, or (at your
 *  option) any later version.
 *
 *  Ipmimonitoring 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 Ipmimonitoring.  If not, see <http://www.gnu.org/licenses/>.
\*****************************************************************************/

#ifndef _IPMI_SDR_CACHE_H
#define _IPMI_SDR_CACHE_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>
#include <freeipmi/api/ipmi-api.h>

#define IPMI_SDR_CACHE_ERR_SUCCESS                                      0
#define IPMI_SDR_CACHE_ERR_CONTEXT_NULL                                 1
#define IPMI_SDR_CACHE_ERR_CONTEXT_INVALID                              2
#define IPMI_SDR_CACHE_ERR_PARAMETERS                                   3
#define IPMI_SDR_CACHE_ERR_OUT_OF_MEMORY                                4
#define IPMI_SDR_CACHE_ERR_FILENAME_INVALID                             5
#define IPMI_SDR_CACHE_ERR_FILESYSTEM                                   6
#define IPMI_SDR_CACHE_ERR_PERMISSION                                   7
#define IPMI_SDR_CACHE_ERR_CACHE_CREATE_CACHE_EXISTS                    8
#define IPMI_SDR_CACHE_ERR_CACHE_CREATE_CTX_SET_TO_READ                 9
#define IPMI_SDR_CACHE_ERR_CACHE_CREATE_DUPLICATE_RECORD_ID             10
#define IPMI_SDR_CACHE_ERR_CACHE_CREATE_INVALID_RECORD_LENGTH           11
#define IPMI_SDR_CACHE_ERR_CACHE_CREATE_INVALID_RECORD_COUNT            12
#define IPMI_SDR_CACHE_ERR_CACHE_READ_ALREADY_INITIALIZED               13
#define IPMI_SDR_CACHE_ERR_CACHE_READ_INITIALIZATION                    14
#define IPMI_SDR_CACHE_ERR_CACHE_READ_CACHE_DOES_NOT_EXIST              15
#define IPMI_SDR_CACHE_ERR_CACHE_DELETE_CTX_SET_TO_READ                 16
#define IPMI_SDR_CACHE_ERR_CACHE_INVALID                                17
#define IPMI_SDR_CACHE_ERR_CACHE_OUT_OF_DATE                            18
#define IPMI_SDR_CACHE_ERR_NOT_FOUND                                    19
#define IPMI_SDR_CACHE_ERR_IPMI_ERROR                                   20
#define IPMI_SDR_CACHE_ERR_SYSTEM_ERROR                                 21
#define IPMI_SDR_CACHE_ERR_OVERFLOW                                     22
#define IPMI_SDR_CACHE_ERR_INTERNAL_ERROR                               23
#define IPMI_SDR_CACHE_ERR_ERRNUMRANGE                                  24

#define IPMI_SDR_CACHE_FLAGS_DEFAULT                   0x0000
#define IPMI_SDR_CACHE_FLAGS_DEBUG_DUMP                0x0001

#define IPMI_SDR_CACHE_MAX_SDR_RECORD_LENGTH           261 /* 256 + header */

#define IPMI_SDR_CACHE_CREATE_FLAGS_DEFAULT            0x0
/* During cache creation, overwrite any previously created cache.  Default
 * is to return an error that the cache already exists.
 */
#define IPMI_SDR_CACHE_CREATE_FLAGS_OVERWRITE          0x1

#define IPMI_SDR_CACHE_VALIDATION_FLAGS_DEFAULT                 0x0
/* During cache creation, check for duplicate record ids and return error if
 * one is found.
 */
#define IPMI_SDR_CACHE_VALIDATION_FLAGS_DUPLICATE_RECORD_ID     0x1

typedef struct ipmi_sdr_cache_ctx *ipmi_sdr_cache_ctx_t;

/* Callback between every record that is cached */
typedef void (*Sdr_Create_Callback)(uint8_t sdr_version,
                                    uint16_t record_count,
                                    uint32_t most_recent_addition_timestamp,
                                    uint32_t most_recent_erase_timestamp,
                                    uint16_t record_id,
                                    void *data);

/* SDR Cache Context Functions */
ipmi_sdr_cache_ctx_t ipmi_sdr_cache_ctx_create (void);
void ipmi_sdr_cache_ctx_destroy (ipmi_sdr_cache_ctx_t ctx);
int ipmi_sdr_cache_ctx_errnum (ipmi_sdr_cache_ctx_t ctx);
char * ipmi_sdr_cache_ctx_strerror (int errnum);
char * ipmi_sdr_cache_ctx_errormsg (ipmi_sdr_cache_ctx_t ctx);

/* SDR flag functions */
int ipmi_sdr_cache_ctx_get_flags (ipmi_sdr_cache_ctx_t ctx, unsigned int *flags);
int ipmi_sdr_cache_ctx_set_flags (ipmi_sdr_cache_ctx_t ctx, unsigned int flags);
char *ipmi_sdr_cache_ctx_get_debug_prefix (ipmi_sdr_cache_ctx_t ctx);
int ipmi_sdr_cache_ctx_set_debug_prefix (ipmi_sdr_cache_ctx_t ctx, const char *debug_prefix);

/* SDR Cache Creation Functions */
int ipmi_sdr_cache_create (ipmi_sdr_cache_ctx_t ctx,
                           ipmi_ctx_t ipmi_ctx,
                           const char *filename,
                           int create_flags,
                           int validation_flags,
                           Sdr_Create_Callback create_callback,
                           void *create_callback_data);

/* SDR Cache Reading Functions */
int ipmi_sdr_cache_open (ipmi_sdr_cache_ctx_t ctx,
                         ipmi_ctx_t ipmi_ctx,
                         const char *filename);

int ipmi_sdr_cache_sdr_version (ipmi_sdr_cache_ctx_t ctx, uint8_t *sdr_version);
int ipmi_sdr_cache_record_count (ipmi_sdr_cache_ctx_t ctx, uint16_t *record_count);
int ipmi_sdr_cache_most_recent_addition_timestamp (ipmi_sdr_cache_ctx_t ctx,
                                                   uint32_t *most_recent_addition_timestamp);
int ipmi_sdr_cache_most_recent_erase_timestamp (ipmi_sdr_cache_ctx_t ctx,
                                                uint32_t *most_recent_erase_timestamp);

int ipmi_sdr_cache_first (ipmi_sdr_cache_ctx_t ctx);
int ipmi_sdr_cache_next (ipmi_sdr_cache_ctx_t ctx);
int ipmi_sdr_cache_seek (ipmi_sdr_cache_ctx_t ctx, unsigned int index);
int ipmi_sdr_cache_search_record_id (ipmi_sdr_cache_ctx_t ctx, uint16_t record_id);
/* sensor owner id is 8bit field - 7 bit slave or system software id + 1 bit indicating type */
int ipmi_sdr_cache_search_sensor (ipmi_sdr_cache_ctx_t ctx, uint8_t sensor_number, uint8_t sensor_owner_id);

/* return length of data read into buffer on success, -1 on error */
int ipmi_sdr_cache_record_read (ipmi_sdr_cache_ctx_t ctx,
                                void *buf,
                                unsigned int buflen);

int ipmi_sdr_cache_close (ipmi_sdr_cache_ctx_t ctx);

/* SDR Cache Delete Functions */
int ipmi_sdr_cache_delete (ipmi_sdr_cache_ctx_t ctx, const char *filename);

#ifdef __cplusplus
}
#endif

#endif /* _IPMI_SDR_CACHE_H */