/usr/include/OpenIPMI/internal/ipmi_oem.h is in libopenipmi-dev 2.0.16-1.4.
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 | /*
* ipmi_oem.h
*
* MontaVista IPMI interface, OEM handling
*
* Author: MontaVista Software, Inc.
* Corey Minyard <minyard@mvista.com>
* source@mvista.com
*
* Copyright 2002,2003 MontaVista Software Inc.
*
* 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.
*
*
* 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.
*
* 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.
*/
#ifndef IPMI_OEM_H
#define IPMI_OEM_H
/*
* These calls allow OEM code to register for various events so they can
* create their own entities, sensors, or modify existing ones as necessary.
*/
#include <OpenIPMI/ipmiif.h>
#include <OpenIPMI/ipmi_sdr.h>
/* This registers an OEM handler. If an MC is detected that has the
given manufacturer id and product id, the handler will be
called. If the IPMI system is shutdown while this is registered,
then shutdown will be called (if it is not NULL). Note that this
is called with the "dummy" system interface MC (the once created by
the domain to talk to the LAN's management controller directly), if
the IPMI address is a system interface address and the channel is
also the system interface address (15), it is that MC. That MC
does not show up as a normal MC, so you may need special handling
for this. */
typedef int (*ipmi_oem_mc_match_handler_cb)(ipmi_mc_t *mc, void *cb_data);
typedef int (*ipmi_oem_shutdown_handler_cb)(void *cb_data);
int ipmi_register_oem_handler(unsigned int manufacturer_id,
unsigned int product_id,
ipmi_oem_mc_match_handler_cb handler,
ipmi_oem_shutdown_handler_cb shutdown,
void *cb_data);
int ipmi_deregister_oem_handler(unsigned int manufacturer_id,
unsigned int product_id);
int ipmi_register_oem_handler_range
(unsigned int manufacturer_id,
unsigned int first_product_id,
unsigned int last_product_id,
ipmi_oem_mc_match_handler_cb handler,
ipmi_oem_shutdown_handler_cb shutdown,
void *cb_data);
int ipmi_deregister_oem_handler_range(unsigned int manufacturer_id,
unsigned int first_product_id,
unsigned int last_product_id);
/* Register an OEM handler for domains, based upon the main connection's
MC info. */
typedef int (*ipmi_oem_domain_match_handler_cb)(ipmi_domain_t *domain,
void *cb_data);
typedef int (*ipmi_oem_domain_shutdown_handler_cb)(void *cb_data);
int ipmi_domain_register_oem_handler(unsigned int manufacturer_id,
unsigned int product_id,
ipmi_oem_domain_match_handler_cb handler,
ipmi_oem_domain_shutdown_handler_cb shutdown,
void *cb_data);
int ipmi_domain_register_oem_handler_range
(unsigned int manufacturer_id,
unsigned int first_product_id,
unsigned int last_product_id,
ipmi_oem_domain_match_handler_cb handler,
ipmi_oem_domain_shutdown_handler_cb shutdown,
void *cb_data);
int ipmi_domain_deregister_oem_handler(unsigned int manufacturer_id,
unsigned int product_id);
int ipmi_domain_deregister_oem_handler_range(unsigned int manufacturer_id,
unsigned int first_product_id,
unsigned int last_product_id);
/* Register an OEM handler for connections, based upon MC. This is
primarily so that a connection handler can register a way to get
the connections slave address, but it may have other uses. */
typedef int (*ipmi_oem_conn_handler_cb)(ipmi_con_t *conn, void *cb_data);
int ipmi_register_oem_conn_handler(unsigned int manufacturer_id,
unsigned int product_id,
ipmi_oem_conn_handler_cb handler,
void *cb_data);
int ipmi_deregister_oem_conn_handler(unsigned int manufacturer_id,
unsigned int product_id);
/* Register a handler to be called when a connection goes up and the
user is informed. */
int ipmi_domain_set_con_up_handler(ipmi_domain_t *domain,
ipmi_domain_ptr_cb handler,
void *cb_data);
/* Used to report that an mc as been removed to the OEM handler. The
OEM handler may not refuse to allow the mc to be removed. This is
so the OEM handler can free data if necessary. This is registered
against the MC itself, not the BMC, and must be called on each MC
that needs it. */
typedef void (*ipmi_mc_oem_removed_cb)(ipmi_domain_t *domain,
ipmi_mc_t *mc,
void *cb_data);
int ipmi_mc_add_oem_removed_handler(ipmi_mc_t *mc,
ipmi_mc_oem_removed_cb handler,
void *cb_data);
int ipmi_mc_remove_oem_removed_handler(ipmi_mc_t *mc,
ipmi_mc_oem_removed_cb handler,
void *cb_data);
/* This is called right after the SDRs are fetched before they are
processed. It lets the OEM code clean up and SDR problems. */
typedef void (*ipmi_mc_oem_fixup_sdrs_cb)(ipmi_mc_t *mc,
ipmi_sdr_info_t *sdrs,
void *cb_data);
int ipmi_mc_set_sdrs_fixup_handler(ipmi_mc_t *mc,
ipmi_mc_oem_fixup_sdrs_cb handler,
void *cb_data);
/* This is called right after the SDRs are fetched before they are
processed, like the above but for the domain. It lets the OEM code
clean up and SDR problems. */
typedef void (*ipmi_domain_oem_fixup_sdrs_cb)(ipmi_domain_t *domain,
ipmi_sdr_info_t *sdrs,
void *cb_data);
int ipmi_domain_set_sdrs_fixup_handler(ipmi_domain_t *mc,
ipmi_domain_oem_fixup_sdrs_cb handler,
void *cb_data);
/* A new sensor has been added, the OEM handlers get first access at
it. The new sensor handler is called before the sensor is added to
the entity. If this call returns true, the sensor will NOT be
added to the entity, the OEM device is assumed to have taken over
control of the sensor. The OEM handler may also add it's own
callback or register it's own data conversion handler for this
sensor. The link is a value allocated with
ipmi_entity_alloc_sensor_link; if the OEM callback returns false,
the oem callback cannot use this value. If it returns true, the
oem callback will own the link and be responsible for freeing the
link. Setting the callback to NULL will disable it. */
typedef int (*ipmi_mc_oem_new_sensor_cb)(ipmi_mc_t *mc,
ipmi_entity_t *ent,
ipmi_sensor_t *sensor,
void *link,
void *cb_data);
int ipmi_mc_set_oem_new_sensor_handler(ipmi_mc_t *mc,
ipmi_mc_oem_new_sensor_cb handler,
void *cb_data);
/* The handler should return 0 if it didn't handle the event, or 1
if it did. If the call handles the event, OpenIPMI will not deliver
the event anywhere else. */
typedef int (*ipmi_oem_event_handler_cb)(ipmi_mc_t *mc,
ipmi_event_t *log,
void *cb_data);
/* Set a handler for when an event comes in from a specific MC. This
is so the code can handle custom messages or broken events. */
int ipmi_mc_set_oem_event_handler(ipmi_mc_t *mc,
ipmi_oem_event_handler_cb handler,
void *cb_data);
/* Set a handler for when an event comes from the SEL of a specific
MC. Note that the message may be from another MC, but it was
stored in the given MC's SEL. This handler gets first dibs at the
message, and must parse the time itself. This is so OEM code can
handle broken or custom SELs. */
int ipmi_mc_set_sel_oem_event_handler(ipmi_mc_t *mc,
ipmi_oem_event_handler_cb handler,
void *cb_data);
#endif /* IPMI_OEM_H */
|