Compare commits

..

1 Commits

212 changed files with 27233 additions and 41801 deletions

39
.gitignore vendored
View File

@ -1,39 +0,0 @@
.deps
.dirstamp
.libs
.*.swp
*.log
*.rej
*.orig
*.o
*.lo
*.la
*.*~
Makefile
Makefile.in
aclocal.m4
autom4te.cache
compile
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
depcomp
install-sh
ltmain.sh
libtool
missing
stamp-h1
control/ipmitool.spec
control/pkginfo
control/prototype
control/rpmmacros
src/ipmievd
src/ipmitool
doc/ipmievd.8
doc/ipmitool.1
cscope.out
tags

View File

@ -1,37 +0,0 @@
language: C
sudo: enabled
before_script:
- ./bootstrap
addons:
apt:
update: true
packages:
- libssl-dev
homebrew:
packages:
- openssl
matrix:
include:
- os: linux
dist: xenial
addons:
apt:
packages:
- libsystemd-dev
script:
- ./configure --enable-intf-dummy --enable-intf-dbus
- make
- sudo make install
- os: linux
dist: trusty
script:
- ./configure --enable-intf-dummy
- make
- sudo make install
- os: osx
osx_image: xcode10.2
script:
- ./configure --enable-intf-dummy
- make
- sudo make install

392
INSTALL
View File

