/usr/include/OpenIPMI/ipmi_types.h is in libopenipmi-dev 2.0.22-1.1.
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 | /*
* ipmi_types.h
*
* MontaVista IPMI interface general types.
*
* Author: MontaVista Software, Inc.
* Corey Minyard <minyard@mvista.com>
* source@mvista.com
*
* Copyright 2003,2004,2005 MontaVista Software Inc.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* Lesser General Public License (GPL) Version 2 or the modified BSD
* license below. The following disclamer applies to both licenses:
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* GNU Lesser General Public Licence
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Modified BSD Licence
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*/
#ifndef _IPMI_TYPES_H
#define _IPMI_TYPES_H
#ifndef IPMI_FUNC_DEPRECATED
# if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2))
# define IPMI_FUNC_DEPRECATED __attribute__ ((deprecated))
# define IPMI_TYPE_DEPRECATED __attribute__ ((deprecated))
# define IPMI_VAR_DEPRECATED __attribute__ ((deprecated))
# else
# define IPMI_FUNC_DEPRECATED
# define IPMI_TYPE_DEPRECATED
# define IPMI_VAR_DEPRECATED
# endif
#endif
#include <stdint.h>
#include <OpenIPMI/ipmi_addr.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* These are the main types the user has to deal with.
*/
/*
* This represents IPMI system, called a "domain". A domain is where
* a set of entities reside.
*/
typedef struct ipmi_domain_s ipmi_domain_t;
typedef struct ipmi_domain_id_s ipmi_domain_id_t;
/*
* An entity is a physical device that can be monitored or controlled.
*/
typedef struct ipmi_entity_s ipmi_entity_t;
typedef struct ipmi_entity_id_s ipmi_entity_id_t;
/*
* A fru is something that an entity contains that holds information
* about the entity in a defined format.
*/
typedef struct ipmi_fru_s ipmi_fru_t;
/*
* A sensor is something connected to an entity that can monitor or control
* the entity.
*/
typedef struct ipmi_sensor_s ipmi_sensor_t;
typedef struct ipmi_sensor_id_s ipmi_sensor_id_t;
/*
* A control is an output device, such as a light, relay, or display.
*/
typedef struct ipmi_control_s ipmi_control_t;
typedef struct ipmi_control_id_s ipmi_control_id_t;
/* Used to represent a time difference, in nanoseconds. */
typedef int64_t ipmi_timeout_t;
#define IPMI_INVALID_TIME INT64_MIN
/* Used to represent an absolute time, in nanoseconds since 00:00 Jan
1, 1970 */
typedef int64_t ipmi_time_t;
/* This type holds the arguments for an IPMI connection. */
typedef struct ipmi_args_s ipmi_args_t;
#ifndef __LINUX_IPMI_H /* Don't include this is we are including the kernel */
#define IPMI_MAX_MSG_LENGTH 256
/* A raw IPMI message without any addressing. This covers both
commands and responses. The completion code is always the first
byte of data in the response (as the spec shows the messages laid
out). */
typedef struct ipmi_msg
{
unsigned char netfn;
unsigned char cmd;
unsigned short data_len;
unsigned char *data;
} ipmi_msg_t;
#else
/* Generate a type for the kernel version of this. */
typedef struct ipmi_msg ipmi_msg_t;
#endif
/* A structure used to hold messages that can be put into a linked
list. */
typedef struct ipmi_msg_item_s
{
ipmi_addr_t addr;
unsigned int addr_len;
ipmi_msg_t msg;
unsigned char data[IPMI_MAX_MSG_LENGTH];
struct ipmi_msg_item_s *next;
void *data1;
void *data2;
void *data3;
void *data4;
} ipmi_msgi_t;
/* Return values for function that take the previous item. */
#define IPMI_MSG_ITEM_NOT_USED 0
#define IPMI_MSG_ITEM_USED 1
/* Pay no attention to the contents of these structures... */
struct ipmi_domain_id_s
{
ipmi_domain_t *domain;
};
#define IPMI_DOMAIN_ID_INVALID { NULL }
struct ipmi_entity_id_s
{
ipmi_domain_id_t domain_id;
unsigned int entity_id : 8;
unsigned int entity_instance : 8;
unsigned int channel : 4;
unsigned int address : 8;
long seq;
};
#define IPMI_ENTITY_ID_INVALID { IPMI_DOMAIN_ID_INVALID, 0, 0, 0, 0, 0 }
/* This structure is kind of a cheap hack. It's internal and
definately *NOT* for use by the user. It can represent two
different types of addresses. An IPMI will have a normal channel
number (usually 0 or 1) and the IPMB address will be in "mc_num".
A direct connection to a system interface (KCS, LAN, etc.) is
represented as IPMI_BMC_CHANNEL in the channel number and the
interface number in mc_num. Multiple interface numbers are used
because you can have more than one connection to a domain; the
first connection will be mc_num 0, the second will be mc_num 1,
etc. */
typedef struct ipmi_mcid_s
{
ipmi_domain_id_t domain_id;
unsigned char mc_num;
unsigned char channel;
long seq;
} ipmi_mcid_t;
#define IPMI_MCID_INVALID { IPMI_DOMAIN_ID_INVALID, 0, 0, 0 }
typedef struct ipmi_mc_s ipmi_mc_t;
struct ipmi_sensor_id_s
{
ipmi_mcid_t mcid;
unsigned int lun : 3;
unsigned int sensor_num : 8;
};
#define IPMI_SENSOR_ID_INVALID { IPMI_MCID_INVALID, 0, 0 }
struct ipmi_control_id_s
{
ipmi_mcid_t mcid;
unsigned int lun : 3;
unsigned int control_num : 8;
};
#define IPMI_CONTROL_ID_INVALID { IPMI_MCID_INVALID, 0, 0 }
/* The event structure is no longer public. */
typedef struct ipmi_event_s ipmi_event_t;
/* This represents a low-level connection. */
typedef struct ipmi_con_s ipmi_con_t;
/*
* Channel information for a connection.
*/
typedef struct ipmi_chan_info_s
{
unsigned int medium : 7;
unsigned int xmit_support : 1;
unsigned int recv_lun : 3;
unsigned int protocol : 5;
unsigned int session_support : 2;
unsigned int vendor_id : 24;
unsigned int aux_info : 16;
} ipmi_chan_info_t;
#define MAX_IPMI_USED_CHANNELS 14
#ifdef __cplusplus
}
#endif
#endif /* _IPMI_TYPES_H */
|