@ -1,392 +0,0 @@
Installation Instructions
*************************
Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
Prerequisites
=============
This project requires at least gcc 4.8.1 as it uses some GNU
extensions and some C11 features. For `lanplus` interface the OpenSSL
library and development headers are required. As of April 2019, the
project is tested automatically to build cleanly for the following
64-bit operating systems:
- Ubuntu 14.04 Trusty
- Ubuntu 16.04 Xenial
- MacOS X 10.14 (Xcode 10.2)
For Ubuntu 16.04 it is recommended to do the following before building:
$ sudo apt install automake gcc git libreadline-dev libssl-dev libsystemd-dev libtool make wget
For Fedora 31 it is recommended to do the following before building:
$ sudo dnf install automake gcc git libtool make openssl-devel readline-devel systemd-devel wget
Basic Installation
==================
Briefly, the followong shell command should configure, build, and
install this package:
`./bootstrap && ./configure && make && sudo make install`
The following more-detailed instructions are generic; see the
`README' file for instructions specific to this package. Some
packages provide this `INSTALL' file but do not implement all of the
features documented below. The lack of an optional feature in a given
package is not necessarily a bug. More recommendations for GNU
packages can be found in *note Makefile Conventions:
(standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the `make install' phase executed with root
privileges.
5. Optionally, type `make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior `make install' required
root privileges, verifies that the installation completed
correctly.
6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
7. Often, you can also type `make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide `make
distcheck', which can by used by developers to test that all other
targets like `make install' and `make uninstall' work correctly.
This target is generally not run by end users.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'. This
is known as a "VPATH" build.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX', where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the
default for these options is expressed in terms of `${prefix}', so that
specifying just `--prefix' will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to `configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
`make install' command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, `make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
`${prefix}'. Any directories that were specified during `configure',
but not in terms of `${prefix}', must each be overridden at install
time for the entire installation to be relocated. The approach of
makefile variable overrides for each directory variable is required by
the GNU Coding Standards, and ideally causes no recompilation.
However, some platforms have known limitations with the semantics of
shared libraries that end up requiring recompilation when using this
method, particularly noticeable in packages that use GNU Libtool.
The second method involves providing the `DESTDIR' variable. For
example, `make install DESTDIR=/alternate/directory' will prepend
`/alternate/directory' before all installation names. The approach of
`DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of `${prefix}'
at `configure' time.
Optional Features
=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the
execution of `make' will be. For these packages, running `./configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with `make V=1'; while running `./configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with `make V=0'.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX `make' updates targets which have the same time stamps as
their prerequisites, which makes it generally unusable when shipped
generated files such as `configure' are involved. Use GNU `make'
instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
to try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.
On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf limitation. Until the limitation is lifted, you can use
this workaround:
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of all of the options to `configure', and exit.
`--help=short'
`--help=recursive'
Print a summary of the options unique to this package's
`configure', and exit. The `short' variant lists options used
only in the top level, while the `recursive' variant lists options
also present in any nested packages.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
`--no-create'
`-n'
Run the configure checks, but stop before creating any output
files.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

0
NEWS
View File

View File

@ -1,326 +0,0 @@
#!/bin/sh
#############################################################################
#
# exchange-bmc-os-info: Set OS and BMC (Baseboard Management Controller)
# parameters during system startup.
#
# version: 0.72
#
# Authors: Charles Rose <charles_rose@dell.com>
# Jordan Hargrave <jordan_hargrave@dell.com>
#
# Description: Script to set OS information in the BMC; fetch BMC IP/URL
# and set in the OS for use by other scripts/user.
#
# BMC IP and URL are made available in /var/run/bmc-info
#
# Example to launch BMC web-interface:
# # . /var/run/bmc-info
# # xdg-open $BMC_URL
#
# See here for details:
# https://fedoraproject.org/wiki/Features/AgentFreeManagement
#
# OEM Specific: OEM specific ipmi commands go in:
# 'oem_set_os_version' and 'oem_get_bmc_url'
#############################################################################
#
# chkconfig: 345 99 00
# description: Set OS name, hostname in BMC; make BMC IP/URL available in OS
# processname: exchange-bmc-os-info
# config: /etc/sysconfig/exchange-bmc-os-info
#
### BEGIN INIT INFO
# Provides: exchange-bmc-os-info
# Required-Start: ipmi
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
#############################################################################
# GLOBALS
#############################################################################
CONFIGFILE=/etc/sysconfig/exchange-bmc-os-info
IPMI_TOOL=/usr/bin/ipmitool
BMC_INFO=/var/run/bmc-info
# BMC Manufacturer ID used in 'oem_set_os_version' and 'oem_get_bmc_url'
DELL="674"
#OTHER_OEM="123"
# Defaults for ${CONFIGFILE}
SET_OS_INFO="yes"
RESET_OS_INFO="no"
SET_BMC_INFO="yes"
# getsysinfo and setsysinfo commands
IPMI_SET_SYSINFO="${IPMI_TOOL} mc setsysinfo"
IPMI_GET_SYSINFO="${IPMI_TOOL} mc getsysinfo"
#############################################################################
SCRIPT_NAME=$(basename $0)
# source config
[ -r ${CONFIGFILE} ] && . ${CONFIGFILE}
RETVAL=0
if [ -f /bin/gettext.sh ]; then
GETTEXT=1
. /bin/gettext.sh
OUTPUT="eval_gettext"
else
GETTEXT=0
OUTPUT="echo"
fi
#############################################################################
# Get Vendor ID of BMC for use in 'oem_set_os_version' and 'oem_get_bmc_url'
#
get_bmc_vendor_id()
{
BMC_VENDOR=$(${IPMI_TOOL} mc info 2>/dev/null | \
sed -n "s#^Manufacturer ID.*: ##p")
[ -z "${BMC_VENDOR}" ] && RETVAL=4
}
check_ipmitool()
{
if [ -x ${IPMI_TOOL} ]; then
# v1.8.12 plus patches are required for set/getsysinfo support
# http://sourceforge.net/mailarchive/message.php?msg_id=29647222
[ ! ${IPMI_GET_SYSINFO} >/dev/null 2>&1 ] && \
RETVAL=3
else
RETVAL=2
fi
}
bmc_exists()
{
check_ipmitool
[ $RETVAL -eq 0 ] && get_bmc_vendor_id
return $RETVAL
}
#############################################################################
get_os_info()
{
OS_HOSTNAME=$(hostname)
KERNEL_VERSION=$(uname -r -m)
if [ -e /etc/lsb-release ] ; then
. /etc/lsb-release
NAME=${DISTRIB_ID}
VERSION="${DISTRIB_RELEASE} ${DISTRIB_CODENAME}"
fi
# we prefer systemd's /etc/os-release over other sources
[ -e /etc/os-release ] && . /etc/os-release
OS_NAME=${NAME}
OS_VERSION="${VERSION} kernel ${KERNEL_VERSION}"
}
oem_set_os_version()
{
# OS Version setting is not standard yet
# we need per vendor oem commands
case "${BMC_VENDOR}" in
$DELL) ${IPMI_SET_SYSINFO} delloem_os_version \
"${OS_VERSION}" > /dev/null 2>&1
return $?
;;
# Add OEM specific commands.
# Example:
# $OTHER_OEM) ${IPMI_SET_SYSINFO} otheroem_os_version \
# "${OS_VERSION}" > /dev/null 2>&1
# return $?
# ;;
*) return 0
;;
esac
}
set_os_info()
{
# Set and reset OS info in the BMC
if [ "$1" = "reset" ]; then
OS_NAME=""
OS_HOSTNAME=""
OS_VERSION=""
fi
${IPMI_SET_SYSINFO} os_name "${OS_NAME}" >/dev/null 2>&1 \
|| RETVAL=6
${IPMI_SET_SYSINFO} primary_os_name "${OS_NAME}" >/dev/null 2>&1 \
|| RETVAL=6
${IPMI_SET_SYSINFO} system_name "${OS_HOSTNAME}" >/dev/null 2>&1 \
|| RETVAL=6
oem_set_os_version || RETVAL=6
}
#############################################################################
valid_url()
{
url="(https?|http)://[a-z0-9-]+(\.[a-z0-9-]+)+([/?].*)?"
printf -- "%s" "${TMP_URL}"| grep -Eq "^${url}"
return $?
}
oem_get_bmc_url()
{
# BMC URL is not standard yet
# we need per vendor oem commands
case "$BMC_VENDOR" in
$DELL) TMP_URL=$(${IPMI_GET_SYSINFO} delloem_url 2> /dev/null)
;;
# Add OEM specific commands
# Example:
# $OTHER_OEM)
# TMP_URL=$(${IPMI_GET_SYSINFO} otheroem_url 2> /dev/null)
# ;;
*) TMP_URL="" ;;
esac
valid_url && BMC_URL=${TMP_URL} || BMC_URL=""
}
valid_ip()
{
#Thanks to mkyong.com
octet="([01]?[[:digit:]][[:digit:]]?|2[0-4][[:digit:]]|25[0-5])"
printf -- "%s" "${TMP_IPv4}"| grep -Eq "^${octet}\\.${octet}\\.${octet}\\.${octet}$"
return $?
}
get_bmc_ip()
{
#Thanks to http://ingvar.blog.redpill-linpro.com
for CHANNEL in `seq 1 14`
do
[ $(${IPMI_TOOL} lan print ${CHANNEL} 2>/dev/null \
| grep -q "^Set") ] || break
done
# Get BMC_IPv4 and BMC_URL from BMC
TMP_IPv4=$(${IPMI_TOOL} lan print ${CHANNEL} 2>/dev/null \
| sed -n "s#^IP Address .*: ##p")
valid_ip && BMC_IPv4=${TMP_IPv4} || BMC_IPv4=""
}
get_bmc_info()
{
get_bmc_ip
if [ -z "${BMC_IPv4}" ] || [ "${BMC_IPv4}" = "0.0.0.0" ]; then
BMC_IPv4=""
RETVAL=5
else
# URL makes sense only if there is an IP
oem_get_bmc_url
fi
}
set_bmc_info()
{
if [ ! $(touch "${BMC_INFO}" && chmod 600 "${BMC_INFO}") ]; then
printf "BMC_IPv4=%s\n" "${BMC_IPv4}" > "${BMC_INFO}"
[ -n "${BMC_URL}" ] && \
printf "BMC_URL=%s\n" "${BMC_URL}" >> "${BMC_INFO}"
else
RETVAL=5
fi
}
unset_bmc_info()
{
[ -f ${BMC_INFO} ] && rm -f ${BMC_INFO} > /dev/null 2>&1
}
#############################################################################
start()
{
if bmc_exists; then
[ "${SET_OS_INFO}" = "yes" ] && \
get_os_info && set_os_info
if [ "${SET_BMC_INFO}" = "yes" ]; then
get_bmc_info
if [ ${RETVAL} -eq 0 ]; then
set_bmc_info
fi
fi
fi
}
#############################################################################
stop()
{
if bmc_exists; then
# reset OS info while system reboots
# aids with debugging OS boot-up issues
if [ "${RESET_OS_INFO}" = "yes" ]; then
set_os_info reset
fi
unset_bmc_info
fi
}
#############################################################################
restart()
{
stop
[ $RETVAL -eq 0 ] && start
}
#############################################################################
status()
{
[ -r ${BMC_INFO} ] && \
grep -q "BMC_IPv4" "${BMC_INFO}" >/dev/null 1>&2 && \
BMC_STATUS="ok" || BMC_STATUS="inactive"
${OUTPUT} "${SCRIPT_NAME}: ${BMC_STATUS}" 1>&2
[ ${GETTEXT} -eq 1 ] && echo
}
#############################################################################
usage()
{
${OUTPUT} "Usage: ${SCRIPT_NAME} {start|stop|restart|status}" 1>&2
[ ${GETTEXT} -eq 1 ] && echo
RETVAL=1
}
#############################################################################
# MAIN
#############################################################################
case "$1" in
start) start ;;
stop) stop ;;
restart) restart ;;
status) status ;;
*) usage ;;
esac
case "$RETVAL" in
0|1) ;;
2) ${OUTPUT} "${SCRIPT_NAME}: ipmitool(1) not found." 1>&2 ;;
3) ${OUTPUT} "${SCRIPT_NAME}: this version of ipmitool does not support getsysinfo." 1>&2 ;;
4) ${OUTPUT} "${SCRIPT_NAME}: failed to communicate with BMC." 1>&2 ;;
5) ${OUTPUT} "${SCRIPT_NAME}: failed to set OS information in BMC." 1>&2 ;;
6) ${OUTPUT} "${SCRIPT_NAME}: failed to get BMC information." 1>&2 ;;
*) ${OUTPUT} "${SCRIPT_NAME}: unexpected error." 1>&2 ;;
esac
if [ ${RETVAL} -gt 1 ]; then
${OUTPUT} " Return code: ${RETVAL}" 1>&2
[ ${GETTEXT} -eq 1 ] && echo
fi
exit ${RETVAL}
#############################################################################
# end of file
#############################################################################

View File

@ -1,14 +0,0 @@
[Unit]
Description=Exchange Information between BMC and OS
After=network.target
AssertFileIsExecutable=/usr/bin/ipmitool
AssertPathExistsGlob=/dev/ipmi*
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/libexec/exchange-bmc-os-info start
ExecStop=/usr/libexec/exchange-bmc-os-info stop
[Install]
WantedBy=multi-user.target

View File

@ -1,26 +0,0 @@
# exchange-bmc-os-info
#
# Config file to control Exchange of information between
# the OS and Service Processor/Baseboard Management Controller (BMC)
#
# See here for details
# https://fedoraproject.org/wiki/Features/AgentFreeManagement
### Set OS Info in BMC/Service Processor ###
# Name: SET_OS_INFO
# Description: Set OS Name, Version and Hostname in the Service Processor (BMC)
# Default: yes
SET_OS_INFO="yes"
### Reset OS Info in BMC/Service Processor ###
# Name: RESET_OS_INFO
# Description: Reset OS Name, Version and Hostname in the Service Processor (BMC).
# Useful when the OS Name/Hostname should be empty on reboot
# Default: no
RESET_OS_INFO="no"
### Set BMC/Service Processor Info in OS ###
# Name; SET_BMC_INFO
# Description: Set IP Address and URL of Service Processor/BMC in /run/bmc-info
# Default: yes
SET_BMC_INFO="yes"

View File

@ -1,88 +0,0 @@
#!/bin/sh
#############################################################################
#
# log_bmc.sh: Add SEL entries to indicate OS Boot/Install status.
#
# version: 0.1
#
# Authors: Charles Rose <charles_rose@dell.com>
# Jordan Hargrave <jordan_hargrave@dell.com>
#
# Description: Script to log OS boot/install status to the BMC. Primarily
# meant for use in automated installs and start up scripts.
# Will provide administrators with OS boot/install status in
# BMC and aid with debugging.
#
# Example usage:
# # ./log_bmc.sh inst_start
# # ipmitool sel list
# b | 05/07/2014 | 12:07:32 | OS Boot | Installation started
#
# See here for details:
# https://fedoraproject.org/wiki/Features/AgentFreeManagement
#
#############################################################################
IPMI_CMD="/usr/bin/ipmitool"
#############################################################################
# SEL Event types from ipmi_sel.h
OS_STOP="0x20"
OS_BOOT="0x1f"
# SEL Event data from ipmi_sel.h
GRACEFUL_SHUTDOWN="0x03" # OS Stop/Shutdown: Installation started
BOOT_COMPLETED="0x01" # OS Boot: Installation started
INSTALL_STARTED="0x07" # OS Boot: Installation started
INSTALL_COMPLETED="0x08" # OS Boot: Installation completed
INSTALL_ABORTED="0x09" # OS Boot: Installation aborted
INSTALL_FAILED="0x0a" # OS Boot: Installation failed
##########################################################################
# check for ipmi functionality.
check_ipmi()
{
# ensures presence of ipmitool and /dev/ipmi*
${IPMI_CMD} mc info > /dev/null 2>&1
[ $? -ne 0 ] && RETVAL=2
}
# Write out the events to SEL
ipmi_sel_add()
{
# Refer ipmitool(1) event for details on format.
printf "0x04 %s 0x00 0x6f %s 0x00 0x00" ${type} ${status} > \
${tmpfile} && \
${IPMI_CMD} sel add ${tmpfile} > /dev/null 2>&1
[ $? -ne 0 ] && RETVAL=3
}
### Main
# Most of the status is for this event type
tmpfile=$(/usr/bin/mktemp)
RETVAL=0
type=${OS_BOOT}
case ${1} in
os_shutdown) type=${OS_STOP}; status=${GRACEFUL_SHUTDOWN} ;;
os_boot) status=${BOOT_COMPLETED} ;;
inst_start) status=${INSTALL_STARTED} ;;
inst_complete) status=${INSTALL_COMPLETED} ;;
inst_abort) status=${INSTALL_ABORTED} ;;
inst_fail) status=${INSTALL_FAILED} ;;
*) RETVAL=1 ;;
esac
[ ${RETVAL} -eq 0 ] && check_ipmi
[ ${RETVAL} -eq 0 ] && ipmi_sel_add ${status}
case ${RETVAL} in
0) ;;
1) printf -- %s\\n "Usage: $0 <os_boot|os_shutdown|inst_start|inst_complete|inst_abort|inst_fail>" ;;
2) printf -- %s\\n "failed to communicate with BMC." ;;
3) printf -- %s\\n "error adding ipmi sel entry." ;;
esac
[ -f ${tmpfile} ] && rm -f ${tmpfile} > /dev/null 2>&1
exit ${RETVAL}
### End

View File

@ -1,10 +0,0 @@
#!/bin/sh
git describe --first-parent --tags 2>/dev/null | (
IFS=- read tag rev hash
if [ $? ] && [ -n "$rev" ]; then
echo .$rev.$hash
elif [ -d .git ]; then
echo .0.gsnapshot
fi
)

View File

@ -1,91 +0,0 @@
/*
* Copyright (c) 2012 Pigeon Point Systems. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution 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.
*
* Neither the name of Pigeon Point Systems nor the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* PIGEON POINT SYSTEMS ("PPS") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* PPS OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF PPS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#include <stdint.h>
#include <ipmitool/ipmi_intf.h>
/* Global HPM.2 defines */
#define HPM2_REVISION 0x01
#define HPM3_REVISION 0x01
#define HPM2_LAN_PARAMS_REV 0x01
#define HPM2_SOL_PARAMS_REV 0x01
#define HPM3_LAN_PARAMS_REV 0x01
/* IPMI defines parameter revision as
* MSN = present revision,
* LSN = oldest revision parameter is
* backward compatible with. */
#define LAN_PARAM_REV(x, y) (((x) << 4) | ((y) & 0xF))
/* HPM.2 capabilities */
#define HPM2_CAPS_SOL_EXTENSION 0x01
#define HPM2_CAPS_PACKET_TRACE 0x02
#define HPM2_CAPS_EXT_MANAGEMENT 0x04
#define HPM2_CAPS_VERSION_SENSOR 0x08
#define HPM2_CAPS_DYNAMIC_SESSIONS 0x10
#if HAVE_PRAGMA_PACK
# pragma pack(push, 1)
#endif
/* HPM.2 LAN attach capabilities */
struct hpm2_lan_attach_capabilities {
uint8_t hpm2_revision_id;
uint16_t lan_channel_mask;
uint8_t hpm2_caps;
uint8_t hpm2_lan_params_start;
uint8_t hpm2_lan_params_rev;
uint8_t hpm2_sol_params_start;
uint8_t hpm2_sol_params_rev;
} ATTRIBUTE_PACKING;
/* HPM.2 LAN channel capabilities */
struct hpm2_lan_channel_capabilities {
uint8_t capabilities;
uint8_t attach_type;
uint8_t bandwidth_class;
uint16_t max_inbound_pld_size;
uint16_t max_outbound_pld_size;
} ATTRIBUTE_PACKING;
#if HAVE_PRAGMA_PACK
# pragma pack(pop)
#endif
/* HPM.2 command assignments */
#define HPM2_GET_LAN_ATTACH_CAPABILITIES 0x3E
extern int hpm2_get_capabilities(struct ipmi_intf * intf,
struct hpm2_lan_attach_capabilities * caps);
extern int hpm2_get_lan_channel_capabilities(struct ipmi_intf * intf,
uint8_t hpm2_lan_params_start,
struct hpm2_lan_channel_capabilities * caps);
extern int hpm2_detect_max_payload_size(struct ipmi_intf * intf);

View File

@ -1,197 +0,0 @@
/*
* Copyright (c) 2016 Pentair Technical Products. All right reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution 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.
*
* Neither the name of Pentair Technical Products or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "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
* PENTAIR TECHNICAL SOLUTIONS 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.
*/
#ifndef IPMI_CFGP_H
#define IPMI_CFGP_H
#include <stdio.h>
/* Forward declarations. */
struct ipmi_cfgp;
struct ipmi_cfgp_ctx;
/*
* Action types.
*/
enum {
/* parse dumped parameter data */
CFGP_PARSE,
/* get parameter from BMC */
CFGP_GET,
/* set parameter to BMC */
CFGP_SET,
/* output parameter data in form that can be parsed back */
CFGP_SAVE,
/* print parameter in user-friendly format */
CFGP_PRINT
};
/*
* Action-specific information.
*/
struct ipmi_cfgp_action {
/* Action type. */
int type;
/* Set selector. */
int set;
/* Block selector. */
int block;
/* No error output needed. */
int quiet;
/* Number of command line arguments (only for parse action). */
int argc;
/* Command line arguments (only for parse action). */
const char **argv;
/* Output file (only for dump/print actions). */
FILE *file;
};
/*
* Access types.
*/
enum {
CFGP_RDWR,
CFGP_RDONLY,
CFGP_WRONLY,
CFGP_RESERVED
};
/*
* Configuration parameter descriptor.
*/
struct ipmi_cfgp {
/* Parameter name. */
const char *name;
/* Parameter format description. */
const char *format;
/* Various parameter traits. */
unsigned int size; /* block size */
unsigned int access:2; /* read-write/read-only/write-only */
unsigned int is_set:1; /* takes non-zero set selectors */
unsigned int first_set:1; /* 1 = 1-based set selector */
unsigned int has_blocks:1; /* takes non-zero block selectors */
unsigned int first_block:1; /* 1 = 1-based block selector */
/* Parameter-specific data. */
int specific;
};
/* Parameter callback. */
typedef int (*ipmi_cfgp_handler_t)(void *priv,
const struct ipmi_cfgp *p, const struct ipmi_cfgp_action *action,
unsigned char *data);
/*
* Parameter selector.
*/
struct ipmi_cfgp_sel {
int param;
int set;
int block;
};
/*
* Configuration parameter data.
*/
struct ipmi_cfgp_data {
struct ipmi_cfgp_data *next;
struct ipmi_cfgp_sel sel;
unsigned char data[];
};
/*
* Configuration parameter operation context.
*/
struct ipmi_cfgp_ctx {
/* Set of parameters. */
const struct ipmi_cfgp *set;
/* Descriptor count. */
int count;
/* Parameter action handler. */
ipmi_cfgp_handler_t handler;
/* ipmitool cmd name */
const char *cmdname;
/* List of parameter values. */
struct ipmi_cfgp_data *v;
/* Private data. */
void *priv;
};
/* Initialize configuration context. */
extern int ipmi_cfgp_init(struct ipmi_cfgp_ctx *ctx,
const struct ipmi_cfgp *set, unsigned int count,
const char *cmdname,
ipmi_cfgp_handler_t handler, void *priv);
/* Uninitialize context, free allocated memory. */
extern int ipmi_cfgp_uninit(struct ipmi_cfgp_ctx *ctx);
/* Print parameter usage. */
void ipmi_cfgp_usage(const struct ipmi_cfgp *set, int count, int write);
/* Parse parameter selector from command line. */
extern int ipmi_cfgp_parse_sel(struct ipmi_cfgp_ctx *ctx,
int argc, const char **argv, struct ipmi_cfgp_sel *sel);
/* Parse parameter data from command line. */
extern int ipmi_cfgp_parse_data(struct ipmi_cfgp_ctx *ctx,
const struct ipmi_cfgp_sel *sel, int argc, const char **argv);
/* Get parameter data from BMC. */
extern int ipmi_cfgp_get(struct ipmi_cfgp_ctx *ctx,
const struct ipmi_cfgp_sel *sel);
/* Set parameter data to BMC. */
extern int ipmi_cfgp_set(struct ipmi_cfgp_ctx *ctx,
const struct ipmi_cfgp_sel *sel);
/* Write parameter data to file. */
extern int ipmi_cfgp_save(struct ipmi_cfgp_ctx *ctx,
const struct ipmi_cfgp_sel *sel, FILE *file);
/* Print parameter data in user-friendly format. */
extern int ipmi_cfgp_print(struct ipmi_cfgp_ctx *ctx,
const struct ipmi_cfgp_sel *sel, FILE *file);
#endif /* IPMI_CFGP_H */

View File

@ -1,243 +0,0 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution 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.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef IPMI_KFWUM_H
# define IPMI_KFWUM_H
#include <inttypes.h>
#include <ipmitool/ipmi.h>
/* KFWUM Version */
# define VER_MAJOR 1
# define VER_MINOR 3
/* Minimum size (IPMB/IOL/old protocol) */
# define KFWUM_SMALL_BUFFER 32
/* Maximum size on KCS interface */
# define KFWUM_BIG_BUFFER 32
# define MAX_BUFFER_SIZE 1024*16
/* 3 address + 1 size + 1 checksum + 1 command */
# define KFWUM_OLD_CMD_OVERHEAD 6
/* 1 sequence + 1 size + 1 checksum + 1 command */
# define KFWUM_NEW_CMD_OVERHEAD 4
# define KFWUM_PAGE_SIZE 256
# define FWUM_SAVE_FIRMWARE_NO_RESPONSE_LIMIT 6
# define FWUM_MAX_UPLOAD_RETRY 6
# define TRACE_LOG_CHUNK_COUNT 7
# define TRACE_LOG_CHUNK_SIZE 7
# define TRACE_LOG_ATT_COUNT 3
# define IN_FIRMWARE_INFO_OFFSET_LOCATION 0x5a0
# define IN_FIRMWARE_INFO_SIZE 20
# define IN_FIRMWARE_INFO_OFFSET_FILE_SIZE 0
# define IN_FIRMWARE_INFO_OFFSET_CHECKSUM 4
# define IN_FIRMWARE_INFO_OFFSET_BOARD_ID 6
# define IN_FIRMWARE_INFO_OFFSET_DEVICE_ID 8
# define IN_FIRMWARE_INFO_OFFSET_TABLE_VERSION 9
# define IN_FIRMWARE_INFO_OFFSET_IMPLEMENT_REV 10
# define IN_FIRMWARE_INFO_OFFSET_VER_MAJOROR 11
# define IN_FIRMWARE_INFO_OFFSET_VER_MINORSUB 12
# define IN_FIRMWARE_INFO_OFFSET_SDR_REV 13
# define IN_FIRMWARE_INFO_OFFSET_IANA0 14
# define IN_FIRMWARE_INFO_OFFSET_IANA1 15
# define IN_FIRMWARE_INFO_OFFSET_IANA2 16
# define KWUM_GET_BYTE_AT_OFFSET(pBuffer,os) pBuffer[os]
int ipmi_fwum_main(struct ipmi_intf *, int, char **);
typedef enum eKFWUM_BoardList
{
KFWUM_BOARD_KONTRON_UNKNOWN = 0,
KFWUM_BOARD_KONTRON_5002 = 5002,
} tKFWUM_BoardList;
typedef struct sKFWUM_BoardInfo
{
tKFWUM_BoardList boardId;
IPMI_OEM iana;
} tKFWUM_BoardInfo;
typedef enum eKFWUM_DownloadType
{
KFWUM_DOWNLOAD_TYPE_ADDRESS = 0,
KFWUM_DOWNLOAD_TYPE_SEQUENCE,
} tKFWUM_DownloadType;
typedef enum eKFWUM_DownloadBuffferType
{
KFWUM_SMALL_BUFFER_TYPE = 0,
KFUMW_BIG_BUFFER_TYPE
} tKFWUM_DownloadBuffferType;
typedef struct sKFWUM_InFirmwareInfo
{
unsigned long fileSize;
unsigned short checksum;
unsigned short sumToRemoveFromChecksum;
/* Since the checksum is added in the bin
* after the checksum is calculated, we
* need to remove the each byte value. This
* byte will contain the addition of both bytes
*/
tKFWUM_BoardList boardId;
unsigned char deviceId;
unsigned char tableVers;
unsigned char implRev;
unsigned char versMajor;
unsigned char versMinor;
unsigned char versSubMinor;
unsigned char sdrRev;
IPMI_OEM iana;
} tKFWUM_InFirmwareInfo;
typedef struct sKFWUM_SaveFirmwareInfo
{
tKFWUM_DownloadType downloadType;
unsigned char bufferSize;
unsigned char overheadSize;
} tKFWUM_SaveFirmwareInfo;
/* COMMANDS */
# ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
# endif
struct KfwumGetInfoResp {
unsigned char protocolRevision;
unsigned char controllerDeviceId;
struct {
unsigned char mode:1;
unsigned char seqAdd:1;
unsigned char res : 6;
} byte;
unsigned char firmRev1;
unsigned char firmRev2;
unsigned char numBank;
} ATTRIBUTE_PACKING;
# ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
# endif
# ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
# endif
struct KfwumGetStatusResp {
unsigned char bankState;
unsigned char firmLengthLSB;
unsigned char firmLengthMid;
unsigned char firmLengthMSB;
unsigned char firmRev1;
unsigned char firmRev2;
unsigned char firmRev3;
} ATTRIBUTE_PACKING;
# ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
# endif
# ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
# endif
struct KfwumManualRollbackReq {
unsigned char type;
} ATTRIBUTE_PACKING;
# ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
# endif
# ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
# endif
struct KfwumStartFirmwareDownloadReq {
unsigned char lengthLSB;
unsigned char lengthMid;
unsigned char lengthMSB;
unsigned char paddingLSB;
unsigned char paddingMSB;
unsigned char useSequence;
} ATTRIBUTE_PACKING;
# ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
# endif
# ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
# endif
struct KfwumStartFirmwareDownloadResp {
unsigned char bank;
} ATTRIBUTE_PACKING;
# ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
# endif
# ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
# endif
struct KfwumSaveFirmwareAddressReq
{
unsigned char addressLSB;
unsigned char addressMid;
unsigned char addressMSB;
unsigned char numBytes;
unsigned char txBuf[KFWUM_SMALL_BUFFER-KFWUM_OLD_CMD_OVERHEAD];
} ATTRIBUTE_PACKING;
# ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
# endif
# ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
# endif
struct KfwumSaveFirmwareSequenceReq
{
unsigned char sequenceNumber;
unsigned char txBuf[KFWUM_BIG_BUFFER];
} ATTRIBUTE_PACKING;
# ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
# endif
# ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
# endif
struct KfwumFinishFirmwareDownloadReq {
unsigned char versionMaj;
unsigned char versionMinSub;
unsigned char versionSdr;
unsigned char reserved;
} ATTRIBUTE_PACKING;
# ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
# endif
#endif /* IPMI_KFWUM_H */

View File

@ -1,809 +0,0 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution 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.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef IPMI_HPMFWUPG_H
#define IPMI_HPMFWUPG_H
#include <inttypes.h>
#include <ipmitool/ipmi.h>
int ipmi_hpmfwupg_main(struct ipmi_intf *, int, char **);
/* Agent version */
#define HPMFWUPG_VERSION_MAJOR 1
#define HPMFWUPG_VERSION_MINOR 0
#define HPMFWUPG_VERSION_SUBMINOR 9
/* HPM.1 FIRMWARE UPGRADE COMMANDS (part of PICMG) */
#define HPMFWUPG_GET_TARGET_UPG_CAPABILITIES 0x2E
#define HPMFWUPG_GET_COMPONENT_PROPERTIES 0x2F
#define HPMFWUPG_ABORT_UPGRADE 0x30
#define HPMFWUPG_INITIATE_UPGRADE_ACTION 0x31
#define HPMFWUPG_UPLOAD_FIRMWARE_BLOCK 0x32
#define HPMFWUPG_FINISH_FIRMWARE_UPLOAD 0x33
#define HPMFWUPG_GET_UPGRADE_STATUS 0x34
#define HPMFWUPG_ACTIVATE_FIRMWARE 0x35
#define HPMFWUPG_QUERY_SELFTEST_RESULT 0x36
#define HPMFWUPG_QUERY_ROLLBACK_STATUS 0x37
#define HPMFWUPG_MANUAL_FIRMWARE_ROLLBACK 0x38
/* HPM.1 SPECIFIC COMPLETION CODES */
#define HPMFWUPG_ROLLBACK_COMPLETED 0x00
#define HPMFWUPG_COMMAND_IN_PROGRESS 0x80
#define HPMFWUPG_NOT_SUPPORTED 0x81
#define HPMFWUPG_SIZE_MISMATCH 0x81
#define HPMFWUPG_ROLLBACK_FAILURE 0x81
#define HPMFWUPG_INV_COMP_MASK 0x81
#define HPMFWUPG__ABORT_FAILURE 0x81
#define HPMFWUPG_INV_COMP_ID 0x82
#define HPMFWUPG_INT_CHECKSUM_ERROR 0x82
#define HPMFWUPG_INV_UPLOAD_MODE 0x82
#define HPMFWUPG_ROLLBACK_OVERRIDE 0x82
#define HPMFWUPG_INV_COMP_PROP 0x83
#define HPMFWUPG_FW_MISMATCH 0x83
#define HPMFWUPG_ROLLBACK_DENIED 0x83
/*
* This error code is used as a temporary PATCH to
* the latest Open ipmi driver. This PATCH
* will be removed once a new Open IPMI driver is released.
* (Buggy version = 39)
*/
#define ENABLE_OPENIPMI_V39_PATCH
#ifdef ENABLE_OPENIPMI_V39_PATCH
# define RETRY_COUNT_MAX 3
static int errorCount;
# define HPMFWUPG_IS_RETRYABLE(error) \
((((error==0x83)||(error==0x82)||(error==0x80)) && (errorCount++<RETRY_COUNT_MAX))?TRUE:FALSE)
#else
# define HPMFWUPG_IS_RETRYABLE(error) FALSE
#endif
/* HPM FIRMWARE UPGRADE GENERAL DEFINITIONS */
#define HPMFWUPG_PICMG_IDENTIFIER 0
#define HPMFWUPG_VERSION_SIZE 6
#define HPMFWUPG_DESC_STRING_LENGTH 12
#define HPMFWUPG_DEFAULT_INACCESS_TIMEOUT 60 /* sec */
#define HPMFWUPG_DEFAULT_UPGRADE_TIMEOUT 60 /* sec */
#define HPMFWUPG_MD5_SIGNATURE_LENGTH 16
/* Component IDs */
typedef enum eHpmfwupgComponentId {
HPMFWUPG_COMPONENT_ID_0 = 0,
HPMFWUPG_COMPONENT_ID_1,
HPMFWUPG_COMPONENT_ID_2,
HPMFWUPG_COMPONENT_ID_3,
HPMFWUPG_COMPONENT_ID_4,
HPMFWUPG_COMPONENT_ID_5,
HPMFWUPG_COMPONENT_ID_6,
HPMFWUPG_COMPONENT_ID_7,
HPMFWUPG_COMPONENT_ID_MAX
} tHpmfwupgComponentId;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgComponentBitMask {
union {
unsigned char byte;
struct {
#ifdef WORDS_BIGENDIAN
unsigned char component7 : 1;
unsigned char component6 : 1;
unsigned char component5 : 1;
unsigned char component4 : 1;
unsigned char component3 : 1;
unsigned char component2 : 1;
unsigned char component1 : 1;
unsigned char component0 : 1;
#else
unsigned char component0 : 1;
unsigned char component1 : 1;
unsigned char component2 : 1;
unsigned char component3 : 1;
unsigned char component4 : 1;
unsigned char component5 : 1;
unsigned char component6 : 1;
unsigned char component7 : 1;
#endif
} ATTRIBUTE_PACKING bitField;
} ATTRIBUTE_PACKING ComponentBits;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
static const int HPMFWUPG_SUCCESS = 0;
static const int HPMFWUPG_ERROR = -1;
/* Upload firmware specific error codes */
static const int HPMFWUPG_UPLOAD_BLOCK_LENGTH = 1;
static const int HPMFWUPG_UPLOAD_RETRY = 2;
/* TARGET UPGRADE CAPABILITIES DEFINITIONS */
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetTargetUpgCapabilitiesReq {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetTargetUpgCapabilitiesResp {
unsigned char picmgId;
unsigned char hpmVersion;
union {
unsigned char byte;
struct {
#if WORDS_BIGENDIAN
unsigned char fwUpgUndesirable : 1;
unsigned char autRollbackOverride : 1;
unsigned char ipmcDegradedDurinUpg: 1;
unsigned char deferActivation : 1;
unsigned char servAffectDuringUpg : 1;
unsigned char manualRollback : 1;
unsigned char autRollback : 1;
unsigned char ipmcSelftestCap : 1;
#else
unsigned char ipmcSelftestCap : 1;
unsigned char autRollback : 1;
unsigned char manualRollback : 1;
unsigned char servAffectDuringUpg : 1;
unsigned char deferActivation : 1;
unsigned char ipmcDegradedDurinUpg: 1;
unsigned char autRollbackOverride : 1;
unsigned char fwUpgUndesirable : 1;
#endif
} ATTRIBUTE_PACKING bitField;
} ATTRIBUTE_PACKING GlobalCapabilities;
unsigned char upgradeTimeout;
unsigned char selftestTimeout;
unsigned char rollbackTimeout;
unsigned char inaccessTimeout;
struct HpmfwupgComponentBitMask componentsPresent;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetTargetUpgCapabilitiesCtx {
struct HpmfwupgGetTargetUpgCapabilitiesReq req;
struct HpmfwupgGetTargetUpgCapabilitiesResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* COMPONENT PROPERTIES DEFINITIONS */
typedef enum eHpmfwupgCompPropertiesSelect {
HPMFWUPG_COMP_GEN_PROPERTIES = 0,
HPMFWUPG_COMP_CURRENT_VERSION,
HPMFWUPG_COMP_DESCRIPTION_STRING,
HPMFWUPG_COMP_ROLLBACK_FIRMWARE_VERSION,
HPMFWUPG_COMP_DEFERRED_FIRMWARE_VERSION,
HPMFWUPG_COMP_RESERVED,
HPMFWUPG_COMP_OEM_PROPERTIES = 192
} tHpmfwupgCompPropertiesSelect;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetComponentPropertiesReq {
unsigned char picmgId;
unsigned char componentId;
unsigned char selector;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetGeneralPropResp {
unsigned char picmgId;
union {
unsigned char byte;
struct {
#if WORDS_BIGENDIAN
unsigned char reserved : 2;
unsigned char payloadColdReset : 1;
unsigned char deferredActivation : 1;
unsigned char comparisonSupport : 1;
unsigned char preparationSupport : 1;
unsigned char rollbackBackup : 2;
#else
unsigned char rollbackBackup : 2;
unsigned char preparationSupport : 1;
unsigned char comparisonSupport : 1;
unsigned char deferredActivation : 1;
unsigned char payloadColdReset : 1;
unsigned char reserved : 2;
#endif
} ATTRIBUTE_PACKING bitfield;
} ATTRIBUTE_PACKING GeneralCompProperties;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetCurrentVersionResp {
unsigned char picmgId;
unsigned char currentVersion[HPMFWUPG_VERSION_SIZE];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetDescStringResp {
unsigned char picmgId;
char descString[HPMFWUPG_DESC_STRING_LENGTH];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetRollbackFwVersionResp {
unsigned char picmgId;
unsigned char rollbackFwVersion[HPMFWUPG_VERSION_SIZE];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetDeferredFwVersionResp {
unsigned char picmgId;
unsigned char deferredFwVersion[HPMFWUPG_VERSION_SIZE];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* GetComponentProperties - OEM properties (192) */
#define HPMFWUPG_OEM_LENGTH 4
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetOemProperties {
unsigned char picmgId;
unsigned char oemRspData[HPMFWUPG_OEM_LENGTH];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetComponentPropertiesResp {
union {
struct HpmfwupgGetGeneralPropResp generalPropResp;
struct HpmfwupgGetCurrentVersionResp currentVersionResp;
struct HpmfwupgGetDescStringResp descStringResp;
struct HpmfwupgGetRollbackFwVersionResp rollbackFwVersionResp;
struct HpmfwupgGetDeferredFwVersionResp deferredFwVersionResp;
struct HpmfwupgGetOemProperties oemProperties;
} ATTRIBUTE_PACKING Response;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetComponentPropertiesCtx {
struct HpmfwupgGetComponentPropertiesReq req;
struct HpmfwupgGetComponentPropertiesResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* ABORT UPGRADE DEFINITIONS */
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgAbortUpgradeReq {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgAbortUpgradeResp {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgAbortUpgradeCtx {
struct HpmfwupgAbortUpgradeReq req;
struct HpmfwupgAbortUpgradeResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* UPGRADE ACTIONS DEFINITIONS */
typedef enum eHpmfwupgUpgradeAction {
HPMFWUPG_UPGRADE_ACTION_BACKUP = 0,
HPMFWUPG_UPGRADE_ACTION_PREPARE,
HPMFWUPG_UPGRADE_ACTION_UPGRADE,
HPMFWUPG_UPGRADE_ACTION_COMPARE,
HPMFWUPG_UPGRADE_ACTION_INVALID = 0xff
} tHpmfwupgUpgradeAction;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgInitiateUpgradeActionReq {
unsigned char picmgId;
struct HpmfwupgComponentBitMask componentsMask;
unsigned char upgradeAction;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgInitiateUpgradeActionResp {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgInitiateUpgradeActionCtx {
struct HpmfwupgInitiateUpgradeActionReq req;
struct HpmfwupgInitiateUpgradeActionResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* UPLOAD FIRMWARE BLOCK DEFINITIONS */
#define HPMFWUPG_SEND_DATA_COUNT_KCS 30
#define HPMFWUPG_SEND_DATA_COUNT_LAN 25
#define HPMFWUPG_SEND_DATA_COUNT_IPMB 26
#define HPMFWUPG_SEND_DATA_COUNT_IPMBL 26
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgUploadFirmwareBlockReq {
unsigned char picmgId;
unsigned char blockNumber;
unsigned char data[];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgUploadFirmwareBlockResp {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgUploadFirmwareBlockCtx {
struct HpmfwupgUploadFirmwareBlockReq * req;
struct HpmfwupgUploadFirmwareBlockResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* FINISH FIRMWARE UPLOAD DEFINITIONS */
#define HPMFWUPG_IMAGE_SIZE_BYTE_COUNT 4
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgFinishFirmwareUploadReq {
unsigned char picmgId;
unsigned char componentId;
unsigned char imageLength[HPMFWUPG_IMAGE_SIZE_BYTE_COUNT];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgFinishFirmwareUploadResp {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgFinishFirmwareUploadCtx {
struct HpmfwupgFinishFirmwareUploadReq req;
struct HpmfwupgFinishFirmwareUploadResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* ACTIVATE FW DEFINITIONS */
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgActivateFirmwareReq {
unsigned char picmgId;
unsigned char rollback_override;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgActivateFirmwareResp {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgActivateFirmwareCtx {
struct HpmfwupgActivateFirmwareReq req;
struct HpmfwupgActivateFirmwareResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* GET UPGRADE STATUS DEFINITIONS */
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetUpgradeStatusReq {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetUpgradeStatusResp {
unsigned char picmgId;
unsigned char cmdInProcess;
unsigned char lastCmdCompCode;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetUpgradeStatusCtx {
struct HpmfwupgGetUpgradeStatusReq req;
struct HpmfwupgGetUpgradeStatusResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* MANUAL FW ROLLBACK DEFINITIONS */
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgManualFirmwareRollbackReq {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgManualFirmwareRollbackResp {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
struct HpmfwupgManualFirmwareRollbackCtx {
struct HpmfwupgManualFirmwareRollbackReq req;
struct HpmfwupgManualFirmwareRollbackResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* QUERY ROLLBACK STATUS DEFINITIONS */
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgQueryRollbackStatusReq {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgQueryRollbackStatusResp {
unsigned char picmgId;
struct HpmfwupgComponentBitMask rollbackComp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgQueryRollbackStatusCtx {
struct HpmfwupgQueryRollbackStatusReq req;
struct HpmfwupgQueryRollbackStatusResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* QUERY SELF TEST RESULT DEFINITIONS */
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgQuerySelftestResultReq {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgQuerySelftestResultResp {
unsigned char picmgId;
unsigned char result1;
unsigned char result2;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgQuerySelftestResultCtx {
struct HpmfwupgQuerySelftestResultReq req;
struct HpmfwupgQuerySelftestResultResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* HPM.1 IMAGE DEFINITIONS */
#define HPMFWUPG_HEADER_SIGNATURE_LENGTH 8
#define HPMFWUPG_MANUFATURER_ID_LENGTH 3
#define HPMFWUPG_PRODUCT_ID_LENGTH 2
#define HPMFWUPG_TIME_LENGTH 4
#define HPMFWUPG_TIMEOUT_LENGTH 1
#define HPMFWUPG_COMP_REVISION_LENGTH 2
#define HPMFWUPG_FIRM_REVISION_LENGTH 6
#define HPMFWUPG_IMAGE_HEADER_VERSION 0
#define HPMFWUPG_IMAGE_SIGNATURE "PICMGFWU"
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct HpmfwupgImageHeader {
char signature[HPMFWUPG_HEADER_SIGNATURE_LENGTH];
unsigned char formatVersion;
unsigned char deviceId;
unsigned char manId[HPMFWUPG_MANUFATURER_ID_LENGTH];
unsigned char prodId[HPMFWUPG_PRODUCT_ID_LENGTH];
unsigned char time[HPMFWUPG_TIME_LENGTH];
union {
struct {
#if WORDS_BIGENDIAN
unsigned char imageSelfTest : 1;
unsigned char autRollback : 1;
unsigned char manRollback : 1;
unsigned char servAffected : 1;
unsigned char reserved : 4;
#else
unsigned char reserved : 4;
unsigned char servAffected : 1;
unsigned char manRollback : 1;
unsigned char autRollback : 1;
unsigned char imageSelfTest : 1;
#endif
} ATTRIBUTE_PACKING bitField;
unsigned char byte;
}ATTRIBUTE_PACKING imageCapabilities;
struct HpmfwupgComponentBitMask components;
unsigned char selfTestTimeout;
unsigned char rollbackTimeout;
unsigned char inaccessTimeout;
unsigned char compRevision[HPMFWUPG_COMP_REVISION_LENGTH];
unsigned char firmRevision[HPMFWUPG_FIRM_REVISION_LENGTH];
unsigned short oemDataLength;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#define HPMFWUPG_DESCRIPTION_LENGTH 21
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgActionRecord {
unsigned char actionType;
struct HpmfwupgComponentBitMask components;
unsigned char checksum;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#define HPMFWUPG_FIRMWARE_SIZE_LENGTH 4
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgFirmwareImage {
unsigned char version[HPMFWUPG_FIRM_REVISION_LENGTH];
char desc[HPMFWUPG_DESCRIPTION_LENGTH];
unsigned char length[HPMFWUPG_FIRMWARE_SIZE_LENGTH];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgUpgradeCtx {
struct HpmfwupgComponentBitMask compUpdateMask;
unsigned int imageSize;
unsigned char* pImageData;
unsigned char componentId;
struct HpmfwupgGetTargetUpgCapabilitiesResp targetCap;
struct HpmfwupgGetGeneralPropResp genCompProp[HPMFWUPG_COMPONENT_ID_MAX];
struct ipm_devid_rsp devId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
typedef enum eHpmfwupgActionType {
HPMFWUPG_ACTION_BACKUP_COMPONENTS = 0,
HPMFWUPG_ACTION_PREPARE_COMPONENTS,
HPMFWUPG_ACTION_UPLOAD_FIRMWARE,
HPMFWUPG_ACTION_RESERVED = 0xFF
} tHpmfwupgActionType;
/* FUNCTIONS PROTOTYPES */
#define HPMFWUPG_MAJORMINOR_VERSION_SIZE 2
/* Options added for user to check the version and to view both the FILE and
* TARGET Version
*/
#define VIEW_MODE 0x01
#define DEBUG_MODE 0x02
#define FORCE_MODE 0x04
#define COMPARE_MODE 0x08
typedef struct _VERSIONINFO {
unsigned char componentId;
unsigned char targetMajor;
unsigned char targetMinor;
unsigned char targetAux[4];
unsigned char rollbackMajor;
unsigned char rollbackMinor;
unsigned char rollbackAux[4];
unsigned char deferredMajor;
unsigned char deferredMinor;
unsigned char deferredAux[4];
unsigned char imageMajor;
unsigned char imageMinor;
unsigned char imageAux[4];
unsigned char coldResetRequired;
unsigned char rollbackSupported;
unsigned char deferredActivationSupported;
char descString[HPMFWUPG_DESC_STRING_LENGTH + 1];
}VERSIONINFO, *PVERSIONINFO;
VERSIONINFO gVersionInfo[HPMFWUPG_COMPONENT_ID_MAX];
#define TARGET_VER (0x01)
#define ROLLBACK_VER (0x02)
#define IMAGE_VER (0x04)
#endif /* IPMI_KFWUM_H */

View File

@ -1,54 +0,0 @@
/*
* Copyright (c) 2016 Pentair Technical Products. All right reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution 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.
*
* Neither the name of Pentair Technical Products or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "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
* PENTAIR TECHNICAL SOLUTIONS 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.
*/
#ifndef IPMI_LANP6_H
#define IPMI_LANP6_H
#include <ipmitool/ipmi_intf.h>
/*
* LAN configuration parameter.
*/
struct ipmi_lanp {
int selector;
const char *name;
int size;
};
/*
* Private data for LAN configuration.
*/
struct ipmi_lanp_priv {
struct ipmi_intf *intf;
int channel;
};
#endif /* IPMI_LANP6_H */

View File

@ -1,329 +0,0 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution 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.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef IPMI_MC_H
#define IPMI_MC_H
#include <stdbool.h>
#include <ipmitool/ipmi.h>
#include <ipmitool/helper.h>
#include <ipmitool/ipmi_strings.h>
#define OEM_MFG_STRING(oem) val2str(IPM_DEV_MANUFACTURER_ID(oem),\
ipmi_oem_info)
#define OEM_PROD_STRING(oem, p) oemval2str(IPM_DEV_MANUFACTURER_ID(oem),\
ipmi16toh(p),\
ipmi_oem_product_info)
#define BMC_GET_DEVICE_ID 0x01
#define BMC_COLD_RESET 0x02
#define BMC_WARM_RESET 0x03
#define BMC_GET_SELF_TEST 0x04
#define BMC_RESET_WATCHDOG_TIMER 0x22
#define BMC_SET_WATCHDOG_TIMER 0x24
#define BMC_GET_WATCHDOG_TIMER 0x25
#define BMC_SET_GLOBAL_ENABLES 0x2e
#define BMC_GET_GLOBAL_ENABLES 0x2f
#define BMC_GET_GUID 0x37
int ipmi_mc_main(struct ipmi_intf *, int, char **);
/*
* Response data from IPM Get Device ID Command (IPMI rev 1.5, section 17.1)
* The following really apply to any IPM device, not just BMCs...
*/
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct ipm_devid_rsp {
uint8_t device_id;
uint8_t device_revision;
uint8_t fw_rev1;
uint8_t fw_rev2;
uint8_t ipmi_version;
uint8_t adtl_device_support;
uint8_t manufacturer_id[3];
uint8_t product_id[2];
uint8_t aux_fw_rev[4];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#define IPM_DEV_DEVICE_ID_SDR_MASK (0x80) /* 1 = provides SDRs */
#define IPM_DEV_DEVICE_ID_REV_MASK (0x0F) /* BCD-enoded */
#define IPM_DEV_FWREV1_AVAIL_MASK (0x80) /* 0 = normal operation */
#define IPM_DEV_FWREV1_MAJOR_MASK (0x3f) /* Major rev, BCD-encoded */
#define IPM_DEV_IPMI_VER_MAJOR_MASK (0x0F) /* Major rev, BCD-encoded */
#define IPM_DEV_IPMI_VER_MINOR_MASK (0xF0) /* Minor rev, BCD-encoded */
#define IPM_DEV_IPMI_VER_MINOR_SHIFT (4) /* Minor rev shift */
#define IPM_DEV_IPMI_VERSION_MAJOR(x) \
(x & IPM_DEV_IPMI_VER_MAJOR_MASK)
#define IPM_DEV_IPMI_VERSION_MINOR(x) \
((x & IPM_DEV_IPMI_VER_MINOR_MASK) >> IPM_DEV_IPMI_VER_MINOR_SHIFT)
#define IPM_DEV_MANUFACTURER_ID_RESERVED 0x0FFFFF
#define IPM_DEV_MANUFACTURER_ID(x) ipmi24toh(x)
#define IPM_DEV_ADTL_SUPPORT_BITS (8)
/* There are lots of BMC implementations that don't follow the IPMI
* specification for GUID encoding. Some send data encoded as in
* RFC4122, some follow SMBIOS specification. We support all users
* of those buggy implementations here.
*
* Most implementations like AMI MegaRAC do it the SMBIOS way.
* This is the legacy behavior we don't want to break yet.
* That's why the last real mode is GUID_SMBIOS. If automatic
* detection finds more than one possible candidate, and
* GUID_SMBIOS is one of them, then it will take precedence.
*
* For the same reason GUID_IPMI is right before GUID_SMBIOS.
* If both RFC4122 and IPMI encodings have a valid version
* field, then IPMI takes precedence.
*/
typedef enum {
/* Real modes, in reverse precedence order */
GUID_RFC4122,
GUID_IPMI,
GUID_SMBIOS,
GUID_REAL_MODES, /* Real mode count*/
/* Pseudo modes start here */
GUID_AUTO = GUID_REAL_MODES, /* Automatically detect mode */
GUID_DUMP, /* Just dump the data */
GUID_TOTAL_MODES
} ipmi_guid_mode_t;
#define GUID_NODE_SZ 6
#define GUID_VER_MASK 0x0F
#define GUID_VER_SHIFT 12
#define GUID_VERSION(t_hi) (((t_hi) >> GUID_VER_SHIFT) & GUID_VER_MASK)
#define GUID_TIME_HI(t_hi) ((t_hi) & ~(GUID_VER_MASK << GUID_VER_SHIFT))
typedef enum {
GUID_VERSION_UNKNOWN = 0, /* Not valid according to any specification */
/* The following are according to IPMI/SMBIOS/RFC4122 */
GUID_VERSION_TIME, /* Time-based, recommended for IPMI */
GUID_VERSION_DCE, /* DCE Security with POSIX UIDs, not for IPMI */
GUID_VERSION_MD5, /* Name-based, using MD5 */
GUID_VERSION_RND, /* Randomly generated */
GUID_VERSION_SHA1, /* Name-based, using SHA-1 */
GUID_VERSION_MAX = GUID_VERSION_SHA1, /* The maximum supported version */
GUID_VERSION_COUNT /* The number of supported versions */
} guid_version_t;
static inline bool is_guid_version_valid(guid_version_t ver)
{
return (ver > GUID_VERSION_UNKNOWN) && (ver <= GUID_VERSION_MAX);
}
/* The structure follows IPMI v2.0, rev 1.1
* See section 20.8 */
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
typedef struct {
uint8_t node[GUID_NODE_SZ]; /* Byte 0 is LSB */
union {
struct {
uint8_t clock_seq_low; /* clock sequence low field */
uint8_t clock_seq_hi_and_rsvd;/* clock sequence high field */
};
uint16_t clock_seq_and_rsvd;
};
uint16_t time_hi_and_version; /* timestamp high field and version number */
uint16_t time_mid; /* timestamp middle field */
uint32_t time_low; /* timestamp low field */
} ATTRIBUTE_PACKING ipmi_guid_t;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
/* The structure follows RFC4122 (section 4.1.2)
* and SMBIOS v3.0.0 (section 7.2.1) */
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
typedef struct {
uint32_t time_low; /* timestamp low field */
uint16_t time_mid; /* timestamp middle field */
uint16_t time_hi_and_version; /* timestamp high field and version number */
union {
struct {
uint8_t clock_seq_hi_and_rsvd;/* clock sequence high field */
uint8_t clock_seq_low; /* clock sequence low field */
};
uint16_t clock_seq_and_rsvd;
};
uint8_t node[GUID_NODE_SZ]; /* Byte 0 is MSB */
} ATTRIBUTE_PACKING rfc_guid_t;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
/* Parsed GUID structure */
typedef struct {
uint8_t node[GUID_NODE_SZ]; /* MSB first */
/* These are architecture-specific for easy output with printf() */
uint16_t clock_seq_and_rsvd;
uint64_t time_hi_and_version;
uint64_t time_mid;
uint64_t time_low;
/* These are the parsed values */
time_t time;
ipmi_guid_mode_t mode;
guid_version_t ver; /* Version from time_hi_and_version, if valid */
} parsed_guid_t;
parsed_guid_t ipmi_parse_guid(void *guid, ipmi_guid_mode_t guid_mode);
int _ipmi_mc_get_guid(struct ipmi_intf *intf, ipmi_guid_t *guid);
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct ipm_selftest_rsp {
unsigned char code;
unsigned char test;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#define IPM_SFT_CODE_OK 0x55
#define IPM_SFT_CODE_NOT_IMPLEMENTED 0x56
#define IPM_SFT_CODE_DEV_CORRUPTED 0x57
#define IPM_SFT_CODE_FATAL_ERROR 0x58
#define IPM_SFT_CODE_RESERVED 0xff
#define IPM_SELFTEST_SEL_ERROR 0x80
#define IPM_SELFTEST_SDR_ERROR 0x40
#define IPM_SELFTEST_FRU_ERROR 0x20
#define IPM_SELFTEST_IPMB_ERROR 0x10
#define IPM_SELFTEST_SDRR_EMPTY 0x08
#define IPM_SELFTEST_INTERNAL_USE 0x04
#define IPM_SELFTEST_FW_BOOTBLOCK 0x02
#define IPM_SELFTEST_FW_CORRUPTED 0x01
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct ipm_get_watchdog_rsp {
unsigned char use;
unsigned char intr_action;
unsigned char pre_timeout;
unsigned char exp_flags;
union {
struct {
unsigned char initial_countdown_lsb;
unsigned char initial_countdown_msb;
};
uint16_t init_cnt_le;
};
union {
struct {
unsigned char present_countdown_lsb;
unsigned char present_countdown_msb;
};
uint16_t pres_cnt_le;
};
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#define IPM_WATCHDOG_RESET_ERROR 0x80
#define IPM_WATCHDOG_BIOS_FRB2 0x01
#define IPM_WATCHDOG_BIOS_POST 0x02
#define IPM_WATCHDOG_OS_LOAD 0x03
#define IPM_WATCHDOG_SMS_OS 0x04
#define IPM_WATCHDOG_OEM 0x05
#define IPM_WATCHDOG_NO_ACTION 0x00
#define IPM_WATCHDOG_HARD_RESET 0x01
#define IPM_WATCHDOG_POWER_DOWN 0x02
#define IPM_WATCHDOG_POWER_CYCLE 0x03
#define IPM_WATCHDOG_CLEAR_OEM 0x20
#define IPM_WATCHDOG_CLEAR_SMS_OS 0x10
#define IPM_WATCHDOG_CLEAR_OS_LOAD 0x08
#define IPM_WATCHDOG_CLEAR_BIOS_POST 0x04
#define IPM_WATCHDOG_CLEAR_BIOS_FRB2 0x02
/* Use */
#define IPMI_WDT_USE_NOLOG_SHIFT 7
#define IPMI_WDT_USE_DONTSTOP_SHIFT 6 /* For 'set' */
#define IPMI_WDT_USE_RUNNING_SHIFT 6 /* For 'get' */
#define IPMI_WDT_USE_SHIFT 0
#define IPMI_WDT_USE_MASK 0x07
/* Pre-timeout interrupt type */
#define IPMI_WDT_INTR_SHIFT 4
#define IPMI_WDT_INTR_MASK 0x07 /* Apply to the intr value, not to the data byte */
/* Action */
#define IPMI_WDT_ACTION_SHIFT 0
#define IPMI_WDT_ACTION_MASK 0x07
#define IPMI_WDT_GET(b, s) (((b) >> (IPMI_WDT_##s##_SHIFT)) & (IPMI_WDT_##s##_MASK))
#define IS_WDT_BIT(b, s) IS_SET((b), IPMI_WDT_##s##_SHIFT)
/* IPMI 2.0 command for system information*/
#define IPMI_SET_SYS_INFO 0x58
#define IPMI_GET_SYS_INFO 0x59
#define IPMI_SYSINFO_SET0_SIZE 14
#define IPMI_SYSINFO_SETN_SIZE 16
/* System Information "Parameter selector" values: */
#define IPMI_SYSINFO_SET_STATE 0x00
#define IPMI_SYSINFO_SYSTEM_FW_VERSION 0x01
#define IPMI_SYSINFO_HOSTNAME 0x02
#define IPMI_SYSINFO_PRIMARY_OS_NAME 0x03
#define IPMI_SYSINFO_OS_NAME 0x04
#define IPMI_SYSINFO_DELL_OS_VERSION 0xe4
#define IPMI_SYSINFO_DELL_URL 0xde
#define IPMI_SYSINFO_DELL_IPV6_COUNT 0xe6
#define IPMI_SYSINFO_DELL_IPV6_DESTADDR 0xf0
int ipmi_mc_getsysinfo(struct ipmi_intf * intf, int param, int block, int set,
int len, void *buffer);
int ipmi_mc_setsysinfo(struct ipmi_intf * intf, int len, void *buffer);
#endif /*IPMI_MC_H */

View File

@ -1,691 +0,0 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution 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.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef IPMI_SEL_H
#define IPMI_SEL_H
#include <inttypes.h>
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_sdr.h>
#define IPMI_CMD_GET_SEL_INFO 0x40
#define IPMI_CMD_GET_SEL_ALLOC_INFO 0x41
#define IPMI_CMD_RESERVE_SEL 0x42
#define IPMI_CMD_GET_SEL_ENTRY 0x43
#define IPMI_CMD_ADD_SEL_ENTRY 0x44
#define IPMI_CMD_PARTIAL_ADD_SEL_ENTRY 0x45
#define IPMI_CMD_DELETE_SEL_ENTRY 0x46
#define IPMI_CMD_CLEAR_SEL 0x47
#define IPMI_CMD_GET_SEL_TIME 0x48
#define IPMI_CMD_SET_SEL_TIME 0x49
#define IPMI_CMD_GET_AUX_LOG_STATUS 0x5A
#define IPMI_CMD_SET_AUX_LOG_STATUS 0x5B
enum {
IPMI_EVENT_CLASS_DISCRETE,
IPMI_EVENT_CLASS_DIGITAL,
IPMI_EVENT_CLASS_THRESHOLD,
IPMI_EVENT_CLASS_OEM,
};
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct sel_get_rq {
uint16_t reserve_id;
uint16_t record_id;
uint8_t offset;
uint8_t length;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
struct standard_spec_sel_rec{
uint32_t timestamp;
uint16_t gen_id;
uint8_t evm_rev;
uint8_t sensor_type;
uint8_t sensor_num;
#if WORDS_BIGENDIAN
uint8_t event_dir : 1;
uint8_t event_type : 7;
#else
uint8_t event_type : 7;
uint8_t event_dir : 1;
#endif
#define DATA_BYTE2_SPECIFIED_MASK 0xc0 /* event_data[0] bit mask */
#define DATA_BYTE3_SPECIFIED_MASK 0x30 /* event_data[0] bit mask */
#define EVENT_OFFSET_MASK 0x0f /* event_data[0] bit mask */
uint8_t event_data[3];
};
/* Dell Specific MACRO's */
#define OEM_CODE_IN_BYTE2 0x80 /* Dell specific OEM Byte in Byte 2 Mask */
#define OEM_CODE_IN_BYTE3 0x20 /* Dell specific OEM Byte in Byte 3 Mask */
/* MASK MACROS */
#define MASK_LOWER_NIBBLE 0x0F
#define MASK_HIGHER_NIBBLE 0xF0
/*Senosr type Macro's */
#define SENSOR_TYPE_MEMORY 0x0C
#define SENSOR_TYPE_CRIT_INTR 0x13
#define SENSOR_TYPE_EVT_LOG 0x10
#define SENSOR_TYPE_SYS_EVENT 0x12
#define SENSOR_TYPE_PROCESSOR 0x07
#define SENSOR_TYPE_OEM_SEC_EVENT 0xC1
#define SENSOR_TYPE_VER_CHANGE 0x2B
#define SENSOR_TYPE_FRM_PROG 0x0F
#define SENSOR_TYPE_WTDOG 0x23
#define SENSOR_TYPE_OEM_NFATAL_ERROR 0xC2
#define SENSOR_TYPE_OEM_FATAL_ERROR 0xC3
#define SENSOR_TYPE_TXT_CMD_ERROR 0x20
#define SENSOR_TYPE_SUPERMICRO_OEM 0xD0
/* End of Macro for DELL Specific */
#define SEL_OEM_TS_DATA_LEN 6
#define SEL_OEM_NOTS_DATA_LEN 13
struct oem_ts_spec_sel_rec{
uint32_t timestamp;
uint8_t manf_id[3];
uint8_t oem_defined[SEL_OEM_TS_DATA_LEN];
};
struct oem_nots_spec_sel_rec{
uint8_t oem_defined[SEL_OEM_NOTS_DATA_LEN];
};
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct sel_event_record {
uint16_t record_id;
uint8_t record_type;
union{
struct standard_spec_sel_rec standard_type;
struct oem_ts_spec_sel_rec oem_ts_type;
struct oem_nots_spec_sel_rec oem_nots_type;
} sel_type;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
struct ipmi_event_sensor_types {
uint8_t code;
uint8_t offset;
#define ALL_OFFSETS_SPECIFIED 0xff
uint8_t data;
const char * desc;
};
static const struct ipmi_event_sensor_types generic_event_types[] = {
/* Threshold Based States */
{ 0x01, 0x00, 0xff, "Lower Non-critical going low " },
{ 0x01, 0x01, 0xff, "Lower Non-critical going high" },
{ 0x01, 0x02, 0xff, "Lower Critical going low " },
{ 0x01, 0x03, 0xff, "Lower Critical going high" },
{ 0x01, 0x04, 0xff, "Lower Non-recoverable going low " },
{ 0x01, 0x05, 0xff, "Lower Non-recoverable going high" },
{ 0x01, 0x06, 0xff, "Upper Non-critical going low " },
{ 0x01, 0x07, 0xff, "Upper Non-critical going high" },
{ 0x01, 0x08, 0xff, "Upper Critical going low " },
{ 0x01, 0x09, 0xff, "Upper Critical going high" },
{ 0x01, 0x0a, 0xff, "Upper Non-recoverable going low " },
{ 0x01, 0x0b, 0xff, "Upper Non-recoverable going high" },
/* DMI-based "usage state" States */
{ 0x02, 0x00, 0xff, "Transition to Idle" },
{ 0x02, 0x01, 0xff, "Transition to Active" },
{ 0x02, 0x02, 0xff, "Transition to Busy" },
/* Digital-Discrete Event States */
{ 0x03, 0x00, 0xff, "State Deasserted" },
{ 0x03, 0x01, 0xff, "State Asserted" },
{ 0x04, 0x00, 0xff, "Predictive Failure Deasserted" },
{ 0x04, 0x01, 0xff, "Predictive Failure Asserted" },
{ 0x05, 0x00, 0xff, "Limit Not Exceeded" },
{ 0x05, 0x01, 0xff, "Limit Exceeded" },
{ 0x06, 0x00, 0xff, "Performance Met" },
{ 0x06, 0x01, 0xff, "Performance Lags" },
/* Severity Event States */
{ 0x07, 0x00, 0xff, "Transition to OK" },
{ 0x07, 0x01, 0xff, "Transition to Non-critical from OK" },
{ 0x07, 0x02, 0xff, "Transition to Critical from less severe" },
{ 0x07, 0x03, 0xff, "Transition to Non-recoverable from less severe" },
{ 0x07, 0x04, 0xff, "Transition to Non-critical from more severe" },
{ 0x07, 0x05, 0xff, "Transition to Critical from Non-recoverable" },
{ 0x07, 0x06, 0xff, "Transition to Non-recoverable" },
{ 0x07, 0x07, 0xff, "Monitor" },
{ 0x07, 0x08, 0xff, "Informational" },
/* Availability Status States */
{ 0x08, 0x00, 0xff, "Device Absent" },
{ 0x08, 0x01, 0xff, "Device Present" },
{ 0x09, 0x00, 0xff, "Device Disabled" },
{ 0x09, 0x01, 0xff, "Device Enabled" },
{ 0x0a, 0x00, 0xff, "Transition to Running" },
{ 0x0a, 0x01, 0xff, "Transition to In Test" },
{ 0x0a, 0x02, 0xff, "Transition to Power Off" },
{ 0x0a, 0x03, 0xff, "Transition to On Line" },
{ 0x0a, 0x04, 0xff, "Transition to Off Line" },
{ 0x0a, 0x05, 0xff, "Transition to Off Duty" },
{ 0x0a, 0x06, 0xff, "Transition to Degraded" },
{ 0x0a, 0x07, 0xff, "Transition to Power Save" },
{ 0x0a, 0x08, 0xff, "Install Error" },
/* Redundancy States */
{ 0x0b, 0x00, 0xff, "Fully Redundant" },
{ 0x0b, 0x01, 0xff, "Redundancy Lost" },
{ 0x0b, 0x02, 0xff, "Redundancy Degraded" },
{ 0x0b, 0x03, 0xff, "Non-Redundant: Sufficient from Redundant" },
{ 0x0b, 0x04, 0xff, "Non-Redundant: Sufficient from Insufficient" },
{ 0x0b, 0x05, 0xff, "Non-Redundant: Insufficient Resources" },
{ 0x0b, 0x06, 0xff, "Redundancy Degraded from Fully Redundant" },
{ 0x0b, 0x07, 0xff, "Redundancy Degraded from Non-Redundant" },
/* ACPI Device Power States */
{ 0x0c, 0x00, 0xff, "D0 Power State" },
{ 0x0c, 0x01, 0xff, "D1 Power State" },
{ 0x0c, 0x02, 0xff, "D2 Power State" },
{ 0x0c, 0x03, 0xff, "D3 Power State" },
/* END */
{ 0x00, 0x00, 0xff, NULL },
};
static const struct ipmi_event_sensor_types sensor_specific_event_types[] = {
/* Physical Security */
{ 0x05, 0x00, 0xff, "General Chassis intrusion" },
{ 0x05, 0x01, 0xff, "Drive Bay intrusion" },
{ 0x05, 0x02, 0xff, "I/O Card area intrusion" },
{ 0x05, 0x03, 0xff, "Processor area intrusion" },
{ 0x05, 0x04, 0xff, "System unplugged from LAN" },
{ 0x05, 0x05, 0xff, "Unauthorized dock" },
{ 0x05, 0x06, 0xff, "FAN area intrusion" },
/* Platform Security */
{ 0x06, 0x00, 0xff, "Front Panel Lockout violation attempted" },
{ 0x06, 0x01, 0xff, "Pre-boot password violation - user password" },
{ 0x06, 0x02, 0xff, "Pre-boot password violation - setup password" },
{ 0x06, 0x03, 0xff, "Pre-boot password violation - network boot password" },
{ 0x06, 0x04, 0xff, "Other pre-boot password violation" },
{ 0x06, 0x05, 0xff, "Out-of-band access password violation" },
/* Processor */
{ 0x07, 0x00, 0xff, "IERR" },
{ 0x07, 0x01, 0xff, "Thermal Trip" },
{ 0x07, 0x02, 0xff, "FRB1/BIST failure" },
{ 0x07, 0x03, 0xff, "FRB2/Hang in POST failure" },
{ 0x07, 0x04, 0xff, "FRB3/Processor startup/init failure" },
{ 0x07, 0x05, 0xff, "Configuration Error" },
{ 0x07, 0x06, 0xff, "SM BIOS Uncorrectable CPU-complex Error" },
{ 0x07, 0x07, 0xff, "Presence detected" },
{ 0x07, 0x08, 0xff, "Disabled" },
{ 0x07, 0x09, 0xff, "Terminator presence detected" },
{ 0x07, 0x0a, 0xff, "Throttled" },
{ 0x07, 0x0b, 0xff, "Uncorrectable machine check exception" },
{ 0x07, 0x0c, 0xff, "Correctable machine check error" },
/* Power Supply */
{ 0x08, 0x00, 0xff, "Presence detected" },
{ 0x08, 0x01, 0xff, "Failure detected" },
{ 0x08, 0x02, 0xff, "Predictive failure" },
{ 0x08, 0x03, 0xff, "Power Supply AC lost" },
{ 0x08, 0x04, 0xff, "AC lost or out-of-range" },
{ 0x08, 0x05, 0xff, "AC out-of-range, but present" },
{ 0x08, 0x06, 0x00, "Config Error: Vendor Mismatch" },
{ 0x08, 0x06, 0x01, "Config Error: Revision Mismatch" },
{ 0x08, 0x06, 0x02, "Config Error: Processor Missing" },
{ 0x08, 0x06, 0x03, "Config Error: Power Supply Rating Mismatch" },
{ 0x08, 0x06, 0x04, "Config Error: Voltage Rating Mismatch" },
{ 0x08, 0x06, 0xff, "Config Error" },
{ 0x08, 0x06, 0xff, "Power Supply Inactive" },
/* Power Unit */
{ 0x09, 0x00, 0xff, "Power off/down" },
{ 0x09, 0x01, 0xff, "Power cycle" },
{ 0x09, 0x02, 0xff, "240VA power down" },
{ 0x09, 0x03, 0xff, "Interlock power down" },
{ 0x09, 0x04, 0xff, "AC lost" },
{ 0x09, 0x05, 0xff, "Soft-power control failure" },
{ 0x09, 0x06, 0xff, "Failure detected" },
{ 0x09, 0x07, 0xff, "Predictive failure" },
/* Memory */
{ 0x0c, 0x00, 0xff, "Correctable ECC" },
{ 0x0c, 0x01, 0xff, "Uncorrectable ECC" },
{ 0x0c, 0x02, 0xff, "Parity" },
{ 0x0c, 0x03, 0xff, "Memory Scrub Failed" },
{ 0x0c, 0x04, 0xff, "Memory Device Disabled" },
{ 0x0c, 0x05, 0xff, "Correctable ECC logging limit reached" },
{ 0x0c, 0x06, 0xff, "Presence Detected" },
{ 0x0c, 0x07, 0xff, "Configuration Error" },
{ 0x0c, 0x08, 0xff, "Spare" },
{ 0x0c, 0x09, 0xff, "Throttled" },
{ 0x0c, 0x0a, 0xff, "Critical Overtemperature" },
/* Drive Slot */
{ 0x0d, 0x00, 0xff, "Drive Present" },
{ 0x0d, 0x01, 0xff, "Drive Fault" },
{ 0x0d, 0x02, 0xff, "Predictive Failure" },
{ 0x0d, 0x03, 0xff, "Hot Spare" },
{ 0x0d, 0x04, 0xff, "Parity Check In Progress" },
{ 0x0d, 0x05, 0xff, "In Critical Array" },
{ 0x0d, 0x06, 0xff, "In Failed Array" },
{ 0x0d, 0x07, 0xff, "Rebuild In Progress" },
{ 0x0d, 0x08, 0xff, "Rebuild Aborted" },
/* System Firmware Error */
{ 0x0f, 0x00, 0x00, "Unspecified" },
{ 0x0f, 0x00, 0x01, "No system memory installed" },
{ 0x0f, 0x00, 0x02, "No usable system memory" },
{ 0x0f, 0x00, 0x03, "Unrecoverable IDE device failure" },
{ 0x0f, 0x00, 0x04, "Unrecoverable system-board failure" },
{ 0x0f, 0x00, 0x05, "Unrecoverable diskette failure" },
{ 0x0f, 0x00, 0x06, "Unrecoverable hard-disk controller failure" },
{ 0x0f, 0x00, 0x07, "Unrecoverable PS/2 or USB keyboard failure" },
{ 0x0f, 0x00, 0x08, "Removable boot media not found" },
{ 0x0f, 0x00, 0x09, "Unrecoverable video controller failure" },
{ 0x0f, 0x00, 0x0a, "No video device selected" },
{ 0x0f, 0x00, 0x0b, "BIOS corruption detected" },
{ 0x0f, 0x00, 0x0c, "CPU voltage mismatch" },
{ 0x0f, 0x00, 0x0d, "CPU speed mismatch failure" },
{ 0x0f, 0x00, 0xff, "Unknown Error" },
/* System Firmware Hang */
{ 0x0f, 0x01, 0x00, "Unspecified" },
{ 0x0f, 0x01, 0x01, "Memory initialization" },
{ 0x0f, 0x01, 0x02, "Hard-disk initialization" },
{ 0x0f, 0x01, 0x03, "Secondary CPU Initialization" },
{ 0x0f, 0x01, 0x04, "User authentication" },
{ 0x0f, 0x01, 0x05, "User-initiated system setup" },
{ 0x0f, 0x01, 0x06, "USB resource configuration" },
{ 0x0f, 0x01, 0x07, "PCI resource configuration" },
{ 0x0f, 0x01, 0x08, "Option ROM initialization" },
{ 0x0f, 0x01, 0x09, "Video initialization" },
{ 0x0f, 0x01, 0x0a, "Cache initialization" },
{ 0x0f, 0x01, 0x0b, "SMBus initialization" },
{ 0x0f, 0x01, 0x0c, "Keyboard controller initialization" },
{ 0x0f, 0x01, 0x0d, "Management controller initialization" },
{ 0x0f, 0x01, 0x0e, "Docking station attachment" },
{ 0x0f, 0x01, 0x0f, "Enabling docking station" },
{ 0x0f, 0x01, 0x10, "Docking station ejection" },
{ 0x0f, 0x01, 0x11, "Disabling docking station" },
{ 0x0f, 0x01, 0x12, "Calling operating system wake-up vector" },
{ 0x0f, 0x01, 0x13, "System boot initiated" },
{ 0x0f, 0x01, 0x14, "Motherboard initialization" },
{ 0x0f, 0x01, 0x15, "reserved" },
{ 0x0f, 0x01, 0x16, "Floppy initialization" },
{ 0x0f, 0x01, 0x17, "Keyboard test" },
{ 0x0f, 0x01, 0x18, "Pointing device test" },
{ 0x0f, 0x01, 0x19, "Primary CPU initialization" },
{ 0x0f, 0x01, 0xff, "Unknown Hang" },
/* System Firmware Progress */
{ 0x0f, 0x02, 0x00, "Unspecified" },
{ 0x0f, 0x02, 0x01, "Memory initialization" },
{ 0x0f, 0x02, 0x02, "Hard-disk initialization" },
{ 0x0f, 0x02, 0x03, "Secondary CPU Initialization" },
{ 0x0f, 0x02, 0x04, "User authentication" },
{ 0x0f, 0x02, 0x05, "User-initiated system setup" },
{ 0x0f, 0x02, 0x06, "USB resource configuration" },
{ 0x0f, 0x02, 0x07, "PCI resource configuration" },
{ 0x0f, 0x02, 0x08, "Option ROM initialization" },
{ 0x0f, 0x02, 0x09, "Video initialization" },
{ 0x0f, 0x02, 0x0a, "Cache initialization" },
{ 0x0f, 0x02, 0x0b, "SMBus initialization" },
{ 0x0f, 0x02, 0x0c, "Keyboard controller initialization" },
{ 0x0f, 0x02, 0x0d, "Management controller initialization" },
{ 0x0f, 0x02, 0x0e, "Docking station attachment" },
{ 0x0f, 0x02, 0x0f, "Enabling docking station" },
{ 0x0f, 0x02, 0x10, "Docking station ejection" },
{ 0x0f, 0x02, 0x11, "Disabling docking station" },
{ 0x0f, 0x02, 0x12, "Calling operating system wake-up vector" },
{ 0x0f, 0x02, 0x13, "System boot initiated" },
{ 0x0f, 0x02, 0x14, "Motherboard initialization" },
{ 0x0f, 0x02, 0x15, "reserved" },
{ 0x0f, 0x02, 0x16, "Floppy initialization" },
{ 0x0f, 0x02, 0x17, "Keyboard test" },
{ 0x0f, 0x02, 0x18, "Pointing device test" },
{ 0x0f, 0x02, 0x19, "Primary CPU initialization" },
{ 0x0f, 0x02, 0xff, "Unknown Progress" },
/* Event Logging Disabled */
{ 0x10, 0x00, 0xff, "Correctable memory error logging disabled" },
{ 0x10, 0x01, 0xff, "Event logging disabled" },
{ 0x10, 0x02, 0xff, "Log area reset/cleared" },
{ 0x10, 0x03, 0xff, "All event logging disabled" },
{ 0x10, 0x04, 0xff, "Log full" },
{ 0x10, 0x05, 0xff, "Log almost full" },
/* Watchdog 1 */
{ 0x11, 0x00, 0xff, "BIOS Reset" },
{ 0x11, 0x01, 0xff, "OS Reset" },
{ 0x11, 0x02, 0xff, "OS Shut Down" },
{ 0x11, 0x03, 0xff, "OS Power Down" },
{ 0x11, 0x04, 0xff, "OS Power Cycle" },
{ 0x11, 0x05, 0xff, "OS NMI/Diag Interrupt" },
{ 0x11, 0x06, 0xff, "OS Expired" },
{ 0x11, 0x07, 0xff, "OS pre-timeout Interrupt" },
/* System Event */
{ 0x12, 0x00, 0xff, "System Reconfigured" },
{ 0x12, 0x01, 0xff, "OEM System boot event" },
{ 0x12, 0x02, 0xff, "Undetermined system hardware failure" },
{ 0x12, 0x03, 0xff, "Entry added to auxiliary log" },
{ 0x12, 0x04, 0xff, "PEF Action" },
{ 0x12, 0x05, 0xff, "Timestamp Clock Sync" },
/* Critical Interrupt */
{ 0x13, 0x00, 0xff, "NMI/Diag Interrupt" },
{ 0x13, 0x01, 0xff, "Bus Timeout" },
{ 0x13, 0x02, 0xff, "I/O Channel check NMI" },
{ 0x13, 0x03, 0xff, "Software NMI" },
{ 0x13, 0x04, 0xff, "PCI PERR" },
{ 0x13, 0x05, 0xff, "PCI SERR" },
{ 0x13, 0x06, 0xff, "EISA failsafe timeout" },
{ 0x13, 0x07, 0xff, "Bus Correctable error" },
{ 0x13, 0x08, 0xff, "Bus Uncorrectable error" },
{ 0x13, 0x09, 0xff, "Fatal NMI" },
{ 0x13, 0x0a, 0xff, "Bus Fatal Error" },
{ 0x13, 0x0b, 0xff, "Bus Degraded" },
/* Button */
{ 0x14, 0x00, 0xff, "Power Button pressed" },
{ 0x14, 0x01, 0xff, "Sleep Button pressed" },
{ 0x14, 0x02, 0xff, "Reset Button pressed" },
{ 0x14, 0x03, 0xff, "FRU Latch" },
{ 0x14, 0x04, 0xff, "FRU Service" },
/* Chip Set */
{ 0x19, 0x00, 0xff, "Soft Power Control Failure" },
{ 0x19, 0x01, 0xff, "Thermal Trip" },
/* Cable/Interconnect */
{ 0x1b, 0x00, 0xff, "Connected" },
{ 0x1b, 0x01, 0xff, "Config Error" },
/* System Boot Initiated */
{ 0x1d, 0x00, 0xff, "Initiated by power up" },
{ 0x1d, 0x01, 0xff, "Initiated by hard reset" },
{ 0x1d, 0x02, 0xff, "Initiated by warm reset" },
{ 0x1d, 0x03, 0xff, "User requested PXE boot" },
{ 0x1d, 0x04, 0xff, "Automatic boot to diagnostic" },
{ 0x1d, 0x05, 0xff, "OS initiated hard reset" },
{ 0x1d, 0x06, 0xff, "OS initiated warm reset" },
{ 0x1d, 0x07, 0xff, "System Restart" },
/* Boot Error */
{ 0x1e, 0x00, 0xff, "No bootable media" },
{ 0x1e, 0x01, 0xff, "Non-bootable disk in drive" },
{ 0x1e, 0x02, 0xff, "PXE server not found" },
{ 0x1e, 0x03, 0xff, "Invalid boot sector" },
{ 0x1e, 0x04, 0xff, "Timeout waiting for selection" },
/* OS Boot */
{ 0x1f, 0x00, 0xff, "A: boot completed" },
{ 0x1f, 0x01, 0xff, "C: boot completed" },
{ 0x1f, 0x02, 0xff, "PXE boot completed" },
{ 0x1f, 0x03, 0xff, "Diagnostic boot completed" },
{ 0x1f, 0x04, 0xff, "CD-ROM boot completed" },
{ 0x1f, 0x05, 0xff, "ROM boot completed" },
{ 0x1f, 0x06, 0xff, "boot completed - device not specified" },
{ 0x1f, 0x07, 0xff, "Installation started" },
{ 0x1f, 0x08, 0xff, "Installation completed" },
{ 0x1f, 0x09, 0xff, "Installation aborted" },
{ 0x1f, 0x0a, 0xff, "Installation failed" },
/* OS Stop/Shutdown */
{ 0x20, 0x00, 0xff, "Error during system startup" },
{ 0x20, 0x01, 0xff, "Run-time critical stop" },
{ 0x20, 0x02, 0xff, "OS graceful stop" },
{ 0x20, 0x03, 0xff, "OS graceful shutdown" },
{ 0x20, 0x04, 0xff, "PEF initiated soft shutdown" },
{ 0x20, 0x05, 0xff, "Agent not responding" },
/* Slot/Connector */
{ 0x21, 0x00, 0xff, "Fault Status" },
{ 0x21, 0x01, 0xff, "Identify Status" },
{ 0x21, 0x02, 0xff, "Device Installed" },
{ 0x21, 0x03, 0xff, "Ready for Device Installation" },
{ 0x21, 0x04, 0xff, "Ready for Device Removal" },
{ 0x21, 0x05, 0xff, "Slot Power is Off" },
{ 0x21, 0x06, 0xff, "Device Removal Request" },
{ 0x21, 0x07, 0xff, "Interlock" },
{ 0x21, 0x08, 0xff, "Slot is Disabled" },
{ 0x21, 0x09, 0xff, "Spare Device" },
/* System ACPI Power State */
{ 0x22, 0x00, 0xff, "S0/G0: working" },
{ 0x22, 0x01, 0xff, "S1: sleeping with system hw & processor context maintained" },
{ 0x22, 0x02, 0xff, "S2: sleeping, processor context lost" },
{ 0x22, 0x03, 0xff, "S3: sleeping, processor & hw context lost, memory retained" },
{ 0x22, 0x04, 0xff, "S4: non-volatile sleep/suspend-to-disk" },
{ 0x22, 0x05, 0xff, "S5/G2: soft-off" },
{ 0x22, 0x06, 0xff, "S4/S5: soft-off" },
{ 0x22, 0x07, 0xff, "G3: mechanical off" },
{ 0x22, 0x08, 0xff, "Sleeping in S1/S2/S3 state" },
{ 0x22, 0x09, 0xff, "G1: sleeping" },
{ 0x22, 0x0a, 0xff, "S5: entered by override" },
{ 0x22, 0x0b, 0xff, "Legacy ON state" },
{ 0x22, 0x0c, 0xff, "Legacy OFF state" },
{ 0x22, 0x0e, 0xff, "Unknown" },
/* Watchdog 2 */
{ 0x23, 0x00, 0xff, "Timer expired" },
{ 0x23, 0x01, 0xff, "Hard reset" },
{ 0x23, 0x02, 0xff, "Power down" },
{ 0x23, 0x03, 0xff, "Power cycle" },
{ 0x23, 0x04, 0xff, "reserved" },
{ 0x23, 0x05, 0xff, "reserved" },
{ 0x23, 0x06, 0xff, "reserved" },
{ 0x23, 0x07, 0xff, "reserved" },
{ 0x23, 0x08, 0xff, "Timer interrupt" },
/* Platform Alert */
{ 0x24, 0x00, 0xff, "Platform generated page" },
{ 0x24, 0x01, 0xff, "Platform generated LAN alert" },
{ 0x24, 0x02, 0xff, "Platform Event Trap generated" },
{ 0x24, 0x03, 0xff, "Platform generated SNMP trap, OEM format" },
/* Entity Presence */
{ 0x25, 0x00, 0xff, "Present" },
{ 0x25, 0x01, 0xff, "Absent" },
{ 0x25, 0x02, 0xff, "Disabled" },
/* LAN */
{ 0x27, 0x00, 0xff, "Heartbeat Lost" },
{ 0x27, 0x01, 0xff, "Heartbeat" },
/* Management Subsystem Health */
{ 0x28, 0x00, 0xff, "Sensor access degraded or unavailable" },
{ 0x28, 0x01, 0xff, "Controller access degraded or unavailable" },
{ 0x28, 0x02, 0xff, "Management controller off-line" },
{ 0x28, 0x03, 0xff, "Management controller unavailable" },
{ 0x28, 0x04, 0xff, "Sensor failure" },
{ 0x28, 0x05, 0xff, "FRU failure" },
/* Battery */
{ 0x29, 0x00, 0xff, "Low" },
{ 0x29, 0x01, 0xff, "Failed" },
{ 0x29, 0x02, 0xff, "Presence Detected" },
/* Version Change */
{ 0x2b, 0x00, 0xff, "Hardware change detected" },
{ 0x2b, 0x01, 0x00, "Firmware or software change detected" },
{ 0x2b, 0x01, 0x01, "Firmware or software change detected, Mngmt Ctrl Dev Id" },
{ 0x2b, 0x01, 0x02, "Firmware or software change detected, Mngmt Ctrl Firm Rev" },
{ 0x2b, 0x01, 0x03, "Firmware or software change detected, Mngmt Ctrl Dev Rev" },
{ 0x2b, 0x01, 0x04, "Firmware or software change detected, Mngmt Ctrl Manuf Id" },
{ 0x2b, 0x01, 0x05, "Firmware or software change detected, Mngmt Ctrl IPMI Vers" },
{ 0x2b, 0x01, 0x06, "Firmware or software change detected, Mngmt Ctrl Aux Firm Id" },
{ 0x2b, 0x01, 0x07, "Firmware or software change detected, Mngmt Ctrl Firm Boot Block" },
{ 0x2b, 0x01, 0x08, "Firmware or software change detected, Mngmt Ctrl Other" },
{ 0x2b, 0x01, 0x09, "Firmware or software change detected, BIOS/EFI change" },
{ 0x2b, 0x01, 0x0A, "Firmware or software change detected, SMBIOS change" },
{ 0x2b, 0x01, 0x0B, "Firmware or software change detected, O/S change" },
{ 0x2b, 0x01, 0x0C, "Firmware or software change detected, O/S loader change" },
{ 0x2b, 0x01, 0x0D, "Firmware or software change detected, Service Diag change" },
{ 0x2b, 0x01, 0x0E, "Firmware or software change detected, Mngmt SW agent change" },
{ 0x2b, 0x01, 0x0F, "Firmware or software change detected, Mngmt SW App change" },
{ 0x2b, 0x01, 0x10, "Firmware or software change detected, Mngmt SW Middle" },
{ 0x2b, 0x01, 0x11, "Firmware or software change detected, Prog HW Change (FPGA)" },
{ 0x2b, 0x01, 0x12, "Firmware or software change detected, board/FRU module change" },
{ 0x2b, 0x01, 0x13, "Firmware or software change detected, board/FRU component change" },
{ 0x2b, 0x01, 0x14, "Firmware or software change detected, board/FRU replace equ ver" },
{ 0x2b, 0x01, 0x15, "Firmware or software change detected, board/FRU replace new ver" },
{ 0x2b, 0x01, 0x16, "Firmware or software change detected, board/FRU replace old ver" },
{ 0x2b, 0x01, 0x17, "Firmware or software change detected, board/FRU HW conf change" },
{ 0x2b, 0x02, 0xff, "Hardware incompatibility detected" },
{ 0x2b, 0x03, 0xff, "Firmware or software incompatibility detected" },
{ 0x2b, 0x04, 0xff, "Invalid or unsupported hardware version" },
{ 0x2b, 0x05, 0xff, "Invalid or unsupported firmware or software version" },
{ 0x2b, 0x06, 0xff, "Hardware change success" },
{ 0x2b, 0x07, 0x00, "Firmware or software change success" },
{ 0x2b, 0x07, 0x01, "Firmware or software change success, Mngmt Ctrl Dev Id" },
{ 0x2b, 0x07, 0x02, "Firmware or software change success, Mngmt Ctrl Firm Rev" },
{ 0x2b, 0x07, 0x03, "Firmware or software change success, Mngmt Ctrl Dev Rev" },
{ 0x2b, 0x07, 0x04, "Firmware or software change success, Mngmt Ctrl Manuf Id" },
{ 0x2b, 0x07, 0x05, "Firmware or software change success, Mngmt Ctrl IPMI Vers" },
{ 0x2b, 0x07, 0x06, "Firmware or software change success, Mngmt Ctrl Aux Firm Id" },
{ 0x2b, 0x07, 0x07, "Firmware or software change success, Mngmt Ctrl Firm Boot Block" },
{ 0x2b, 0x07, 0x08, "Firmware or software change success, Mngmt Ctrl Other" },
{ 0x2b, 0x07, 0x09, "Firmware or software change success, BIOS/EFI change" },
{ 0x2b, 0x07, 0x0A, "Firmware or software change success, SMBIOS change" },
{ 0x2b, 0x07, 0x0B, "Firmware or software change success, O/S change" },
{ 0x2b, 0x07, 0x0C, "Firmware or software change success, O/S loader change" },
{ 0x2b, 0x07, 0x0D, "Firmware or software change success, Service Diag change" },
{ 0x2b, 0x07, 0x0E, "Firmware or software change success, Mngmt SW agent change" },
{ 0x2b, 0x07, 0x0F, "Firmware or software change success, Mngmt SW App change" },
{ 0x2b, 0x07, 0x10, "Firmware or software change success, Mngmt SW Middle" },
{ 0x2b, 0x07, 0x11, "Firmware or software change success, Prog HW Change (FPGA)" },
{ 0x2b, 0x07, 0x12, "Firmware or software change success, board/FRU module change" },
{ 0x2b, 0x07, 0x13, "Firmware or software change success, board/FRU component change" },
{ 0x2b, 0x07, 0x14, "Firmware or software change success, board/FRU replace equ ver" },
{ 0x2b, 0x07, 0x15, "Firmware or software change success, board/FRU replace new ver" },
{ 0x2b, 0x07, 0x16, "Firmware or software change success, board/FRU replace old ver" },
{ 0x2b, 0x07, 0x17, "Firmware or software change success, board/FRU HW conf change" },
/* FRU State */
{ 0x2c, 0x00, 0xff, "Not Installed" },
{ 0x2c, 0x01, 0xff, "Inactive" },
{ 0x2c, 0x02, 0xff, "Activation Requested" },
{ 0x2c, 0x03, 0xff, "Activation in Progress" },
{ 0x2c, 0x04, 0xff, "Active" },
{ 0x2c, 0x05, 0xff, "Deactivation Requested" },
{ 0x2c, 0x06, 0xff, "Deactivation in Progress" },
{ 0x2c, 0x07, 0xff, "Communication lost" },
/* PICMG FRU Hot Swap */
{ 0xF0, 0x00, 0xFF, "Transition to M0" },
{ 0xF0, 0x01, 0xFF, "Transition to M1" },
{ 0xF0, 0x02, 0xFF, "Transition to M2" },
{ 0xF0, 0x03, 0xFF, "Transition to M3" },
{ 0xF0, 0x04, 0xFF, "Transition to M4" },
{ 0xF0, 0x05, 0xFF, "Transition to M5" },
{ 0xF0, 0x06, 0xFF, "Transition to M6" },
{ 0xF0, 0x07, 0xFF, "Transition to M7" },
/* PICMG IPMB Physical Link */
{ 0xF1, 0x00, 0xff, "IPMB-A disabled, IPMB-B disabled" },
{ 0xF1, 0x01, 0xff, "IPMB-A enabled, IPMB-B disabled" },
{ 0xF1, 0x02, 0xff, "IPMB-A disabled, IPMB-B enabled" },
{ 0xF1, 0x03, 0xff, "IPMB-A enabled, IPMB-B enabled" },
/* PICMG Module Hot Swap */
{ 0xF2, 0x00, 0xff, "Module Handle Closed" },
{ 0xF2, 0x01, 0xff, "Module Handle Opened" },
{ 0xF2, 0x02, 0xff, "Quiesced" },
{ 0x00, 0x00, 0xff, NULL },
};
static const struct ipmi_event_sensor_types vita_sensor_event_types[] = {
/* VITA FRU State */
{ 0xF0, 0x00, 0xFF, "Transition to M0" },
{ 0xF0, 0x01, 0xFF, "Transition to M1" },
{ 0xF0, 0x04, 0xFF, "Transition to M4" },
{ 0xF0, 0x05, 0xFF, "Transition to M5" },
{ 0xF0, 0x06, 0xFF, "Transition to M6" },
{ 0xF0, 0x07, 0xFF, "Transition to M7" },
/* VITA System IPMB Link */
{ 0xF1, 0x00, 0xFF, "IPMB-A disabled, IPMB-B disabled" },
{ 0xF1, 0x01, 0xFF, "IPMB-A enabled, IPMB-B disabled" },
{ 0xF1, 0x02, 0xFF, "IPMB-A disabled, IPMB-B enabled" },
{ 0xF1, 0x03, 0xFF, "IPMB-A enabled, IPMB-B enabled" },
/* VITA FRU Temperature */
{ 0xF3, 0x00, 0xff, "At or below Lower Non-critical" },
{ 0xF3, 0x01, 0xff, "At or below Lower Critical" },
{ 0xF3, 0x02, 0xff, "At or below Lower Non-recoverable" },
{ 0xF3, 0x03, 0xff, "At or above Upper Non-critical" },
{ 0xF3, 0x04, 0xff, "At or above Upper Critical" },
{ 0xF3, 0x05, 0xff, "At or above Upper Non-recoverable" },
{ 0x00, 0x00, 0xff, NULL }
};
static const struct ipmi_event_sensor_types oem_kontron_event_types[] = {
/* Board Reset(cPCI) */
{ 0xC1, 0x00, 0xff, "Push Button" },
{ 0xC1, 0x01, 0xff, "Bridge Reset" },
{ 0xC1, 0x02, 0xff, "Backplane" },
{ 0xC1, 0x03, 0xff, "Hotswap Fault" },
{ 0xC1, 0x04, 0xff, "Hotswap Healty" },
{ 0xC1, 0x05, 0xff, "Unknown" },
{ 0xC1, 0x06, 0xff, "ITP" },
{ 0xC1, 0x07, 0xff, "Hardware Watchdog" },
{ 0xC1, 0x08, 0xff, "Software Reset" },
/* IPMB-L Link State, based on PICMG IPMB-0 Link state sensor */
{ 0xC3, 0x02, 0xff, "IPMB L Disabled" },
{ 0xC3, 0x03, 0xff, "IPMB L Enabled" },
/* Board Reset */
{ 0xC4, 0x00, 0xff, "Push Button" },
{ 0xC4, 0x01, 0xff, "Hardware Power Failure" },
{ 0xC4, 0x02, 0xff, "Unknown" },
{ 0xC4, 0x03, 0xff, "Hardware Watchdog" },
{ 0xC4, 0x04, 0xff, "Soft Reset" },
{ 0xC4, 0x05, 0xff, "Warm Reset" },
{ 0xC4, 0x06, 0xff, "Cold Reset" },
{ 0xC4, 0x07, 0xff, "IPMI Command" },
{ 0xC4, 0x08, 0xff, "Setup Reset (Save CMOS)" },
{ 0xC4, 0x09, 0xff, "Power Up Reset" },
/* POST Value */
{ 0xC6, 0x0E, 0xff, "Post Error (see data2)" },
/* FWUM Status */
{ 0xC7, 0x00, 0xff, "First Boot After Upgrade" },
{ 0xC7, 0x01, 0xff, "First Boot After Rollback(error)" },
{ 0xC7, 0x02, 0xff, "First Boot After Errors (watchdog)" },
{ 0xC7, 0x03, 0xff, "First Boot After Manual Rollback" },
{ 0xC7, 0x08, 0xff, "Firmware Watchdog Bite, reset occurred" },
/* Switch Mngt Software Status */
{ 0xC8, 0x00, 0xff, "Not Loaded" },
{ 0xC8, 0x01, 0xff, "Initializing" },
{ 0xC8, 0x02, 0xff, "Ready" },
{ 0xC8, 0x03, 0xff, "Failure (see data2)" },
/* Diagnostic Status */
{ 0xC9, 0x00, 0xff, "Started" },
{ 0xC9, 0x01, 0xff, "Pass" },
{ 0xC9, 0x02, 0xff, "Fail" },
{ 0xCA, 0x00, 0xff, "In progress"},
{ 0xCA, 0x01, 0xff, "Success"},
{ 0xCA, 0x02, 0xff, "Failure"},
/* FRU Over Current */
{ 0xCB, 0x00, 0xff, "Asserted"},
{ 0xCB, 0x01, 0xff, "Deasserted"},
/* FRU Sensor Error */
{ 0xCC, 0x00, 0xff, "Asserted"},
{ 0xCC, 0x01, 0xff, "Deasserted"},
/* FRU Power Denied */
{ 0xCD, 0x00, 0xff, "Asserted"},
{ 0xCD, 0x01, 0xff, "Deasserted"},
/* Reset */
{ 0xCF, 0x00, 0xff, "Asserted"},
{ 0xCF, 0x01, 0xff, "Deasserted"},
/* END */
{ 0x00, 0x00, 0xff, NULL },
};
int ipmi_sel_main(struct ipmi_intf *, int, char **);
void ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt);
void ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_record * evt);
void ipmi_sel_print_extended_entry(struct ipmi_intf * intf, struct sel_event_record * evt);
void ipmi_sel_print_extended_entry_verbose(struct ipmi_intf * intf, struct sel_event_record * evt);
void ipmi_get_event_desc(struct ipmi_intf * intf, struct sel_event_record * rec, char ** desc);
const char * ipmi_get_sensor_type(struct ipmi_intf *intf, uint8_t code);
uint16_t ipmi_sel_get_std_entry(struct ipmi_intf * intf, uint16_t id, struct sel_event_record * evt);
char * get_viking_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec);
IPMI_OEM ipmi_get_oem(struct ipmi_intf * intf);
char * ipmi_get_oem_desc(struct ipmi_intf * intf, struct sel_event_record * rec);
int ipmi_sel_oem_init(const char * filename);
const struct ipmi_event_sensor_types *
ipmi_get_first_event_sensor_type(struct ipmi_intf *intf, uint8_t sensor_type, uint8_t event_type);
const struct ipmi_event_sensor_types *
ipmi_get_next_event_sensor_type(const struct ipmi_event_sensor_types *evt);
#endif /* IPMI_SEL_H */

View File

@ -1,155 +0,0 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution 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.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef IPMI_SEL_SUPERMICRO_H
# define IPMI_SEL_SUPERMICRO_H
static uint16_t supermicro_x11[] = {
0x0958, 0x0955, 0x0953, 0x0952, 0x0941, 0x093A, 0x0939, 0x0938, 0x0937, 0x0930, 0x0927, 0x091D,
0x091C, 0x0917, 0x090D, 0x0909, 0x0907, 0x0901, 0x089F, 0x089C, 0x089B, 0x089A, 0x0898, 0x0896,
0x0895, 0x0894, 0x0891, 0x0890, 0x0888, 0x0886, 0x0885, 0x0884, 0xFFFF
};
static uint16_t supermicro_b11[] = {
0xFFFF
};
static uint16_t supermicro_b2[] = {
0x0951, 0x094E, 0x0931, 0x092E, 0x092A, 0x0928, 0x0908, 0xFFFF
};
static uint16_t supermicro_x10OBi[] = {
0x0923, 0xFFFF
};
static uint16_t supermicro_x10QRH[] = {
0x0872, 0xFFFF
};
static uint16_t supermicro_x10QBL[] = {
0x0853, 0xFFFF
};
static uint16_t supermicro_brickland[] = {
0x0726, 0x083A, 0xFFFF
};
static uint16_t supermicro_x9dal[] = {
0x0635, 0xFFFF
};
static uint16_t supermicro_x9db[] = {
0x0733, 0x0722, 0x0703, 0x0721, 0x0716, 0x0637, 0xFFFF
};
static uint16_t supermicro_x9sb[] = {
0x0651, 0xFFFF
};
static uint16_t supermicro_x9[] = {
0x0635, 0x0733, 0x0722, 0x0703, 0x0721, 0x0716, 0x0637, 0x0651, 0xFFFF
};
static uint16_t supermicro_romely[] = {
0x0841, 0x0732, 0x0731, 0x0730, 0x0727, 0x0725, 0x0724, 0x0723, 0x0720, 0x0718, 0x0717, 0x0715,
0x0713, 0x0711, 0x070E, 0x070A, 0x0709, 0x0708, 0x0706, 0x0705, 0x0704, 0x0702, 0x0701, 0x0700,
0x066F, 0x066E, 0x066D, 0x0669, 0x0667, 0x0666, 0x0665, 0x0664, 0x0662, 0x0660, 0x0636, 0x0630,
0x062F, 0x062C, 0x0628, 0x0626, 0x0827, 0x070F, 0x0707, 0x0840, 0x0729, 0x0719, 0x0712, 0x070D,
0x066C, 0x066A, 0x0625, 0x0714, 0x0710, 0x070C, 0x070B, 0x0668, 0x0663, 0x0661, 0x062B, 0x062A,
0x0629, 0x093E, 0x0932, 0x092D, 0x092B, 0x0924, 0x0922, 0x0921, 0x091E, 0x0919, 0x0916, 0x089D,
0x0899, 0x0893, 0x0892, 0x0882, 0x0881, 0x0880, 0x087F, 0x087D, 0x0879, 0x0877, 0x086F, 0x086E,
0x086D, 0x086C, 0x086B, 0x085C, 0x085B, 0x084B, 0x0865, 0x0864, 0x0860, 0x0859, 0x0858, 0x0857,
0x0854, 0x0852, 0x0845, 0x0844, 0x0843, 0x0842, 0x083B, 0x0838, 0x0837, 0x0836, 0x0835, 0x0834,
0x0833, 0x0832, 0x0831, 0x0830, 0x0826, 0x0825, 0x0824, 0x0822, 0x0821, 0x0819, 0x0818, 0x0817,
0x0816, 0x0815, 0x0814, 0x0728, 0x0813, 0x0812, 0x0810, 0x0807, 0x0806, 0x0805, 0x0804, 0x0803,
0x0802, 0x0801, 0x0889, 0x0861, 0x083E, 0x0846, 0x0946, 0x0950, 0xFFFF
};
static uint16_t supermicro_b8[] = {
0x000A, 0x061c, 0x0620, 0x0101, 0x061f, 0x0612, 0x061e, 0xFFFF
};
static uint16_t supermicro_h8[] = {
0xa111, 0x0408, 0x0811, 0x1411, 0x0911, 0x1211, 0x1011, 0xcd11, 0x1111, 0xbe11, 0xce11, 0xbd11,
0xbc11, 0xa911, 0xaa11, 0xcb11, 0xad11, 0xa811, 0xac11, 0xaf11, 0xa511, 0xa011, 0x1611, 0x2511,
0xbf11, 0x1511, 0x2211, 0x2411, 0x1911, 0xab11, 0xd011, 0xae11, 0xca11, 0x0409, 0xa211, 0xa311,
0x1311, 0xba11, 0xa711, 0xd111, 0x1711, 0xcf11, 0x2011, 0x1811, 0xFFFF
};
static uint16_t supermicro_p8[] = {
0x5980, 0x6280, 0x6480, 0x7380, 0x7480, 0x0933, 0x094F, 0xFFFF
};
static uint16_t supermicro_x8[] = {
0xa880, 0x0403, 0x0100, 0x0601, 0x0001, 0x0404, 0x0606, 0x0608, 0x0632, 0x0400, 0x0401, 0x0006,
0x040a, 0xf280, 0x060f, 0x0609, 0x0008, 0x0613, 0x061b, 0x0007, 0x0600, 0x060c, 0x060d, 0x0614,
0x0003, 0x040b, 0x0621, 0x0610, 0x0638, 0xf380, 0x060b, 0x040d, 0x0605, 0x062d, 0x060e, 0x061a,
0xf580, 0x062e, 0x0009, 0xFFFF
};
static uint16_t supermicro_X8[] = {
0x000A, 0x061c, 0x0620, 0x0101, 0x061f, 0x0612, 0x061e, 0xa111, 0x0408, 0x0811, 0x1411, 0x0911,
0x1211, 0x1011, 0xcd11, 0x1111, 0xbe11, 0xce11, 0xbd11, 0xbc11, 0xa911, 0xaa11, 0xcb11, 0xad11,
0xa811, 0xac11, 0xaf11, 0xa511, 0xa011, 0x1611, 0x2511, 0xbf11, 0x1511, 0x2211, 0x2411, 0x1911,
0xab11, 0xd011, 0xae11, 0xca11, 0x0409, 0xa211, 0xa311, 0x1311, 0xba11, 0xa711, 0xd111, 0x1711,
0xcf11, 0x2011, 0x1811, 0x5980, 0x6280, 0x6480, 0x7380, 0x7480, 0x0933, 0x094F, 0xa880, 0x0403,
0x0100, 0x0601, 0x0001, 0x0404, 0x0606, 0x0608, 0x0632, 0x0400, 0x0401, 0x0006, 0x040a, 0xf280,
0x060f, 0x0609, 0x0008, 0x0613, 0x061b, 0x0007, 0x0600, 0x060c, 0x060d, 0x0614, 0x0003, 0x040b,
0x0621, 0x0610, 0x0638, 0xf380, 0x060b, 0x040d, 0x0605, 0x062d, 0x060e, 0x061a, 0xf580, 0x062e,
0x0009, 0xFFFF
};
static uint16_t supermicro_older[] = {
0x8080, 0x8180, 0x8280, 0x8480, 0x8580, 0x8680, 0x8780, 0x8880, 0x8980, 0x9080, 0x9180, 0x9280,
0x9380, 0x9480, 0x9580, 0x9680, 0x9780, 0xA080, 0x9880, 0x9980, 0xB080, 0xB180, 0xB280, 0xB380,
0xB480, 0xA280, 0xB580, 0xB680, 0xA580, 0xB780, 0xD180, 0xA380, 0xA480, 0xD680, 0xBA80, 0xD280,
0x2111, 0xD380, 0xBC80, 0xBD80, 0xBE80, 0xC080, 0xC180, 0xAA80, 0xBE80, 0xBF80, 0xAB80, 0xD480,
0xD580, 0xAF80, 0xAE80, 0xC280, 0xAC80, 0xD080, 0xDA80, 0xDB80, 0xDC80, 0xDD80, 0xA680, 0xDE80,
0xAA80, 0xDF80, 0xBB80, 0xA780, 0xF080, 0xF180, 0xB880, 0xC380, 0xB780, 0x2311, 0xA980, 0xF480,
0xB980, 0x0002, 0xba80, 0x0602, 0x0603, 0x0604, 0x0607, 0x0410, 0xA611, 0x060A, 0x0611, 0xBB11,
0x061D, 0x0622, 0x0623, 0x0624, 0x0627, 0x0631, 0x0633, 0x0634, 0x0690, 0x0691, 0x0640, 0x0641,
0x0642, 0x066B, 0x0743, 0x0644, 0x0645, 0x0645, 0x0646, 0x0647, 0x0648, 0x0647, 0x0650, 0x0652,
0x0653, 0x0654, 0x0655, 0x0808, 0x0809, 0x0656, 0x0657, 0x0658, 0x0659, 0x0820, 0x0820, 0x0734,
0x0823, 0x0828, 0x0829, 0x0839, 0x083C, 0x083D, 0x083F, 0x0847, 0x0848, 0x0849, 0x0850, 0x0851,
0x0855, 0x0856, 0x0862, 0x0863, 0x0866, 0x0867, 0x0868, 0x0869, 0x084A, 0x084C, 0x084D, 0x084F,
0x085A, 0x085D, 0x085E, 0x085F, 0x086A, 0x0870, 0x0873, 0x0874, 0x0875, 0x0876, 0x0878, 0x087A,
0x087B, 0x087C, 0x087E, 0x0883, 0x0887, 0x088A, 0x088B, 0x088C, 0x088D, 0x088E, 0x088F, 0x0897,
0x089E, 0x0902, 0x0903, 0x0904, 0x0905, 0x0906, 0x090A, 0x090B, 0x090C, 0x090E, 0x090F, 0x0910,
0x0912, 0x0913, 0x0914, 0x0915, 0x0918, 0x091A, 0x091B, 0x091F, 0x0920, 0x0925, 0x0926, 0x0929,
0x092C, 0x092F, 0x0934, 0x0935, 0x0936, 0x093B, 0x093C, 0x093D, 0x093F, 0x0940, 0x0942, 0x0943,
0x0944, 0x0945, 0x0947, 0x0948, 0x0949, 0x094A, 0x094B, 0x094C, 0x094D, 0x094E, 0x0954, 0x0956,
0x0957, 0x0959, 0xFFFF
};
#endif /* IPMI_SEL_SUPERMICRO_H */

View File

@ -1,93 +0,0 @@
/*
* Copyright (c) 2018 Alexander Amelkin. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution 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.
*
* Neither the name of the copyright holder, nor the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* THE COPYRIGHT HOLDER AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* THE COPYRIGHT HOLDER OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE,
* PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
* INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE
* THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS
* SOFTWARE, EVEN IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGES.
*/
#ifndef IPMI_TIME_H
#define IPMI_TIME_H
#include <time.h>
#include <stdbool.h>
extern bool time_in_utc;
/* Special values according to IPMI v2.0, rev. 1.1, section 37.1 */
#define IPMI_TIME_UNSPECIFIED 0xFFFFFFFFu
#define IPMI_TIME_INIT_DONE 0x20000000u
#define SECONDS_A_DAY (24 * 60 * 60)
/*
* Check whether the timestamp is in seconds since Epoch or since
* the system startup.
*/
static inline bool ipmi_timestamp_is_special(time_t ts)
{
return (ts < IPMI_TIME_INIT_DONE);
}
/*
* Check whether the timestamp is valid at all
*/
static inline bool ipmi_timestamp_is_valid(time_t ts)
{
return (ts != IPMI_TIME_UNSPECIFIED);
}
/*
* Just 26 characters are required for asctime_r(), plus timezone info.
* However just to be safe locale-wise and assuming that in no locale
* the date/time string exceeds the 'standard' legacy terminal width,
* the buffer size is set here to 80.
*/
#define IPMI_ASCTIME_SZ 80
typedef char ipmi_datebuf_t[IPMI_ASCTIME_SZ];
/*
* These are ipmitool-specific versions that take
* in account the command line options
*/
char *ipmi_asctime_r(time_t stamp, ipmi_datebuf_t outbuf);
size_t ipmi_strftime(char *s, size_t max, const char *format, time_t stamp)
__attribute__((format(strftime, 3, 0)));
/* These return pointers to static arrays and aren't thread safe */
char *ipmi_timestamp_fmt(uint32_t stamp, const char *fmt)
__attribute__((format(strftime, 2, 0)));
char *ipmi_timestamp_string(uint32_t stamp); /* Day Mon DD HH:MM:SS YYYY ZZZ */
char *ipmi_timestamp_numeric(uint32_t stamp); /* MM/DD/YYYY HH:MM:SS ZZZ */
char *ipmi_timestamp_date(uint32_t stamp); /* MM/DD/YYYY ZZZ */
char *ipmi_timestamp_time(uint32_t stamp); /* HH:MM:SS ZZZ */
/* Subtract the UTC offset from local time_t */
time_t ipmi_localtime2utc(time_t local);
#endif

View File

@ -1,86 +0,0 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution 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.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef IPMI_USER_H
#define IPMI_USER_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <ipmitool/ipmi.h>
#define IPMI_PASSWORD_DISABLE_USER 0x00
#define IPMI_PASSWORD_ENABLE_USER 0x01
#define IPMI_PASSWORD_SET_PASSWORD 0x02
#define IPMI_PASSWORD_TEST_PASSWORD 0x03
#define IPMI_USER_ENABLE_UNSPECIFIED 0x00
#define IPMI_USER_ENABLE_ENABLED 0x40
#define IPMI_USER_ENABLE_DISABLED 0x80
#define IPMI_USER_ENABLE_RESERVED 0xC0
#define IPMI_UID_MASK 0x3F /* The user_id is 6-bit and is usually in bits [5:0] */
#define IPMI_UID(id) ((id) & IPMI_UID_MASK)
/* (22.27) Get and (22.26) Set User Access */
struct user_access_t {
uint8_t callin_callback;
uint8_t channel;
uint8_t enabled_user_ids;
uint8_t enable_status;
uint8_t fixed_user_ids;
uint8_t ipmi_messaging;
uint8_t link_auth;
uint8_t max_user_ids;
uint8_t privilege_limit;
uint8_t session_limit;
uint8_t user_id;
};
/* (22.29) Get User Name */
struct user_name_t {
uint8_t user_id;
uint8_t user_name[17];
};
int ipmi_user_main(struct ipmi_intf *, int, char **);
int _ipmi_get_user_access(struct ipmi_intf *intf,
struct user_access_t *user_access_rsp);
int _ipmi_get_user_name(struct ipmi_intf *intf, struct user_name_t *user_name);
int _ipmi_set_user_access(struct ipmi_intf *intf,
struct user_access_t *user_access_req,
uint8_t change_priv_limit_only);
int _ipmi_set_user_password(struct ipmi_intf *intf,
uint8_t user_id, uint8_t operation,
const char *password, uint8_t is_twenty_byte);
#endif /* IPMI_USER_H */

View File

@ -1,49 +0,0 @@
/*
* Copyright (c) Pigeon Point Systems. All right reserved
*/
#ifndef _IPMI_VITA_H_
#define _IPMI_VITA_H_
/* VITA 46.11 commands */
#define VITA_GET_VSO_CAPABILITIES_CMD 0x00
#define VITA_FRU_CONTROL_CMD 0x04
#define VITA_GET_FRU_LED_PROPERTIES_CMD 0x05
#define VITA_GET_LED_COLOR_CAPABILITIES_CMD 0x06
#define VITA_SET_FRU_LED_STATE_CMD 0x07
#define VITA_GET_FRU_LED_STATE_CMD 0x08
#define VITA_SET_FRU_STATE_POLICY_BITS_CMD 0x0A
#define VITA_GET_FRU_STATE_POLICY_BITS_CMD 0x0B
#define VITA_SET_FRU_ACTIVATION_CMD 0x0C
#define VITA_GET_FRU_ADDRESS_INFO_CMD 0x40
/* VITA 46.11 site types */
#define VITA_FRONT_VPX_MODULE 0x00
#define VITA_POWER_ENTRY 0x01
#define VITA_CHASSIS_FRU 0x02
#define VITA_DEDICATED_CHMC 0x03
#define VITA_FAN_TRAY 0x04
#define VITA_FAN_TRAY_FILTER 0x05
#define VITA_ALARM_PANEL 0x06
#define VITA_XMC 0x07
#define VITA_VPX_RTM 0x09
#define VITA_FRONT_VME_MODULE 0x0A
#define VITA_FRONT_VXS_MODULE 0x0B
#define VITA_POWER_SUPPLY 0x0C
#define VITA_FRONT_VITA62_MODULE 0x0D
#define VITA_71_MODULE 0x0E
#define VITA_FMC 0x0F
#define GROUP_EXT_VITA 0x03
extern uint8_t
vita_discover(struct ipmi_intf *intf);
extern uint8_t
ipmi_vita_ipmb_address(struct ipmi_intf *intf);
extern int
ipmi_vita_main(struct ipmi_intf * intf, int argc, char ** argv);
#endif /* _IPMI_VITA_H_ */

View File

@ -2,4 +2,3 @@ Duncan Laurie <duncan@iceblink.org>
Fredrik Öhrn <ohrn@chl.chalmers.se>
Jon Cassorla <jon.cassorla@newisys.com>
Jeremy Ellington <jeremy@jeremye.net>
Petter Reinholdtsen <pere@hungry.com>

View File

@ -1,357 +1,4 @@
version 1.8.18 2016-10-08
* Add mac2str() and str2mac() to print/parse MAC address
* Change formatting, remove commented-out code in
src/plugins/imb/imbapi.c
* Export find_lan_channel() as global
* Expose _ipmi_get_channel_info()
* Extend buf2str to allow separator
* Fix indentation of #define in src/plugins/imb/imbapi.c
* Fix missing `goto out_free;` when ipmi_parse_hex() returns (-1)
* Fix warning for buf2str argument
* ID 408 - fix sel list last X listing
* ID: 38 - Protocol violating SOL retries when talking to
SIMSO-HTC
* ID: 459 - Fix reading FRU on Artesyn (Emerson) shelf manager,
MF105.
* ID: 464 - ipmievd crash fix in log_event
* ID:230 - check return value of malloc() in lib/ipmi_ekanalyzer.c
* ID:261 - Fix err. output consistency for % ipmitool chassis
INV_PARAM;
* ID:287 - Fix print-out of DDR3 SDRAM Serial Number
* ID:287 - Remove trailing white-spaces from dimm_spd.c
* ID:289 - bmx-snmp-proxy: PEF alerting does not work for
multiple destinations
* ID:312 - BREAKING CHANGE - Re-design of PEF user interface
* ID:312 - Fix bitmask in _ipmi_set_pef_policy_entry()
* ID:335 - Check return value of fseek(), prevent segfault
* ID:335 - Check return value of fseek(), prevent segfault
* ID:355 - Comment out statement without effect in lib/ipmi_sel.c
* ID:355 - Fix 'missing initializer' in struct lan_param
* ID:355 - Fix ``warning: ISO C forbids zero-size array 'data'''
* ID:355 - Fix different pointer type in lib/ipmi_picmg.c
* ID:355 - Fix missing struct initializers in lib/ipmi_firewall.c
* ID:355 - Fix printf format in lib/ipmi_sunoem.c
* ID:355 - Fix printf() related warnings in lib/ipmi_delloem.c
* ID:355 - Fix signedness warnings in lib/ipmi_sdr.c
* ID:355 - Fix statements without effect in lib/ipmi_ekanalyzer.c
* ID:355 - Move section_id from ipmi_fru. to ipmi_fru.c
* ID:355 - Replace DEBUG() macro with lprintf(LOG_DEBUG, ...)
* ID:375 - Add lan6 subcommand to handle IPv6 LAN parameters
* ID:400 - Add support for VITA-specific sensor types and events.
* ID:441 - Add support for HMAC_MD5 and HMAC_SHA256
* ID:443 - Disable USB driver by default on non-Linux systems
* ID:444 - Cleanup of defaults in configure.ac
* ID:445 - Fix of compilation on FreeBSD
* ID:446 - Fix broken firewall reset iterator
* ID:447 - Fix access beyond array limits in serial_terminal
* ID:449 - ipmitool close console session for sol deactivate
command
* ID:451 - Modify the memory ecc error display of SEL for new
supermicro motherboards.
* ID:452 - Add PICMG extension 5.x for PICMG extension check
* ID:454 - Add support for PICMG 3.1 R2.0 Link Types and Link
Classes.
* ID:456 - Unable to disable the VLAN ID using ipmitool
* ID:457 - Display User ID enable/disable status
* ID:463 - Removal of Nokia Siemens Networks
* ID:465 - Supermicro memory ecc Modify the memory ecc error
display of SEL for new supermicro boards.
* Moved ipmi_parse_hex() to helper.c
* Re-work ipmi_mc_get_guid() and turn it into reusable code
* Revert "ID:335 - Check return value of fseek(), prevent
segfault"
* Rewrite code with the notion that Kg is binary data, not string
version 1.8.17 2016-05-01
* Add INSTALL and NEWS, mandated by autoconf
* Added missing ipmi_sel_supermicro.h to template Makefile.am
* Check rsp->data_len in ipmi_sel_get_info()
* Fix "redirecting incorrect #include <sys/poll.h> to <poll.h>"
warning with musl libc
* Fix automake compatibility warnings
* Fix implicit declaration of function
'get_nic_selection_mode_12g' in lib/ipmi_delloem.c
* Fix implicit declaration of function 'ipmi_get_oem' in
src/plugins/imb/imb.c
* Fix implicit declaration of function 'ipmi_get_oem' in
src/plugins/lanplus/lanplus.c
* Fix implicit declaration of function 'ipmi_get_oem' in
src/plugins/open/open.c
* Fix implicit declarations of functions 'HpmfwupgPreUpgradeCheck'
and 'ipmi_intf_get_max_request_data_size' in lib/ipmi_hpmfwupg.c
* Fix implicit declarations of functions
'ipmi_intf_set_max_request_data_size' and
'ipmi_intf_set_max_response_data_size' in lib/hpm2.c
* Fix implicit function declaration of
ipmi_intf_get_max_response_data_size in lib/ipmi_sdr.c
* Fix several implicit declarations of functions in
lib/ipmi_main.c
* Fix several implicit function declarations in lib/ipmi_fru.c
* Fix warning: suggest parentheses around '+' inside '<<'
in lib/ipmi_main.c
* Fix warning: suggest parentheses around arithmetic in operand of
'|' in include/ipmitool/hpm2
* Get rid of old INCLUDES macro, use AM_CPPFLAGS instead.
* ID 440 - Fix 'unknown type name fd_set" error.
* ID 440 - remove obsolete headers from lib/ipmi_sunoem.c
* ID:322 - let 'ekanalyzer frushow' run without a working
IPMI target
* ID:355 - Add #include <strings.h> to lib/ipmi_sel.c
* ID:355 - Add macros and #include and reduce number of warnings
* ID:355 - Change CFLAG -std=c99 to -std=gnu99
* ID:355 - Move Super Micro stuff into dedicated header file
* ID:355 - Remove declared, but not used variables
* ID:404 - Edit FRU information update problem
* ID:405 - Use meaningful Generator ID for "ipmitool sel add"
* ID:407 - Avoid assert on mismatched session ID
* ID:409 - Fix IPv6 socket creation on Windows/Cygwin.
* ID:410 - Disable USB interface for Windows/Cygwin by default.
* ID:410 - Enable/disable USB interface by "auto"
* ID:411 - Fix HPM.2 revision check for R1.1 and subsequent
specification revisions.
* ID:412 - Check errors when setting a user password.
* ID:413 - Print new line chne character when setting user
privilege.
* ID:414 - ekanalyzer frushow fails to show 'Product Info'
correctly
* ID:417 - Fix some typos
* ID:418 - Fix Compiling under Mac OS X
* ID:419 - List dummy.h in Makefile.am, so it gets included in
a release tarball
* ID:421 - Fix memleak for sol output
* ID:423 - Don't assume internal use area is present in ekanalyzer
* ID:424 - Update dimm_spd.c with data from the latest JEDEC List
* ID:425 - Disable USB interface for OS X/darwin
* ID:426 - Fallback to run-time detection of PAGESIZE if
compile-time detection is not supported
* ID:426 - Include sys/socket.h instead of asm/socket.h
* ID:426 - Include wchar.h instead of defining wchar_t ourselves
* ID:427 - Cleanup comment in ipmi_sdr_get_header()
* ID:427 - The first two bytes of dumped raw SDR data is wrong.
* ID:428 - Update IANA numbers / Product Name for IBM and ADLINK
* ID:430 - Change Nokia Siemens Networks to Nokia Solutions
and Networks
* ID:431 - Fix correct interpretation of led states
* ID:437 - sel: Fix "sel time set <time>"
* Make bootstrap script part of dist packages
* Remove #if 0 code aka not-compiled-in
* Remove trailing white-spaces in lib/log.c
* git-ignore autoconf-generated files
version 1.8.16 2015-11-22
* Add _ipmi_get_channel_access() and _ipmi_get_channel_info()
* Add _ipmi_get_user_access() and _ipmi_set_user_access()
* Add _ipmi_get_user_name()
* Add _ipmi_set_channel_access() function
* Add _ipmi_set_user_password() function
* Add limits check in get_cmdline_macaddr()
* Change expression in ipmi_pef_get_info() in order to silence Coverity
* Change expression in ipmi_pef_list_policies() in order to silence Coverity
* Code cleanup in ipmi_user_main()
* Create ask_password() and re-use code
* Delete dead code from ipmi_sunoem_echo() - CID#1261338
* Don't output pidfile before parsing command line arguments
* Don't use tmp variable since it's not necessary in ipmi_user_test()
* Fix 'user help' output
* Fix Assign instead of compare in KfwumGetDeviceInfo() - CID#1149034
* Fix Identical code for different branches in ipmi_tsol_main() -
CID#1261346
* Fix big parameter passed by value in ipmi_sel_oem_match() - CID#1261347
* Fix dead code in ipmi_firewall_reset() - CID#1261342
* Fix eval logic in ipmi_user_priv()
* Fix file descriptor leak in ipmi_exec_main() - CID#1149040
* Fix identical code for diff branches in DellOEM - CID#1261326
* Fix memory leak in get_supermicro_evt_desc()
* Fix memory leak in ipmi_ek_display_board_info_area() - CID#1149051
* Fix missing return in ipmi_kontronoem_main() - CID#1261317
* Fix of previous commit - memset() expects pointer
* Fix out-of-bound-reads in get_supermicro_evt_desc()
* Fix resource leak in fru_area_print_board() - CDI#1149048
* Fix resource leak in fru_area_print_chassis() - CID#1149047
* Fix resource leak in fru_area_print_product() - CID#1149046
* Fix resource leak in ipmi_kontron_set_serial_number() - CID#1149041
* Fix typo vlan->VLAN in ipmi_lan_set_vlan_id() and
ipmi_lan_set_vlan_priority()
* Fix uninitialized struct in ipmi_fru_upg_ekeying() - CID#1149065
* Fix user input validation in Channel and User sub-commands
* Fix wrong size argument in ipmi_sdr_list_cache_fromfile() - CID#1149056
* Fix/remove pointer cast in _ipmi_set_user_access()
* Hook functions in ipmi_user to _ipmi_set_user_password()
* Hook ipmi_get_channel_info() to _ipmi_get_*()
* Hook ipmi_get_channel_medium() to new _ipmi_get_*() functions
* Hook ipmi_lan_set_password() to _ipmi_set_user_password()
* Hook ipmi_print_user_list() and friends to _ipmi_* functions
* Hook ipmi_set_alert_enable() to _ipmi_*()
* Hook ipmi_set_user_access() to _ipmi_set_user_access()
* Hook ipmi_user_priv() to _ipmi_set_user_access()
* ID:307 - Intel I82751 super pass through mode fixup
* ID:355 - Fix compiler warnings for Dummy Interface
* ID:380 - raw commands override retry and timeout values
* ID:319 - Interface safe re-open
* ID:320 - Add VITA 46.11 support
* ID:333 - Set read timeout to 15s in OpenIPMI interface
* ID:336 - ipmitool does not fall back to IPv4 for IPMI v2 / RMCP+ sessions
* ID:343 - Print actual sensor thresholds in 'sensors' comand
* ID:343 - Remove AC_FUNC_MALLOC
* ID:344 - Fix HPM.2 long message support
* ID:345 - Do not do several close session retries when catching SIGINT
* ID:346 - lib/ipmi_sdradd.c ipmi_sdr_read_record has a file descriptor leak
* ID:347 - Incorrect reserved channel number
* ID:348 - Add support for the "System Firmware Version"
* ID:349 - user set password - add option to choose 16/20 byte password
* ID:354 - Replace obsolete u_int with uint32_t in dimm_spd.c
* ID:354 - Replace obsolete u_int[0-9]+_t with standardized types in Free
iface
* ID:354 - forcefully switch to C99 and more strict CFLAGS
* ID:354 - replace/drop caddr_t in IMB
* ID:354 - struct member h_addr has been replaced
* ID:354 - uint8_t >= 0 is always true, don't test it
* ID:355 - Fix Enumeration value not handled in ipmi_get_event_desc()
* ID:355 - Fix ``ISO C forbids omitting the middle term of a ?: expression''
* ID:355 - Fix ``obsolete use of designated initializer with ¿:¿'' warning
* ID:355 - Fix comparison of unsigned expression
* ID:355 - Fix compiler warnings
* ID:355 - Fix compiler warnings in dimm_spd.c
* ID:355 - Fix couple compiler warnings in ipmi_lanp.h
* ID:355 - Fix formatting warning in get_cmdline_ipaddr()
* ID:355 - Fix zero-length format string warning in
get_supermicro_evt_desc()
* ID:355 - Remove defined but unused variable in _set_command_enables()
* ID:355 - remove unused variables from ipmi_dcmi.c
* ID:357 - out-of-bound access in DDR4 code ID:356 - DIMM4 Die Count is
unreachable
* ID:357 - out-of-bound access in DDR4 code
* ID:358 - check data length in else branch of ipmi_spd_print()
* ID:361 - Add a OEM IANA information
* ID:363 - Node Manager feature patch.
* ID:363 - fix Coverity issues in NM implementation
* ID:364 - Fix for serial-basic interface bridging
* ID:365 - Fix for ipmitool crash when using serial-terminal interface
* ID:366 - Properly clean LAN and LAN+ interfaces on close
* ID:367 - Fix building of non-bridged LAN interface commands
* ID:368 - Fix handling of bridging-related parameters
* ID:369 - Fix lanplus interface bridging and response matching
* ID:370 - add anonymous union support in CFLAGS for older gcc
* ID:371 - add ericsson oem
* ID:373 - Fix compilation of IMB on Windows
* ID:374 - Check/set LED Duration correctly
* ID:376 - Add means to configure "Bad Password Threshold"
* ID:381 - Script to log installation status as SEL events
* ID:382 - Fix memcpy() params in HpmFwupgActionUploadFirmware()
* ID:383 - Fix compile-time error in src/plugins/lan/lan.c
* ID:384 - Fix compilation under cygwin64
* ID:388 - Fix Error message always printed if BMC does not support VITA
* ID:388 - Handle ccode 0xCC as well in VITA discovery
* ID:388 - Turn all messages into LOG_INFO in VITA discovery
* ID:389 - Add on of Advantech IANA number
* ID:390 - Support for new Communication Interface (USB Medium)
* ID:391 - changing data_len from 17 to 16 according to ipmi spec 22.29,
first byte is completion code
* ID:392 - _ipmi_get_user_name() work-around for some BMCs
* ID:393 - ipmitool man page addition for Node Manager support.
* ID:394 - close fp if isn't NULL and set it NULL afterwards in USB plugin
* ID:394 - plugins/usb: Fix probe for SCSI devices
* ID:395 - Fix fru string without resizing it
* ID:396 - Fixed invalid length check in picmg led cap command.
* ID:397 - Fixed picmg policy set command.
* ID:398 - Fixed channel setaccess command.
* ID:399 - Fixed channel getciphers command.
* ID:401 - Fixed 30 second delay when activating SOL on 'dumb' Intel MACs.
* ID:402 - Misguiding error print-out when using some 'lan' commands.
* Init user_access_t struct in ipmi_user_priv()
* Make user User Privilege Limit is within range
* Node Manager Feature, correct 1268194 missing break.
* Output pidfile only in verbose mode
* Print error message to STDERR in ipmi_channel.c
* Re-work 'channel getaccess' and 'channel setaccess'
* Re-work ccode eval in ipmi_get_channel_medium()
* Remove commented-out code in ipmi_picmg_clk_set() - CID#1261339
* Remove dead code - rsp can't be NULL at this point - CID#1149005
* Remove dead code in fru_area_print_board() - CID#1149001
* Remove dead code in fru_area_print_chassis() - CID#1149000
* Remove dead code in fru_area_print_product() - CID#1148999
* Remove dead(duplicate) code from ipmi_sol_main() - CID#1148996
* Remove get_channel_access_rsp and get_channel_info_rsp structs
* Remove ipmi_user_set_password()
* Remove length checks in get_supermicro_evt_desc()
* Remove redundant user-input conversion from ipmi_sel_delete()
* Remove trailing white-spaces in ipmi_user.c
* Remove trailing white-spaces in ipmi_user.c
* Remove trailing white-spaces in src/plugins/dummy/dummy.c
* Remove unused variable from ipmi_get_channel_cipher_suites()
* Replace deprecated bzero() with memset()
* Replace s6_addr16 with s6_addr since Mac OS X does not have it
* Rewrite ipmi_set_channel_access()
* Split ipmi_user_main() into smaller functions
* ipmi_print_user_summary() to utilize _ipmi_get_user_access()
* ipmitool delloem: ipmitool delloem extension always return success - fix
it
version 1.8.15 2014-11-24
* ID: 340 - ipmitool sol session improperly closes on packet retry
* ID: 277 - support for hostnames longer than 64 chars
* ID: 313 - ipmitool doesn't support hostname long than 64 symbols
* ID: 277 - Minor issue with ipmi_intf_session_set_hostname()
* ID: 247 - 'sensor thresh' help output is wrong
* ID: 324 - conflicting declaration write_fru_area()
* ID: 337 - Add support for 13G Dell PowerEdge
* ID: 325 - DDR4 DIMM Decoding Logic
* ID: 328 - HPM.2 fixes
* ID: 329 - hpm.1 upgrade fixes
* ID: 103 - picmg discover messages should be DEBUG, not INFO
* ID: 331 - Passwords provided in file (-f option) truncated on space
* ID: 318 - ipmi_tsol.c: fix buffer overflow
* ID: 306 - "fru print" command prints the FRU #0 twice
* ID: 305 - HPM.1 deferred activation support fixup
* ID: 317 - ipmi_fwum.c: fix typo
* ID: 315 - buildsystem: configure.in is deprecated
* ID: 316 - Directory debian is outdated
* ID: 103 - 'lib/ipmi_ekanalyzer.c' needs a re-work
* ID: 46 - SEL OEM record corner case
version 1.8.14 2014-05-05
* ID: 299 - openipmi plugin writes zero to wrong byte
* ID: 301 - Add OS/Hypervisor installation status events
* ID: 298 - fix LANplus retry
* ID: 295 - inform user if SOL session disconnected
* ID: 297 - don't print-out SEL entry if ID not present
* ID: 296 - Fix PSD size decoding
* ID: 293 - Use of uninitialized variable in ipmi_main()
* ID: 278 - Error in sol looptest
* ID: 290 - ipmi_sol.c needs a clean-up
* ID: 85 - Supermicro memory ECC error display
* ID: 290 - ipmi_sol.c needs a clean-up
* ID: 286 - Open session retries hit assert in ipmi_lanplus_send_payload
* ID: 285 - Fix SEGV in ipmi_lanplus_open_session
* ID: 284 - Fix SEGV in ipmi_main
* ID: 283 - ipmi_intf_socket_connect fails with IPv4 hosts
* ID: 46 - ipmi_fwum needs some re-work
* ID: 50 - ipmi_hpmfwupg needs a clean up
* ID: 279 - ipmitool sdr list broken
* ID: 44 - dummy interface support - fake-ipmistack project
* ID: 48 - Remove hard-coded FRU inventory access length restriction
* ID: 276 - HPM.1 upgrade combined patch
* ID: 90 - Add options to chassis bootparam set bootflag
* ID: 292 -Properly handle plugin non-zero target adddress with -t
* Numerous Fixes based on running Coverity
* Use TIOCFLUSH if TCFLSH is missing to get the serial plugin building on
Hurd.
* Disable imb and open plugins by default on Hurd. The platform lack
the required kernel support.
* Change serial plugin to only try to disable the IUCLC serial line flag on
platforms supporting it. Fixes build problem on Hurd and FreeBSD.
* PA: 83 - Revised IPv6 patch
* FR: 24 - Exchange OS Name Hostname BMC URL during startup
* ID: 304 - Incorect byteswap in SOL maximum payload
* ID: 303 - Fix build error in HPM.2 code
* ID: 300 - new sunoem functionality
* ID: 144 - Fix 'dcmi power set_limit action <value>'
* ID: 302 - HPM.2 long message support
* ID: 309 - Add new SEL entries for ipmi 2.0 rev 1.1
* ID: 280 - man page cleanup
* ID: 311 - man page update for new sunoem commands
version 1.8.13 2013-09-09
version 1.8.13rc0 2013-08-09
* ID: 3611905 - Direct Serial Basic/Terminal Mode Interface drivers
* ID: 3577766 - configure's knobs and switches don't work
* ID: 3611253 - do not override OS-default values for interfaces
@ -479,7 +126,6 @@ version 1.8.13 2013-09-09
* ID: 99 - 'lib/ipmi_sel.c' - possible int *flow
* ID: 222 - 'lib/ipmi_sdr.c' - a typo 'Not Reading' -> 'No Reading'
* ID: 35 - Script to setup redirection of SNMP to/from BMC
* ID: 273 - Reduce SOL Input buffer size by SOL header size
version 1.8.12 released 2012-08-09

View File

@ -31,7 +31,9 @@
DOCDIR = $(datadir)/doc/$(PACKAGE)
DOCLIST = $(top_srcdir)/README $(top_srcdir)/COPYING $(top_srcdir)/AUTHORS $(top_srcdir)/ChangeLog
EXTRA_DIST = $(DOCLIST) bootstrap
EXTRA_DIST = $(DOCLIST) \
debian/changelog debian/control debian/copyright \
debian/dirs debian/docs debian/rules
AUTOMAKE_OPTIONS = dist-bzip2
@ -41,37 +43,11 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure configure-stamp \
$(distdir).tar.gz $(distdir).tar.bz2
SUBDIRS = lib src include doc contrib control
IANA_PEN = http://www.iana.org/assignments/enterprise-numbers
dist-hook:
cp control/ipmitool.spec $(distdir)
.PHONY: install-pen-database
if DOWNLOAD
enterprise-numbers:
@echo Downloading IANA PEN database...
@$(DOWNLOAD) "$(IANA_PEN)" > tmpfile.$$PPID || {\
echo "FAILED to download the IANA PEN database"; \
rm tmpfile.$$PPID; \
false; \
}
@mv tmpfile.$$PPID $@
install-pen-database: enterprise-numbers
mkdir -m 755 -p $(DESTDIR)$(IANADIR)
$(INSTALL_DATA) $< -t $(DESTDIR)$(IANADIR)/
else
install-pen-database:
@echo "*** NOT installing the IANA PEN database."
@echo "*** Don't know how to download it."
endif
install-data-local: install-pen-database
install-data-local:
mkdir -p $(DESTDIR)$(DOCDIR)
$(INSTALL_DATA) $(DOCLIST) $(DESTDIR)$(DOCDIR)

View File

@ -24,7 +24,7 @@ Background
==========
I originally wrote ipmitool while between projects and employeed at Sun
Microsystems. Sun had just embarked on a new line of general-purpose x86
servers that included an OEM Intel board with an IPMIv1.5 BMC on board.
servers that inclued an OEM Intel board with an IPMIv1.5 BMC on board.
It started with an idea that remote chassis power control would be a handy
feature for my systems in the lab and from there it grew into a multi-
purpose tool that lots of people found useful. I decided to release it
@ -42,8 +42,8 @@ Requirements
============
Obviously the largest requirement is hardware with a service processor
that supports the IPMI specification. Many x86-based servers are now
coming with IPMI support, check with your preferred hardware vendor
about available products.
comming with IPMI support, check with your preferred hardware vendor
about available prodcuts.
Once you are certain you have the required hardware, you then need to
decide how you want to access the BMC. The most common case involve
@ -126,7 +126,7 @@ hardware will come with a utility (often a DOS bootable CD) for configuring
enabling the LAN interface as well.
In order to support the IPMIv2.0 interface you must have an OpenSSL library
with the required encryption functions. Recent distributions should have
with the required encrytion functions. Recent distributions should have
no problems. The IPMIv1.5 interface will attempt to use OpenSSL for MD5
hash function at compile time but if that is not found it will use an
internal library.
@ -396,16 +396,17 @@ ipmievd: Memory Sensor 01 - Correctable ECC
Resources
=========
IPMItool homepage
http://github.com/ipmitool/ipmitool
http://ipmitool.sourceforge.net
IPMItool manpage
https://github.com/ipmitool/ipmitool/blob/master/doc/ipmitool.1.in
http://ipmitool.sourceforge.net/manpage.html
IPMItool overview paper from Linux.conf.au 2004
http://ipmitool.sourceforge.net/lca2004_ipmitool.pdf
Intelligent Platform Management Interface specification
https://www.intel.com/content/www/us/en/servers/ipmi/ipmi-home.html
http://www.intel.com/design/servers/ipmi/spec.htm
OpenIPMI project: Linux IPMI kernel driver and userland library
http://openipmi.sourceforge.net
IPMItool commit archive
https://lists.sourceforge.net/lists/listinfo/ipmitool-cvs

View File

@ -31,15 +31,7 @@
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
aclocal
case `uname` in
Darwin*)
glibtoolize --automake --copy
;;
*)
libtoolize --automake --copy
;;
esac
libtoolize --automake --copy
autoheader
automake --foreign --add-missing --copy

View File

@ -1,13 +1,11 @@
dnl
dnl autoconf for ipmitool
dnl
m4_define([git_suffix], m4_esyscmd_s(./csv-revision))
AC_INIT([ipmitool], [1.8.18git_suffix])
AC_CONFIG_SRCDIR([src/ipmitool.c])
AC_CONFIG_COMMANDS_PRE([export prefix=$prefix])
AC_INIT([src/ipmitool.c])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([foreign])
AM_INIT_AUTOMAKE([ipmitool], [1.8.13rc0-cvs])
AM_CONFIG_HEADER(config.h)
AC_CONFIG_SRCDIR([src/ipmitool.c])
AC_PREREQ(2.50)
AC_SUBST(ac_configure_args)
@ -18,8 +16,6 @@ AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_CHECK_PROG([RPMBUILD], [rpmbuild], [rpmbuild], [rpm])
AC_CHECK_PROG([SED], [sed], [sed])
AC_CHECK_PROG([WGET], [wget], [wget])
AC_CHECK_PROG([CURL], [curl], [curl])
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h paths.h])
@ -30,20 +26,19 @@ AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN
AC_FUNC_MALLOC
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STRTOD
AC_CHECK_FUNCS([alarm gethostbyname getaddrinfo getifaddrs socket select])
AC_CHECK_FUNCS([alarm gethostbyname socket select])
AC_CHECK_FUNCS([memmove memset strchr strdup strerror])
AC_CHECK_FUNCS([getpassphrase])
CFLAGS="$CFLAGS -Wall -Wextra -std=gnu11 -pedantic -Wformat -Wformat-nonliteral"
CFLAGS="$CFLAGS -fno-strict-aliasing -Wreturn-type"
AM_PROG_LIBTOOL
LIBTOOL="$LIBTOOL --silent"
AC_SEARCH_LIBS([gethostbyname], [nsl])
AC_SEARCH_LIBS([getaddrinfo], [nsl])
AC_SEARCH_LIBS([getifaddrs], [nsl])
AC_SEARCH_LIBS([socket], [socket], [],
[AC_CHECK_LIB([nsl], [socket],
[LIBS="$LIBS -lsocket -lnsl"], [], [-lsocket])])
@ -56,36 +51,16 @@ if test "x$exec_prefix" = "xNONE"; then
exec_prefix="$prefix"
fi
if test "x$WGET" = "x"; then
if test "x$CURL" = "x"; then
AC_MSG_WARN([** Neither wget nor curl could be found.])
AC_MSG_WARN([** IANA PEN database will not be installed by `make install` !])
else
DOWNLOAD="$CURL -#"
AM_CONDITIONAL([DOWNLOAD], [true])
fi
else
DOWNLOAD="$WGET -c -nd -O -"
AM_CONDITIONAL([DOWNLOAD], [true])
fi
AC_MSG_WARN([** Download is:])
AC_MSG_WARN($DOWNLOAD)
AC_SUBST(DOWNLOAD, $DOWNLOAD)
dnl
dnl set default option values
dnl
xenable_all_options=yes
xenable_intf_bmc=no
xenable_intf_dbus=no
xenable_intf_dummy=no
xenable_intf_imb=yes
xenable_intf_lipmi=yes
xenable_intf_open=yes
xenable_intf_lipmi=yes
#xenable_intf_serial=yes
xenable_intf_usb=no
xenable_all_options=yes
xenable_ipmishell=yes
dnl set some things so we build with GNU tools on Solaris
@ -110,30 +85,27 @@ solaris*)
xenable_intf_imb=no
xenable_intf_open=no
xenable_intf_lipmi=no
xenable_intf_bmc=no
;;
*darwin*|aix*)
# disable the linux and solaris-specific interfaces
xenable_intf_imb=no
xenable_intf_open=no
xenable_intf_lipmi=no
xenable_intf_bmc=no
xenable_ipmishell=no
;;
*freebsd*)
xenable_intf_imb=no
xenable_intf_lipmi=no
CFLAGS="$CFLAGS -D__BSD_VISIBLE"
xenable_intf_bmc=no
;;
*netbsd*)
xenable_intf_imb=no
xenable_intf_lipmi=no
xenable_intf_bmc=no
xenable_intf_open=no
;;
gnu*)
# disable the linux and solaris-specific interfaces on Hurd
xenable_intf_imb=no
xenable_intf_open=no
xenable_intf_usb=yes
;;
esac
AC_SUBST(ARCH, $host_cpu)
@ -151,24 +123,6 @@ if test "x$xenable_all_options" = "xyes" || test "x$xenable_solaris_opt" = "xyes
AC_DEFINE(ENABLE_ALL_OPTIONS, [1], [Define to 1 to enable all command line options.])
fi
dnl Determine anonymous union/structure support in GCC
AC_TRY_COMPILE([
#include <stdio.h>
], [
struct test {
union {
int a;
unsigned int b;
};
} test;
printf("a is %d", test.a);
], ac_need_fms_extension=no, ac_need_fms_extension=yes)
if test "x$ac_need_fms_extension" = "xyes"; then
CFLAGS="$CFLAGS -fms-extensions"
AC_SUBST(CFLAGS)
fi
dnl check for OpenSSL functionality
AC_ARG_ENABLE([internal-md5],
[AC_HELP_STRING([--enable-internal-md5],
@ -182,16 +136,6 @@ AC_CHECK_LIB([crypto], [EVP_aes_128_cbc],
fi],
[have_crypto=no], [-lcrypto])
AC_CHECK_LIB([crypto], [EVP_sha256],
[if test "x$xenable_internal_sha256" != "xyes"; then
if test "x$have_crypto" != "xyes"; then
LIBS="$LIBS -lcrypto"
have_sha256=yes
fi
AC_DEFINE(HAVE_CRYPTO_SHA256, [1], [Define to 1 if libcrypto supports SHA256.])
fi],
[], [-lcrypto])
AC_CHECK_LIB([crypto], [MD5_Init],
[if test "x$xenable_internal_md5" != "xyes"; then
if test "x$have_crypto" != "xyes"; then
@ -212,14 +156,6 @@ AC_CHECK_LIB([crypto], [MD2_Init],
fi],
[], [-lcrypto])
dnl check for libsystemd in case dbus-intf is requested
AC_CHECK_LIB([systemd], [sd_bus_default],
[
LIBS="$LIBS -lsystemd"
have_systemd=yes
],
[ have_systemd=no],[])
dnl enable IPMIv1.5 LAN interface
AC_ARG_ENABLE([intf-lan],
[AC_HELP_STRING([--enable-intf-lan],
@ -236,22 +172,6 @@ if test "x$xenable_intf_lan" = "xyes"; then
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lan/libintf_lan.la"
fi
dnl enable IPMI USB interface
AC_ARG_ENABLE([intf-usb],
[AC_HELP_STRING([--enable-intf-usb],
[enable IPMI USB interface [default=auto]])],
[xenable_intf_usb=$enableval],
[xenable_intf_usb=$xenable_intf_usb])
if test "x$xenable_intf_usb" = "xstatic" || test "x$xenable_intf_usb" = "xplugin"; then
xenable_intf_usb=yes
fi
if test "x$xenable_intf_usb" = "xyes"; then
AC_DEFINE(IPMI_INTF_USB, [1], [Define to 1 to enable USB interface.])
AC_SUBST(INTF_USB, [usb])
AC_SUBST(INTF_USB_LIB, [libintf_usb.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB usb/libintf_usb.la"
fi
dnl enable IPMIv2.0 RMCP+ LAN interface
AC_ARG_ENABLE([intf-lanplus],
[AC_HELP_STRING([--enable-intf-lanplus],
@ -583,51 +503,32 @@ if test "x$xenable_intf_bmc" = "xyes"; then
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB bmc/libintf_bmc.la"
fi
dnl enable IPMI dbus interface
AC_ARG_ENABLE([intf-dbus],
[AC_HELP_STRING([--enable-intf-dbus],
[enable IPMI dbus interface [default=no]])],
[xenable_intf_dbus=$enableval],
[xenable_intf_dbus=no])
if test "x$xenable_intf_dbus" != "xno"; then
if test "x$have_systemd" != "xyes"; then
AC_MSG_ERROR([** Unable to find libsystemd required by dbus-intf.])
xenable_intf_dbus=no
fi
fi
if test "x$xenable_intf_dbus" = "xyes"; then
AC_DEFINE(IPMI_INTF_DBUS, [1], [Define to 1 to enable dbus interface.])
AC_SUBST(INTF_DBUS, [dbus])
AC_SUBST(INTF_DBUS_LIB, [libintf_dbus.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB dbus/libintf_dbus.la"
fi
dnl enable Dummy interface for testing
AC_ARG_ENABLE([intf-dummy],
[AC_HELP_STRING([--enable-intf-dummy],
[enable Dummy(test) interface [default=no]])],
[xenable_intf_dummy=$enableval], [xenable_intf_dummy=no])
if test "x$xenable_intf_dummy" = "xyes"; then
AC_DEFINE(IPMI_INTF_DUMMY, [1], [Define to 1 to enable Dummy interface.])
AC_SUBST(INTF_DUMMY, [dummy])
AC_SUBST(INTF_DUMMY_LIB, [libintf_dummy.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB dummy/libintf_dummy.la"
fi
AC_SUBST(IPMITOOL_INTF_LIB)
if test "x$xenable_ipmishell" = "xyes"; then
AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses readline termcap])
AC_SEARCH_LIBS([initscr], [ncurses curses], [have_curses=yes])
AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes])
if test "x$have_curses" != "xyes" || test "x$have_readline" != "xyes"; then
xenable_ipmishell=no
fi
fi
dnl check for readline library to enable ipmi shell
AC_ARG_ENABLE([ipmishell],
[AC_HELP_STRING([--enable-ipmishell],
[enable IPMI shell interface [default=auto]])],
[xenable_ipmishell=$enableval],
[])
dnl check for readline library to enable ipmi shell
if test "x$xenable_ipmishell" = "xyes"; then
AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses readline termcap])
AC_SEARCH_LIBS([initscr], [ncurses curses], [have_curses=yes])
AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes])
if test "x$have_curses" != "xyes"; then
AC_MSG_ERROR([** Unable to find curses required by ipmishell.])
fi
if test "x$have_readline" != "xyes"; then
AC_MSG_ERROR([** Unable to find readline required by ipmishell.])
xenable_ipmishell=no
fi
AC_DEFINE(HAVE_READLINE, [1], [Define to 1 if readline present.])
fi
@ -679,51 +580,6 @@ AC_TRY_COMPILE([],[
[Define to 1 if you need to use #pragma pack instead of __attribute__ ((packed))])]
)
dnl if no environment variable is set, set the default value for the default intf
if test "${xenable_intf_open}" = "yes"; then
DEFAULT_INTF_NO_ENV=open
else dnl macOS does not build open interface, it defaults to lan
DEFAULT_INTF_NO_ENV=lan
fi
dnl allow for a default interface to be set on configure
AC_ARG_VAR(DEFAULT_INTF, [Set the default interface to use (default='open' if available, 'lan' otherwise)])
dnl set the default value for the default interface environment variable
if test "x${DEFAULT_INTF}" == "x"; then
echo "DEFAULT_INTF not found in environment; setting to ${DEFAULT_INTF_NO_ENV}"
DEFAULT_INTF=${DEFAULT_INTF_NO_ENV}
fi
xdefault_intf_is_enabled="xenable_intf_${DEFAULT_INTF}"
if test "x${!xdefault_intf_is_enabled}" != "xyes"; then
AC_MSG_ERROR([** Cannot set ${DEFAULT_INTF} as default; ${DEFAULT_INTF} is not enabled. :${!xdefault_intf_is_enabled}:])
fi
AC_ARG_VAR(IANADIR, [Configure the path to IANA PEN dictionary (default=DATAROOTDIR/misc)])
AC_ARG_VAR(IANAUSERDIR, [Configure the path to IANA PEN dictionary wihtin the user's HOME directory (default=.local/usr/share/misc)])
if test "x${IANADIR}" == "x"; then
echo Set IANA PEN dictionary search path to ${datarootdir}/misc
IANADIR="${datarootdir}/misc"
fi
if test "x${IANAUSERDIR}" == "x"; then
IANAUSERDIR=".local/usr/share/misc"
echo Set user\'s IANA PEN dictionary search path to ${IANAUSERDIR}
fi
AH_TEMPLATE([IANADIR],[The path to system IANA PEN dictionary])
AC_DEFINE_UNQUOTED(IANADIR, "`eval "echo ${IANADIR}"`", [])
AH_TEMPLATE([IANAUSERDIR],[The subpath to user IANA PEN dictionary within the user's HOME])
AC_DEFINE_UNQUOTED(IANAUSERDIR, "`eval "echo ${IANAUSERDIR}"`", [])
AH_TEMPLATE([PATH_SEPARATOR], [The path separator string])
#if defined _WIN32 || defined __CYGWIN__
AC_DEFINE(PATH_SEPARATOR, "\\")
#else
AC_DEFINE(PATH_SEPARATOR, "/")
#endif
dnl Generate files for build
AC_CONFIG_FILES([Makefile
@ -745,32 +601,23 @@ AC_CONFIG_FILES([Makefile
src/plugins/free/Makefile
src/plugins/imb/Makefile
src/plugins/bmc/Makefile
src/plugins/dbus/Makefile
src/plugins/usb/Makefile
src/plugins/lipmi/Makefile
src/plugins/serial/Makefile
src/plugins/dummy/Makefile])
AC_CONFIG_FILES([doc/ipmitool.1], [${SED} -i -e "s%\${prefix}%$prefix%" doc/ipmitool.1])
AC_CONFIG_FILES([doc/ipmievd.8], [${SED} -i -e "s%\${prefix}%$prefix%" doc/ipmievd.8])
src/plugins/serial/Makefile])
AC_OUTPUT
AC_MSG_RESULT([])
AC_MSG_RESULT([ipmitool $VERSION])
AC_MSG_RESULT([])
AC_MSG_RESULT([Interfaces (default=$DEFAULT_INTF)])
AC_MSG_RESULT([Interfaces])
AC_MSG_RESULT([ lan : $xenable_intf_lan])
AC_MSG_RESULT([ lanplus : $xenable_intf_lanplus])
AC_MSG_RESULT([ open : $xenable_intf_open])
AC_MSG_RESULT([ free : $xenable_intf_free])
AC_MSG_RESULT([ imb : $xenable_intf_imb])
AC_MSG_RESULT([ bmc : $xenable_intf_bmc])
AC_MSG_RESULT([ dbus : $xenable_intf_dbus])
AC_MSG_RESULT([ usb : $xenable_intf_usb])
AC_MSG_RESULT([ lipmi : $xenable_intf_lipmi])
AC_MSG_RESULT([ serial : $xenable_intf_serial])
AC_MSG_RESULT([ dummy : $xenable_intf_dummy])
AC_MSG_RESULT([])
AC_MSG_RESULT([Extra tools])
AC_MSG_RESULT([ ipmievd : yes])

View File

@ -34,8 +34,6 @@ dist_pkgdata_DATA = oem_ibm_sel_map
EXTRA_DIST = README \
bmclanconf ipmi.init.basic ipmi.init.redhat \
exchange-bmc-os-info.init.redhat exchange-bmc-os-info.service.redhat \
exchange-bmc-os-info.sysconf log_bmc.sh\
ipmievd.init.redhat ipmievd.init.suse ipmievd.init.debian \
collect_data.sh create_rrds.sh create_webpage_compact.sh create_webpage.sh \
bmc-snmp-proxy bmc-snmp-proxy.service bmc-snmp-proxy.sysconf

View File

@ -3,7 +3,7 @@
#
# bmc-snmp-proxy: Set SNMP proxy to BMC (Baseboard Management Controller)
#
# version: 0.62
# version: 0.6
#
# Authors: Charles Rose <charles_rose@dell.com>
# Jordan Hargrave <jordan_hargrave@dell.com>
@ -20,9 +20,9 @@
SYSCONF_DIR="/etc/sysconfig"
CONFIG="${SYSCONF_DIR}/bmc-snmp-proxy"
SNMPD_BMC_CONF_DIR="/etc/snmp/bmc"
SNMPD_BMC_CONF="${SNMPD_BMC_CONF_DIR}/snmpd.local.conf"
TRAPD_BMC_CONF="${SNMPD_BMC_CONF_DIR}/snmptrapd.local.conf"
SNMPD_LOCAL_CONF_DIR="/etc/snmp/bmc"
SNMPD_LOCAL_CONF="${SNMPD_LOCAL_CONF_DIR}/snmpd.local.conf"
TRAPD_LOCAL_CONF="${SNMPD_LOCAL_CONF_DIR}/snmptrapd.local.conf"
TRAPD_CONF="/etc/snmp/snmptrapd.conf"
@ -57,16 +57,14 @@ bmc_info_exists()
else
RETVAL=2
fi
return $RETVAL
}
check_snmp()
{
if [ ! -d /etc/snmp ] || [ ! -x /usr/sbin/snmpd ]; then
if [ ! -d /etc/snmp ] && [ ! -x /usr/sbin/snmpd ]; then
RETVAL=12
fi
return $RETVAL
}
@ -79,12 +77,11 @@ write_snmp_conf()
printf "###############################################\n"
printf "# Automatically created by %s #\n" "${SCRIPT_NAME}"
printf "###############################################\n"
printf "#view bmcview included %s 80\n" "${BMC_OID}"
printf "#com2sec -Cn bmc_ctx bmc_sec default bmc_cmty\n"
printf "#group bmc_grp v1 bmc_sec\n"
printf "#access bmc_grp bmc_ctx any noauth exact bmcview none none\n"
printf "#proxy -Cn bmc_ctx -v 1 %s\n" "${PROXY_TOKEN}"
printf "proxy -v 1 %s\n" "${PROXY_TOKEN}"
printf "view bmcview included %s 80\n" "${BMC_OID}"
printf "com2sec -Cn bmc_ctx bmc_sec default bmc_cmty\n"
printf "group bmc_grp v1 bmc_sec\n"
printf "access bmc_grp bmc_ctx any noauth exact bmcview none none\n"
printf "proxy -Cn bmc_ctx -v 1 %s\n" "${PROXY_TOKEN}"
printf "###############################################\n"
}
@ -95,7 +92,6 @@ valid_ip()
printf -- "%s" "${1}"| grep -Eq \
"^${octet}\\.${octet}\\.${octet}\\.${octet}$"
return $?
}
@ -116,38 +112,37 @@ set_snmp_proxy()
if check_vars; then
PROXY_TOKEN="-c ${BMC_COMMUNITY} ${BMC_IPv4} ${BMC_OID}"
if [ -d ${SNMPD_BMC_CONF_DIR} ]; then
write_snmp_conf > ${SNMPD_BMC_CONF} || RETVAL=4
if [ ! -d ${SNMPD_LOCAL_CONF_DIR} ] && \
mkdir ${SNMPD_LOCAL_CONF_DIR}; then
write_snmp_conf > ${SNMPD_LOCAL_CONF}
[ $? -ne 0 ] && RETVAL=4
fi
else
RETVAL=3
fi
}
set_snmpd_conf_path()
{
if [ ! -d ${SNMPD_BMC_CONF_DIR} ]; then
mkdir ${SNMPD_BMC_CONF_DIR} || RETVAL=7
fi
# We need SNMPCONFPATH set for both snmpd and snmptrapd
for sysconf in ${SYSCONF_DIR}/snmp*d;
for SYSCONF in ${SYSCONF_DIR}/snmp*d;
do
if ! grep -q "^SNMPCONFPATH.*${SNMPD_BMC_CONF_DIR}" \
"${sysconf}" > /dev/null 2>&1; then
printf "SNMPCONFPATH=/etc/snmp:%s\n" \
"${SNMPD_BMC_CONF_DIR}" >> ${sysconf} || \
RETVAL=7
if grep -q "${SNMPD_LOCAL_CONF_DIR}" "${SYSCONF}" > \
/dev/null 2>&1; then
continue
else
printf "SNMPCONFPATH=%s\n" "${SNMPD_LOCAL_CONF_DIR}" \
>> ${SYSCONF} || RETVAL=7
fi
done
return $RETVAL
}
disable_snmp_proxy()
{
if [ -f ${SNMPD_BMC_CONF} ]; then
rm -f ${SNMPD_BMC_CONF} || RETVAL=5
if [ -f ${SNMPD_LOCAL_CONF} ]; then
rm -f ${SNMPD_LOCAL_CONF}
[ $? -ne 0 ] && RETVAL=5
fi
}
#############################################################################
@ -157,7 +152,6 @@ disable_snmp_proxy()
pick_alert_dest()
{
test_ip="$1"
# We have 4 IPv4 and 4 IPv6 alert dest. We will set IPv4 for now.
for ALERT_DEST in `seq 1 4`
do
temp_ip=$(${IPMITOOL} lan alert print ${CHANNEL} ${ALERT_DEST}\
@ -171,27 +165,27 @@ pick_alert_dest()
set_alert_dest_ip()
{
${IPMITOOL} lan alert set ${CHANNEL} ${ALERT_DEST} ipaddr ${1} \
retry 4 type pet >/dev/null 2>&1 || RETVAL=8
retry 4 type pet >/dev/null 2>&1
[ $? -ne 0 ] && RETVAL=8
}
config_bmc_alert_dest()
bmc_alert_dest()
{
# call with enable|disable
# Pick the first active LAN channel
for CHANNEL in `seq 1 14`
do
[ $(${IPMITOOL} -I open channel info ${CHANNEL} 2>/dev/null \
[ $(${IPMI_TOOL} -I open channel info ${CHANNEL} 2>/dev/null \
| grep -q "802\.3") ] || break
done
# If TRAPD_IP is already set as an alert dest,
if pick_alert_dest "${TRAPD_IP}"; then
# disable: reset it if we are called with disable
[ "${1}" = "disable" ] && \
# reset: reset it if we are called with reset
[ "${1}" = "reset" ] && \
set_alert_dest_ip "0.0.0.0"
# else, find the next free alert dest,
elif pick_alert_dest "0.0.0.0"; then
[ "${1}" = "disable" ] && \
[ "${1}" = "reset" ] && \
return $RETVAL
# set: the TRAPD_IP
set_alert_dest_ip "${TRAPD_IP}"
@ -199,54 +193,42 @@ config_bmc_alert_dest()
# No free alert destinations
RETVAL=9
fi
return $RETVAL
}
set_ipmi_pef()
set_ipmi_alert()
{
# Needs ipmitool-1.8.13 + patches
${IPMITOOL} pef policy set ${ALERT_DEST} "${1}" >/dev/null 2>&1 || \
RETVAL=10
${IPMITOOL} lan set ${CHANNEL} alert "${1}" >/dev/null 2>&1
[ $? -ne 0 ] && RETVAL=10
}
get_host_ip()
{
# Get host's IP that the BMC can reach. This is at best a hack.
# Get host's IP that the BMC can reach.
IFACE=$(/usr/sbin/ip -o -f inet address |awk '!/: lo/ {print $2}')
for dev in ${IFACE}
do
temp_ping=$(ping -c 1 -I ${dev} ${BMC_IPv4})
[ $? -ne 0 ] && continue
printf -- "%s" "$temp_ping"| awk 'NR==1{print $5}' && break
ping -c 1 -I ${dev} ${BMC_IPv4} > /dev/null 2>&1
done
}
config_bmc_alert()
{
# Do two things
# Set/Reset TRAP IP in BMC
# Enable/Disable PEF alerting in BMC for TRAP
# Get Host's IP that the BMC can send traps to
TRAPD_IP=$(get_host_ip)
# Set Host's IP as the alert destination in the BMC
valid_ip ${TRAPD_IP} && config_bmc_alert_dest "${ACTION}"
valid_ip ${TRAPD_IP} && bmc_alert_dest "${ACTION}"
# Enable/Disable alerting on the LAN channel
[ $RETVAL -eq 0 ] && set_ipmi_pef "${ACTION}"
return $RETVAL
# Enable alerting on the LAN channel
[ $RETVAL -eq 0 ] && set_ipmi_alert "${ACTION}"
}
write_trapd_conf()
{
printf "###############################################\n"
printf "# Automatically created by %s #\n" "${SCRIPT_NAME}"
printf "forward default %s\n" "${FORWARD_HOST}"
printf "forward %s %s\n" "${BMC_OID}*" "${FORWARD_HOST}"
printf "###############################################\n"
}
@ -254,9 +236,10 @@ config_trapd()
{
# Proceed only if snmptrapd is available on the system
if [ -f ${TRAPD_CONF} ]; then
write_trapd_conf > ${TRAPD_BMC_CONF} || RETVAL=11
write_trapd_conf > ${TRAPD_LOCAL_CONF}
[ $? -ne 0 ] && RETVAL=11
else
RETVAL=11
return 1
fi
}
@ -266,7 +249,6 @@ trap_sink_exists()
# multiple
FORWARD_HOST=$(awk '/^trap.*sink/{print $2}; /^informsink/{print $2}' \
/etc/snmp/snmpd*conf | head -1)
if [ -z "${FORWARD_HOST}" ]; then
# there is no trapsink setup.
return 1
@ -279,20 +261,19 @@ trap_sink_exists()
trap_forward()
{
NO_TRAP=0
ACTION=${1} # enable or disable
ACTION=${1} # set or reset
if [ "${ACTION}" = "enable" ]; then
if [ "${ACTION}" = "set" ]; then
# Get trapd config,
if trap_sink_exists; then
config_bmc_alert && config_trapd
config_trapd && config_bmc_alert
else
# exit silently if there is no sink
NO_TRAP=1
fi
else
if [ -f ${TRAPD_BMC_CONF} ]; then
rm -f ${TRAPD_BMC_CONF} >/dev/null 2>&1
config_bmc_alert
if [ -f ${TRAPD_LOCAL_CONF} ]; then
rm -f ${TRAPD_LOCAL_CONF} >/dev/null 2>&1
else
NO_TRAP=1
fi
@ -307,6 +288,7 @@ service_reload()
service $1 reload
[ $? -ne 0 ] && RETVAL=6
fi
return
}
#############################################################################
@ -314,12 +296,11 @@ start()
{
if bmc_info_exists && check_snmp; then
touch ${LOCKFILE}
set_snmpd_conf_path && set_snmp_proxy
[ $RETVAL -eq 0 ] && service_reload snmpd
if [ "${TRAP_FORWARD}" = "yes" ]; then
trap_forward "enable"
trap_forward "set"
[ $RETVAL -eq 0 ] && [ $NO_TRAP -eq 0 ] && \
service_reload snmptrapd
fi
@ -335,11 +316,10 @@ stop()
[ $RETVAL -eq 0 ] && service_reload snmpd
if [ "${TRAP_FORWARD}" = "yes" ]; then
trap_forward "disable"
trap_forward "reset"
[ $RETVAL -eq 0 ] && [ $NO_TRAP -eq 0 ] && \
service_reload snmptrapd
fi
rm -f ${LOCKFILE}
fi
}
@ -349,13 +329,12 @@ status()
{
eval_gettext "${SCRIPT_NAME}: snmp proxy to BMC is "
# Checking for lockfile is better.
#if grep -q "^proxy" "${SNMPD_BMC_CONF}" > /dev/null 2>&1 ; then
#if grep -q "^proxy" "${SNMPD_LOCAL_CONF}" > /dev/null 2>&1 ; then
if [ -f ${LOCKFILE} ]; then
eval_gettext "set"
else
eval_gettext "not set"
fi
echo
RETVAL=0
}
@ -381,10 +360,10 @@ case "$RETVAL" in
0|1) ;;
2) eval_gettext "${SCRIPT_NAME}: failed to read ${BMC_INFO} " 1>&2 ;;
3) eval_gettext "${SCRIPT_NAME}: failed to get proxy config." 1>&2 ;;
4) eval_gettext "${SCRIPT_NAME}: failed to set ${SNMPD_BMC_CONF}." 1>&2 ;;
4) eval_gettext "${SCRIPT_NAME}: failed to set ${SNMPD_LOCAL_CONF}." 1>&2 ;;
5) eval_gettext "${SCRIPT_NAME}: failed to disable snmp proxy." 1>&2 ;;
6) eval_gettext "${SCRIPT_NAME}: failed to reload snmpd." 1>&2 ;;
7) eval_gettext "${SCRIPT_NAME}: failed to set snmpd config." 1>&2 ;;
7) eval_gettext "${SCRIPT_NAME}: failed to update ${SYSCONF}." 1>&2 ;;
8) eval_gettext "${SCRIPT_NAME}: failed to set IPMI alert dest." 1>&2 ;;
9) eval_gettext "${SCRIPT_NAME}: no free IPMI alert dest." 1>&2 ;;
10) eval_gettext "${SCRIPT_NAME}: failed to set IPMI PEF." 1>&2 ;;
@ -396,7 +375,6 @@ esac
if [ ${RETVAL} -gt 1 ]; then
eval_gettext " Return code: ${RETVAL}"; echo
fi
exit ${RETVAL}
#############################################################################
# end of file

View File

@ -0,0 +1,5 @@
For more information about setting up your Debian system with IPMI
please see the excellent howto by Tim Small:
http://buttersideup.com/docs/howto/IPMI_on_Debian.html

324
ipmitool/debian/changelog Normal file
View File

@ -0,0 +1,324 @@
version (1.8.11) unstable; urgency=low
* Fix new GCC compilation issues in regards to Packing
* Fix Tracker bug #1642710 - ipmi_kcs_drv being loaded/unloaded
for 2.4 kernel instead of ipmi_si_drv driver module
* New -y option added to allow specification of kg keys with
non-printable characters
* New -K option added to allow kgkey settings via environmental
variable IPMI_KGKEY
* Generic device support added for EEPROM with SDR Type 10h (gendev)
* Fix to lan-bridging for a double-bridging crash and to fix
an issue with bridging multiple concurrent requests and
erroneous handling of raw Send Message
* Lanplus fix for commands like 'sensor list' without the -t option
causing wrong double bridged requests of a sensor is located
on another satellite controller
* Fix lan and lanplus request list entry removal bugs
* Fix non-working issue when trying to send a bridge message with
Cipher 3
* Change bridge message handling to reuse command ipmi_lan_poll_recv
* Added PICMG 2.0 and 2.3 support
* Fix PICMG (ATCA) extension verification and reversal of BCD encoded
values for "major" and "minor" fields
* Add IANA support for Pigeon Point
* Add OEM SW/FW Record identification
* Fix to include I2C and LUN addresses so sensors are correctly managed
* Patch ID 1990560 to get readings from non-linear analog sensors
* Add support for SOL payload status command
* SOL set parameter range checking added
* Fixed SOL activate options usage
* Fixed crashes when parsing 'sol payload' and 'tsol' cmds (#216967)
* Added retries to SOL keepalive
* Fixed wrong mask values for Front Panel disable/enable status
* Add support to access fru internal use area
* Add support for new PICMG 3.0 R3.0 (March 24, 2008) to allow
blocks of data within the FRU storage area to be write
protected.
* Fix node reporting in GUID; Tracker bug #2339675
* Fix watchdog use/action print strings
* Fix endian bug in SDR add from file; Tracker bug #2075258
* Fix crash when dumping SDRs in a file and there's an error
getting an SDR; improve algorithm for optimal packet size
* Fix occasional SDR dump segfault; #1793076
* Allow ipmitool sel delete to accept hex list entry numbers
* Fix SEL total space reporting.
* Fix for garbage sensor threshold values reported when none
returned. Tracker Bug #863748
* ipmievd change to Monitor %used in SEL buffer and log warnings when
the buffer is 80% and 100% full
-- Petter Reinholdtsen <pere@debian.org> Wed, 25 Feb 2009 09:44:31 +0200
ipmitool (1.8.10) unstable; urgency=low
* New upstream version.
* Patch to allow Debian package builds from cvs.
-- Petter Reinholdtsen <pere@debian.org> Fri, 8 Aug 2008 09:44:31 +0200
ipmitool (1.8.7-2) unstable; urgency=low
* Fix typo in init.d/ipmievd. (Closes: #361309)
-- Petter Reinholdtsen <pere@debian.org> Sat, 8 Apr 2006 06:44:31 +0200
ipmitool (1.8.7-1) unstable; urgency=low
* New upstream version.
- Dropped nuclear clause from the copyright. Updated debian/copyright
to reflect this.
- ipmievd now store pid in /var/run/ipmievd.pid. Adjust init.d
script to use it.
* Rename /etc/default/ipmievd variable IPMIEVD_OPTS is renamed to
IPMIEVD_OPTIONS to stay compatible with upstream and other
distributions. Add backwards compatibility code with a warning to
the users of the old variable.
-- Petter Reinholdtsen <pere@debian.org> Sun, 26 Mar 2006 21:11:08 +0200
ipmitool (1.8.6-2) unstable; urgency=low
* Add ia64 as an supported arch. (Closes: #355930)
-- Petter Reinholdtsen <pere@debian.org> Fri, 10 Mar 2006 23:34:50 +0100
ipmitool (1.8.6-1) unstable; urgency=low
* New upstream version.
- Avoid crashing when setting lan IP address. (Closes: #351205)
* Avoid changing history by reverding upstream change
to email addresses in debian/changelog.
* Correct typo in control file: Suggest -> Suggests. Thanks
to Philipp Matthias Hahn for the report.
* Add init.d/ipmievd script. Based on script from Elmar Hoffmann,
slightly modified to use lsb-base functions. Added dependency on
lsb-base. (Closes: #345994)
-- Petter Reinholdtsen <pere@debian.org> Sun, 26 Feb 2006 10:31:14 +0100
ipmitool (1.8.2-2) unstable; urgency=low
* Add build-dependency on 'libreadline5-dev | libreadline-dev' to make
sure all archs get readline support. (Closes: #326341)
* Add build-dependency on libssl-dev to enable SSL support on
all archs.
* Updated Standards-Version to 3.6.2.1. (No updates required)
-- Petter Reinholdtsen <pere@debian.org> Sat, 3 Sep 2005 19:18:51 +0200
ipmitool (1.8.2-1) unstable; urgency=low
* New upstream release.
- Fix FRU reading for large (>255 bytes) areas.
- Overhaul to ipmievd to support SEL polling in addition to OpenIPMI.
- Fix LAN parameter segfault when no Ciphers supported by
BMC. (Closes: #306806)
- Fix IPMIv2 support on Intel v2 BMCs (use -o intelplus).
- Separate option parsing code from main ipmitool source file.
- Add raw I2C support with IPMI Master Read-Write command.
- Add support for new 'sdr elist' extended output format.
- Add support for listing sensors by type with 'sdr type' command.
- Add support for new 'sel elist' extended output format that
cross-references events with sensors.
- Add support for sending dynamically generated platform events
based on existing sensor information.
- New '-S' argument to read local SDR cache created with 'sdr dump'.
- Updated manpage for ipmitool and ipmievd. (Closes: #306894)
* Correct the upstream URL in debian/changelog to the current one.
* Suggest package openipmi. (Closes: #305629)
* Add debian/watch file to detect new source versions.
-- Petter Reinholdtsen <pere@debian.org> Sun, 5 Jun 2005 10:29:18 +0200
ipmitool (1.8.1-1) unstable; urgency=low
* New upstream release.
* Install ipmievd into /usr/sbin/.
-- Petter Reinholdtsen <pere@debian.org> Thu, 7 Apr 2005 01:18:44 +0200
ipmitool (1.8.0-1) unstable; urgency=low
* Initial upload into Debian, based on the upstream build
rules. (Closes: #299924)
* Convert debian/changelog to UTF-8.
* Change section from 'contrib' to 'utils'.
* Build-depend on debhelper (>> 4.0.0) to match the rules file.
* Set Standards-version to 3.6.1.
* Make sure binary dependency is properly generated.
* Add long description, copied from the project README.
* Drop useless provides 'ipmitool', as the package is called 'ipmitool'.
* Don't install the COPYING file, as the license text already is
included in debian/copyright.
* Remove unused parts of the rules file.
* Correct clean target in rules file, to use 'distclean' and remove
configure-stamp not bogus config-stamp.
-- Petter Reinholdtsen <pere@debian.org> Sun, 3 Apr 2005 20:52:02 +0200
ipmitool (1.8.0) unstable; urgency=low
* Fix IPMIv2.0 issues
* Fix chassis boot parameter support
* Add support for linear sensors
-- Duncan Laurie <duncan@iceblink.org> Wed, Mar 16 2005 17:08:12 -0700
ipmitool (1.7.1) unstable; urgency=low
* Update bmc plugin to work with new Solaris bmc driver (new ioctl
for interface detection and new STREAMS message-based interface).
-- Seth Goldberg <sethmeisterg@hotmail.com> Mon, Mar 7 2005 18:03:00 -0800
ipmitool (1.7.0) unstable; urgency=low
* Propogate errors correctly so exit status will be useful
* More consistent display of errors including completion code text
* Errors and debug is send to stderr now
* New "sel get" command that will print details about SEL entry
and corresponding SDR records as well as FRUs via entity association
* Improved event generator, now supports reading events from text file
* New "-o oemtype" option for specifying OEM boards
exsting types are "supermicro" and "intelwv2"
* New PEF subsystem
* New "bmc" plugin for Solaris 10 x86
* Many bugfixes and contributed patches
-- Duncan Laurie <duncan@iceblink.org> Fri, Jan 7 2005 19:58:22 -0700
ipmitool (1.6.2) unstable; urgency=low
* Support for Supermicro BMC OEM authentication method
-- Duncan Laurie <duncan@iceblink.org> Mon, 16 Nov 2004 08:20:01 -0700
ipmitool (1.6.1) unstable; urgency=low
* Fix minor problem with LAN parameter setting
-- Duncan Laurie <duncan@iceblink.org> Wed, 29 Sep 2004 11:19:17 -0700
ipmitool (1.6.0) unstable; urgency=low
* Add a README
* Add support for IPMIv2 and Serial-over-LAN from Newisys
* Add Solaris x86 lipmi interface
* Add support for building Solaris packages
* Add support for building RPMs as non-root user
* Fix segfault when doing "sel list" (from Matthew Braithwaite)
* Fix "chassis identify" on some BMCs (from ebrower@sourceforge)
* Add "bmc info" and related output (from ebrower@sourceforge)
* new "shell" and "exec" commands
* lots of other contributed patches
-- Duncan Laurie <duncan@iceblink.org> Thu, 9 Sep 2004 21:39:37 -0700
ipmitool (1.5.9) unstable; urgency=low
* Add ability to get a particular sensor by name
* Add ability to set a particular sensor threshold
* Add support for displaying V2 channel authentication levels
* Add README for rrdtool scripts in contrib directory
* Improve lan interface retry handling
* Support prompting for password or reading from environment
* Move chaninfo command into channel subcommand
* Fix reservation ID handling when two sessions open to BMC
* Fix reading of large FRU data
* Add configure option for changing binary to ipmiadm for Solaris
* Fix compile problem on Solaris 8
-- Duncan Laurie <duncan@iceblink.org> Sat, 27 Mar 2004 00:11:37 -0700
ipmitool (1.5.8) unstable; urgency=low
* Enable static compilation of interfaces
* Fix types to be 64-bit safe
* Fix compilation problems on Solaris
* Fix multiple big-endian problems for Solaris/SPARC
* Fix channel access to save settings to NVRAM
* Set channel privilege limit to ADMIN during "access on"
* Enable gratuitous ARP in bmcautoconf.sh
* Add support for Linux kernel panic messages in SEL output
* Add support for type 3 SDR records
-- Duncan Laurie <duncan@iceblink.org> Tue, 27 Jan 2004 16:23:25 -0700
ipmitool (1.5.7) unstable; urgency=low
* add IPMIv1.5 eratta fixes
* additions to FRU printing and FRU multirecords
* better handling of SDR printing
* contrib scripts for creating rrdtool graphs
-- Duncan Laurie <duncan@iceblink.org> Mon, 5 Jan 2004 17:29:50 -0700
ipmitool (1.5.6) unstable; urgency=low
* Fix SEL event decoding for generic events
* Handle empty SEL gracefully when doing "sel list"
* Fix sdr handling of sensors that do not return a reading
* Fix for CSV display of sensor readings/units from Fredrik Öhrn
-- Duncan Laurie <duncan@iceblink.org> Thu, 4 Dec 2003 14:47:19 -0700
ipmitool (1.5.5) unstable; urgency=low
* Add -U option for setting LAN username
* Fix -v usage for plugin interfaces
-- Duncan Laurie <duncan@iceblink.org> Tue, 25 Nov 2003 15:10:48 -0700
ipmitool (1.5.4) unstable; urgency=low
* Put interface plugin API into library
* Fix ipmievd
-- Duncan Laurie <duncan@iceblink.org> Fri, 14 Nov 2003 15:16:34 -0700
ipmitool (1.5.3) unstable; urgency=low
* Add -g option to work with grizzly bmc
-- Duncan Laurie <duncan@iceblink.org> Mon, 3 Nov 2003 18:04:07 -0700
ipmitool (1.5.2) unstable; urgency=low
* add support for setting gratuitous arp interval
-- Duncan Laurie <duncan@iceblink.org> Fri, 24 Oct 2003 11:00:00 -0700
ipmitool (1.5.1) unstable; urgency=low
* better SEL support
* fix display bug in SDR list
-- Duncan Laurie <duncan@iceblink.org> Wed, 8 Oct 2003 17:28:51 -0700
ipmitool (1.5.0) unstable; urgency=low
* more robust UDP packet handling
* add Intel IMB driver support
* use autoconf/automake/libtool
-- Duncan Laurie <duncan@iceblink.org> Fri, 5 Sep 2003 11:57:32 -0700
ipmitool (1.2-1) unstable; urgency=low
* New command line option parsing
* More chassis commands supported
-- Duncan Laurie <duncan@iceblink.org> Wed, 2 Apr 2003 17:44:17 -0700
ipmitool (1.1-1) unstable; urgency=low
* Minor fixes.
-- Duncan Laurie <duncan@iceblink.org> Tue, 1 Apr 2003 14:31:10 -0700
ipmitool (1.0-1) unstable; urgency=low
* Initial Release.
-- Duncan Laurie <duncan@iceblink.org> Sun, 30 Mar 2003 21:30:46 -0700

28
ipmitool/debian/control Normal file
View File

@ -0,0 +1,28 @@
Source: ipmitool
Section: utils
Priority: optional
Maintainer: Petter Reinholdtsen <pere@debian.org>
Uploaders: Duncan Laurie <duncan@iceblink.org>
Build-Depends: debhelper (>> 4.0.0), libreadline5-dev | libreadline-dev, libssl-dev, autoconf, automake1.9 | automake, autotools-dev, libtool
Standards-Version: 3.6.2.1
Package: ipmitool
Architecture: i386 amd64 ia64
Depends: ${shlibs:Depends}, lsb-base
Suggests: openipmi
Description: utility for IPMI control with kernel driver or LAN interface
A utility for managing and configuring devices that support the
Intelligent Platform Management Interface. IPMI is an open standard
for monitoring, logging, recovery, inventory, and control of hardware
that is implemented independent of the main CPU, BIOS, and OS. The
service processor (or Baseboard Management Controller, BMC) is the
brain behind platform management and its primary purpose is to handle
the autonomous sensor monitoring and event logging features.
.
The ipmitool program provides a simple command-line interface to this
BMC. It features the ability to read the sensor data repository
(SDR) and print sensor values, display the contents of the System
Event Log (SEL), print Field Replaceable Unit (FRU) inventory
information, read and set LAN configuration parameters, and perform
remote chassis power control.

36
ipmitool/debian/copyright Normal file
View File

@ -0,0 +1,36 @@
This package was debianized by Duncan Laurie before
2003-11-18 17:55:21 +0100.
It was downloaded from <URL:http://ipmitool.sourceforge.net/>
Upstream Author: Duncan Laurie <duncan@iceblink.org>
Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
Redistribution of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Redistribution 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.
Neither the name of Sun Microsystems, Inc. or the names of
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
This software is provided "AS IS," without a warranty of any kind.
ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

4
ipmitool/debian/dirs Normal file
View File

@ -0,0 +1,4 @@
usr/bin
usr/sbin
usr/share/ipmitool
usr/share/doc/ipmitool

2
ipmitool/debian/docs Normal file
View File

@ -0,0 +1,2 @@
README
AUTHORS

View File

@ -0,0 +1,99 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: ipmievd
# Required-Start: $local_fs $remote_fs $syslog
# Required-Stop: $local_fs $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: IPMI event daemon
# Description: ipmievd is a daemon which will listen for events
# from the BMC that are being sent to the SEL and
# also log those messages to syslog.
### END INIT INFO
#
# Author: Elmar Hoffmann <elho@elho.net>
# Licence: This script is public domain using the same
# licence as ipmitool itself.
# Modified by: Petter Reinholdtsen
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="IPMI event daemon"
NAME=ipmievd
DAEMON=/usr/sbin/$NAME
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
. /etc/default/rcS
# Options used by ipmievd.
#
# "open" uses the asynchronous event notification from the OpenIPMI
# kernel driver, "sel" uses active polling of the contents of the SEL
# for new events.
#
# Need to force 'daemon' mode, to make sure messages are sent to
# syslog and the program forks into the background.
#
# Se ipmievd(8) for more info.
IPMIEVD_OPTIONS="open daemon"
# Read config file if it is present.
[ -f /etc/default/$NAME ] && . /etc/default/$NAME
# Backwards compatibility with version 1.8.6-2 and 1.8.6-1. The
# variable was renamed to be compatible with upstream, SuSe and RedHat.
if [ -n "$IPMIEVD_OPTS" ]; then
echo "warning: /etc/default/$NAME variable IPMIEVD_OPTS should be renamed to IPMIEVD_OPTIONS"
IPMIEVD_OPTIONS="$IPMIEVD_OPTS"
fi
#
# Function that starts the daemon/service.
#
d_start() {
start-stop-daemon --start --quiet --exec $DAEMON -- $IPMIEVD_OPTIONS
}
#
# Function that stops the daemon/service.
#
d_stop() {
start-stop-daemon --stop --quiet --name $NAME --exec $DAEMON
}
CODE=0
case "$1" in
start)
[ "$VERBOSE" != no ] && log_begin_msg "Starting $DESC" "$NAME"
d_start || CODE=$?
[ "$VERBOSE" != no ] && log_end_msg $CODE
exit $CODE
;;
stop)
log_begin_msg "Stopping $DESC" "$NAME"
d_stop || CODE=$?
log_end_msg $CODE
exit $CODE
;;
restart|force-reload)
log_begin_msg "Restarting $DESC" "$NAME"
d_stop || true
sleep 1
d_start || CODE=$?
log_end_msg $CODE
exit $CODE
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0

118
ipmitool/debian/rules Executable file
View File

@ -0,0 +1,118 @@
#!/usr/bin/make -f
#export DH_VERBOSE=1
export DH_COMPAT=4
export DH_OPTIONS
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
configure: configure-stamp
configure-stamp:
dh_testdir
./bootstrap
./configure --prefix=/usr \
--with-kerneldir \
--mandir=/usr/share/man
touch configure-stamp
#Architecture
build: build-arch build-indep
build-arch: build-arch-stamp
build-arch-stamp: configure-stamp
# Add here commands to compile the arch part of the package.
$(MAKE)
build-indep: build-indep-stamp
build-indep-stamp: configure-stamp
# Add here commands to compile the indep part of the package.
#$(MAKE) doc
clean:
dh_testdir
dh_testroot
rm -f build-arch-stamp build-indep-stamp configure-stamp
# Add here commands to clean up after the build process.
-$(MAKE) distclean
dh_clean
install: install-arch #install-indep
install-indep:
dh_testdir
dh_testroot
dh_clean -k -i
dh_installdirs -i
# Add here commands to install the indep part of the package into
# debian/<package>-doc.
#INSTALLDOC#
# $(MAKE) install-doc DESTDIR=$(CURDIR)/debian/tmp/ipmitool-doc
# dh_movefiles -i
install-arch:
dh_testdir
dh_testroot
dh_clean -k -a
dh_installdirs -a
# Add here commands to install the arch part of the package into
# debian/tmp.
$(MAKE) install DESTDIR=$(CURDIR)/debian/ipmitool
# No need to have two copies of the license text in the package.
$(RM) $(CURDIR)/debian/ipmitool/usr/share/doc/ipmitool/COPYING
# Move upstream changelog to correct filename.
mv $(CURDIR)/debian/ipmitool/usr/share/doc/ipmitool/ChangeLog \
$(CURDIR)/debian/ipmitool/usr/share/doc/ipmitool/changelog
# Compress to avoid lintian warning. Not sure why dh_compress
# isn't fixing this.
gzip -9 $(CURDIR)/debian/ipmitool/usr/share/doc/ipmitool/changelog
# dh_movefiles -a
# Must not depend on anything. This is to be called by
# binary-arch/binary-multi
# in another 'make' thread.
binary-common:
dh_testdir
dh_testroot
dh_installdocs
dh_installchangelogs
dh_installinit --name ipmievd
dh_link
dh_strip
dh_compress
dh_fixperms
dh_makeshlibs
dh_shlibdeps
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture independant packages using the common target.
binary-indep: build-indep install-indep
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
# Build architecture dependant packages using the common target.
binary-arch: build-arch install-arch
$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
binary: binary-arch #binary-indep
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure

6
ipmitool/debian/watch Normal file
View File

@ -0,0 +1,6 @@
# Rename this file to "watch" and then you can run the "uscan" command
# to check for upstream updates and more.
# Site Directory Pattern Version Script
version=2
http://heanet.dl.sourceforge.net/sourceforge/ipmitool/ipmitool-(.*).tar.bz2
# debian uupdate

View File

@ -145,7 +145,7 @@ placed at the end of commands to get option usage help.
> ipmievd help
.br
Commands:
open Use OpenIPMI for asynchronous notification of events
open Use OpenIPMI for asyncronous notification of events
sel Poll SEL for notification of events
.TP
@ -217,16 +217,6 @@ Reading Sensors...
.br
Waiting for Events...
.br
.SH FILES
.TP
.B @IANADIR@/enterprise-numbers
system IANA PEN registry taken from http://www.iana.org/assignments/enterprise-numbers
.TP
.B ~/@IANAUSERDIR@/enterprise-numbers
user's override for the system IANA PEN registry, this file if it exists is loaded instead
of the system registry (see above).
.SH "AUTHOR"
Duncan Laurie <duncan@iceblink.org>
.SH "SEE ALSO"

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,7 @@
MAINTAINERCLEANFILES = Makefile.in
noinst_HEADERS = log.h bswap.h hpm2.h helper.h ipmi.h ipmi_cc.h ipmi_intf.h \
noinst_HEADERS = log.h bswap.h helper.h ipmi.h ipmi_cc.h ipmi_intf.h \
ipmi_chassis.h ipmi_entity.h ipmi_fru.h ipmi_hpmfwupg.h ipmi_lanp.h \
ipmi_sdr.h ipmi_sel.h ipmi_sol.h ipmi_mc.h ipmi_raw.h \
ipmi_channel.h ipmi_sensor.h ipmi_event.h ipmi_session.h \
@ -38,5 +38,5 @@ noinst_HEADERS = log.h bswap.h hpm2.h helper.h ipmi.h ipmi_cc.h ipmi_intf.h \
ipmi_oem.h ipmi_sdradd.h ipmi_isol.h ipmi_sunoem.h ipmi_picmg.h \
ipmi_fwum.h ipmi_main.h ipmi_tsol.h ipmi_firewall.h \
ipmi_kontronoem.h ipmi_ekanalyzer.h ipmi_gendev.h ipmi_ime.h \
ipmi_delloem.h ipmi_dcmi.h ipmi_vita.h ipmi_sel_supermicro.h \
ipmi_cfgp.h ipmi_lanp6.h ipmi_quantaoem.h
ipmi_delloem.h ipmi_dcmi.h

View File

@ -37,10 +37,6 @@
#include <inttypes.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h> /* For free() */
#include <stdbool.h>
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
#ifndef TRUE
#define TRUE 1
@ -54,12 +50,6 @@
#define tboolean int
#endif
#ifdef __GNUC__
#define __UNUSED__(x) x __attribute__((unused))
#else
#define __UNUSED__(x) x
#endif
/* IPMI spec. - UID 0 reserved, 63 maximum UID which can be used */
#ifndef IPMI_UID_MIN
# define IPMI_UID_MIN 1
@ -71,7 +61,7 @@
struct ipmi_intf;
struct valstr {
uint32_t val;
uint16_t val;
const char * str;
};
struct oemvalstr {
@ -80,12 +70,8 @@ struct oemvalstr {
const char * str;
};
const char *
specific_val2str(uint32_t val,
const struct valstr *specific,
const struct valstr *generic);
const char *val2str(uint32_t val, const struct valstr * vs);
const char *oemval2str(uint32_t oem, uint32_t val, const struct oemvalstr * vs);
const char * val2str(uint16_t val, const struct valstr * vs);
const char * oemval2str(uint32_t oem,uint16_t val, const struct oemvalstr * vs);
int str2double(const char * str, double * double_ptr);
int str2long(const char * str, int64_t * lng_ptr);
@ -97,117 +83,22 @@ int str2ushort(const char * str, uint16_t * ushrt_ptr);
int str2char(const char * str, int8_t * chr_ptr);
int str2uchar(const char * str, uint8_t * uchr_ptr);
bool args2buf(int argc, char *argv[], uint8_t *out, size_t len);
int eval_ccode(const int ccode);
int is_fru_id(const char *argv_ptr, uint8_t *fru_id_ptr);
int is_ipmi_channel_num(const char *argv_ptr, uint8_t *channel_ptr);
int is_ipmi_user_id(const char *argv_ptr, uint8_t *ipmi_uid_ptr);
int is_ipmi_user_priv_limit(const char *argv_ptr, uint8_t *ipmi_priv_limit_ptr);
uint32_t str2val32(const char *str, const struct valstr *vs);
static inline uint16_t str2val(const char *str, const struct valstr *vs)
{
return (uint16_t)str2val32(str, vs);
}
uint16_t str2val(const char * str, const struct valstr * vs);
void print_valstr(const struct valstr * vs, const char * title, int loglevel);
void print_valstr_2col(const struct valstr * vs, const char * title, int loglevel);
uint16_t buf2short(uint8_t * buf);
uint32_t buf2long(uint8_t * buf);
#define BUF2STR_MAXIMUM_OUTPUT_SIZE (3*1024 + 1)
const char * buf2str_extended(const uint8_t *buf, int len, const char *sep);
const char * buf2str(const uint8_t *buf, int len);
int str2mac(const char *arg, uint8_t *buf);
const char * mac2str(const uint8_t *buf);
int ipmi_parse_hex(const char *str, uint8_t *out, int size);
const char * buf2str(uint8_t * buf, int len);
void printbuf(const uint8_t * buf, int len, const char * desc);
uint8_t ipmi_csum(uint8_t * d, int s);
FILE * ipmi_open_file(const char * file, int rw);
void ipmi_start_daemon(struct ipmi_intf *intf);
uint16_t ipmi_get_oem_id(struct ipmi_intf *intf);
#define IS_SET(v, b) ((v) & (1 << (b)))
/**
* Free the memory and clear the pointer.
* @param[in] ptr - a pointer to your pointer to free.
*/
static inline void free_n(void *ptr) {
void **pptr = (void **)ptr;
if (pptr && *pptr) {
free(*pptr);
*pptr = NULL;
}
}
/* le16toh(), hto16le(), et. al. don't exist for Windows or Apple */
/* For portability, let's simply define our own versions here */
/* IPMI is always little-endian */
static inline uint16_t ipmi16toh(void *ipmi16)
{
uint8_t *ipmi = (uint8_t *)ipmi16;
uint16_t h;
h = ipmi[1] << 8; /* MSB */
h |= ipmi[0]; /* LSB */
return h;
}
static inline void htoipmi16(uint16_t h, uint8_t *ipmi)
{
ipmi[0] = h & 0xFF; /* LSB */
ipmi[1] = h >> 8; /* MSB */
}
static inline uint32_t ipmi24toh(void *ipmi24)
{
uint8_t *ipmi = (uint8_t *)ipmi24;
uint32_t h = 0;
h = ipmi[2] << 16; /* MSB */
h |= ipmi[1] << 8;
h |= ipmi[0]; /* LSB */
return h;
}
static inline void htoipmi24(uint32_t h, uint8_t *ipmi)
{
ipmi[0] = h & 0xFF; /* LSB */
ipmi[1] = (h >> 8) & 0xFF;
ipmi[2] = (h >> 16) & 0xFF; /* MSB */
}
static inline uint32_t ipmi32toh(void *ipmi32)
{
uint8_t *ipmi = ipmi32;
uint32_t h;
h = ipmi[3] << 24; /* MSB */
h |= ipmi[2] << 16;
h |= ipmi[1] << 8;
h |= ipmi[0]; /* LSB */
return h;
}
static inline void htoipmi32(uint32_t h, uint8_t *ipmi)
{
ipmi[0] = h & 0xFF; /* LSB */
ipmi[1] = (h >> 8) & 0xFF;
ipmi[2] = (h >> 16) & 0xFF;
ipmi[3] = (h >> 24) & 0xFF; /* MSB */
}
uint8_t *array_byteswap(uint8_t *buffer, size_t length);
uint8_t *array_ntoh(uint8_t *buffer, size_t length);
uint8_t *array_letoh(uint8_t *buffer, size_t length);
#define ipmi_open_file_read(file) ipmi_open_file(file, 0)
#define ipmi_open_file_write(file) ipmi_open_file(file, 1)

View File

@ -46,7 +46,6 @@
#endif
#define IPMI_BUF_SIZE 1024
#define IPMI_MAX_MD_SIZE 0x20
#if HAVE_PRAGMA_PACK
#define ATTRIBUTE_PACKING
@ -212,13 +211,13 @@ struct ipmi_rs {
uint32_t console_id;
uint8_t bmc_rand[16]; /* Random number generated by the BMC */
uint8_t bmc_guid[16];
uint8_t key_exchange_auth_code[IPMI_MAX_MD_SIZE];
uint8_t key_exchange_auth_code[20];
} rakp2_message;
struct {
uint8_t message_tag;
uint8_t rakp_return_code;
uint32_t console_id;
uint8_t integrity_check_value[IPMI_MAX_MD_SIZE];
uint8_t integrity_check_value[20];
} rakp4_message;
struct {
uint8_t packet_sequence_number;
@ -252,17 +251,8 @@ struct ipmi_rs {
/* These values are IANA numbers */
/************************************************************************
* Add ID String for IANA Enterprise Number of IBM & ADLINK
* https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers
************************************************************************/
typedef enum IPMI_OEM {
IPMI_OEM_UNKNOWN = 0,
IPMI_OEM_DEBUG = 0xFFFFFE, /* Hoping IANA won't hit this soon */
IPMI_OEM_RESERVED = 0x0FFFFF, /* As per IPMI 2.0 specification */
/* 2 for [IBM] */
IPMI_OEM_IBM_2 = 2,
IPMI_OEM_HP = 11,
IPMI_OEM_SUN = 42,
IPMI_OEM_NOKIA = 94,
@ -270,7 +260,6 @@ typedef enum IPMI_OEM {
IPMI_OEM_HITACHI_116 = 116,
IPMI_OEM_NEC = 119,
IPMI_OEM_TOSHIBA = 186,
IPMI_OEM_ERICSSON = 193,
IPMI_OEM_INTEL = 343,
IPMI_OEM_TATUNG = 373,
IPMI_OEM_HITACHI_399 = 399,
@ -278,13 +267,9 @@ typedef enum IPMI_OEM {
IPMI_OEM_LMC = 2168,
IPMI_OEM_RADISYS = 4337,
IPMI_OEM_BROADCOM = 4413,
/* 4769 for [IBM Corporation] */
IPMI_OEM_IBM_4769 = 4769,
IPMI_OEM_MAGNUM = 5593,
IPMI_OEM_TYAN = 6653,
IPMI_OEM_QUANTA = 7244,
IPMI_OEM_VIKING = 9237,
IPMI_OEM_ADVANTECH = 10297,
IPMI_OEM_NEWISYS = 9237,
IPMI_OEM_FUJITSU_SIEMENS = 10368,
IPMI_OEM_AVOCENT = 10418,
IPMI_OEM_PEPPERCON = 10437,
@ -295,15 +280,8 @@ typedef enum IPMI_OEM {
IPMI_OEM_RARITAN = 13742,
IPMI_OEM_KONTRON = 15000,
IPMI_OEM_PPS = 16394,
/* 20301 for [IBM eServer X] */
IPMI_OEM_IBM_20301 = 20301,
IPMI_OEM_AMI = 20974,
/* 24339 for [ADLINK TECHNOLOGY INC.] */
IPMI_OEM_ADLINK_24339 = 24339,
IPMI_OEM_NOKIA_SOLUTIONS_AND_NETWORKS = 28458,
IPMI_OEM_VITA = 33196,
IPMI_OEM_SUPERMICRO_47488 = 47488,
IPMI_OEM_YADRO = 49769,
IPMI_OEM_NOKIA_SIEMENS_NETWORKS = 28458
} IPMI_OEM;
extern const struct valstr completion_code_vals[];

View File

@ -37,11 +37,9 @@
# include <config.h>
#endif
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_intf.h>
#define IPMI_GET_CHANNEL_AUTH_CAP 0x38
#define IPMI_SET_CHANNEL_ACCESS 0x40
#define IPMI_GET_CHANNEL_ACCESS 0x41
#define IPMI_GET_CHANNEL_INFO 0x42
#define IPMI_SET_USER_ACCESS 0x43
@ -51,98 +49,6 @@
#define IPMI_SET_USER_PASSWORD 0x47
#define IPMI_GET_CHANNEL_CIPHER_SUITES 0x54
/* These are for channel_info_t.session_support */
#define IPMI_CHANNEL_SESSION_LESS 0x00
#define IPMI_CHANNEL_SESSION_SINGLE 0x40
#define IPMI_CHANNEL_SESSION_MULTI 0x80
#define IPMI_CHANNEL_SESSION_BASED 0xC0
/* Fixed channel numbers as per Table 6-1 */
typedef enum {
CH_PRIMARY_IPMB,
CH_IMP_SPECIFIC_1,
CH_IMP_SPECIFIC_2,
CH_IMP_SPECIFIC_3,
CH_IMP_SPECIFIC_4,
CH_IMP_SPECIFIC_5,
CH_IMP_SPECIFIC_6,
CH_IMP_SPECIFIC_7,
CH_IMP_SPECIFIC_8,
CH_IMP_SPECIFIC_9,
CH_IMP_SPECIFIC_A,
CH_IMP_SPECIFIC_B,
CH_RSVD1,
CH_RSVD2,
CH_CURRENT,
CH_SYSTEM,
CH_TOTAL,
CH_UNKNOWN = UINT8_MAX
} ipmi_channel_num_t;
/* (22.24) Get Channel Info */
struct channel_info_t {
uint8_t channel;
uint8_t medium;
uint8_t protocol;
uint8_t session_support;
uint8_t active_sessions;
uint8_t vendor_id[3];
uint8_t aux_info[2];
};
/* (22.23) Get Channel Access */
struct channel_access_t {
uint8_t access_mode;
uint8_t alerting;
uint8_t channel;
uint8_t per_message_auth;
uint8_t privilege_limit;
uint8_t user_level_auth;
};
/*
* The Cipher Suite Record Format from table 22-18 of the IPMI v2.0 spec
*/
enum cipher_suite_format_tag {
STANDARD_CIPHER_SUITE = 0xc0,
OEM_CIPHER_SUITE = 0xc1,
};
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct std_cipher_suite_record_t {
uint8_t start_of_record;
uint8_t cipher_suite_id;
uint8_t auth_alg;
uint8_t integrity_alg;
uint8_t crypt_alg;
} ATTRIBUTE_PACKING;
struct oem_cipher_suite_record_t {
uint8_t start_of_record;
uint8_t cipher_suite_id;
uint8_t iana[3];
uint8_t auth_alg;
uint8_t integrity_alg;
uint8_t crypt_alg;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#define CIPHER_ALG_MASK 0x3f
#define MAX_CIPHER_SUITE_RECORD_OFFSET 0x40
#define MAX_CIPHER_SUITE_DATA_LEN 0x10
#define LIST_ALGORITHMS_BY_CIPHER_SUITE 0x80
/* Below is the theoretical maximum number of cipher suites that could be
* reported by a BMC. That is with the Get Channel Cipher Suites Command, at 16
* bytes at a time and 0x40 requests, it can report 1024 bytes, which is about
* 204 standard records or 128 OEM records. Really, we probably don't need more
* than about 20, which is the full set of standard records plus a few OEM
* records.
*/
#define MAX_CIPHER_SUITE_COUNT (MAX_CIPHER_SUITE_RECORD_OFFSET * \
MAX_CIPHER_SUITE_DATA_LEN / \
sizeof(struct std_cipher_suite_record_t))
/*
* The Get Authentication Capabilities response structure
@ -195,27 +101,158 @@ struct get_channel_auth_cap_rsp {
#pragma pack(0)
#endif
int _ipmi_get_channel_access(struct ipmi_intf *intf,
struct channel_access_t *channel_access,
uint8_t get_volatile_settings);
int ipmi_get_channel_cipher_suites(struct ipmi_intf *intf,
const char *payload_type,
uint8_t channel,
struct cipher_suite_info *suites,
size_t *count);
int _ipmi_get_channel_info(struct ipmi_intf *intf,
struct channel_info_t *channel_info);
int _ipmi_set_channel_access(struct ipmi_intf *intf,
struct channel_access_t channel_access,
uint8_t access_option,
uint8_t privilege_option);
/*
* The Get Channel Info response structure
* From table 22-29 of the IPMI v2.0 spec
*/
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct get_channel_info_rsp {
#if WORDS_BIGENDIAN
uint8_t __reserved1 : 4;
uint8_t channel_number : 4; /* channel number */
#else
uint8_t channel_number : 4; /* channel number */
uint8_t __reserved1 : 4;
#endif
#if WORDS_BIGENDIAN
uint8_t __reserved2 : 1;
uint8_t channel_medium : 7; /* Channel medium type per table 6-3 */
#else
uint8_t channel_medium : 7; /* Channel medium type per table 6-3 */
uint8_t __reserved2 : 1;
#endif
#if WORDS_BIGENDIAN
uint8_t __reserved3 : 3;
uint8_t channel_protocol : 5; /* Channel protocol per table 6-2 */
#else
uint8_t channel_protocol : 5; /* Channel protocol per table 6-2 */
uint8_t __reserved3 : 3;
#endif
#if WORDS_BIGENDIAN
uint8_t session_support : 2; /* Description of session support */
uint8_t active_sessions : 6; /* Count of active sessions */
#else
uint8_t active_sessions : 6; /* Count of active sessions */
uint8_t session_support : 2; /* Description of session support */
#endif
uint8_t vendor_id[3]; /* For OEM that specified the protocol */
uint8_t aux_info[2]; /* Not used*/
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
/*
* The Get Channel Access response structure
* From table 22-28 of the IPMI v2.0 spec
*/
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct get_channel_access_rsp {
#if WORDS_BIGENDIAN
uint8_t __reserved1 : 2;
uint8_t alerting : 1;
uint8_t per_message_auth : 1;
uint8_t user_level_auth : 1;
uint8_t access_mode : 3;
#else
uint8_t access_mode : 3;
uint8_t user_level_auth : 1;
uint8_t per_message_auth : 1;
uint8_t alerting : 1;
uint8_t __reserved1 : 2;
#endif
#if WORDS_BIGENDIAN
uint8_t __reserved2 : 4;
uint8_t channel_priv_limit : 4; /* Channel privilege level limit */
#else
uint8_t channel_priv_limit : 4; /* Channel privilege level limit */
uint8_t __reserved2 : 4;
#endif
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct get_user_access_rsp {
#if WORDS_BIGENDIAN
uint8_t __reserved1 : 2;
uint8_t max_user_ids : 6;
uint8_t __reserved2 : 2;
uint8_t enabled_user_ids : 6;
uint8_t __reserved3 : 2;
uint8_t fixed_user_ids : 6;
uint8_t __reserved4 : 1;
uint8_t callin_callback : 1;
uint8_t link_auth : 1;
uint8_t ipmi_messaging : 1;
uint8_t privilege_limit : 4;
#else
uint8_t max_user_ids : 6;
uint8_t __reserved1 : 2;
uint8_t enabled_user_ids : 6;
uint8_t __reserved2 : 2;
uint8_t fixed_user_ids : 6;
uint8_t __reserved3 : 2;
uint8_t privilege_limit : 4;
uint8_t ipmi_messaging : 1;
uint8_t link_auth : 1;
uint8_t callin_callback : 1;
uint8_t __reserved4 : 1;
#endif
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct set_user_access_data {
#if WORDS_BIGENDIAN
uint8_t change_bits : 1;
uint8_t callin_callback : 1;
uint8_t link_auth : 1;
uint8_t ipmi_messaging : 1;
uint8_t channel : 4;
uint8_t __reserved1 : 2;
uint8_t user_id : 6;
uint8_t __reserved2 : 4;
uint8_t privilege_limit : 4;
uint8_t __reserved3 : 4;
uint8_t session_limit : 4;
#else
uint8_t channel : 4;
uint8_t ipmi_messaging : 1;
uint8_t link_auth : 1;
uint8_t callin_callback : 1;
uint8_t change_bits : 1;
uint8_t user_id : 6;
uint8_t __reserved1 : 2;
uint8_t privilege_limit : 4;
uint8_t __reserved2 : 4;
uint8_t session_limit : 4;
uint8_t __reserved3 : 4;
#endif
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
uint8_t ipmi_get_channel_medium(struct ipmi_intf * intf, uint8_t channel);
void ipmi_current_channel_info(struct ipmi_intf *intf,
struct channel_info_t *chinfo);
uint8_t ipmi_current_channel_medium(struct ipmi_intf * intf);
int ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv);
int ipmi_get_channel_auth_cap(struct ipmi_intf * intf,
uint8_t channel, uint8_t priv);
int ipmi_get_channel_auth_cap(struct ipmi_intf * intf, uint8_t channel, uint8_t priv);
int ipmi_get_channel_info(struct ipmi_intf * intf, uint8_t channel);
#endif /*IPMI_CHANNEL_H*/

View File

@ -118,16 +118,14 @@
#define IPMI_AUTH_RAKP_NONE 0x00
#define IPMI_AUTH_RAKP_HMAC_SHA1 0x01
#define IPMI_AUTH_RAKP_HMAC_MD5 0x02
#define IPMI_AUTH_RAKP_HMAC_SHA256 0x03
/* From table 13-18 of the IPMI v2 specification */
#define IPMI_INTEGRITY_NONE 0x00
#define IPMI_INTEGRITY_HMAC_SHA1_96 0x01
#define IPMI_INTEGRITY_HMAC_MD5_128 0x02
#define IPMI_INTEGRITY_MD5_128 0x03
#define IPMI_INTEGRITY_HMAC_SHA256_128 0x04
/* From table 13-19 of the IPMI v2 specification */
/* From table 13-19 of the IPMI v2 specfication */
#define IPMI_CRYPT_NONE 0x00
#define IPMI_CRYPT_AES_CBC_128 0x01
#define IPMI_CRYPT_XRC4_128 0x02

View File

@ -52,53 +52,6 @@
#define GOOD_PWR_GLIMIT_CCODE(ccode) ((ccode = ((ccode == 0x80) ? 0 : ccode)))
#define GOOD_ASSET_TAG_CCODE(ccode) ((ccode = (((ccode == 0x80) || (ccode == 0x81) || (ccode == 0x82) || (ccode == 0x83)) ? 0 : ccode)))
/* External Node Manager Configuration and Control Commands per spec 2.0 */
#define IPMI_NM_POLICY_CTL 0xC0
#define IPMI_NM_SET_POLICY 0xC1
#define IPMI_NM_GET_POLICY 0xC2
#define IPMI_NM_SET_ALERT_TH 0xC3
#define IPMI_NM_GET_ALERT_TH 0xC4
#define IPMI_NM_SET_SUSPEND 0xC5
#define IPMI_NM_GET_SUSPEND 0xC6
#define IPMI_NM_RESET_STATS 0xC7
#define IPMI_NM_GET_STATS 0xC8
#define IPMI_NM_GET_CAP 0xC9
#define IPMI_NM_GET_VERSION 0xCA
#define IPMI_NM_SET_POWER 0xCB
#define IPMI_NM_SET_ALERT_DS 0xCE
#define IPMI_NM_GET_ALERT_DS 0xCF
#define IPMI_NM_LIMITING 0xF2
/* Node Manager Policy Control Flags */
#define IPMI_NM_GLOBAL_ENABLE 0x01
#define IPMI_NM_DOMAIN_ENABLE 0x02
#define IPMI_NM_PER_POLICY_ENABLE 0x04
/* Node Manager Set Policy Enable */
#define IPMI_NM_POLICY_ENABLE 0x10
/* Node Manager Policy Trigger Codes */
#define IPMI_NM_NO_POLICY_TRIG 0x00
#define IPMI_NM_TEMP_TRIGGER 0x01
#define IPMI_NM_NO_READ_TRIG 0x02
#define IPMI_NM_RESET_TRIGGER 0x03
#define IPMI_NM_BOOT_TRIGGER 0x04
/* Policy Exception Actions flags */
#define IPMI_NM_POLICY_ALERT 0x01
#define IPMI_NM_POLICY_SHUT 0x02
/* Power Correction codes for Policy action */
#define IPMI_NM_PWR_AUTO_CORR 0x00
#define IPMI_NM_PWR_SOFT_CORR 0x01
#define IPMI_NM_PWR_AGGR_CORR 0x02
/* Set Threshold message size */
#define IPMI_NM_SET_THRESH_LEN 12
/* Number of Suspend Periods */
#define IPMI_NM_SUSPEND_PERIOD_MAX 5
struct dcmi_cmd {
uint16_t val;
@ -129,7 +82,7 @@ struct power_reading {
uint8_t state;
} __attribute__ ((packed));
/* make a struct for the return from the capabilities command */
/* make a struct for the return from the capabilites command */
struct capabilities {
uint8_t grp_id; /* first byte: Group Extension ID */
uint16_t conformance;
@ -173,98 +126,4 @@ struct thermal_limit {
int ipmi_dcmi_main(struct ipmi_intf * intf, int argc, char ** argv);
/* Node Manager discover command */
struct nm_discover {
uint8_t intel_id[3]; /* Always returns 000157 */
uint8_t nm_version;
uint8_t ipmi_version;
uint8_t patch_version;
uint8_t major_rev;
uint8_t minor_rev;
} __attribute__ ((packed));
/* Node Manager get capabilities command */
struct nm_capability {
uint8_t intel_id[3];
uint8_t max_settings;
uint16_t max_value; /* max power/thermal/time after reset */
uint16_t min_value; /* min "" */
uint32_t min_corr; /* min correction time inmillesecs */
uint32_t max_corr;
uint16_t min_stats;
uint16_t max_stats;
uint8_t scope;
} __attribute__ ((packed));
/* Node Manager get statistics command */
struct nm_statistics {
uint8_t intel_id[3];
uint16_t curr_value;
uint16_t min_value;
uint16_t max_value;
uint16_t ave_value;
uint32_t time_stamp;
uint32_t stat_period;
uint8_t id_state;
} __attribute__ ((packed));
/* Node Manager set policy */
struct nm_policy {
uint8_t intel_id[3];
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
uint8_t policy_id;
uint8_t policy_type; /* 0:3 trigger type 4 = action 5:6 correction */
uint8_t policy_exception; /* exception actions */
uint16_t policy_limits;
uint32_t corr_time;
uint16_t trigger_limit;
uint16_t stats_period;
} __attribute__ ((packed));
/* Node Maager get policy */
struct nm_get_policy {
uint8_t intel_id[3];
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
uint8_t policy_type; /* 0:3 trigger type 4 = action 5:6 correction */
uint8_t policy_exception; /* exception actions */
uint16_t policy_limits;
uint32_t corr_time;
uint16_t trigger_limit;
uint16_t stats_period;
} __attribute__ ((packed));
/* Node Manager set alert destination */
struct nm_set_alert {
uint8_t intel_id[3];
uint8_t chan; /* 0:3 BMC chan, 4:6 reserved, bit 7=0 register alert receiver =1 invalidate */
uint8_t dest; /* lan destination */
uint8_t string; /* alert string selector */
} __attribute__ ((packed));
/* Node Manager set alert threshold */
struct nm_thresh {
uint8_t intel_id[3];
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
uint8_t policy_id;
uint8_t count;
uint16_t thresholds[3];
} __attribute__ ((packed));
/* Node Manager suspend period struct */
struct nm_period {
uint8_t start;
uint8_t stop;
uint8_t repeat;
} __attribute__ ((packed));
/* Node Manager set suspend period */
struct nm_suspend {
uint8_t intel_id[3];
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
uint8_t policy_id;
uint8_t count;
struct nm_period period[IPMI_NM_SUSPEND_PERIOD_MAX];
} __attribute__ ((packed));
int ipmi_nm_main(struct ipmi_intf * intf, int argc, char ** argv);
#endif /*IPMI_DCMI_H*/

View File

@ -72,7 +72,6 @@ POSSIBILITY OF SUCH DAMAGE.
#define IDRAC_11G 1
#define IDRAC_12G 2
#define IDRAC_13G 3
// Return Error code for license
#define LICENSE_NOT_SUPPORTED 0x6F
#define VFL_NOT_LICENSED 0x33
@ -185,9 +184,6 @@ typedef struct _lcd_mode
#define IMC_IDRAC_12G_MONOLITHIC (uint8_t) (0x10)
#define IMC_IDRAC_12G_MODULAR (uint8_t) (0x11)
#define IMC_IDRAC_13G_MONOLITHIC (uint8_t) (0x20)
#define IMC_IDRAC_13G_MODULAR (uint8_t) (0x21)
#define IMC_IDRAC_13G_DCS (uint8_t) (0x22)
typedef struct

View File

@ -61,33 +61,6 @@ struct platform_event_msg {
#pragma pack(0)
#endif
/* See IPMI 2.0 Specification, Appendix G, Table G-1, "Event Commands" */
typedef enum {
IPMI_CMD_SET_EVENT_RCVR = 0,
IPMI_CMD_GET_EVENT_RCVR,
IPMI_CMD_PLATFORM_EVENT
} ipmi_event_cmd_t;
typedef enum {
PLATFORM_EVENT_DATA_LEN_NON_SI = sizeof(struct platform_event_msg),
PLATFORM_EVENT_DATA_LEN_SI, /* System interfaces require generator ID */
PLATFORM_EVENT_DATA_LEN_MAX = PLATFORM_EVENT_DATA_LEN_SI
} ipmi_platform_event_data_len_t;
/* See Table 5-4 */
typedef enum {
EVENT_SWID_BIOS_BASE = 0x00, /* BIOS */
EVENT_SWID_SMI_BASE = 0x10, /* SMI Handler */
EVENT_SWID_SMS_BASE = 0x20, /* System Management Software */
EVENT_SWID_OEM_BASE = 0x30, /* OEM */
EVENT_SWID_REMOTE_CONSOLE_BASE = 0x40, /* Remote Console SW */
EVENT_SWID_TERMINAL_MODE_BASE = 0x47 /* Terminal Mode RC SW */
} ipmi_event_swid_t;
#define EVENT_SWID(base, index) ((EVENT_SWID_##base##_BASE + index) & 0x7F)
/* See Figure 29-2, Table 32-1 */
#define EVENT_GENERATOR(base, index) (EVENT_SWID(base,index) << 1 | 1)
int ipmi_event_main(struct ipmi_intf *, int, char **);
#endif /*IPMI_EVENT_H*/

View File

@ -36,14 +36,11 @@
#include <inttypes.h>
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_sdr.h>
#include <ipmitool/ipmi_time.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#define FRU_END_OF_FIELDS 0xc1
#define GET_FRU_INFO 0x10
#define GET_FRU_DATA 0x11
#define SET_FRU_DATA 0x12
@ -66,8 +63,6 @@ enum {
struct fru_info {
uint16_t size;
uint8_t access:1;
uint8_t max_read_size;
uint8_t max_write_size;
};
#ifdef HAVE_PRAGMA_PACK
@ -75,7 +70,6 @@ struct fru_info {
#endif
struct fru_header {
uint8_t version;
union {
struct {
uint8_t internal;
uint8_t chassis;
@ -83,8 +77,6 @@ struct fru_header {
uint8_t product;
uint8_t multi;
} offset;
uint8_t offsets[5];
};
uint8_t pad;
uint8_t checksum;
}ATTRIBUTE_PACKING;
@ -196,6 +188,9 @@ struct fru_multirec_powersupply {
#pragma pack(0)
#endif
static const char * combined_voltage_desc[] __attribute__((unused)) = {
"12 V", "-12 V", "5 V", "3.3 V"};
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
@ -302,7 +297,6 @@ struct fru_picmgext_link_desc {
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD 0x32
unsigned int type:8;
unsigned int ext:4;
unsigned int grouping:8;
@ -314,7 +308,6 @@ struct fru_picmgext_link_desc {
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD 0x32
unsigned int type:8;
unsigned int desig_port:4;
unsigned int desig_if:2;
@ -590,38 +583,22 @@ struct fru_picmgext_amc_link_desc_record {
#pragma pack(0)
#endif
/* IPMI Return codes for Get FRU Inventory Area and Write FRU Inventory Area */
/* PROTECTED_OFFSET Only expected on write command failures. */
#define IPMI_CC_FRU_WRITE_PROTECTED_OFFSET 0x80
#define IPMI_CC_FRU_DEVICE_BUSY 0x81
/* FRU Board manufacturing date */
#define FRU_BOARD_DATE_UNSPEC 0 /* IPMI FRU Information Storage Definition
v1.0 rev 1.3, Table 11-1 */
static inline time_t ipmi_fru2time_t(void *mfg_date) {
const uint64_t secs_from_1970_1996 = 820454400;
uint32_t fru_ts = ipmi24toh(mfg_date);
time_t ts;
if (FRU_BOARD_DATE_UNSPEC == fru_ts) {
ts = IPMI_TIME_UNSPECIFIED;
}
else {
ts = fru_ts * 60 + secs_from_1970_1996;
}
return ts;
}
typedef struct ipmi_fru_bloc {
struct ipmi_fru_bloc * next;
uint16_t start;
uint16_t size;
uint8_t blocId[32];
} t_ipmi_fru_bloc;
static const uint64_t secs_from_1970_1996 = 820454400;
static const char * chassis_type_desc[] __attribute__((unused)) = {
"Unspecified", "Other", "Unknown",
"Desktop", "Low Profile Desktop", "Pizza Box",
"Mini Tower", "Tower",
"Portable", "LapTop", "Notebook", "Hand Held",
"Docking Station", "All in One", "Sub Notebook",
"Space-saving", "Lunch Box", "Main Server Chassis",
"Expansion Chassis", "SubChassis", "Bus Expansion Chassis",
"Peripheral Chassis", "RAID Chassis", "Rack Mount Chassis",
"Sealed-case PC", "Multi-system Chassis", "CompactPCI",
"AdvancedTCA", "Blade", "Blade Enclosure"
};
int ipmi_fru_main(struct ipmi_intf *intf, int argc, char **argv);
int ipmi_fru_print(struct ipmi_intf *intf, struct sdr_record_fru_locator *fru);
char *get_fru_area_str(uint8_t *data, uint32_t *offset);
#endif /* IPMI_FRU_H */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018 Quanta Computer Inc. All rights reserved.
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -12,7 +12,7 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of Quanta Computer Inc. or the names of
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
@ -20,36 +20,23 @@
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* Quanta Computer Inc. AND ITS LICENSORS SHALL NOT BE LIABLE
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* Quanta Computer Inc. OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef IPMI_QUANTAOEM_H
#define IPMI_QUANTAOEM_H
#ifndef IPMI_KFWUM_H
#define IPMI_KFWUM_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <inttypes.h>
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_sdr.h>
#define OEM_QCT_NETFN 0x36
#define OEM_QCT_GET_INFO 0x65
typedef enum
{
OEM_QCT_PLATFORM_UNKNOWN = 0,
OEM_QCT_PLATFORM_GRANTLEY,
OEM_QCT_PLATFORM_PURLEY
} qct_platform_t;
int ipmi_fwum_main(struct ipmi_intf *, int, char **);
qct_platform_t oem_qct_get_platform_id(struct ipmi_intf *intf);
char *oem_qct_get_evt_desc(struct ipmi_intf *intf, struct sel_event_record *rec);
#endif /*IPMI_QUANTAOEM_H*/
#endif /* IPMI_KFWUM_H */

View File

@ -0,0 +1,41 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution 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.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef IPMI_HPMFWUPG_H
#define IPMI_HPMFWUPG_H
#include <inttypes.h>
#include <ipmitool/ipmi.h>
int ipmi_hpmfwupg_main(struct ipmi_intf *, int, char **);
#endif /* IPMI_KFWUM_H */

View File

@ -59,77 +59,37 @@ enum LANPLUS_SESSION_STATE {
#define IPMI_AUTHCODE_BUFFER_SIZE 20
#define IPMI_SIK_BUFFER_SIZE IPMI_MAX_MD_SIZE
#define IPMI_SIK_BUFFER_SIZE 20
#define IPMI_KG_BUFFER_SIZE 21 /* key plus null byte */
enum cipher_suite_ids {
IPMI_LANPLUS_CIPHER_SUITE_0 = 0,
IPMI_LANPLUS_CIPHER_SUITE_1 = 1,
IPMI_LANPLUS_CIPHER_SUITE_2 = 2,
IPMI_LANPLUS_CIPHER_SUITE_3 = 3,
IPMI_LANPLUS_CIPHER_SUITE_4 = 4,
IPMI_LANPLUS_CIPHER_SUITE_5 = 5,
IPMI_LANPLUS_CIPHER_SUITE_6 = 6,
IPMI_LANPLUS_CIPHER_SUITE_7 = 7,
IPMI_LANPLUS_CIPHER_SUITE_8 = 8,
IPMI_LANPLUS_CIPHER_SUITE_9 = 9,
IPMI_LANPLUS_CIPHER_SUITE_10 = 10,
IPMI_LANPLUS_CIPHER_SUITE_11 = 11,
IPMI_LANPLUS_CIPHER_SUITE_12 = 12,
IPMI_LANPLUS_CIPHER_SUITE_13 = 13,
IPMI_LANPLUS_CIPHER_SUITE_14 = 14,
#ifdef HAVE_CRYPTO_SHA256
IPMI_LANPLUS_CIPHER_SUITE_15 = 15,
IPMI_LANPLUS_CIPHER_SUITE_16 = 16,
IPMI_LANPLUS_CIPHER_SUITE_17 = 17,
#endif /* HAVE_CRYPTO_SHA256 */
IPMI_LANPLUS_CIPHER_SUITE_RESERVED = 0xff,
};
struct cipher_suite_info {
enum cipher_suite_ids cipher_suite_id;
uint8_t auth_alg;
uint8_t integrity_alg;
uint8_t crypt_alg;
uint32_t iana;
};
struct ipmi_session_params {
char * hostname;
struct ipmi_session {
uint8_t hostname[64];
uint8_t username[17];
uint8_t authcode_set[IPMI_AUTHCODE_BUFFER_SIZE + 1];
uint8_t authcode[IPMI_AUTHCODE_BUFFER_SIZE + 1];
uint8_t challenge[16];
uint8_t authtype;
uint8_t authtype_set;
uint8_t privlvl;
enum cipher_suite_ids cipher_suite_id;
char sol_escape_char;
int password;
int port;
int retry;
uint32_t timeout;
uint8_t kg[IPMI_KG_BUFFER_SIZE]; /* BMC key */
uint8_t lookupbit;
};
#define IPMI_AUTHSTATUS_PER_MSG_DISABLED 0x10
#define IPMI_AUTHSTATUS_PER_USER_DISABLED 0x08
#define IPMI_AUTHSTATUS_NONNULL_USERS_ENABLED 0x04
#define IPMI_AUTHSTATUS_NULL_USERS_ENABLED 0x02
#define IPMI_AUTHSTATUS_ANONYMOUS_USERS_ENABLED 0x01
struct ipmi_session {
uint8_t authstatus;
uint8_t authextra;
uint8_t privlvl;
uint8_t cipher_suite_id;
char sol_escape_char;
int password;
int port;
int active;
int retry;
uint32_t session_id;
uint32_t in_seq;
uint32_t out_seq;
uint8_t authcode[IPMI_AUTHCODE_BUFFER_SIZE + 1];
uint8_t challenge[16];
uint8_t authtype;
uint8_t authstatus;
uint8_t authextra;
uint32_t timeout;
struct sockaddr_storage addr;
struct sockaddr_in addr;
socklen_t addrlen;
/*
@ -146,12 +106,13 @@ struct ipmi_session {
uint8_t integrity_alg;
uint8_t crypt_alg;
uint8_t max_priv_level;
uint8_t lookupbit;
uint32_t console_id;
uint32_t bmc_id;
/*
* Values required for RAKP messages
* Values required for RAKP mesages
*/
/* Random number generated byt the console */
@ -164,12 +125,9 @@ struct ipmi_session {
uint8_t rakp2_return_code;
uint8_t sik[IPMI_SIK_BUFFER_SIZE]; /* Session integrity key */
uint8_t sik_len; /* Session Integrity key length */
uint8_t kg[IPMI_KG_BUFFER_SIZE]; /* BMC key */
uint8_t k1[IPMI_MAX_MD_SIZE]; /* Used for Integrity checking? */
uint8_t k1_len; /* K1 key length */
uint8_t k2[IPMI_MAX_MD_SIZE]; /* First 16 bytes used for AES */
uint8_t k2_len; /* K2 key length */
uint8_t k1[20]; /* Used for Integrity checking? */
uint8_t k2[20]; /* First 16 bytes used for AES */
} v2_data;
@ -209,11 +167,8 @@ struct ipmi_intf {
int abort;
int noanswer;
int picmg_avail;
int vita_avail;
IPMI_OEM manufacturer_id;
int ai_family;
struct ipmi_session_params ssn_params;
struct ipmi_session * session;
struct ipmi_oem_handle * oem;
struct ipmi_cmd * cmdlist;
@ -224,8 +179,7 @@ struct ipmi_intf {
uint8_t target_channel;
uint32_t transit_addr;
uint8_t transit_channel;
uint16_t max_request_data_size;
uint16_t max_response_data_size;
uint8_t channel_buf_size;
uint8_t devnum;
@ -233,17 +187,13 @@ struct ipmi_intf {
int (*open)(struct ipmi_intf * intf);
void (*close)(struct ipmi_intf * intf);
struct ipmi_rs *(*sendrecv)(struct ipmi_intf * intf, struct ipmi_rq * req);
int (*sendrsp)(struct ipmi_intf * intf, struct ipmi_rs * rsp);
struct ipmi_rs *(*recv_sol)(struct ipmi_intf * intf);
struct ipmi_rs *(*send_sol)(struct ipmi_intf * intf, struct ipmi_v2_payload * payload);
int (*keepalive)(struct ipmi_intf * intf);
int (*set_my_addr)(struct ipmi_intf * intf, uint8_t addr);
void (*set_max_request_data_size)(struct ipmi_intf * intf, uint16_t size);
void (*set_max_response_data_size)(struct ipmi_intf * intf, uint16_t size);
};
uint16_t ipmi_intf_get_max_request_data_size(struct ipmi_intf *intf);
uint16_t ipmi_intf_get_max_response_data_size(struct ipmi_intf *intf);
struct ipmi_intf * ipmi_intf_load(char * name);
void ipmi_intf_print(struct ipmi_intf_support * intflist);
@ -252,20 +202,13 @@ void ipmi_intf_session_set_username(struct ipmi_intf * intf, char * username);
void ipmi_intf_session_set_password(struct ipmi_intf * intf, char * password);
void ipmi_intf_session_set_privlvl(struct ipmi_intf * intf, uint8_t privlvl);
void ipmi_intf_session_set_lookupbit(struct ipmi_intf * intf, uint8_t lookupbit);
#ifdef IPMI_INTF_LANPLUS
void ipmi_intf_session_set_cipher_suite_id(struct ipmi_intf * intf,
enum cipher_suite_ids cipher_suite_id);
#endif /* IPMI_INTF_LANPLUS */
void ipmi_intf_session_set_cipher_suite_id(struct ipmi_intf * intf, uint8_t cipher_suite_id);
void ipmi_intf_session_set_sol_escape_char(struct ipmi_intf * intf, char sol_escape_char);
void ipmi_intf_session_set_kgkey(struct ipmi_intf *intf, const uint8_t *kgkey);
void ipmi_intf_session_set_kgkey(struct ipmi_intf * intf, char * kgkey);
void ipmi_intf_session_set_port(struct ipmi_intf * intf, int port);
void ipmi_intf_session_set_authtype(struct ipmi_intf * intf, uint8_t authtype);
void ipmi_intf_session_set_timeout(struct ipmi_intf * intf, uint32_t timeout);
void ipmi_intf_session_set_retry(struct ipmi_intf * intf, int retry);
void ipmi_intf_session_cleanup(struct ipmi_intf *intf);
void ipmi_cleanup(struct ipmi_intf * intf);
#if defined(IPMI_INTF_LAN) || defined (IPMI_INTF_LANPLUS)
int ipmi_intf_socket_connect(struct ipmi_intf * intf);
#endif
#endif /* IPMI_INTF_H */

View File

@ -50,13 +50,6 @@
#define IPMI_LANP_WRITE_LOCK 1
#define IPMI_LANP_WRITE_COMMIT 2
#define IPMI_LANP_VLAN_ID_MAX 4094
#define IPMI_LANP_VLAN_ID_MIN 1
#define IPMI_LANP_VLAN_DISABLE 0 /* ID 0 = VLAN is disabled for the channel */
#define IPMI_LANP_IS_VLAN_VALID(x) \
((x) >= IPMI_LANP_VLAN_ID_MIN && (x) <= IPMI_LANP_VLAN_ID_MAX)
enum {
IPMI_LANP_SET_IN_PROGRESS,
IPMI_LANP_AUTH_TYPE,
@ -83,39 +76,6 @@ enum {
IPMI_LANP_RMCP_CIPHER_SUPPORT,
IPMI_LANP_RMCP_CIPHERS,
IPMI_LANP_RMCP_PRIV_LEVELS,
IPMI_LANP_VLAN_TAGS,
IPMI_LANP_BAD_PASS_THRESH,
IPMI_LANP_IP6_SUPPORT=50,
IPMI_LANP_IP6_ENABLES,
IPMI_LANP_IP6_TRAFFIC_CLASS,
IPMI_LANP_IP6_STATIC_HOPS,
IPMI_LANP_IP6_FLOW_LABEL,
IPMI_LANP_IP6_STATUS,
IPMI_LANP_IP6_STATIC_ADDR,
IPMI_LANP_IP6_STATIC_DUID_STG,
IPMI_LANP_IP6_STATIC_DUID,
IPMI_LANP_IP6_DYNAMIC_ADDR,
IPMI_LANP_IP6_DYNAMIC_DUID_STG,
IPMI_LANP_IP6_DYNAMIC_DUID,
IPMI_LANP_IP6_DHCP6_CFG_SUP,
IPMI_LANP_IP6_DHCP6_CFG,
IPMI_LANP_IP6_ROUTER_CFG,
IPMI_LANP_IP6_STATIC_RTR1_ADDR,
IPMI_LANP_IP6_STATIC_RTR1_MAC,
IPMI_LANP_IP6_STATIC_RTR1_PFX_LEN,
IPMI_LANP_IP6_STATIC_RTR1_PFX,
IPMI_LANP_IP6_STATIC_RTR2_ADDR,
IPMI_LANP_IP6_STATIC_RTR2_MAC,
IPMI_LANP_IP6_STATIC_RTR2_PFX_LEN,
IPMI_LANP_IP6_STATIC_RTR2_PFX,
IPMI_LANP_IP6_NUM_DYNAMIC_RTRS,
IPMI_LANP_IP6_DYNAMIC_RTR_ADDR,
IPMI_LANP_IP6_DYNAMIC_RTR_MAC,
IPMI_LANP_IP6_DYNAMIC_RTR_PFX_LEN,
IPMI_LANP_IP6_DYNAMIC_RTR_PFX,
IPMI_LANP_IP6_DYNAMIC_HOPS,
IPMI_LANP_IP6_NDSLAAC_CFG_SUP,
IPMI_LANP_IP6_NDSLAAC_CFG,
IPMI_LANP_OEM_ALERT_STRING=96,
IPMI_LANP_ALERT_RETRY=97,
IPMI_LANP_UTC_OFFSET=98,
@ -125,8 +85,48 @@ enum {
IPMI_LANP_CHAN_ACCESS_MODE=201,
};
static struct lan_param {
int cmd;
int size;
char desc[24];
uint8_t * data;
int data_len;
} ipmi_lan_params[] __attribute__((unused)) = {
{ IPMI_LANP_SET_IN_PROGRESS, 1, "Set in Progress" },
{ IPMI_LANP_AUTH_TYPE, 1, "Auth Type Support" },
{ IPMI_LANP_AUTH_TYPE_ENABLE, 5, "Auth Type Enable" },
{ IPMI_LANP_IP_ADDR, 4, "IP Address" },
{ IPMI_LANP_IP_ADDR_SRC, 1, "IP Address Source" },
{ IPMI_LANP_MAC_ADDR, 6, "MAC Address" }, /* 5 */
{ IPMI_LANP_SUBNET_MASK, 4, "Subnet Mask" },
{ IPMI_LANP_IP_HEADER, 3, "IP Header" },
{ IPMI_LANP_PRI_RMCP_PORT, 2, "Primary RMCP Port" },
{ IPMI_LANP_SEC_RMCP_PORT, 2, "Secondary RMCP Port" },
{ IPMI_LANP_BMC_ARP, 1, "BMC ARP Control" }, /* 10 */
{ IPMI_LANP_GRAT_ARP, 1, "Gratituous ARP Intrvl" },
{ IPMI_LANP_DEF_GATEWAY_IP, 4, "Default Gateway IP" },
{ IPMI_LANP_DEF_GATEWAY_MAC, 6, "Default Gateway MAC" },
{ IPMI_LANP_BAK_GATEWAY_IP, 4, "Backup Gateway IP" },
{ IPMI_LANP_BAK_GATEWAY_MAC, 6, "Backup Gateway MAC" }, /* 15 */
{ IPMI_LANP_SNMP_STRING, 18, "SNMP Community String" },
{ IPMI_LANP_NUM_DEST, 1, "Number of Destinations"},
{ IPMI_LANP_DEST_TYPE, 4, "Destination Type" },
{ IPMI_LANP_DEST_ADDR, 13, "Destination Addresses" },
{ IPMI_LANP_VLAN_ID, 2, "802.1q VLAN ID" }, /* 20 */
{ IPMI_LANP_VLAN_PRIORITY, 1, "802.1q VLAN Priority" },
{ IPMI_LANP_RMCP_CIPHER_SUPPORT,1, "RMCP+ Cipher Suite Count" },
{ IPMI_LANP_RMCP_CIPHERS, 16, "RMCP+ Cipher Suites" },
{ IPMI_LANP_RMCP_PRIV_LEVELS, 9, "Cipher Suite Priv Max" },
{ IPMI_LANP_OEM_ALERT_STRING, 28, "OEM Alert String" }, /* 25 */
{ IPMI_LANP_ALERT_RETRY, 1, "Alert Retry Algorithm" },
{ IPMI_LANP_UTC_OFFSET, 3, "UTC Offset" },
{ IPMI_LANP_DHCP_SERVER_IP, 4, "DHCP Server IP" },
{ IPMI_LANP_DHCP_SERVER_MAC, 6, "DHDP Server MAC" },
{ IPMI_LANP_DHCP_ENABLE, 1, "DHCP Enable" }, /* 30 */
{ IPMI_LANP_CHAN_ACCESS_MODE, 2, "Channel Access Mode" },
{ -1 }
};
int ipmi_lanp_main(struct ipmi_intf *, int, char **);
uint8_t find_lan_channel(struct ipmi_intf *intf, uint8_t start);
#endif /*IPMI_LANP_H*/

View File

@ -0,0 +1,170 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution 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.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef IPMI_MC_H
#define IPMI_MC_H
#include <ipmitool/ipmi.h>
#define BMC_GET_DEVICE_ID 0x01
#define BMC_COLD_RESET 0x02
#define BMC_WARM_RESET 0x03
#define BMC_GET_SELF_TEST 0x04
#define BMC_RESET_WATCHDOG_TIMER 0x22
#define BMC_SET_WATCHDOG_TIMER 0x24
#define BMC_GET_WATCHDOG_TIMER 0x25
#define BMC_SET_GLOBAL_ENABLES 0x2e
#define BMC_GET_GLOBAL_ENABLES 0x2f
#define BMC_GET_GUID 0x37
int ipmi_mc_main(struct ipmi_intf *, int, char **);
/*
* Response data from IPM Get Device ID Command (IPMI rev 1.5, section 17.1)
* The following really apply to any IPM device, not just BMCs...
*/
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct ipm_devid_rsp {
uint8_t device_id;
uint8_t device_revision;
uint8_t fw_rev1;
uint8_t fw_rev2;
uint8_t ipmi_version;
uint8_t adtl_device_support;
uint8_t manufacturer_id[3];
uint8_t product_id[2];
uint8_t aux_fw_rev[4];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#define IPM_DEV_DEVICE_ID_SDR_MASK (0x80) /* 1 = provides SDRs */
#define IPM_DEV_DEVICE_ID_REV_MASK (0x0F) /* BCD-enoded */
#define IPM_DEV_FWREV1_AVAIL_MASK (0x80) /* 0 = normal operation */
#define IPM_DEV_FWREV1_MAJOR_MASK (0x3f) /* Major rev, BCD-encoded */
#define IPM_DEV_IPMI_VER_MAJOR_MASK (0x0F) /* Major rev, BCD-encoded */
#define IPM_DEV_IPMI_VER_MINOR_MASK (0xF0) /* Minor rev, BCD-encoded */
#define IPM_DEV_IPMI_VER_MINOR_SHIFT (4) /* Minor rev shift */
#define IPM_DEV_IPMI_VERSION_MAJOR(x) \
(x & IPM_DEV_IPMI_VER_MAJOR_MASK)
#define IPM_DEV_IPMI_VERSION_MINOR(x) \
((x & IPM_DEV_IPMI_VER_MINOR_MASK) >> IPM_DEV_IPMI_VER_MINOR_SHIFT)
#define IPM_DEV_MANUFACTURER_ID(x) \
((uint32_t) ((x[2] & 0x0F) << 16 | x[1] << 8 | x[0]))
#define IPM_DEV_ADTL_SUPPORT_BITS (8)
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct ipm_selftest_rsp {
unsigned char code;
unsigned char test;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#define IPM_SFT_CODE_OK 0x55
#define IPM_SFT_CODE_NOT_IMPLEMENTED 0x56
#define IPM_SFT_CODE_DEV_CORRUPTED 0x57
#define IPM_SFT_CODE_FATAL_ERROR 0x58
#define IPM_SFT_CODE_RESERVED 0xff
#define IPM_SELFTEST_SEL_ERROR 0x80
#define IPM_SELFTEST_SDR_ERROR 0x40
#define IPM_SELFTEST_FRU_ERROR 0x20
#define IPM_SELFTEST_IPMB_ERROR 0x10
#define IPM_SELFTEST_SDRR_EMPTY 0x08
#define IPM_SELFTEST_INTERNAL_USE 0x04
#define IPM_SELFTEST_FW_BOOTBLOCK 0x02
#define IPM_SELFTEST_FW_CORRUPTED 0x01
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct ipm_get_watchdog_rsp {
unsigned char timer_use;
unsigned char timer_actions;
unsigned char pre_timeout;
unsigned char timer_use_exp;
unsigned char initial_countdown_lsb;
unsigned char initial_countdown_msb;
unsigned char present_countdown_lsb;
unsigned char present_countdown_msb;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#define IPM_WATCHDOG_RESET_ERROR 0x80
#define IPM_WATCHDOG_BIOS_FRB2 0x01
#define IPM_WATCHDOG_BIOS_POST 0x02
#define IPM_WATCHDOG_OS_LOAD 0x03
#define IPM_WATCHDOG_SMS_OS 0x04
#define IPM_WATCHDOG_OEM 0x05
#define IPM_WATCHDOG_NO_ACTION 0x00
#define IPM_WATCHDOG_HARD_RESET 0x01
#define IPM_WATCHDOG_POWER_DOWN 0x02
#define IPM_WATCHDOG_POWER_CYCLE 0x03
#define IPM_WATCHDOG_CLEAR_OEM 0x20
#define IPM_WATCHDOG_CLEAR_SMS_OS 0x10
#define IPM_WATCHDOG_CLEAR_OS_LOAD 0x08
#define IPM_WATCHDOG_CLEAR_BIOS_POST 0x04
#define IPM_WATCHDOG_CLEAR_BIOS_FRB2 0x02
/* IPMI 2.0 command for system information*/
#define IPMI_SET_SYS_INFO 0x58
#define IPMI_GET_SYS_INFO 0x59
#define IPMI_SYSINFO_SET0_SIZE 14
#define IPMI_SYSINFO_SETN_SIZE 16
#define IPMI_SYSINFO_HOSTNAME 0x02
#define IPMI_SYSINFO_PRIMARY_OS_NAME 0x03
#define IPMI_SYSINFO_OS_NAME 0x04
#define IPMI_SYSINFO_DELL_OS_VERSION 0xe4
#define IPMI_SYSINFO_DELL_URL 0xde
int ipmi_mc_getsysinfo(struct ipmi_intf * intf, int param, int block, int set,
int len, void *buffer);
int ipmi_mc_setsysinfo(struct ipmi_intf * intf, int len, void *buffer);
#endif /*IPMI_MC_H */

View File

@ -40,7 +40,7 @@
struct pef_capabilities { /* "get pef capabilities" response */
uint8_t version;
uint8_t actions; /* mapped by PEF_ACTION_xxx */
uint8_t event_filter_count;
uint8_t tblsize;
};
typedef enum {
@ -111,6 +111,224 @@ struct bit_desc_map { /* description text container */
struct desc_map desc_maps[128];
};
static struct bit_desc_map
pef_b2s_actions __attribute__((unused)) = {
BIT_DESC_MAP_ALL,
{ {"Alert", PEF_ACTION_ALERT},
{"Power-off", PEF_ACTION_POWER_DOWN},
{"Reset", PEF_ACTION_RESET},
{"Power-cycle", PEF_ACTION_POWER_CYCLE},
{"OEM-defined", PEF_ACTION_OEM},
{"Diagnostic-interrupt", PEF_ACTION_DIAGNOSTIC_INTERRUPT},
{NULL}
} };
static struct bit_desc_map
pef_b2s_severities __attribute__((unused)) = {
BIT_DESC_MAP_ANY,
{ {"Non-recoverable", PEF_SEVERITY_NON_RECOVERABLE},
{"Critical", PEF_SEVERITY_CRITICAL},
{"Warning", PEF_SEVERITY_WARNING},
{"OK", PEF_SEVERITY_OK},
{"Information", PEF_SEVERITY_INFORMATION},
{"Monitor", PEF_SEVERITY_MONITOR},
{NULL}
} };
static struct bit_desc_map
pef_b2s_sensortypes __attribute__((unused)) = {
BIT_DESC_MAP_LIST,
{ {"Any", 255},
{"Temperature", 1},
{"Voltage", 2},
{"Current", 3},
{"Fan", 4},
{"Chassis Intrusion", 5},
{"Platform security breach", 6},
{"Processor", 7},
{"Power supply", 8},
{"Power Unit", 9},
{"Cooling device", 10},
{"Other (units-based)", 11},
{"Memory", 12},
{"Drive Slot", 13},
{"POST memory resize", 14},
{"POST error", 15},
{"Logging disabled", 16},
{"Watchdog 1", 17},
{"System event", 18},
{"Critical Interrupt", 19},
{"Button", 20},
{"Module/board", 21},
{"uController/coprocessor", 22},
{"Add-in card", 23},
{"Chassis", 24},
{"Chipset", 25},
{"Other (FRU)", 26},
{"Cable/interconnect", 27},
{"Terminator", 28},
{"System boot", 29},
{"Boot error", 30},
{"OS boot", 31},
{"OS critical stop", 32},
{"Slot/connector", 33},
{"ACPI power state", 34},
{"Watchdog 2", 35},
{"Platform alert", 36},
{"Entity presence", 37},
{"Monitor ASIC/IC", 38},
{"LAN", 39},
{"Management subsytem health",40},
{"Battery", 41},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_1 = {
BIT_DESC_MAP_LIST,
{ {"<LNC", 0}, /* '<' : getting worse */
{">LNC", 1}, /* '>' : getting better */
{"<LC", 2},
{">LC", 3},
{"<LNR", 4},
{">LNR", 5},
{">UNC", 6},
{"<UNC", 7},
{">UC", 8},
{"<UC", 9},
{">UNR", 10},
{"<UNR", 11},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_2 = {
BIT_DESC_MAP_LIST,
{ {"transition to idle", 0},
{"transition to active", 1},
{"transition to busy", 2},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_3 = {
BIT_DESC_MAP_LIST,
{ {"state deasserted", 0},
{"state asserted", 1},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_4 = {
BIT_DESC_MAP_LIST,
{ {"predictive failure deasserted", 0},
{"predictive failure asserted", 1},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_5 = {
BIT_DESC_MAP_LIST,
{ {"limit not exceeded", 0},
{"limit exceeded", 1},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_6 = {
BIT_DESC_MAP_LIST,
{ {"performance met", 0},
{"performance lags", 1},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_7 = {
BIT_DESC_MAP_LIST,
{ {"ok", 0},
{"<warn", 1}, /* '<' : getting worse */
{"<fail", 2},
{"<dead", 3},
{">warn", 4}, /* '>' : getting better */
{">fail", 5},
{"dead", 6},
{"monitor", 7},
{"informational", 8},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_8 = {
BIT_DESC_MAP_LIST,
{ {"device removed/absent", 0},
{"device inserted/present", 1},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_9 = {
BIT_DESC_MAP_LIST,
{ {"device disabled", 0},
{"device enabled", 1},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_10 = {
BIT_DESC_MAP_LIST,
{ {"transition to running", 0},
{"transition to in test", 1},
{"transition to power off", 2},
{"transition to online", 3},
{"transition to offline", 4},
{"transition to off duty", 5},
{"transition to degraded", 6},
{"transition to power save", 7},
{"install error", 8},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_11 = {
BIT_DESC_MAP_LIST,
{ {"fully redundant", 0},
{"redundancy lost", 1},
{"redundancy degraded", 2},
{"<non-redundant/sufficient", 3}, /* '<' : getting worse */
{">non-redundant/sufficient", 4}, /* '>' : getting better */
{"non-redundant/insufficient", 5},
{"<redundancy degraded", 6},
{">redundancy degraded", 7},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_12 = {
BIT_DESC_MAP_LIST,
{ {"D0 power state", 0},
{"D1 power state", 1},
{"D2 power state", 2},
{"D3 power state", 3},
{NULL}
} };
static struct bit_desc_map *
pef_b2s_generic_ER[] __attribute__((unused)) = {
&pef_b2s_gentype_1,
&pef_b2s_gentype_2,
&pef_b2s_gentype_3,
&pef_b2s_gentype_4,
&pef_b2s_gentype_5,
&pef_b2s_gentype_6,
&pef_b2s_gentype_7,
&pef_b2s_gentype_8,
&pef_b2s_gentype_9,
&pef_b2s_gentype_10,
&pef_b2s_gentype_11,
&pef_b2s_gentype_12,
};
#define PEF_B2S_GENERIC_ER_ENTRIES \
(sizeof(pef_b2s_generic_ER) / sizeof(pef_b2s_generic_ER[0]))
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
@ -118,7 +336,6 @@ struct bit_desc_map { /* description text container */
struct pef_policy_entry {
#define PEF_POLICY_ID_MASK 0xf0
#define PEF_POLICY_ID_SHIFT 4
#define PEF_POLICY_DISABLED 0xF7
#define PEF_POLICY_ENABLED 0x08
#define PEF_POLICY_FLAGS_MASK 0x07
#define PEF_POLICY_FLAGS_MATCH_ALWAYS 0
@ -138,6 +355,46 @@ struct pef_policy_entry {
#pragma pack(0)
#endif
static struct bit_desc_map
pef_b2s_policies __attribute__((unused)) = {
BIT_DESC_MAP_LIST,
{ {"Match-always", PEF_POLICY_FLAGS_MATCH_ALWAYS},
{"Try-next-entry", PEF_POLICY_FLAGS_PREV_OK_SKIP},
{"Try-next-set", PEF_POLICY_FLAGS_PREV_OK_NEXT_POLICY_SET},
{"Try-next-channel", PEF_POLICY_FLAGS_PREV_OK_NEXT_CHANNEL_IN_SET},
{"Try-next-destination", PEF_POLICY_FLAGS_PREV_OK_NEXT_DESTINATION_IN_SET},
{NULL}
} };
static struct bit_desc_map
pef_b2s_ch_medium __attribute__((unused)) = {
#define PEF_CH_MEDIUM_TYPE_IPMB 1
#define PEF_CH_MEDIUM_TYPE_ICMB_10 2
#define PEF_CH_MEDIUM_TYPE_ICMB_09 3
#define PEF_CH_MEDIUM_TYPE_LAN 4
#define PEF_CH_MEDIUM_TYPE_SERIAL 5
#define PEF_CH_MEDIUM_TYPE_XLAN 6
#define PEF_CH_MEDIUM_TYPE_PCI_SMBUS 7
#define PEF_CH_MEDIUM_TYPE_SMBUS_V1X 8
#define PEF_CH_MEDIUM_TYPE_SMBUS_V2X 9
#define PEF_CH_MEDIUM_TYPE_USB_V1X 10
#define PEF_CH_MEDIUM_TYPE_USB_V2X 11
#define PEF_CH_MEDIUM_TYPE_SYSTEM 12
BIT_DESC_MAP_LIST,
{ {"IPMB (I2C)", PEF_CH_MEDIUM_TYPE_IPMB},
{"ICMB v1.0", PEF_CH_MEDIUM_TYPE_ICMB_10},
{"ICMB v0.9", PEF_CH_MEDIUM_TYPE_ICMB_09},
{"802.3 LAN", PEF_CH_MEDIUM_TYPE_LAN},
{"Serial/Modem (RS-232)", PEF_CH_MEDIUM_TYPE_SERIAL},
{"Other LAN", PEF_CH_MEDIUM_TYPE_XLAN},
{"PCI SMBus", PEF_CH_MEDIUM_TYPE_PCI_SMBUS},
{"SMBus v1.0/1.1", PEF_CH_MEDIUM_TYPE_SMBUS_V1X},
{"SMBus v2.0", PEF_CH_MEDIUM_TYPE_SMBUS_V2X},
{"USB 1.x", PEF_CH_MEDIUM_TYPE_USB_V1X},
{"USB 2.x", PEF_CH_MEDIUM_TYPE_USB_V2X},
{"System I/F (KCS,SMIC,BT)", PEF_CH_MEDIUM_TYPE_SYSTEM},
{NULL}
} };
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
@ -192,6 +449,15 @@ struct pef_cfgparm_control {
#pragma pack(0)
#endif
static struct bit_desc_map
pef_b2s_control __attribute__((unused)) = {
BIT_DESC_MAP_ALL,
{ {"PEF", PEF_CONTROL_ENABLE},
{"PEF event messages", PEF_CONTROL_ENABLE_EVENT_MESSAGES},
{"PEF startup delay", PEF_CONTROL_ENABLE_STARTUP_DELAY},
{"Alert startup delay", PEF_CONTROL_ENABLE_ALERT_STARTUP_DELAY},
{NULL}
} };
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
@ -244,9 +510,7 @@ struct pef_cfgparm_filter_table_size {
#pragma pack(1)
#endif
struct pef_cfgparm_filter_table_entry {
# define PEF_FILTER_DISABLED 0x7F
# define PEF_FILTER_ENABLED 0x80
# define PEF_FILTER_TABLE_ID_MASK 0x7F
#define PEF_FILTER_TABLE_ID_MASK 0x7f
uint8_t data1;
struct pef_table_entry entry;
} ATTRIBUTE_PACKING;
@ -258,8 +522,8 @@ struct pef_cfgparm_filter_table_entry {
#pragma pack(1)
#endif
struct pef_cfgparm_filter_table_data_1 {
uint8_t id;
uint8_t cfg;
uint8_t data1;
uint8_t data2;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
@ -389,6 +653,15 @@ struct pef_lan_cfgparm_dest_type {
#pragma pack(0)
#endif
static struct bit_desc_map
pef_b2s_lan_desttype __attribute__((unused)) = {
BIT_DESC_MAP_LIST,
{ {"Acknowledged", PEF_LAN_DEST_TYPE_ACK},
{"PET", PEF_LAN_DEST_TYPE_PET},
{"OEM 1", PEF_LAN_DEST_TYPE_OEM_1},
{"OEM 2", PEF_LAN_DEST_TYPE_OEM_2},
{NULL}
} };
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
@ -479,6 +752,18 @@ struct pef_serial_cfgparm_dest_info {
#pragma pack(0)
#endif
static struct bit_desc_map
pef_b2s_serial_desttype __attribute__((unused)) = {
BIT_DESC_MAP_LIST,
{ {"Acknowledged", PEF_SERIAL_DEST_TYPE_ACK},
{"TAP page", PEF_SERIAL_DEST_TYPE_TAP},
{"PPP PET", PEF_SERIAL_DEST_TYPE_PPP},
{"Basic callback", PEF_SERIAL_DEST_TYPE_BASIC_CALLBACK},
{"PPP callback", PEF_SERIAL_DEST_TYPE_PPP_CALLBACK},
{"OEM 1", PEF_SERIAL_DEST_TYPE_OEM_1},
{"OEM 2", PEF_SERIAL_DEST_TYPE_OEM_2},
{NULL}
} };
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
@ -547,6 +832,14 @@ struct pef_serial_cfgparm_tap_svc_settings {
#pragma pack(0)
#endif
static struct bit_desc_map
pef_b2s_tap_svc_confirm __attribute__((unused)) = {
BIT_DESC_MAP_LIST,
{ {"ACK", PEF_SERIAL_TAP_CONFIRMATION_ACK_AFTER_ETX},
{"211+ACK", PEF_SERIAL_TAP_CONFIRMATION_211_ACK_AFTER_ETX},
{"{211|213}+ACK", PEF_SERIAL_TAP_CONFIRMATION_21X_ACK_AFTER_ETX},
{NULL}
} };
#if 0 /* FYI : config parm groupings */
struct pef_config_parms { /* PEF */
@ -643,7 +936,6 @@ struct pef_serial_cfgparm_tap_svc_settings {
#endif
#define IPMI_CMD_GET_PEF_CAPABILITIES 0x10
#define IPMI_CMD_SET_PEF_CONFIG_PARMS 0x12
#define IPMI_CMD_GET_PEF_CONFIG_PARMS 0x13
#define IPMI_CMD_GET_LAST_PROCESSED_EVT_ID 0x15
#define IPMI_CMD_GET_SYSTEM_GUID 0x37
@ -651,13 +943,6 @@ struct pef_serial_cfgparm_tap_svc_settings {
#define IPMI_CMD_LAN_GET_CONFIG 0x02
#define IPMI_CMD_SERIAL_GET_CONFIG 0x11
struct pef_cfgparm_set_policy_table_entry
{
uint8_t param_selector;
uint8_t policy_id;
struct pef_policy_entry entry;
} ATTRIBUTE_PACKING;
const char * ipmi_pef_bit_desc(struct bit_desc_map * map, uint32_t val);
void ipmi_pef_print_flags(struct bit_desc_map * map, flg_e type, uint32_t val);
void ipmi_pef_print_dec(const char * text, uint32_t val);

View File

@ -12,7 +12,6 @@
#define PICMG_CPCI_MAJOR_VERSION 1
#define PICMG_ATCA_MAJOR_VERSION 2
#define PICMG_AMC_MAJOR_VERSION 4
#define PICMG_UTCA_MAJOR_VERSION 5
/* PICMG commands */
#define PICMG_GET_PICMG_PROPERTIES_CMD 0x00
@ -92,7 +91,95 @@ typedef enum picmg_busres_resource_id {
PICMG_BUSRES_SYNC_CLOCK_GROUP_3
} t_picmg_busres_resource_id;
const char *picmg_led_color_str(int color);
/* the LED color capabilities */
static const char* led_color_str[] __attribute__((unused)) = {
"reserved",
"BLUE",
"RED",
"GREEN",
"AMBER",
"ORANGE",
"WHITE",
"reserved"
};
static const char* amc_link_type_str[] __attribute__((unused)) = {
"RESERVED",
"RESERVED1",
"PCI EXPRESS",
"ADVANCED SWITCHING1",
"ADVANCED SWITCHING2",
"ETHERNET",
"RAPIDIO",
"STORAGE",
};
static const char* amc_link_type_ext_str[][16] __attribute__((unused)) = {
/* FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED */
{
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
},
/* FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED1 */
{
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
},
/* FRU_PICMGEXT_AMC_LINK_TYPE_PCI_EXPRESS */
{
"Gen 1 - NSSC",
"Gen 1 - SSC",
"Gen 2 - NSSC",
"Gen 2 - SSC",
"", "", "", "",
"", "", "", "",
"", "", "", ""
},
/* FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING1 */
{
"Gen 1 - NSSC",
"Gen 1 - SSC",
"Gen 2 - NSSC",
"Gen 2 - SSC",
"", "", "", "",
"", "", "", "",
"", "", "", ""
},
/* FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING2 */
{
"Gen 1 - NSSC",
"Gen 1 - SSC",
"Gen 2 - NSSC",
"Gen 2 - SSC",
"", "", "", "",
"", "", "", "",
"", "", "", ""
},
/* FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET */
{
"1000BASE-BX (SerDES Gigabit)",
"10GBASE-BX410 Gigabit XAUI",
"", "",
"", "", "", "",
"", "", "", "",
"", "", "", ""
},
/* FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO */
{
"1.25 Gbaud transmission rate",
"2.5 Gbaud transmission rate",
"3.125 Gbaud transmission rate",
"", "", "", "", "",
"", "", "", "", "", "", "", ""
},
/* FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE */
{
"Fibre Channel",
"Serial ATA",
"Serial Attached SCSI",
"", "", "", "", "",
"", "", "", "", "", "", "", ""
}
};
struct sAmcPortState {
#ifndef WORDS_BIGENDIAN

View File

@ -37,7 +37,6 @@
# include <config.h>
#endif
#include <stdbool.h>
#include <inttypes.h>
#include <math.h>
#include <ipmitool/bswap.h>
@ -103,24 +102,8 @@ enum {
#define GET_SENSOR_EVENT_STATUS 0x2b
#define GET_SENSOR_READING 0x2d
#define GET_SENSOR_TYPE 0x2f
/*
* IPMI Specification limits the length of the ID string to 16 bytes for
* SDR records, although the ID type/length code may contain a number up
* to 31 (0x1F). See IPMI 2.0 Specification Tables 43-6 through 43-8.
*/
#define SDR_TYPECODE_LEN_MASK 0x1f
#define SDR_ID_STRING_MAX 16
#define SDR_ID_STRLEN_BYTYPE(typelen) \
((size_t)__max(typelen & SDR_TYPECODE_LEN_MASK, SDR_ID_STRING_MAX))
#define SDR_ID_STRLEN(sdr) SDR_ID_STRLEN_BYTYPE((sdr)->id_code)
#define SDR_ID_TO_CSTRING(cstring, sdr) \
do { \
memset((cstring), 0, sizeof(cstring)); \
snprintf((cstring), sizeof(cstring), "%.*s", \
SDR_ID_STRLEN(sdr), (sdr)->id_string); \
} while(0)
#define GET_SENSOR_READING 0x2d
#define GET_SENSOR_TYPE 0x2f
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
@ -400,29 +383,6 @@ struct sdr_record_common_sensor {
struct sdr_record_mask mask;
/* IPMI 2.0, Table 43-1, byte 21[7:6] Analog (numeric) Data Format */
#define SDR_UNIT_FMT_UNSIGNED 0 /* unsigned */
#define SDR_UNIT_FMT_1S_COMPL 1 /* 1's complement (signed) */
#define SDR_UNIT_FMT_2S_COMPL 2 /* 2's complement (signed) */
#define SDR_UNIT_FMT_NA 3 /* does not return analog (numeric) reading */
/* IPMI 2.0, Table 43-1, byte 21[5:3] Rate */
#define SDR_UNIT_RATE_NONE 0 /* none */
#define SDR_UNIT_RATE_MICROSEC 1 /* per us */
#define SDR_UNIT_RATE_MILLISEC 2 /* per ms */
#define SDR_UNIT_RATE_SEC 3 /* per s */
#define SDR_UNIT_RATE_MIN 4 /* per min */
#define SDR_UNIT_RATE_HR 5 /* per hour */
#define SDR_UNIT_RATE_DAY 6 /* per day */
#define SDR_UNIT_RATE_RSVD 7 /* reserved */
/* IPMI 2.0, Table 43-1, byte 21[2:1] Modifier Unit */
#define SDR_UNIT_MOD_NONE 0 /* none */
#define SDR_UNIT_MOD_DIV 1 /* Basic Unit / Modifier Unit */
#define SDR_UNIT_MOD_MUL 2 /* Basic Unit * Mofifier Unit */
#define SDR_UNIT_MOD_RSVD 3 /* Reserved */
/* IPMI 2.0, Table 43-1, byte 21[0] Percentage */
#define SDR_UNIT_PCT_NO 0
#define SDR_UNIT_PCT_YES 1
struct {
#if WORDS_BIGENDIAN
uint8_t analog:2;
@ -436,8 +396,8 @@ struct sdr_record_common_sensor {
uint8_t analog:2;
#endif
struct {
uint8_t base; /* Base unit type code per IPMI 2.0 Table 43-15 */
uint8_t modifier; /* Modifier unit type code per Table 43-15 */
uint8_t base;
uint8_t modifier;
} ATTRIBUTE_PACKING type;
} ATTRIBUTE_PACKING unit;
} ATTRIBUTE_PACKING;
@ -484,7 +444,7 @@ struct sdr_record_compact_sensor {
uint8_t __reserved[3];
uint8_t oem; /* reserved for OEM use */
uint8_t id_code; /* sensor ID string type/length code */
uint8_t id_string[SDR_ID_STRING_MAX]; /* sensor ID string bytes */
uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
@ -535,7 +495,7 @@ struct sdr_record_eventonly_sensor {
uint8_t __reserved;
uint8_t oem; /* reserved for OEM use */
uint8_t id_code; /* sensor ID string type/length code */
uint8_t id_string[SDR_ID_STRING_MAX]; /* sensor ID string bytes */
uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
@ -605,7 +565,7 @@ struct sdr_record_full_sensor {
uint8_t __reserved[2];
uint8_t oem; /* reserved for OEM use */
uint8_t id_code; /* sensor ID string type/length code */
uint8_t id_string[SDR_ID_STRING_MAX]; /* sensor ID string bytes */
uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
@ -637,7 +597,7 @@ struct sdr_record_mc_locator {
struct entity_id entity;
uint8_t oem;
uint8_t id_code;
uint8_t id_string[SDR_ID_STRING_MAX];
uint8_t id_string[16];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
@ -670,7 +630,7 @@ struct sdr_record_fru_locator {
struct entity_id entity;
uint8_t oem;
uint8_t id_code;
uint8_t id_string[SDR_ID_STRING_MAX];
uint8_t id_string[16];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
@ -704,7 +664,7 @@ struct sdr_record_generic_locator {
struct entity_id entity;
uint8_t oem;
uint8_t id_code;
uint8_t id_string[SDR_ID_STRING_MAX];
uint8_t id_string[16];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
@ -815,15 +775,55 @@ struct sdr_record_list {
#pragma pack(0)
#endif
/* unit description codes (IPMI v1.5 section 37.16) */
#define UNIT_MAX 0x90
static const char *unit_desc[] __attribute__ ((unused)) = {
"unspecified",
"degrees C", "degrees F", "degrees K",
"Volts", "Amps", "Watts", "Joules",
"Coulombs", "VA", "Nits",
"lumen", "lux", "Candela",
"kPa", "PSI", "Newton",
"CFM", "RPM", "Hz",
"microsecond", "millisecond", "second", "minute", "hour",
"day", "week", "mil", "inches", "feet", "cu in", "cu feet",
"mm", "cm", "m", "cu cm", "cu m", "liters", "fluid ounce",
"radians", "steradians", "revolutions", "cycles",
"gravities", "ounce", "pound", "ft-lb", "oz-in", "gauss",
"gilberts", "henry", "millihenry", "farad", "microfarad",
"ohms", "siemens", "mole", "becquerel", "PPM", "reserved",
"Decibels", "DbA", "DbC", "gray", "sievert",
"color temp deg K", "bit", "kilobit", "megabit", "gigabit",
"byte", "kilobyte", "megabyte", "gigabyte", "word", "dword",
"qword", "line", "hit", "miss", "retry", "reset",
"overflow", "underrun", "collision", "packets", "messages",
"characters", "error", "correctable error", "uncorrectable error",};
/* sensor type codes (IPMI v1.5 table 36.3)
/ Updated to v2.0 Table 42-3, Sensor Type Codes */
#define SENSOR_TYPE_MAX 0x2C
static const char *sensor_type_desc[] __attribute__ ((unused)) = {
"reserved",
"Temperature", "Voltage", "Current", "Fan",
"Physical Security", "Platform Security", "Processor",
"Power Supply", "Power Unit", "Cooling Device", "Other",
"Memory", "Drive Slot / Bay", "POST Memory Resize",
"System Firmwares", "Event Logging Disabled", "Watchdog1",
"System Event", "Critical Interrupt", "Button",
"Module / Board", "Microcontroller", "Add-in Card",
"Chassis", "Chip Set", "Other FRU", "Cable / Interconnect",
"Terminator", "System Boot Initiated", "Boot Error",
"OS Boot", "OS Critical Stop", "Slot / Connector",
"System ACPI Power State", "Watchdog2", "Platform Alert",
"Entity Presence", "Monitor ASIC", "LAN",
"Management Subsys Health", "Battery", "Session Audit",
"Version Change", "FRU State" };
struct sensor_reading {
char s_id[SDR_ID_STRING_MAX + 1]; /* sensor name, null-terminated */
union {
char s_id[17]; /* name of the sensor */
struct sdr_record_full_sensor *full;
struct sdr_record_compact_sensor *compact;
void *raw;
};
uint8_t s_reading_valid; /* read value valididity */
uint8_t s_scanning_disabled; /* read of value disabled */
uint8_t s_reading_unavailable; /* read value unavailable */
@ -866,10 +866,11 @@ struct sdr_get_rs *ipmi_sdr_get_next_header(struct ipmi_intf *intf,
struct ipmi_sdr_iterator *i);
uint8_t *ipmi_sdr_get_record(struct ipmi_intf *intf, struct sdr_get_rs *header,
struct ipmi_sdr_iterator *i);
void ipmi_sdr_end(struct ipmi_sdr_iterator *i);
void ipmi_sdr_end(struct ipmi_intf *intf, struct ipmi_sdr_iterator *i);
int ipmi_sdr_print_sdr(struct ipmi_intf *intf, uint8_t type);
int sdr_get_name_from_rawentry(uint8_t type, void *raw, char *buf, size_t len);
int ipmi_sdr_print_name_from_rawentry(struct ipmi_intf *intf,uint16_t id,
uint8_t type,uint8_t * raw);
int ipmi_sdr_print_rawentry(struct ipmi_intf *intf, uint8_t type, uint8_t * raw,
int len);
int ipmi_sdr_print_listentry(struct ipmi_intf *intf,
@ -878,7 +879,7 @@ void ipmi_sdr_print_sensor_hysteresis(struct sdr_record_common_sensor *sensor,
struct sdr_record_full_sensor *full,
uint8_t hysteresis_value,
const char *hdrstr);
const char *ipmi_sdr_get_unit_string(bool pct, uint8_t type,
const char *ipmi_sdr_get_unit_string(uint8_t pct, uint8_t type,
uint8_t base, uint8_t modifier);
struct sensor_reading *
ipmi_sdr_read_sensor_value(struct ipmi_intf *intf,
@ -908,14 +909,21 @@ struct ipmi_rs *ipmi_sdr_get_sensor_thresholds(struct ipmi_intf *intf,
struct ipmi_rs *ipmi_sdr_get_sensor_hysteresis(struct ipmi_intf *intf,
uint8_t sensor,
uint8_t target, uint8_t lun, uint8_t channel);
const char *ipmi_sdr_get_sensor_type_desc(const uint8_t type);
int ipmi_sdr_get_reservation(struct ipmi_intf *intf, int use_builtin,
uint16_t * reserve_id);
int ipmi_sdr_print_sensor_eventonly(struct ipmi_intf *intf,
struct sdr_record_eventonly_sensor *sensor);
int ipmi_sdr_print_sensor_generic_locator(struct sdr_record_generic_locator *fru);
int ipmi_sdr_print_sensor_fru_locator(struct sdr_record_fru_locator *fru);
int ipmi_sdr_print_sensor_mc_locator(struct sdr_record_mc_locator *mc);
int ipmi_sdr_print_sensor_generic_locator(struct ipmi_intf *intf,
struct sdr_record_generic_locator
*fru);
int ipmi_sdr_print_sensor_fru_locator(struct ipmi_intf *intf,
struct sdr_record_fru_locator *fru);
int ipmi_sdr_print_sensor_mc_locator(struct ipmi_intf *intf,
struct sdr_record_mc_locator *mc);
int ipmi_sdr_print_sensor_entity_assoc(struct ipmi_intf *intf,
struct sdr_record_entity_assoc *assoc);
struct sdr_record_list *ipmi_sdr_find_sdr_byentity(struct ipmi_intf *intf,
struct entity_id *entity);
@ -928,15 +936,13 @@ struct sdr_record_list *ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf,
struct sdr_record_list *ipmi_sdr_find_sdr_bytype(struct ipmi_intf *intf,
uint8_t type);
int ipmi_sdr_list_cache(struct ipmi_intf *intf);
int ipmi_sdr_list_cache_fromfile(const char *ifile);
void ipmi_sdr_list_empty(void);
int ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile);
void ipmi_sdr_list_empty(struct ipmi_intf *intf);
int ipmi_sdr_print_info(struct ipmi_intf *intf);
void ipmi_sdr_print_discrete_state(struct ipmi_intf *intf,
const char *desc, uint8_t sensor_type,
void ipmi_sdr_print_discrete_state(const char *desc, uint8_t sensor_type,
uint8_t event_type, uint8_t state1,
uint8_t state2);
void ipmi_sdr_print_discrete_state_mini(struct ipmi_intf *intf,
const char *header, const char *separator,
void ipmi_sdr_print_discrete_state_mini(const char *header, const char *separator,
uint8_t sensor_type, uint8_t event_type,
uint8_t state1, uint8_t state2);
int ipmi_sdr_print_sensor_event_status(struct ipmi_intf *intf,

View File

@ -0,0 +1,693 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution 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.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef IPMI_SEL_H
#define IPMI_SEL_H
#include <inttypes.h>
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_sdr.h>
#define IPMI_CMD_GET_SEL_INFO 0x40
#define IPMI_CMD_GET_SEL_ALLOC_INFO 0x41
#define IPMI_CMD_RESERVE_SEL 0x42
#define IPMI_CMD_GET_SEL_ENTRY 0x43
#define IPMI_CMD_ADD_SEL_ENTRY 0x44
#define IPMI_CMD_PARTIAL_ADD_SEL_ENTRY 0x45
#define IPMI_CMD_DELETE_SEL_ENTRY 0x46
#define IPMI_CMD_CLEAR_SEL 0x47
#define IPMI_CMD_GET_SEL_TIME 0x48
#define IPMI_CMD_SET_SEL_TIME 0x49
#define IPMI_CMD_GET_AUX_LOG_STATUS 0x5A
#define IPMI_CMD_SET_AUX_LOG_STATUS 0x5B
enum {
IPMI_EVENT_CLASS_DISCRETE,
IPMI_EVENT_CLASS_DIGITAL,
IPMI_EVENT_CLASS_THRESHOLD,
IPMI_EVENT_CLASS_OEM,
};
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct sel_get_rq {
uint16_t reserve_id;
uint16_t record_id;
uint8_t offset;
uint8_t length;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
struct standard_spec_sel_rec{
uint32_t timestamp;
uint16_t gen_id;
uint8_t evm_rev;
uint8_t sensor_type;
uint8_t sensor_num;
#if WORDS_BIGENDIAN
uint8_t event_dir : 1;
uint8_t event_type : 7;
#else
uint8_t event_type : 7;
uint8_t event_dir : 1;
#endif
#define DATA_BYTE2_SPECIFIED_MASK 0xc0 /* event_data[0] bit mask */
#define DATA_BYTE3_SPECIFIED_MASK 0x30 /* event_data[0] bit mask */
#define EVENT_OFFSET_MASK 0x0f /* event_data[0] bit mask */
uint8_t event_data[3];
};
/* Dell Specific MACRO's */
#define OEM_CODE_IN_BYTE2 0x80 /* Dell specific OEM Byte in Byte 2 Mask */
#define OEM_CODE_IN_BYTE3 0x20 /* Dell specific OEM Byte in Byte 3 Mask */
/* MASK MACROS */
#define MASK_LOWER_NIBBLE 0x0F
#define MASK_HIGHER_NIBBLE 0xF0
/*Senosr type Macro's */
#define SENSOR_TYPE_MEMORY 0x0C
#define SENSOR_TYPE_CRIT_INTR 0x13
#define SENSOR_TYPE_EVT_LOG 0x10
#define SENSOR_TYPE_SYS_EVENT 0x12
#define SENSOR_TYPE_PROCESSOR 0x07
#define SENSOR_TYPE_OEM_SEC_EVENT 0xC1
#define SENSOR_TYPE_VER_CHANGE 0x2B
#define SENSOR_TYPE_FRM_PROG 0x0F
#define SENSOR_TYPE_WTDOG 0x23
#define SENSOR_TYPE_OEM_NFATAL_ERROR 0xC2
#define SENSOR_TYPE_OEM_FATAL_ERROR 0xC3
#define SENSOR_TYPE_TXT_CMD_ERROR 0x20
/* End of Macro for DELL Specific */
#define SEL_OEM_TS_DATA_LEN 6
#define SEL_OEM_NOTS_DATA_LEN 13
struct oem_ts_spec_sel_rec{
uint32_t timestamp;
uint8_t manf_id[3];
uint8_t oem_defined[SEL_OEM_TS_DATA_LEN];
};
struct oem_nots_spec_sel_rec{
uint8_t oem_defined[SEL_OEM_NOTS_DATA_LEN];
};
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct sel_event_record {
uint16_t record_id;
uint8_t record_type;
union{
struct standard_spec_sel_rec standard_type;
struct oem_ts_spec_sel_rec oem_ts_type;
struct oem_nots_spec_sel_rec oem_nots_type;
} sel_type;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
struct ipmi_event_sensor_types {
uint8_t code;
uint8_t offset;
#define ALL_OFFSETS_SPECIFIED 0xff
uint8_t data;
uint8_t class;
const char * type;
const char * desc;
};
/* The sel module uses the "iana" number to select the appropriate array at run time
This table if for iana number 15000 ( Kontron ), you can add you own OEM sensor types
using a similar constuct, look for switch(iana) in ipmi_sel.c
*/
static struct ipmi_event_sensor_types oem_kontron_event_types[] __attribute__((unused)) = {
/* event type details uses an oem event type */
{ 0xC0 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info", NULL },
{ 0xC0 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info", NULL },
{ 0xC1 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Push Button" },
{ 0xC1 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Bridge Reset" },
{ 0xC1 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Backplane" },
{ 0xC1 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hotswap Fault" },
{ 0xC1 , 0x04 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hotswap Healty" },
{ 0xC1 , 0x05 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Unknown" },
{ 0xC1 , 0x06 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "ITP" },
{ 0xC1 , 0x07 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hardware Watchdog" },
{ 0xC1 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Software Reset" },
/* Uses standard digital reading type */
{ 0xC2 , 0xFF , 0xff, IPMI_EVENT_CLASS_DIGITAL , "SDRR Init Agent", NULL },
/* based on PICMG IPMB-0 Link state sensor */
{ 0xC3 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "IPMB-L Link State", "IPMB L Disabled" },
{ 0xC3 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "IPMB-L Link State", "IPMB L Enabled" },
{ 0xC4 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Push Button" },
{ 0xC4 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Hardware Power Failure" },
{ 0xC4 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Unknown" },
{ 0xC4 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Hardware Watchdog" },
{ 0xC4 , 0x04 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Soft Reset" },
{ 0xC4 , 0x05 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Warm Reset" },
{ 0xC4 , 0x06 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Cold Reset" },
{ 0xC4 , 0x07 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "IPMI Command" },
{ 0xC4 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Setup Reset (Save CMOS)" },
{ 0xC4 , 0x09 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Power Up Reset" },
/* event type details uses a standard */
{ 0xC5 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Information Agent", NULL },
{ 0xC6 , 0x0E , 0xff, IPMI_EVENT_CLASS_DISCRETE , "POST Value", "Post Error (see data2)" },
{ 0xC7 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Upgrade" },
{ 0xC7 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Rollback(error)" },
{ 0xC7 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Errors (watchdog)" },
{ 0xC7 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Manual Rollback" },
{ 0xC7 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "Firmware Watchdog Bite, reset occured" },
{ 0xC8 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Not Loaded" },
{ 0xC8 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Initializing" },
{ 0xC8 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Ready" },
{ 0xC8 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Failure (see data2)" },
{ 0xC9 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Started" },
{ 0xC9 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Pass" },
{ 0xC9 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Fail" },
{ 0xCA , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Firmware Upgrade Status", "In progress"},
{ 0xCA , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Firmware Upgrade Status", "Success"},
{ 0xCA , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Firmware Upgrade Status", "Failure"},
{ 0xCB , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Over Current", "Asserted"},
{ 0xCB , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Over Current", "Deasserted"},
{ 0xCC , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Sensor Error", "Asserted"},
{ 0xCC , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Sensor Error", "Deasserted"},
{ 0xCD , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Power Denied", "Asserted"},
{ 0xCD , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Power Denied", "Deasserted"},
{ 0xCF , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Reset", "Asserted"},
{ 0xCF , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Reset", "Deasserted"},
/* END */
{ 0x00, 0x00, 0xff, 0x00, NULL, NULL },
};
static struct ipmi_event_sensor_types generic_event_types[] __attribute__((unused)) = {
/* Threshold Based States */
{ 0x01, 0x00, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-critical going low " },
{ 0x01, 0x01, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-critical going high" },
{ 0x01, 0x02, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Critical going low " },
{ 0x01, 0x03, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Critical going high" },
{ 0x01, 0x04, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-recoverable going low " },
{ 0x01, 0x05, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-recoverable going high" },
{ 0x01, 0x06, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-critical going low " },
{ 0x01, 0x07, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-critical going high" },
{ 0x01, 0x08, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Critical going low " },
{ 0x01, 0x09, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Critical going high" },
{ 0x01, 0x0a, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-recoverable going low " },
{ 0x01, 0x0b, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-recoverable going high" },
/* DMI-based "usage state" States */
{ 0x02, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Idle" },
{ 0x02, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Active" },
{ 0x02, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Busy" },
/* Digital-Discrete Event States */
{ 0x03, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "State Deasserted" },
{ 0x03, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "State Asserted" },
{ 0x04, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Predictive Failure Deasserted" },
{ 0x04, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Predictive Failure Asserted" },
{ 0x05, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Limit Not Exceeded" },
{ 0x05, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Limit Exceeded" },
{ 0x06, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Performance Met" },
{ 0x06, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Performance Lags" },
/* Severity Event States */
{ 0x07, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to OK" },
{ 0x07, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-critical from OK" },
{ 0x07, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Critical from less severe" },
{ 0x07, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-recoverable from less severe" },
{ 0x07, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-critical from more severe" },
{ 0x07, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Critical from Non-recoverable" },
{ 0x07, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-recoverable" },
{ 0x07, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Monitor" },
{ 0x07, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Informational" },
/* Availability Status States */
{ 0x08, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Absent" },
{ 0x08, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Present" },
{ 0x09, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Disabled" },
{ 0x09, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Enabled" },
{ 0x0a, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Running" },
{ 0x0a, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to In Test" },
{ 0x0a, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Power Off" },
{ 0x0a, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to On Line" },
{ 0x0a, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Off Line" },
{ 0x0a, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Off Duty" },
{ 0x0a, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Degraded" },
{ 0x0a, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Power Save" },
{ 0x0a, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Install Error" },
/* Redundancy States */
{ 0x0b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Fully Redundant" },
{ 0x0b, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Lost" },
{ 0x0b, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Degraded" },
{ 0x0b, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Non-Redundant: Sufficient from Redundant" },
{ 0x0b, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Non-Redundant: Sufficient from Insufficient" },
{ 0x0b, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Non-Redundant: Insufficient Resources" },
{ 0x0b, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Degraded from Fully Redundant" },
{ 0x0b, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Degraded from Non-Redundant" },
/* ACPI Device Power States */
{ 0x0c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D0 Power State" },
{ 0x0c, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D1 Power State" },
{ 0x0c, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D2 Power State" },
{ 0x0c, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D3 Power State" },
/* END */
{ 0x00, 0x00, 0xff, 0x00, NULL, NULL },
};
static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unused)) = {
{ 0x00, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Reserved", NULL },
{ 0x01, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Temperature", NULL },
{ 0x02, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Voltage", NULL },
{ 0x03, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Current", NULL },
{ 0x04, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Fan", NULL },
{ 0x05, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "General Chassis intrusion" },
{ 0x05, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "Drive Bay intrusion" },
{ 0x05, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "I/O Card area intrusion" },
{ 0x05, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "Processor area intrusion" },
{ 0x05, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "System unplugged from LAN" },
{ 0x05, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "Unauthorized dock" },
{ 0x05, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "FAN area intrusion" },
{ 0x06, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Front Panel Lockout violation attempted" },
{ 0x06, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Pre-boot password violation - user password" },
{ 0x06, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Pre-boot password violation - setup password" },
{ 0x06, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Pre-boot password violation - network boot password" },
{ 0x06, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Other pre-boot password violation" },
{ 0x06, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Out-of-band access password violation" },
{ 0x07, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "IERR" },
{ 0x07, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Thermal Trip" },
{ 0x07, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "FRB1/BIST failure" },
{ 0x07, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "FRB2/Hang in POST failure" },
{ 0x07, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "FRB3/Processor startup/init failure" },
{ 0x07, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Configuration Error" },
{ 0x07, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "SM BIOS Uncorrectable CPU-complex Error" },
{ 0x07, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Presence detected" },
{ 0x07, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Disabled" },
{ 0x07, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Terminator presence detected" },
{ 0x07, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Throttled" },
{ 0x08, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Presence detected" },
{ 0x08, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Failure detected" },
{ 0x08, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Predictive failure" },
{ 0x08, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Power Supply AC lost" },
{ 0x08, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "AC lost or out-of-range" },
{ 0x08, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "AC out-of-range, but present" },
{ 0x08, 0x06, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Vendor Mismatch" },
{ 0x08, 0x06, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Revision Mismatch" },
{ 0x08, 0x06, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Processor Missing" },
{ 0x08, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error" },
{ 0x09, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Power off/down" },
{ 0x09, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Power cycle" },
{ 0x09, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "240VA power down" },
{ 0x09, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Interlock power down" },
{ 0x09, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "AC lost" },
{ 0x09, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Soft-power control failure" },
{ 0x09, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Failure detected" },
{ 0x09, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Predictive failure" },
{ 0x0a, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Cooling Device", NULL },
{ 0x0b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Other Units-based Sensor", NULL },
{ 0x0c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Correctable ECC" },
{ 0x0c, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Uncorrectable ECC" },
{ 0x0c, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Parity" },
{ 0x0c, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Memory Scrub Failed" },
{ 0x0c, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Memory Device Disabled" },
{ 0x0c, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Correctable ECC logging limit reached" },
{ 0x0c, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Presence Detected" },
{ 0x0c, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Configuration Error" },
{ 0x0c, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Spare" },
{ 0x0c, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Throttled" },
{ 0x0d, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Drive Present" },
{ 0x0d, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Drive Fault" },
{ 0x0d, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Predictive Failure" },
{ 0x0d, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Hot Spare" },
{ 0x0d, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Parity Check In Progress" },
{ 0x0d, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "In Critical Array" },
{ 0x0d, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "In Failed Array" },
{ 0x0d, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Rebuild In Progress" },
{ 0x0d, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Rebuild Aborted" },
{ 0x0e, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "POST Memory Resize", NULL },
{ 0x0f, 0x00, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unspecified" },
{ 0x0f, 0x00, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "No system memory installed" },
{ 0x0f, 0x00, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "No usable system memory" },
{ 0x0f, 0x00, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable IDE device failure" },
{ 0x0f, 0x00, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable system-board failure" },
{ 0x0f, 0x00, 0x05, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable diskette failure" },
{ 0x0f, 0x00, 0x06, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable hard-disk controller failure" },
{ 0x0f, 0x00, 0x07, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable PS/2 or USB keyboard failure" },
{ 0x0f, 0x00, 0x08, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Removable boot media not found" },
{ 0x0f, 0x00, 0x09, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable video controller failure" },
{ 0x0f, 0x00, 0x0a, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "No video device selected" },
{ 0x0f, 0x00, 0x0b, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "BIOS corruption detected" },
{ 0x0f, 0x00, 0x0c, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "CPU voltage mismatch" },
{ 0x0f, 0x00, 0x0d, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "CPU speed mismatch failure" },
{ 0x0f, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unknown Error" },
{ 0x0f, 0x01, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Unspecified" },
{ 0x0f, 0x01, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Memory initialization" },
{ 0x0f, 0x01, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Hard-disk initialization" },
{ 0x0f, 0x01, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Secondary CPU Initialization" },
{ 0x0f, 0x01, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "User authentication" },
{ 0x0f, 0x01, 0x05, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "User-initiated system setup" },
{ 0x0f, 0x01, 0x06, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "USB resource configuration" },
{ 0x0f, 0x01, 0x07, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "PCI resource configuration" },
{ 0x0f, 0x01, 0x08, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Option ROM initialization" },
{ 0x0f, 0x01, 0x09, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Video initialization" },
{ 0x0f, 0x01, 0x0a, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Cache initialization" },
{ 0x0f, 0x01, 0x0b, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "SMBus initialization" },
{ 0x0f, 0x01, 0x0c, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Keyboard controller initialization" },
{ 0x0f, 0x01, 0x0d, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Management controller initialization" },
{ 0x0f, 0x01, 0x0e, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Docking station attachment" },
{ 0x0f, 0x01, 0x0f, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Enabling docking station" },
{ 0x0f, 0x01, 0x10, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Docking station ejection" },
{ 0x0f, 0x01, 0x11, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Disabling docking station" },
{ 0x0f, 0x01, 0x12, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Calling operating system wake-up vector" },
{ 0x0f, 0x01, 0x13, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "System boot initiated" },
{ 0x0f, 0x01, 0x14, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Motherboard initialization" },
{ 0x0f, 0x01, 0x15, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "reserved" },
{ 0x0f, 0x01, 0x16, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Floppy initialization" },
{ 0x0f, 0x01, 0x17, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Keyboard test" },
{ 0x0f, 0x01, 0x18, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Pointing device test" },
{ 0x0f, 0x01, 0x19, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Primary CPU initialization" },
{ 0x0f, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Unknown Hang" },
{ 0x0f, 0x02, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Unspecified" },
{ 0x0f, 0x02, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Memory initialization" },
{ 0x0f, 0x02, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Hard-disk initialization" },
{ 0x0f, 0x02, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Secondary CPU Initialization" },
{ 0x0f, 0x02, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "User authentication" },
{ 0x0f, 0x02, 0x05, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "User-initiated system setup" },
{ 0x0f, 0x02, 0x06, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "USB resource configuration" },
{ 0x0f, 0x02, 0x07, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "PCI resource configuration" },
{ 0x0f, 0x02, 0x08, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Option ROM initialization" },
{ 0x0f, 0x02, 0x09, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Video initialization" },
{ 0x0f, 0x02, 0x0a, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Cache initialization" },
{ 0x0f, 0x02, 0x0b, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "SMBus initialization" },
{ 0x0f, 0x02, 0x0c, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Keyboard controller initialization" },
{ 0x0f, 0x02, 0x0d, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Management controller initialization" },
{ 0x0f, 0x02, 0x0e, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Docking station attachment" },
{ 0x0f, 0x02, 0x0f, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Enabling docking station" },
{ 0x0f, 0x02, 0x10, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Docking station ejection" },
{ 0x0f, 0x02, 0x11, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Disabling docking station" },
{ 0x0f, 0x02, 0x12, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Calling operating system wake-up vector" },
{ 0x0f, 0x02, 0x13, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "System boot initiated" },
{ 0x0f, 0x02, 0x14, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Motherboard initialization" },
{ 0x0f, 0x02, 0x15, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "reserved" },
{ 0x0f, 0x02, 0x16, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Floppy initialization" },
{ 0x0f, 0x02, 0x17, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Keyboard test" },
{ 0x0f, 0x02, 0x18, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Pointing device test" },
{ 0x0f, 0x02, 0x19, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Primary CPU initialization" },
{ 0x0f, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Unknown Progress" },
{ 0x10, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Correctable memory error logging disabled" },
{ 0x10, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Event logging disabled" },
{ 0x10, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Log area reset/cleared" },
{ 0x10, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "All event logging disabled" },
{ 0x10, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Log full" },
{ 0x10, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Log almost full" },
{ 0x11, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "BIOS Reset" },
{ 0x11, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Reset" },
{ 0x11, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Shut Down" },
{ 0x11, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Power Down" },
{ 0x11, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Power Cycle" },
{ 0x11, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS NMI/Diag Interrupt" },
{ 0x11, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Expired" },
{ 0x11, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS pre-timeout Interrupt" },
{ 0x12, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "System Reconfigured" },
{ 0x12, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "OEM System boot event" },
{ 0x12, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Undetermined system hardware failure" },
{ 0x12, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Entry added to auxiliary log" },
{ 0x12, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "PEF Action" },
{ 0x12, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Timestamp Clock Sync" },
{ 0x13, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "NMI/Diag Interrupt" },
{ 0x13, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Timeout" },
{ 0x13, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "I/O Channel check NMI" },
{ 0x13, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Software NMI" },
{ 0x13, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "PCI PERR" },
{ 0x13, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "PCI SERR" },
{ 0x13, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "EISA failsafe timeout" },
{ 0x13, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Correctable error" },
{ 0x13, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Uncorrectable error" },
{ 0x13, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Fatal NMI" },
{ 0x13, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Fatal Error" },
{ 0x14, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "Power Button pressed" },
{ 0x14, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "Sleep Button pressed" },
{ 0x14, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "Reset Button pressed" },
{ 0x14, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "FRU Latch" },
{ 0x14, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "FRU Service" },
{ 0x15, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module/Board", NULL },
{ 0x16, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Microcontroller/Coprocessor", NULL },
{ 0x17, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Add-in Card", NULL },
{ 0x18, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Chassis", NULL },
{ 0x19, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Chip Set", NULL },
{ 0x1a, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Other FRU", NULL },
{ 0x1b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Cable/Interconnect", "Connected" },
{ 0x1b, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Cable/Interconnect", "Config Error" },
{ 0x1c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Terminator", NULL },
{ 0x1d, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by power up" },
{ 0x1d, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by hard reset" },
{ 0x1d, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by warm reset" },
{ 0x1d, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "User requested PXE boot" },
{ 0x1d, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Automatic boot to diagnostic" },
{ 0x1d, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "OS initiated hard reset" },
{ 0x1d, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "OS initiated warm reset" },
{ 0x1d, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "System Restart" },
{ 0x1e, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "No bootable media" },
{ 0x1e, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "Non-bootable disk in drive" },
{ 0x1e, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "PXE server not found" },
{ 0x1e, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "Invalid boot sector" },
{ 0x1e, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "Timeout waiting for selection" },
{ 0x1f, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "A: boot completed" },
{ 0x1f, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "C: boot completed" },
{ 0x1f, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "PXE boot completed" },
{ 0x1f, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "Diagnostic boot completed" },
{ 0x1f, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "CD-ROM boot completed" },
{ 0x1f, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "ROM boot completed" },
{ 0x1f, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "boot completed - device not specified" },
{ 0x20, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "Error during system startup" },
{ 0x20, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "Run-time critical stop" },
{ 0x20, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "OS graceful stop" },
{ 0x20, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "OS graceful shutdown" },
{ 0x20, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "PEF initiated soft shutdown" },
{ 0x20, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "Agent not responding" },
{ 0x21, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Fault Status" },
{ 0x21, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Identify Status" },
{ 0x21, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Device Installed" },
{ 0x21, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Ready for Device Installation" },
{ 0x21, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Ready for Device Removal" },
{ 0x21, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Slot Power is Off" },
{ 0x21, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Device Removal Request" },
{ 0x21, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Interlock" },
{ 0x21, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Slot is Disabled" },
{ 0x21, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Spare Device" },
{ 0x22, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S0/G0: working" },
{ 0x22, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S1: sleeping with system hw & processor context maintained" },
{ 0x22, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S2: sleeping, processor context lost" },
{ 0x22, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S3: sleeping, processor & hw context lost, memory retained" },
{ 0x22, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S4: non-volatile sleep/suspend-to-disk" },
{ 0x22, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S5/G2: soft-off" },
{ 0x22, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S4/S5: soft-off" },
{ 0x22, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "G3: mechanical off" },
{ 0x22, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Sleeping in S1/S2/S3 state" },
{ 0x22, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "G1: sleeping" },
{ 0x22, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S5: entered by override" },
{ 0x22, 0x0b, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Legacy ON state" },
{ 0x22, 0x0c, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Legacy OFF state" },
{ 0x22, 0x0e, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Unknown" },
{ 0x23, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Timer expired" },
{ 0x23, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Hard reset" },
{ 0x23, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Power down" },
{ 0x23, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Power cycle" },
{ 0x23, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" },
{ 0x23, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" },
{ 0x23, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" },
{ 0x23, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" },
{ 0x23, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Timer interrupt" },
{ 0x24, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform generated page" },
{ 0x24, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform generated LAN alert" },
{ 0x24, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform Event Trap generated" },
{ 0x24, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform generated SNMP trap, OEM format" },
{ 0x25, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Entity Presence", "Present" },
{ 0x25, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Entity Presence", "Absent" },
{ 0x25, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Entity Presence", "Disabled" },
{ 0x26, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Monitor ASIC/IC", NULL },
{ 0x27, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "LAN", "Heartbeat Lost" },
{ 0x27, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "LAN", "Heartbeat" },
{ 0x28, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Sensor access degraded or unavailable" },
{ 0x28, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Controller access degraded or unavailable" },
{ 0x28, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Management controller off-line" },
{ 0x28, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Management controller unavailable" },
{ 0x28, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Sensor failure" },
{ 0x28, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "FRU failure" },
{ 0x29, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Low" },
{ 0x29, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Failed" },
{ 0x29, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Presence Detected" },
{ 0x2b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Hardware change detected" },
{ 0x2b, 0x01, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected" },
{ 0x2b, 0x01, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Dev Id" },
{ 0x2b, 0x01, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Firm Rev" },
{ 0x2b, 0x01, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Dev Rev" },
{ 0x2b, 0x01, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Manuf Id" },
{ 0x2b, 0x01, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl IPMI Vers" },
{ 0x2b, 0x01, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Aux Firm Id" },
{ 0x2b, 0x01, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Firm Boot Block" },
{ 0x2b, 0x01, 0x08, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Other" },
{ 0x2b, 0x01, 0x09, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, BIOS/EFI change" },
{ 0x2b, 0x01, 0x0A, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, SMBIOS change" },
{ 0x2b, 0x01, 0x0B, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, O/S change" },
{ 0x2b, 0x01, 0x0C, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, O/S loader change" },
{ 0x2b, 0x01, 0x0D, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Service Diag change" },
{ 0x2b, 0x01, 0x0E, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt SW agent change" },
{ 0x2b, 0x01, 0x0F, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt SW App change" },
{ 0x2b, 0x01, 0x10, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt SW Middle" },
{ 0x2b, 0x01, 0x11, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Prog HW Change (FPGA)" },
{ 0x2b, 0x01, 0x12, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU module change" },
{ 0x2b, 0x01, 0x13, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU component change" },
{ 0x2b, 0x01, 0x14, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU replace equ ver" },
{ 0x2b, 0x01, 0x15, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU replace new ver" },
{ 0x2b, 0x01, 0x16, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU replace old ver" },
{ 0x2b, 0x01, 0x17, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU HW conf change" },
{ 0x2b, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Hardware incompatibility detected" },
{ 0x2b, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software incompatibility detected" },
{ 0x2b, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Invalid or unsupported hardware version" },
{ 0x2b, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Invalid or unsupported firmware or software version" },
{ 0x2b, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Hardware change success" },
{ 0x2b, 0x07, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success" },
{ 0x2b, 0x07, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Dev Id" },
{ 0x2b, 0x07, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Firm Rev" },
{ 0x2b, 0x07, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Dev Rev" },
{ 0x2b, 0x07, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Manuf Id" },
{ 0x2b, 0x07, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl IPMI Vers" },
{ 0x2b, 0x07, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Aux Firm Id" },
{ 0x2b, 0x07, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Firm Boot Block" },
{ 0x2b, 0x07, 0x08, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Other" },
{ 0x2b, 0x07, 0x09, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, BIOS/EFI change" },
{ 0x2b, 0x07, 0x0A, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, SMBIOS change" },
{ 0x2b, 0x07, 0x0B, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, O/S change" },
{ 0x2b, 0x07, 0x0C, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, O/S loader change" },
{ 0x2b, 0x07, 0x0D, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Service Diag change" },
{ 0x2b, 0x07, 0x0E, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt SW agent change" },
{ 0x2b, 0x07, 0x0F, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt SW App change" },
{ 0x2b, 0x07, 0x10, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt SW Middle" },
{ 0x2b, 0x07, 0x11, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Prog HW Change (FPGA)" },
{ 0x2b, 0x07, 0x12, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU module change" },
{ 0x2b, 0x07, 0x13, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU component change" },
{ 0x2b, 0x07, 0x14, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU replace equ ver" },
{ 0x2b, 0x07, 0x15, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU replace new ver" },
{ 0x2b, 0x07, 0x16, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU replace old ver" },
{ 0x2b, 0x07, 0x17, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU HW conf change" },
{ 0x2c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Not Installed" },
{ 0x2c, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Inactive" },
{ 0x2c, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Activation Requested" },
{ 0x2c, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Activation in Progress" },
{ 0x2c, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Active" },
{ 0x2c, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Deactivation Requested" },
{ 0x2c, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Deactivation in Progress" },
{ 0x2c, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Communication lost" },
{ 0xF0, 0x00, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M0" },
{ 0xF0, 0x01, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M1" },
{ 0xF0, 0x02, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M2" },
{ 0xF0, 0x03, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M3" },
{ 0xF0, 0x04, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M4" },
{ 0xF0, 0x05, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M5" },
{ 0xF0, 0x06, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M6" },
{ 0xF0, 0x07, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M7" },
{ 0xF1, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A disabled, IPMB-B disabled" },
{ 0xF1, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A enabled, IPMB-B disabled" },
{ 0xF1, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A disabled, IPMB-B enabled" },
{ 0xF1, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A enabled, IPMP-B enabled" },
{ 0xF2, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Module Handle Closed" },
{ 0xF2, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Module Handle Opened" },
{ 0xF2, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Quiesced" },
{ 0xC0, 0x00, 0xff, 0x00, "OEM", "OEM Specific" },
{ 0x00, 0x00, 0x00, 0x00, NULL, NULL },
};
int ipmi_sel_main(struct ipmi_intf *, int, char **);
void ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt);
void ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_record * evt);
void ipmi_sel_print_extended_entry(struct ipmi_intf * intf, struct sel_event_record * evt);
void ipmi_sel_print_extended_entry_verbose(struct ipmi_intf * intf, struct sel_event_record * evt);
void ipmi_get_event_desc(struct ipmi_intf * intf, struct sel_event_record * rec, char ** desc);
const char * ipmi_sel_get_sensor_type(uint8_t code);
const char * ipmi_sel_get_sensor_type_offset(uint8_t code, uint8_t offset);
uint16_t ipmi_sel_get_std_entry(struct ipmi_intf * intf, uint16_t id, struct sel_event_record * evt);
char * get_newisys_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec);
IPMI_OEM ipmi_get_oem(struct ipmi_intf * intf);
char * ipmi_get_oem_desc(struct ipmi_intf * intf, struct sel_event_record * rec);
int ipmi_sel_oem_init(const char * filename);
#endif /* IPMI_SEL_H */

View File

@ -64,7 +64,7 @@ struct sol_config_parameters {
/*
* The ACTIVATE PAYLOAD command response structure
* The ACTIVATE PAYLOAD command reponse structure
* From table 24-2 of the IPMI v2.0 spec
*/
#ifdef PRAGMA_PACK
@ -92,16 +92,17 @@ struct activate_payload_rsp {
* function will return -1 if value is not valid, or
* will return 0 if valid.
*/
int ipmi_sol_set_param_isvalid_uint8_t(const char *strval,
int ipmi_sol_set_param_isvalid_uint8_t( const char *strval,
const char *name,
int base,
uint8_t minval,
uint8_t maxval,
uint8_t *out_value);
int ipmi_sol_main(struct ipmi_intf *, int, char **);
int ipmi_get_sol_info(struct ipmi_intf *intf,
int ipmi_get_sol_info(struct ipmi_intf * intf,
uint8_t channel,
struct sol_config_parameters *params);
struct sol_config_parameters * params);
#endif /* IPMI_SOL_H */

View File

@ -35,8 +35,6 @@
#include <ipmitool/helper.h>
#define CC_STRING(cc) val2str(cc, completion_code_vals)
extern const struct valstr completion_code_vals[];
extern const struct valstr entity_id_vals[];
extern const struct valstr entity_device_type_vals[];
@ -53,10 +51,7 @@ extern const struct valstr ipmi_chassis_power_control_vals[];
extern const struct valstr ipmi_auth_algorithms[];
extern const struct valstr ipmi_integrity_algorithms[];
extern const struct valstr ipmi_encryption_algorithms[];
extern const struct valstr ipmi_user_enable_status_vals[];
extern const struct valstr *ipmi_oem_info;
int ipmi_oem_info_init();
void ipmi_oem_info_free();
extern const struct valstr ipmi_oem_info[];
extern const struct valstr picmg_frucontrol_vals[];
extern const struct valstr picmg_clk_family_vals[];
@ -73,7 +68,8 @@ extern const struct oemvalstr picmg_busres_shmc_status_vals[];
/* these are similar, expect that the lookup takes the IANA number
as first parameter */
extern const struct oemvalstr ipmi_oem_product_info[];
extern const char *ipmi_generic_sensor_type_vals[];
extern const struct oemvalstr ipmi_oem_sensor_type_vals[];
extern const struct oemvalstr ipmi_oem_sdr_type_vals[];
#endif /*IPMI_STRINGS_H*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -44,30 +44,14 @@
#define IPMI_SUNOEM_SET_SSH_KEY 0x01
#define IPMI_SUNOEM_DEL_SSH_KEY 0x02
#define IPMI_SUNOEM_GET_HEALTH_STATUS 0x10
#define IPMI_SUNOEM_CLI 0x19
#define IPMI_SUNOEM_SET_FAN_SPEED 0x20
#define IPMI_SUNOEM_LED_GET 0x21
#define IPMI_SUNOEM_LED_SET 0x22
#define IPMI_SUNOEM_ECHO 0x23
#define IPMI_SUNOEM_VERSION 0x24
#define IPMI_SUNOEM_NACNAME 0x29
#define IPMI_SUNOEM_GETVAL 0x2A
#define IPMI_SUNOEM_SETVAL 0x2C
#define IPMI_SUNOEM_SENSOR_SET 0x3A
#define IPMI_SUNOEM_SET_FAN_MODE 0x41
#define IPMI_SUNOEM_CORE_TUNNEL 0x44
/*
* Error codes of sunoem functions
*/
typedef enum {
SUNOEM_EC_SUCCESS = 0,
SUNOEM_EC_INVALID_ARG = 1,
SUNOEM_EC_BMC_NOT_RESPONDING = 2,
SUNOEM_EC_BMC_CCODE_NONZERO = 3
} sunoem_ec_t;
int ipmi_sunoem_main(struct ipmi_intf *, int, char **);
struct ipmi_rs * sunoem_led_get(struct ipmi_intf * intf, struct sdr_record_generic_locator * dev, int ledtype);
struct ipmi_rs * sunoem_led_set(struct ipmi_intf * intf, struct sdr_record_generic_locator * dev, int ledtype, int ledmode);
#endif /*IPMI_SUNOEM_H*/

Some files were not shown because too many files have changed in this diff Show More