mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
Compare commits
1 Commits
master
...
IPMITOOL_1
Author | SHA1 | Date | |
---|---|---|---|
|
5d58a9e2e5 |
37
.github/ISSUE_TEMPLATE/bug_report.md
vendored
37
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -1,37 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: AlexanderAmelkin
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
*Please **DO NOT** report ANYTHING about 1.8.18, it is outdated. Please first check your alleged bug with the latest code from the top of the master branch here.*
|
||||
|
||||
**IPMITOOL Version**
|
||||
|
||||
Make sure you're reporting a bug in the latest code taken from `master` branch here, NOT a bug
|
||||
that you've found in some version that you've got from your OS vendor or any source other than this repository.
|
||||
|
||||
```none
|
||||
$ ipmitool -V
|
||||
<output here>
|
||||
```
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Using hardware/BMC '...'
|
||||
2. Run `ipmitool ...`
|
||||
3. Observe the abnormal reply:
|
||||
```none
|
||||
abnormal output example
|
||||
```
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
120
.github/workflows/ci.yml
vendored
120
.github/workflows/ci.yml
vendored
@ -1,120 +0,0 @@
|
||||
# vi: set et ts=2 sw=2 :
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04 ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: install dependencies
|
||||
run: |
|
||||
sudo apt install \
|
||||
automake \
|
||||
gcc \
|
||||
git \
|
||||
libssl-dev \
|
||||
libtool \
|
||||
make \
|
||||
wget
|
||||
- name: install extra libraries
|
||||
# This build job tries to verify as much of ipmitool code
|
||||
# as possible, hence these libraries. They aren't usually
|
||||
# needed for normal user builds:
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install \
|
||||
libsystemd-dev \
|
||||
libreadline-dev \
|
||||
libfreeipmi-dev \
|
||||
libusb-dev
|
||||
- uses: actions/checkout@v2
|
||||
- name: bootstrap
|
||||
run: ./bootstrap
|
||||
- name: configure
|
||||
run: |
|
||||
# For Linux, build as many extra interfaces as possible
|
||||
# to verify the code
|
||||
./configure --enable-intf-dummy \
|
||||
--enable-intf-dbus \
|
||||
--enable-intf-usb \
|
||||
--enable-intf-free
|
||||
- name: make
|
||||
run: make
|
||||
- name: make check
|
||||
run: make check
|
||||
- name: make distcheck
|
||||
run: make distcheck
|
||||
|
||||
macos:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ macos-10.15, macos-11, macos-12 ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: install dependencies
|
||||
run: brew install automake openssl libtool freeipmi wget
|
||||
- uses: actions/checkout@v2
|
||||
- name: bootstrap
|
||||
run: ./bootstrap
|
||||
- name: configure
|
||||
run: |
|
||||
./configure --enable-intf-dummy \
|
||||
LDFLAGS=-L/usr/local/opt/openssl@1.1/lib \
|
||||
CFLAGS=-I/usr/local/opt/openssl@1.1/include
|
||||
- name: make
|
||||
run: make
|
||||
- name: make check
|
||||
run: make check
|
||||
- name: make distcheck
|
||||
run: make distcheck
|
||||
|
||||
windows:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ windows-2019, windows-2022 ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: install dependencies
|
||||
run: |-
|
||||
choco install cygwin -y
|
||||
choco install cyg-get -y
|
||||
# Line continuation in PowerShell is backtick. Weird as Windows.
|
||||
cyg-get gcc-g++ `
|
||||
make `
|
||||
automake `
|
||||
autoconf `
|
||||
m4 `
|
||||
libtool `
|
||||
libncurses-devel `
|
||||
libreadline-devel `
|
||||
libssl-devel `
|
||||
dos2unix `
|
||||
wget
|
||||
echo "C:/tools/cygwin/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
echo "C:/tools/cygwin/usr/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
- uses: actions/checkout@v2
|
||||
- name: convert line ends
|
||||
# checkout action on Windows apparently converts line ends
|
||||
# so we have to convert them back because cygwin bash can't
|
||||
# can't handle Windows line ends
|
||||
run: dos2unix bootstrap configure.ac csv-revision
|
||||
- name: bootstrap
|
||||
run: bash -c "./bootstrap"
|
||||
- name: configure
|
||||
run: bash -c "./configure"
|
||||
- name: make
|
||||
run: make
|
||||
- name: make check
|
||||
run: make check
|
||||
- name: make distcheck
|
||||
run: make distcheck
|
39
.gitignore
vendored
39
.gitignore
vendored
@ -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
|
431
INSTALL
431
INSTALL
@ -1,431 +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 July 2020, the
|
||||
project is tested automatically to build cleanly for the following
|
||||
64-bit operating systems using GitHub Actions workflow:
|
||||
|
||||
- Ubuntu 18.04 Bionic Beaver
|
||||
- Ubuntu 20.04 Focal Fossa
|
||||
- Ubuntu 22.04 Jammy Jellyfish
|
||||
- MacOS X 10.15 Catalina
|
||||
- MacOS 11 Big Sur
|
||||
- MacOS 12 Monterey
|
||||
- Microsoft Windows Server 2019
|
||||
- Microsoft Windows Server 2022
|
||||
|
||||
It is also known to build successfully on Ubuntu 14.04 and Fedora 31,
|
||||
but that is not automatically verified.
|
||||
|
||||
For Ubuntu 14.04+ it is recommended to do the following before building:
|
||||
|
||||
$ sudo apt install automake gcc git libreadline-dev libssl-dev \
|
||||
libtool make wget
|
||||
|
||||
For Ubuntu 20.04+ you will also need this:
|
||||
|
||||
$ sudo apt install musl-dev
|
||||
|
||||
For Fedora 31 it is recommended to do the following before building:
|
||||
|
||||
$ sudo dnf install automake gcc git libtool make openssl-devel \
|
||||
readline-devel wget
|
||||
|
||||
For MacOS with Xcode and homebrew installed, it is recommended to do the
|
||||
following before building:
|
||||
|
||||
$ brew install automake openssl libtool freeipmi wget
|
||||
$ export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
|
||||
$ export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
|
||||
|
||||
To prepare for building in Windows it is recommended to use Chocolatey
|
||||
and do the following using PowerShell:
|
||||
|
||||
PS C:\ipmitool> choco install cygwin -y
|
||||
PS C:\ipmitool> choco install cyg-get -y
|
||||
PS C:\ipmitool> cyg-get gcc-g++ make automake autoconf `
|
||||
# m4 libtool libncurses-devel libreadline-devel libssl-devel `
|
||||
# dos2unix wget
|
||||
PS C:\ipmitool> $env:path="C:\tools\cygwin\usr\bin;$env:path"
|
||||
PS C:\ipmitool> $env:path="C:\tools\cygwin\bin;$env:path"
|
||||
PS C:\ipmitool> dos2unix bootstrap configure.ac csv-revision
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
Briefly, the followong shell command should configure, build, and
|
||||
install this package:
|
||||
|
||||
./bootstrap && ./configure && make && sudo make install
|
||||
|
||||
For Windows the above command must be run inside a cygwin bash
|
||||
shell.
|
||||
|
||||
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 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.
|
790
configure.ac
790
configure.ac
@ -1,790 +0,0 @@
|
||||
dnl
|
||||
dnl autoconf for ipmitool
|
||||
dnl
|
||||
m4_define([git_suffix], m4_esyscmd_s(./csv-revision))
|
||||
AC_INIT([ipmitool], [1.8.19git_suffix])
|
||||
AC_CONFIG_SRCDIR([src/ipmitool.c])
|
||||
AC_CONFIG_COMMANDS_PRE([export prefix=$prefix])
|
||||
AC_CANONICAL_SYSTEM
|
||||
AM_INIT_AUTOMAKE([foreign])
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AC_PREREQ(2.50)
|
||||
AC_SUBST(ac_configure_args)
|
||||
|
||||
dnl check for requirements
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
AC_CHECK_PROG([RPMBUILD], [rpmbuild], [rpmbuild], [rpm])
|
||||
AC_CHECK_PROG([SED], [sed], [sed])
|
||||
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h paths.h])
|
||||
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/socket.h])
|
||||
AC_CHECK_HEADERS([sys/byteorder.h byteswap.h])
|
||||
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
AC_FUNC_STRTOD
|
||||
AC_CHECK_FUNCS([alarm gethostbyname getaddrinfo getifaddrs socket select])
|
||||
AC_CHECK_FUNCS([memmove memset strchr strdup strerror])
|
||||
AC_CHECK_FUNCS([getpassphrase])
|
||||
|
||||
CFLAGS="$CFLAGS -Wall -Wextra -std=gnu11 -pedantic -Wformat -Wformat-nonliteral"
|
||||
|
||||
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])])
|
||||
|
||||
if test "x$prefix" = "xNONE"; then
|
||||
prefix="$ac_default_prefix"
|
||||
fi
|
||||
|
||||
if test "x$exec_prefix" = "xNONE"; then
|
||||
exec_prefix="$prefix"
|
||||
fi
|
||||
|
||||
dnl allow enabling/disabling the fetching of the IANA PEN registry
|
||||
AC_ARG_ENABLE([registry-download],
|
||||
[AC_HELP_STRING([--enable-registry-download],
|
||||
[download/install the IANA PEN registry [default=yes]])],
|
||||
[xenable_registry_download=$enableval],
|
||||
[xenable_registry_download=yes])
|
||||
|
||||
AM_CONDITIONAL([DOWNLOAD], [false])
|
||||
|
||||
if test "x$xenable_registry_download" = "xyes"; then
|
||||
AC_CHECK_PROG([WGET], [wget], [wget])
|
||||
AC_CHECK_PROG([CURL], [curl], [curl])
|
||||
|
||||
if test "x$WGET" = "x" && 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
|
||||
AM_CONDITIONAL([DOWNLOAD], [true])
|
||||
if test "x$WGET" != "x"; then
|
||||
DOWNLOAD="$WGET -c -nd -O -"
|
||||
else
|
||||
DOWNLOAD="$CURL --location --progress-bar"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_MSG_WARN([** Download is: $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_serial=yes
|
||||
xenable_intf_usb=no
|
||||
xenable_ipmishell=yes
|
||||
|
||||
dnl set some things so we build with GNU tools on Solaris
|
||||
case "$host_os" in
|
||||
solaris*)
|
||||
MAKE=gmake
|
||||
STRIP=gstrip
|
||||
LD=gld
|
||||
AR=gar
|
||||
# openssl libs are in /usr/sfw/lib on solaris 10
|
||||
LIBS="$LIBS -R/usr/sfw/lib"
|
||||
# disable the linux-specific interfaces
|
||||
xenable_intf_bmc=yes
|
||||
xenable_intf_imb=no
|
||||
xenable_intf_open=no
|
||||
xenable_intf_lipmi=no
|
||||
xenable_ipmishell=no
|
||||
xenable_all_options=no
|
||||
;;
|
||||
*cygwin*)
|
||||
# disable the linux and solaris-specific interfaces
|
||||
xenable_intf_imb=no
|
||||
xenable_intf_open=no
|
||||
xenable_intf_lipmi=no
|
||||
;;
|
||||
*darwin*|aix*)
|
||||
# disable the linux and solaris-specific interfaces
|
||||
xenable_intf_imb=no
|
||||
xenable_intf_open=no
|
||||
xenable_intf_lipmi=no
|
||||
xenable_ipmishell=no
|
||||
;;
|
||||
*freebsd*)
|
||||
xenable_intf_imb=no
|
||||
xenable_intf_lipmi=no
|
||||
CFLAGS="$CFLAGS -D__BSD_VISIBLE"
|
||||
;;
|
||||
*netbsd*)
|
||||
xenable_intf_imb=no
|
||||
xenable_intf_lipmi=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)
|
||||
AC_SUBST(OS, $host_os)
|
||||
AC_SUBST(PSTAMP, $host)
|
||||
AC_SUBST(BASEDIR, $prefix)
|
||||
|
||||
dnl allow solaris builds to include all options
|
||||
AC_ARG_ENABLE([solaris-opt],
|
||||
[AC_HELP_STRING([--enable-solaris-opt],
|
||||
[enable all options for Solaris [default=no]])],
|
||||
[xenable_solaris_opt=$enableval],
|
||||
[xenable_solaris_opt=no])
|
||||
if test "x$xenable_all_options" = "xyes" || test "x$xenable_solaris_opt" = "xyes"; then
|
||||
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],
|
||||
[enable internal MD5 library [default=no]])],
|
||||
[xenable_internal_md5=$enableval],
|
||||
[xenable_internal_md5=no])
|
||||
|
||||
AC_CHECK_LIB([crypto], [EVP_aes_128_cbc],
|
||||
[if test "x$xenable_internal_md5" != "xyes"; then
|
||||
have_crypto=yes; LIBS="$LIBS -lcrypto"
|
||||
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
|
||||
LIBS="$LIBS -lcrypto"
|
||||
have_md5=yes
|
||||
fi
|
||||
AC_DEFINE(HAVE_CRYPTO_MD5, [1], [Define to 1 if libcrypto supports MD5.])
|
||||
fi],
|
||||
[], [-lcrypto])
|
||||
|
||||
AC_CHECK_LIB([crypto], [MD2_Init],
|
||||
[if test "x$xenable_internal_md5" != "xyes"; then
|
||||
if test "x$have_crypto" != "xyes" && test "x$have_md5" != "xyes"; then
|
||||
LIBS="$LIBS -lcrypto"
|
||||
have_md2=yes
|
||||
fi
|
||||
AC_DEFINE(HAVE_CRYPTO_MD2, [1], [Define to 1 if libcrypto supports MD2.])
|
||||
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],
|
||||
[enable IPMIv1.5 LAN interface [default=yes]])],
|
||||
[xenable_intf_lan=$enableval],
|
||||
[xenable_intf_lan=yes])
|
||||
if test "x$xenable_intf_lan" = "xstatic" || test "x$xenable_intf_lan" = "xplugin"; then
|
||||
xenable_intf_lan=yes
|
||||
fi
|
||||
if test "x$xenable_intf_lan" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_LAN, [1], [Define to 1 to enable LAN IPMIv1.5 interface.])
|
||||
AC_SUBST(INTF_LAN, [lan])
|
||||
AC_SUBST(INTF_LAN_LIB, [libintf_lan.la])
|
||||
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],
|
||||
[enable IPMIv2.0 RMCP+ LAN interface [default=auto]])],
|
||||
[xenable_intf_lanplus=$enableval],
|
||||
[xenable_intf_lanplus=$have_crypto])
|
||||
if test "x$xenable_intf_lanplus" = "xstatic" || test "x$xenable_intf_lanplus" = "xplugin"; then
|
||||
xenable_intf_lanplus=yes
|
||||
fi
|
||||
if test "x$xenable_intf_lanplus" != "xno" && test "x$have_crypto" != "xyes"; then
|
||||
echo "** The lanplus interface requires an SSL library with EVP_aes_128_cbc defined."
|
||||
xenable_intf_lanplus=no
|
||||
fi
|
||||
if test "x$xenable_intf_lanplus" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_LANPLUS, [1], [Define to 1 to enable LAN+ IPMIv2 interface.])
|
||||
AC_SUBST(INTF_LANPLUS, [lanplus])
|
||||
AC_SUBST(INTF_LANPLUS_LIB, [libintf_lanplus.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lanplus/libintf_lanplus.la"
|
||||
else
|
||||
xenable_intf_lanplus=no
|
||||
fi
|
||||
|
||||
ORIG_CPPFLAGS=$CPPFLAGS
|
||||
|
||||
dnl enable serial interface
|
||||
AC_ARG_ENABLE([intf-serial],
|
||||
[AC_HELP_STRING([--enable-intf-serial],
|
||||
[enable direct Serial Basic/Terminal mode interface [default=yes]])],
|
||||
[xenable_intf_serial=$enableval], [xenable_intf_serial=yes])
|
||||
if test "x$enable_intf_serial" = "xstatic" || test "x$enable_intf_serial" = "xplugin"; then
|
||||
xenable_intf_serial=yes
|
||||
fi
|
||||
if test "x$xenable_intf_serial" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_SERIAL, [1], [Define to 1 to enable serial interface.])
|
||||
AC_SUBST(INTF_SERIAL, [serial])
|
||||
AC_SUBST(INTF_SERIAL_LIB, [libintf_serial.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB serial/libintf_serial.la"
|
||||
else
|
||||
xenable_intf_serial=no
|
||||
fi
|
||||
|
||||
dnl look for OpenIPMI header files
|
||||
AC_ARG_WITH([kerneldir],
|
||||
[AC_HELP_STRING([--with-kerneldir=DIR],
|
||||
[set kernel include path to DIR])],
|
||||
[if test "x$with_kerneldir" = "xyes"; then
|
||||
with_kerneldir="/lib/modules/`uname -r`/build"
|
||||
fi
|
||||
CFLAGS="$CFLAGS -I ${with_kerneldir}/include"
|
||||
AC_SUBST(CFLAGS)
|
||||
CPPFLAGS="$CPPFLAGS -I ${with_kerneldir}/include"
|
||||
AC_SUBST(CPPFLAGS)
|
||||
if test -s ${with_kerneldir}/include/linux/version.h ; then
|
||||
kernelver=`grep UTS_RELEASE ${with_kerneldir}/include/linux/version.h | \
|
||||
sed 's/^\#define UTS_RELEASE \"\(2\.[0-9]\)\..*/\1/'`
|
||||
if test "x$kernelver" = "x2.6"; then
|
||||
CPPFLAGS="$CPPFLAGS -D__user="
|
||||
AC_SUBST(CPPFLAGS)
|
||||
fi
|
||||
fi])
|
||||
|
||||
AH_TEMPLATE([HAVE_LINUX_COMPILER_H], [])
|
||||
AC_MSG_CHECKING([for linux/compiler.h])
|
||||
|
||||
m4_version_prereq([2.68],
|
||||
[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <linux/compiler.h>]])],
|
||||
[AC_DEFINE(HAVE_LINUX_COMPILER_H, [1],
|
||||
[Define to 1 if you have the <linux/compiler.h> header file.])
|
||||
AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])])],
|
||||
[AC_PREPROC_IFELSE([#include <linux/compiler.h>],
|
||||
[AC_DEFINE(HAVE_LINUX_COMPILER_H, [1],
|
||||
[Define to 1 if you have the <linux/compiler.h> header file.])
|
||||
AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])])])
|
||||
|
||||
CPPFLAGS=$ORIG_CPPFLAGS
|
||||
AC_SUBST(CPPFLAGS)
|
||||
|
||||
AC_CHECK_HEADER([sys/ioccom.h],
|
||||
[AC_DEFINE(HAVE_SYS_IOCCOM_H, [1],
|
||||
[Define to 1 if you have the <sys/ioccom.h> header file.])])
|
||||
|
||||
AC_CHECK_HEADER([linux/ipmi.h],
|
||||
[AC_DEFINE(HAVE_OPENIPMI_H, [1],
|
||||
[Define to 1 if you have the <linux/ipmi.h> header file.])],
|
||||
[AC_CHECK_HEADER([sys/ipmi.h],
|
||||
[AC_DEFINE(HAVE_FREEBSD_IPMI_H, [1],
|
||||
[Define to 1 if you have the <sys/ipmi.h> header file.])],
|
||||
[echo "** Unable to find OpenIPMI header files. Using internal version."])])
|
||||
|
||||
dnl look for FreeIPMI files
|
||||
AC_CHECK_LIB(freeipmi, ipmi_open_inband, [have_free=yes], [have_free=no])
|
||||
if test "x$have_free" != "xyes"; then
|
||||
AC_CHECK_LIB(freeipmi, ipmi_ctx_open_inband, [have_free=yes], [have_free=no])
|
||||
fi
|
||||
AC_ARG_ENABLE([intf-free],
|
||||
[AC_HELP_STRING([--enable-intf-free],
|
||||
[enable FreeIPMI IPMI interface [default=auto]])],
|
||||
[xenable_intf_free=$enableval],
|
||||
[xenable_intf_free=$have_free])
|
||||
if test "x$xenable_intf_free" = "xstatic" || test "x$xenable_intf_free" = "xplugin"; then
|
||||
xenable_intf_free=yes
|
||||
fi
|
||||
if test "x$xenable_intf_free" != "xno" && test "x$have_free" != "xyes"; then
|
||||
echo "** Unable to build FreeIPMI interface support!"
|
||||
xenable_intf_free=no
|
||||
fi
|
||||
if test "x$xenable_intf_free" = "xyes"; then
|
||||
dnl Determine if you got the right FreeIPMI version
|
||||
AC_MSG_CHECKING([for libfreeipmi version 0.3.0])
|
||||
AC_TRY_COMPILE([
|
||||
#include <sys/types.h> /* For size_t */
|
||||
#include <stdio.h> /* For NULL */
|
||||
#include <freeipmi/freeipmi.h>
|
||||
#include <freeipmi/udm/ipmi-udm.h>
|
||||
], [
|
||||
ipmi_device_t dev;
|
||||
dev = ipmi_open_inband(IPMI_DEVICE_KCS,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0);
|
||||
], ac_free_version_0_3_0=yes, ac_free_version_0_3_0=no)
|
||||
AC_MSG_RESULT($ac_free_version_0_3_0)
|
||||
AC_MSG_CHECKING([for libfreeipmi version 0.4.0])
|
||||
AC_TRY_COMPILE([
|
||||
#include <sys/types.h> /* For size_t */
|
||||
#include <stdio.h> /* For NULL */
|
||||
#include <freeipmi/freeipmi.h>
|
||||
#include <freeipmi/udm/ipmi-udm.h>
|
||||
], [
|
||||
ipmi_device_t dev = NULL;
|
||||
int rv;
|
||||
dev = ipmi_device_create();
|
||||
rv = ipmi_open_inband(dev,
|
||||
IPMI_DEVICE_KCS,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0);
|
||||
], ac_free_version_0_4_0=yes, ac_free_version_0_4_0=no)
|
||||
AC_MSG_RESULT($ac_free_version_0_4_0)
|
||||
AC_MSG_CHECKING([for libfreeipmi version 0.5.0])
|
||||
AC_TRY_COMPILE([
|
||||
#include <sys/types.h> /* For size_t */
|
||||
#include <stdio.h> /* For NULL */
|
||||
#include <freeipmi/freeipmi.h>
|
||||
#include <freeipmi/udm/ipmi-udm.h>
|
||||
], [
|
||||
ipmi_device_t dev = NULL;
|
||||
int rv;
|
||||
dev = ipmi_device_create();
|
||||
rv = ipmi_open_inband(dev,
|
||||
IPMI_DEVICE_KCS,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
0);
|
||||
], ac_free_version_0_5_0=yes, ac_free_version_0_5_0=no)
|
||||
AC_MSG_RESULT($ac_free_version_0_5_0)
|
||||
|
||||
AC_MSG_CHECKING([for libfreeipmi version 0.6.0])
|
||||
AC_TRY_COMPILE([
|
||||
#include <stdio.h> /* For NULL */
|
||||
#include <freeipmi/freeipmi.h>
|
||||
], [
|
||||
ipmi_ctx_t ctx = NULL;
|
||||
int rv;
|
||||
ctx = ipmi_ctx_create();
|
||||
rv = ipmi_ctx_open_inband(ctx,
|
||||
IPMI_DEVICE_KCS,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
0);
|
||||
], ac_free_version_0_6_0=yes, ac_free_version_0_6_0=no)
|
||||
AC_MSG_RESULT($ac_free_version_0_6_0)
|
||||
|
||||
if test "x$ac_free_version_0_3_0" = "xyes" \
|
||||
|| test "x$ac_free_version_0_4_0" = "xyes" \
|
||||
|| test "x$ac_free_version_0_5_0" = "xyes" \
|
||||
|| test "x$ac_free_version_0_6_0" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_FREE, [1], [Define to 1 to enable FreeIPMI interface.])
|
||||
AC_SUBST(INTF_FREE, [free])
|
||||
AC_SUBST(INTF_FREE_LIB, [libintf_free.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB free/libintf_free.la"
|
||||
if test "x$ac_free_version_0_3_0" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_FREE_0_3_0, [1], [Define to 1 for FreeIPMI 0.3.0.])
|
||||
fi
|
||||
if test "x$ac_free_version_0_4_0" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_FREE_0_4_0, [1], [Define to 1 for FreeIPMI 0.4.0.])
|
||||
fi
|
||||
if test "x$ac_free_version_0_5_0" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_FREE_0_5_0, [1], [Define to 1 for FreeIPMI 0.5.0.])
|
||||
fi
|
||||
if test "x$ac_free_version_0_6_0" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_FREE_0_6_0, [1], [Define to 1 for FreeIPMI 0.6.0.])
|
||||
fi
|
||||
else
|
||||
xenable_intf_free=no
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB(freeipmi,
|
||||
ipmi_cmd_raw_ipmb,
|
||||
AC_DEFINE(IPMI_INTF_FREE_BRIDGING, [1],
|
||||
[Define to 1 to enable FreeIPMI Bridging Support.]))
|
||||
fi
|
||||
|
||||
dnl look for termios header file
|
||||
AC_CHECK_HEADER([termios.h],
|
||||
[AC_DEFINE(HAVE_TERMIOS_H, [1], [Define to 1 if you have <termios.h>.])],
|
||||
[AC_CHECK_HEADER([sys/termios.h],
|
||||
[AC_DEFINE(HAVE_SYS_TERMIOS_H, [1], [Define to 1 if you have <sys/termios.h>.])],
|
||||
[echo "** Unable to find termios header file."])])
|
||||
|
||||
dnl set RPM distro tag for use in RPM name
|
||||
AC_ARG_WITH([rpm-distro],
|
||||
[AC_HELP_STRING([--with-rpm-distro=DISTRO],
|
||||
[set Linux distribution tag for use in RPM version string])],
|
||||
[AC_SUBST(DISTRO, $with_rpm_distro)])
|
||||
|
||||
dnl set RPM release tag
|
||||
AC_ARG_WITH([rpm-release],
|
||||
[AC_HELP_STRING([--with-rpm-release=RELEASE],
|
||||
[set release number for RPM release field])],
|
||||
[], [with_rpm_release=1])
|
||||
AC_SUBST(RPM_RELEASE, $with_rpm_release)
|
||||
|
||||
dnl enable Linux OpenIPMI interface
|
||||
AC_ARG_ENABLE([intf-open],
|
||||
[AC_HELP_STRING([--enable-intf-open],
|
||||
[enable Linux OpenIPMI interface [default=auto]])],
|
||||
[xenable_intf_open=$enableval],
|
||||
[])
|
||||
if test "x$xenable_intf_open" = "xstatic" || test "x$xenable_intf_open" = "xplugin"; then
|
||||
xenable_intf_open=yes
|
||||
fi
|
||||
if test "x$xenable_intf_open" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_OPEN, [1], [Define to 1 to enable Linux OpenIPMI interface.])
|
||||
AC_SUBST(INTF_OPEN, [open])
|
||||
AC_SUBST(INTF_OPEN_LIB, [libintf_open.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB open/libintf_open.la"
|
||||
|
||||
dnl Check for dual bridge support in OpenIPMI
|
||||
AC_MSG_CHECKING([for OpenIPMI dual bridge support])
|
||||
have_openipmi_dual_bridge=no
|
||||
ORIG_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS -Isrc/plugins/open -DENABLE_INTF_OPEN_DUAL_BRIDGE"
|
||||
AC_TRY_COMPILE([
|
||||
#if defined(HAVE_OPENIPMI_H)
|
||||
# if defined(HAVE_LINUX_COMPILER_H)
|
||||
# include <linux/compiler.h>
|
||||
# endif
|
||||
# include <linux/ipmi.h>
|
||||
#elif defined(HAVE_FREEBSD_IPMI_H)
|
||||
# include <sys/ipmi.h>
|
||||
#else
|
||||
# include "open.h"
|
||||
#endif
|
||||
], [
|
||||
struct ipmi_ipmb_addr a;
|
||||
a.transit_slave_addr = 0;
|
||||
], [have_openipmi_dual_bridge=yes])
|
||||
if test x"$have_openipmi_dual_bridge" = x"yes"; then
|
||||
AC_DEFINE(ENABLE_INTF_OPEN_DUAL_BRIDGE, [1],
|
||||
[Define to 1 to enable OpenIPMI interface dual bridge support])
|
||||
fi
|
||||
CPPFLAGS="$ORIG_CPPFLAGS"
|
||||
AC_MSG_RESULT([$have_openipmi_dual_bridge])
|
||||
fi
|
||||
|
||||
dnl enable Intel IMB interface
|
||||
AC_ARG_ENABLE([intf-imb],
|
||||
[AC_HELP_STRING([--enable-intf-imb],
|
||||
[enable Intel IMB driver interface [default=auto]])],
|
||||
[xenable_intf_imb=$enableval],
|
||||
[])
|
||||
if test "x$xenable_intf_imb" = "xstatic" || test "x$xenable_intf_imb" = "xplugin"; then
|
||||
xenable_intf_imb=yes
|
||||
fi
|
||||
if test "x$xenable_intf_imb" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_IMB, [1], [Define to 1 to enable Intel IMB interface.])
|
||||
AC_SUBST(INTF_IMB, [imb])
|
||||
AC_SUBST(INTF_IMB_LIB, [libintf_imb.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB imb/libintf_imb.la"
|
||||
fi
|
||||
|
||||
dnl enable Solaris LIPMI interface
|
||||
AC_CHECK_HEADER([sys/lipmi/lipmi_intf.h], [have_lipmi=yes], [have_lipmi=no])
|
||||
AC_ARG_ENABLE([intf-lipmi],
|
||||
[AC_HELP_STRING([--enable-intf-lipmi],
|
||||
[enable Solaris 9 x86 IPMI interface [default=no]])],
|
||||
[xenable_intf_lipmi=$enableval],
|
||||
[])
|
||||
if test "x$xenable_intf_lipmi" = "xstatic" || test "x$xenable_intf_lipmi" = "xplugin"; then
|
||||
xenable_intf_lipmi=yes
|
||||
fi
|
||||
if test "x$xenable_intf_lipmi" != "xno" && test "x$have_lipmi" != "xyes"; then
|
||||
echo "** Unable to build Solaris 9 x86 IPMI interface support!"
|
||||
xenable_intf_lipmi=no
|
||||
fi
|
||||
if test "x$xenable_intf_lipmi" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_LIPMI, [1], [Define to 1 to enable Solaris 9 LIPMI interface.])
|
||||
AC_SUBST(INTF_LIPMI, [lipmi])
|
||||
AC_SUBST(INTF_LIPMI_LIB, [libintf_lipmi.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lipmi/libintf_lipmi.la"
|
||||
fi
|
||||
|
||||
dnl enable Solaris BMC interface
|
||||
AC_ARG_ENABLE([intf-bmc],
|
||||
[AC_HELP_STRING([--enable-intf-bmc],
|
||||
[enable Solaris 10 x86 IPMI interface [default=auto]])],
|
||||
[xenable_intf_bmc=$enableval],
|
||||
[xenable_intf_bmc=no])
|
||||
if test "x$xenable_intf_bmc" = "xstatic" || test "x$xenable_intf_bmc" = "xplugin"; then
|
||||
xenable_intf_bmc=yes
|
||||
fi
|
||||
if test "x$xenable_intf_bmc" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_BMC, [1], [Define to 1 to enable Solaris 10 BMC interface.])
|
||||
AC_SUBST(INTF_BMC, [bmc])
|
||||
AC_SUBST(INTF_BMC_LIB, [libintf_bmc.la])
|
||||
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)
|
||||
|
||||
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
|
||||
PKG_PROG_PKG_CONFIG
|
||||
PKG_CHECK_MODULES([READLINE], [readline],
|
||||
[LIBS="$LIBS $READLINE_LIBS" have_readline=yes],
|
||||
[AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes])]
|
||||
)
|
||||
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
|
||||
|
||||
dnl Enable -Wall -Werror
|
||||
AC_ARG_ENABLE([buildcheck],
|
||||
[AC_HELP_STRING([--enable-buildcheck],
|
||||
[enable -Wall -Werror for build testing [default=no]])],
|
||||
[xenable_buildcheck=$enableval],
|
||||
[xenable_buildcheck=no])
|
||||
if test "x$xenable_buildcheck" != "xno"; then
|
||||
CFLAGS="$CFLAGS -Wall -Werror -Wpointer-arith -Wstrict-prototypes"
|
||||
fi
|
||||
AC_SUBST(CFLAGS)
|
||||
|
||||
dnl Enable extra file security paranoia
|
||||
AC_ARG_ENABLE([file-security],
|
||||
[AC_HELP_STRING([--enable-file-security],
|
||||
[enable extra security checks on files opened for read [default=no]])],
|
||||
[xenable_file_security=$enableval],
|
||||
[xenable_file_security=no])
|
||||
if test "x$xenable_file_security" != "xno"; then
|
||||
AC_DEFINE(ENABLE_FILE_SECURITY, [1], [Define to 1 for extra file security.])
|
||||
fi
|
||||
|
||||
|
||||
AC_TRY_COMPILE([],[
|
||||
#include <stdio.h>
|
||||
|
||||
struct packstruct {
|
||||
unsigned char t0 :5;
|
||||
unsigned char t1 :5;
|
||||
unsigned char t2 :5;
|
||||
unsigned char t3 :5;
|
||||
unsigned char t4 :4;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
int
|
||||
main(int argc, char ** argv)
|
||||
{
|
||||
if(sizeof(struct packstruct) != 3)
|
||||
return(1);
|
||||
else
|
||||
return(0);
|
||||
}
|
||||
],
|
||||
[],
|
||||
[AC_DEFINE(HAVE_PRAGMA_PACK,[1],
|
||||
[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
|
||||
|
||||
if test "x"`eval "echo \\\${xenable_intf_${DEFAULT_INTF}}"` != "xyes"; then
|
||||
AC_MSG_ERROR([** Cannot set ${DEFAULT_INTF} as default; intf-${DEFAULT_INTF} is not 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
|
||||
IANADIR=`eval echo "${datarootdir}/misc"`
|
||||
echo Set IANA PEN dictionary search path to ${IANADIR}
|
||||
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
|
||||
doc/Makefile
|
||||
contrib/Makefile
|
||||
control/Makefile
|
||||
control/pkginfo
|
||||
control/prototype
|
||||
control/ipmitool.spec
|
||||
lib/Makefile
|
||||
include/Makefile
|
||||
include/ipmitool/Makefile
|
||||
src/Makefile
|
||||
src/plugins/Makefile
|
||||
src/plugins/lan/Makefile
|
||||
src/plugins/lanplus/Makefile
|
||||
src/plugins/open/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
|
||||
doc/ipmitool.1
|
||||
doc/ipmievd.8])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_RESULT([ipmitool $VERSION])
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_RESULT([Interfaces (default=$DEFAULT_INTF)])
|
||||
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])
|
||||
AC_MSG_RESULT([ ipmishell : $xenable_ipmishell])
|
||||
AC_MSG_RESULT([])
|
||||
|
@ -1,403 +0,0 @@
|
||||
#!/bin/sh
|
||||
#############################################################################
|
||||
#
|
||||
# bmc-snmp-proxy: Set SNMP proxy to BMC (Baseboard Management Controller)
|
||||
#
|
||||
# version: 0.62
|
||||
#
|
||||
# Authors: Charles Rose <charles_rose@dell.com>
|
||||
# Jordan Hargrave <jordan_hargrave@dell.com>
|
||||
#
|
||||
# Description: Script to set snmp proxy to the BMC for certain OID
|
||||
# See here for details:
|
||||
# https://fedoraproject.org/wiki/Features/AgentFreeManagement
|
||||
#
|
||||
# Assumptions: This script will work only when /etc/snmp/ is writable.
|
||||
#
|
||||
#############################################################################
|
||||
# GLOBALS
|
||||
#############################################################################
|
||||
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"
|
||||
|
||||
TRAPD_CONF="/etc/snmp/snmptrapd.conf"
|
||||
|
||||
LOCKFILE="/var/lock/subsys/bmc-snmp-proxy"
|
||||
BMC_INFO="/run/bmc-info"
|
||||
|
||||
IPMITOOL=$(which ipmitool)
|
||||
|
||||
#Default config
|
||||
BMC_COMMUNITY="public"
|
||||
BMC_OID=".1.3.6.1.4.1.674.10892.2" # Dell iDRAC
|
||||
TRAP_FORWARD="no"
|
||||
RELOAD_SERVICES="yes"
|
||||
|
||||
#############################################################################
|
||||
|
||||
#TODO: Use inotify and daemonize when $BMC_INFO changes
|
||||
|
||||
# source config
|
||||
[ -r ${CONFIG} ] && . ${CONFIG}
|
||||
|
||||
. gettext.sh
|
||||
|
||||
SCRIPT_NAME=$(basename $0)
|
||||
RETVAL=0
|
||||
|
||||
# Check if bmc-info created by exchange-bmc-os-info
|
||||
bmc_info_exists()
|
||||
{
|
||||
if [ -r "${BMC_INFO}" ]; then
|
||||
. ${BMC_INFO}
|
||||
else
|
||||
RETVAL=2
|
||||
fi
|
||||
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
check_snmp()
|
||||
{
|
||||
if [ ! -d /etc/snmp ] || [ ! -x /usr/sbin/snmpd ]; then
|
||||
RETVAL=12
|
||||
fi
|
||||
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
# configure SNMP proxy
|
||||
#############################################################################
|
||||
write_snmp_conf()
|
||||
{
|
||||
# SNMPv3 security: bmcview, bmc_ctx, bmc_sec, bmc_grp, bmc_cmty
|
||||
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 "###############################################\n"
|
||||
}
|
||||
|
||||
valid_ip()
|
||||
{
|
||||
#Thanks to mkyong.com
|
||||
octet="([01]?[[:digit:]][[:digit:]]?|2[0-4][[:digit:]]|25[0-5])"
|
||||
|
||||
printf -- "%s" "${1}"| grep -Eq \
|
||||
"^${octet}\\.${octet}\\.${octet}\\.${octet}$"
|
||||
|
||||
return $?
|
||||
}
|
||||
|
||||
check_vars()
|
||||
{
|
||||
[ -z ${BMC_COMMUNITY} ] && BMC_COMMUNITY="public"
|
||||
[ -z ${BMC_OID} ] && return 1
|
||||
|
||||
if [ -n "${BMC_IPv4}" ] && valid_ip ${BMC_IPv4}; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
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
|
||||
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;
|
||||
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
|
||||
fi
|
||||
done
|
||||
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
disable_snmp_proxy()
|
||||
{
|
||||
if [ -f ${SNMPD_BMC_CONF} ]; then
|
||||
rm -f ${SNMPD_BMC_CONF} || RETVAL=5
|
||||
fi
|
||||
}
|
||||
#############################################################################
|
||||
# Trap Forwarding
|
||||
#############################################################################
|
||||
|
||||
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}\
|
||||
2>/dev/null| sed -n "s#^Alert IP Address.*: ##p")
|
||||
|
||||
[ "${temp_ip}" = "${test_ip}" ] && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
set_alert_dest_ip()
|
||||
{
|
||||
${IPMITOOL} lan alert set ${CHANNEL} ${ALERT_DEST} ipaddr ${1} \
|
||||
retry 4 type pet >/dev/null 2>&1 || RETVAL=8
|
||||
}
|
||||
|
||||
config_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 \
|
||||
| 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" ] && \
|
||||
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" ] && \
|
||||
return $RETVAL
|
||||
# set: the TRAPD_IP
|
||||
set_alert_dest_ip "${TRAPD_IP}"
|
||||
else
|
||||
# No free alert destinations
|
||||
RETVAL=9
|
||||
fi
|
||||
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
set_ipmi_pef()
|
||||
{
|
||||
# Needs ipmitool-1.8.13 + patches
|
||||
${IPMITOOL} pef policy set ${ALERT_DEST} "${1}" >/dev/null 2>&1 || \
|
||||
RETVAL=10
|
||||
}
|
||||
|
||||
get_host_ip()
|
||||
{
|
||||
# Get host's IP that the BMC can reach. This is at best a hack.
|
||||
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
|
||||
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}"
|
||||
|
||||
# Enable/Disable alerting on the LAN channel
|
||||
[ $RETVAL -eq 0 ] && set_ipmi_pef "${ACTION}"
|
||||
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
write_trapd_conf()
|
||||
{
|
||||
printf "###############################################\n"
|
||||
printf "# Automatically created by %s #\n" "${SCRIPT_NAME}"
|
||||
printf "forward default %s\n" "${FORWARD_HOST}"
|
||||
printf "###############################################\n"
|
||||
}
|
||||
|
||||
config_trapd()
|
||||
{
|
||||
# Proceed only if snmptrapd is available on the system
|
||||
if [ -f ${TRAPD_CONF} ]; then
|
||||
write_trapd_conf > ${TRAPD_BMC_CONF} || RETVAL=11
|
||||
else
|
||||
RETVAL=11
|
||||
fi
|
||||
}
|
||||
|
||||
trap_sink_exists()
|
||||
{
|
||||
# TODO: We only set the first match. We should be able to set
|
||||
# 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
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
# Forward SNMP traps from the BMC to trapsink.
|
||||
trap_forward()
|
||||
{
|
||||
NO_TRAP=0
|
||||
ACTION=${1} # enable or disable
|
||||
|
||||
if [ "${ACTION}" = "enable" ]; then
|
||||
# Get trapd config,
|
||||
if trap_sink_exists; then
|
||||
config_bmc_alert && config_trapd
|
||||
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
|
||||
else
|
||||
NO_TRAP=1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
service_reload()
|
||||
{
|
||||
#TODO: do this in systemd
|
||||
if [ ${RETVAL} -eq 0 ] && [ "${RELOAD_SERVICES}" = "yes" ]; then
|
||||
service $1 reload
|
||||
[ $? -ne 0 ] && RETVAL=6
|
||||
fi
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
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"
|
||||
[ $RETVAL -eq 0 ] && [ $NO_TRAP -eq 0 ] && \
|
||||
service_reload snmptrapd
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
stop()
|
||||
{
|
||||
[ ! -f ${LOCKFILE} ] && return
|
||||
if bmc_info_exists && check_snmp; then
|
||||
disable_snmp_proxy
|
||||
[ $RETVAL -eq 0 ] && service_reload snmpd
|
||||
|
||||
if [ "${TRAP_FORWARD}" = "yes" ]; then
|
||||
trap_forward "disable"
|
||||
[ $RETVAL -eq 0 ] && [ $NO_TRAP -eq 0 ] && \
|
||||
service_reload snmptrapd
|
||||
fi
|
||||
|
||||
rm -f ${LOCKFILE}
|
||||
fi
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
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 [ -f ${LOCKFILE} ]; then
|
||||
eval_gettext "set"
|
||||
else
|
||||
eval_gettext "not set"
|
||||
fi
|
||||
|
||||
echo
|
||||
RETVAL=0
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
usage()
|
||||
{
|
||||
eval_gettext "Usage: $0 {start|stop|status}"; echo 1>&2
|
||||
RETVAL=1
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
# MAIN
|
||||
#############################################################################
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
status) status ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
|
||||
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 ;;
|
||||
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 ;;
|
||||
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 ;;
|
||||
11) eval_gettext "${SCRIPT_NAME}: failed to write snmptrapd.conf." 1>&2 ;;
|
||||
12) eval_gettext "${SCRIPT_NAME}: snmpd not found." 1>&2 ;;
|
||||
*) eval_gettext "${SCRIPT_NAME}: unknown error." 1>&2 ;;
|
||||
esac
|
||||
|
||||
if [ ${RETVAL} -gt 1 ]; then
|
||||
eval_gettext " Return code: ${RETVAL}"; echo
|
||||
fi
|
||||
|
||||
exit ${RETVAL}
|
||||
#############################################################################
|
||||
# end of file
|
||||
#############################################################################
|
@ -1,18 +0,0 @@
|
||||
[Unit]
|
||||
Description=Setup SNMP proxy to BMC
|
||||
|
||||
After=exchange-bmc-os-info.service
|
||||
Requires=exchange-bmc-os-info.service
|
||||
PartOf=exchange-bmc-os-info.service
|
||||
|
||||
ConditionPathExists=/run/bmc-info
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
|
||||
ExecStart=/usr/libexec/bmc-snmp-proxy start
|
||||
ExecStop=/usr/libexec/bmc-snmp-proxy stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,48 +0,0 @@
|
||||
# bmc-snmp-proxy
|
||||
#
|
||||
# Config file to control SNMP redirection between
|
||||
# the OS and Service Processor/Baseboard Management Controller (BMC)
|
||||
#
|
||||
# bmc-snnmp-proxy helps redirect certain SNMP requests (to this host)
|
||||
# destined to the Service Processor. We will need the Service Processor's
|
||||
# SNMP community string and the OID of the Service Processor's SNMP agent.
|
||||
#
|
||||
# For redirecting Traps from the Service Processor to the trap sink
|
||||
# configured in the host (this system), we will have to set
|
||||
# TRAP_FORWARD below.
|
||||
#
|
||||
# See here for details
|
||||
# https://fedoraproject.org/wiki/Features/AgentFreeManagement
|
||||
|
||||
### Configure SNMP proxy to BMC/Service Processor ###
|
||||
|
||||
### Service Processor/BMC SNMP Community String.
|
||||
# Name: BMC_COMMUNITY
|
||||
# Description: Set community string of the Service Processor (BMC)'s
|
||||
# SNMP agent.
|
||||
# Default: public
|
||||
#
|
||||
BMC_COMMUNITY="public"
|
||||
|
||||
### OEM Specific OID of Service Processor
|
||||
# Name: BMC_OID
|
||||
# Description: SNMP OID that we would like to redirect to the Service
|
||||
# Processor (BMC). This can be unique to each OEM.
|
||||
# Default: ".1.3.6.1.4.1.674.10892.2"
|
||||
BMC_OID=".1.3.6.1.4.1.674.10892.2" # Dell iDRAC
|
||||
|
||||
### Forward Traps from the Service Processor to trap sink
|
||||
# Name: TRAP_FORWARD
|
||||
# Description: Enabling this will allow traps from the Service Processor
|
||||
# to be directed to this system and configure snmptrapd
|
||||
# Note: This option will have no effect if trap sink on the system is
|
||||
# not configured
|
||||
# Default: "no"
|
||||
TRAP_FORWARD="yes"
|
||||
|
||||
### Reload snmpd and snmptrapd
|
||||
# Name: RELOAD_SERVICES
|
||||
# Description: Reload snmpd and snmptrapd after making changes to their config
|
||||
# files.
|
||||
# Default: "yes"
|
||||
RELOAD_SERVICES="yes"
|
@ -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 /run/bmc-info
|
||||
#
|
||||
# Example to launch BMC web-interface:
|
||||
# # . /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=/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
|
||||
#############################################################################
|
@ -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
|
@ -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"
|
@ -1,222 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# chkconfig: 2345 11 60
|
||||
# description: start, stop, or query ipmi system monitoring tools
|
||||
# config: /etc/sysconfig/ipmi
|
||||
#
|
||||
# For Redhat, Fedora, or similar systems. Handles both 2.4 and 2.6
|
||||
# configurations. Requires an /etc/sysconfig/ipmi file to function,
|
||||
# see below.
|
||||
#
|
||||
# Phil Hollenback
|
||||
# philiph@pobox.com
|
||||
|
||||
# Source function library.
|
||||
. /etc/init.d/functions
|
||||
|
||||
# Exit silently if we don't have a sysconfig file,
|
||||
# and read IPMI setting from it to determine whether or
|
||||
# not to continue.
|
||||
# The only current setting is ipmi={YES|NO}, whether or not
|
||||
# to enable IPMI.
|
||||
[ -f /etc/sysconfig/ipmi ] || exit 0
|
||||
. /etc/sysconfig/ipmi
|
||||
[ "${IPMI}" = "yes" ] || exit 0
|
||||
|
||||
RETVAL=0
|
||||
|
||||
start() {
|
||||
echo -n $"Starting ipmi: "
|
||||
|
||||
# If ipmidev isn't listed in /proc/devices, try
|
||||
# loading the modules.
|
||||
if ! grep -q ipmidev /proc/devices
|
||||
then
|
||||
/sbin/modprobe ipmi_msghandler || RETVAL=1
|
||||
/sbin/modprobe ipmi_devintf || RETVAL=1
|
||||
# Try loading new driver module, fall back to old
|
||||
# module if that fails.
|
||||
if ! /sbin/modprobe ipmi_si >/dev/null 2>&1
|
||||
then
|
||||
/sbin/modprobe ipmi_si_drv || RETVAL=1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# If ipmidev still isn't listed in /proc/devices after we load
|
||||
# modules, this just isn't going to work. Set RETVAL to mark
|
||||
# this failure.
|
||||
grep -q ipmidev /proc/devices || RETVAL=1
|
||||
|
||||
# remove old device file always
|
||||
# in case ipmi gets assigned new dynamic major number from kernel
|
||||
if [ -c /dev/ipmi0 ]; then
|
||||
rm -f /dev/ipmi0
|
||||
fi
|
||||
|
||||
# Check if the device file exists and create if not.
|
||||
if [ ! -c /dev/ipmi0 ] && [ $RETVAL -eq 0 ]
|
||||
then
|
||||
major=$(awk '/ ipmidev$/{print $1}' /proc/devices)
|
||||
/bin/mknod -m 0600 /dev/ipmi0 c $major 0 || RETVAL=1
|
||||
fi
|
||||
|
||||
if [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ipmi ; then
|
||||
echo_success
|
||||
echo
|
||||
else
|
||||
echo_failure
|
||||
echo
|
||||
fi
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n $"Shutting down ipmi: "
|
||||
|
||||
# Stop doesn't actually do anything because we currently don't
|
||||
# unload ipmi modules on stop. That might change in the future
|
||||
# if we decide unloading the ipmi modules is safe.
|
||||
RETVAL=0
|
||||
|
||||
if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ipmi ; then
|
||||
echo_success
|
||||
echo
|
||||
else
|
||||
echo_failure
|
||||
echo
|
||||
fi
|
||||
}
|
||||
|
||||
dostatus() {
|
||||
# Extract cpu temperatures from ipmitool output.
|
||||
|
||||
# Abort if we don't have the ipmitool program.
|
||||
if ! /usr/bin/ipmitool -V >/dev/null
|
||||
then
|
||||
echo "/usr/bin/ipmitool not found!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Abort if ipmi isn't loaded.
|
||||
if ! grep -q ipmidev /proc/devices
|
||||
then
|
||||
echo "ipmi not listed in /proc/devices!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if we are running on a v1.0 IPMI system, and
|
||||
# change our processor search string appropriately.
|
||||
if /usr/bin/ipmitool -I open bmc info | \
|
||||
grep -q "IPMI Version.*1.0"
|
||||
then
|
||||
IpmiVersion="1.0"
|
||||
fi
|
||||
|
||||
# Determine # of running processors
|
||||
NumProcs=$(grep -c processor /proc/cpuinfo)
|
||||
if [ $NumProcs -eq 0 ]
|
||||
then
|
||||
echo "Can't determine number of processors!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Now build the query string. Concatenate it into
|
||||
# one string because that's more efficient on 2.4 systems.
|
||||
Count=1
|
||||
TempString=""
|
||||
while [ $Count -le $NumProcs ]
|
||||
do
|
||||
if [ x$IpmiVersion = x"1.0" ]
|
||||
then
|
||||
TempString="$TempString CPU\ $Count"
|
||||
else
|
||||
TempString="$TempString Processor$Count\ Temp"
|
||||
fi
|
||||
Count=$((Count + 1))
|
||||
done
|
||||
# building TempString like this and eval'ing it is ugly, but
|
||||
# it's the only way I could make the quoting work. Sorry.
|
||||
TempString="/usr/bin/ipmitool -I open sensor get $TempString"
|
||||
eval $TempString | awk -v "c=$Count" '
|
||||
BEGIN {
|
||||
n = 1
|
||||
}
|
||||
/Sensor Reading/ {
|
||||
printf "CPU%s Temp: %s\n",n,$4
|
||||
n++
|
||||
}
|
||||
END {
|
||||
if ( n != c) {
|
||||
printf "Error: found %s CPUs, but got temps for %s\n",--c,--n >"/dev/stderr"
|
||||
exit 1
|
||||
}
|
||||
exit 0
|
||||
}'
|
||||
RETVAL=$((RETVAL + $?))
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
RETVAL=$?
|
||||
}
|
||||
|
||||
condrestart() {
|
||||
[ -e /var/lock/subsys/ipmi ] && restart || :
|
||||
}
|
||||
|
||||
remove () {
|
||||
# Actually remove the drivers. Don't do during stop in case
|
||||
# this causes system to become unstable (a la lm_sensors)
|
||||
if /sbin/lsmod | awk '{print $1}' | grep -q ipmi_
|
||||
then
|
||||
# Try removing both 2.4 and 2.6 modules.
|
||||
/sbin/rmmod ipmi_si 2>/dev/null
|
||||
/sbin/rmmod ipmi_si_drv 2>/dev/null
|
||||
/sbin/rmmod ipmi_devintf
|
||||
/sbin/rmmod ipmi_msghandler
|
||||
else
|
||||
echo "No ipmi modules loaded!" >&2
|
||||
RETVAL=1
|
||||
return $RETVAL
|
||||
fi
|
||||
|
||||
# Wait a sec to give modules time to unload.
|
||||
sleep 1
|
||||
|
||||
# Check if we failed to remove any modules, and complain if so.
|
||||
if /sbin/lsmod | awk '{print $1}' | grep -q ipmi_
|
||||
then
|
||||
echo "ipmi modules still loaded!" >&2
|
||||
RETVAL=1
|
||||
return $RETVAL
|
||||
fi
|
||||
}
|
||||
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
status)
|
||||
dostatus
|
||||
;;
|
||||
restart|reload)
|
||||
restart
|
||||
;;
|
||||
condrestart)
|
||||
condrestart
|
||||
;;
|
||||
remove)
|
||||
remove
|
||||
;;
|
||||
*)
|
||||
echo "Usage: ipmi {start|stop|status|restart|condrestart|remove}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $RETVAL
|
@ -1,92 +0,0 @@
|
||||
#! /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=/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
|
||||
|
||||
#
|
||||
# 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
|
@ -1,87 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# /etc/rc.d/init.d/ipmievd
|
||||
#
|
||||
# Based on example sysvinitfiles script
|
||||
# Copyright (c) 2000 Red Hat Software, Inc.
|
||||
#
|
||||
# chkconfig: 345 99 00
|
||||
# description: ipmievd daemon to send events to syslog
|
||||
# processname: ipmievd
|
||||
# config: /etc/sysconfig/ipmievd
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ipmievd
|
||||
# Required-Start: $syslog ipmi
|
||||
# Should-Start: $time
|
||||
# Required-Stop: $syslog ipmi
|
||||
# Should-Stop: $time
|
||||
# Default-Start: 3 4 5
|
||||
# Default-Stop: 0 1 2 6
|
||||
# Short-Description: ipmievd daemon to send events to syslog
|
||||
# Description: Start ipmievd to read events from BMC and
|
||||
# log them to syslog. Events correspond to hardware faults,
|
||||
# state transitions such as power on and off, and sensor
|
||||
# readings such as temperature, voltage and fan speed that
|
||||
# are abnormal.
|
||||
### END INIT INFO
|
||||
|
||||
IPMIEVD_BIN=/usr/sbin/ipmievd
|
||||
test -x $IPMIEVD_BIN || { echo "$IPMIEVD_BIN not installed";
|
||||
if [ "$1" = "stop" ]; then exit 0;
|
||||
else exit 5; fi; }
|
||||
|
||||
# Check for existence of needed config file
|
||||
IPMIEVD_CONFIG=/etc/sysconfig/ipmievd
|
||||
test -r $IPMIEVD_CONFIG || { echo "$IPMIEVD_CONFIG does not exist";
|
||||
if [ "$1" = "stop" ]; then exit 0;
|
||||
else exit 6; fi; }
|
||||
|
||||
# Read config file
|
||||
. $IPMIEVD_CONFIG
|
||||
|
||||
# Source function library.
|
||||
. /etc/init.d/functions
|
||||
|
||||
start() {
|
||||
echo "Starting ipmievd:"
|
||||
if [ -f /var/lock/subsys/ipmievd ]; then
|
||||
return 0
|
||||
fi
|
||||
daemon $IPMIEVD_BIN $IPMIEVD_OPTIONS
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && touch /var/lock/subsys/ipmievd
|
||||
return $ret
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo "Shutting down ipmievd:"
|
||||
killproc $IPMIEVD_BIN
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && rm -f /var/lock/subsys/ipmievd
|
||||
return $ret
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
status)
|
||||
status $IPMIEVD_BIN
|
||||
;;
|
||||
restart|reload)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
condrestart)
|
||||
[ -f /var/lock/subsys/ipmievd ] && restart || :
|
||||
;;
|
||||
*)
|
||||
echo "Usage: ipmievd {start|stop|status|reload|restart|condrestart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
exit $?
|
@ -1,212 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# System startup script for ipmievd
|
||||
# Based on skeleton.compat example script
|
||||
# Copyright (C) 1995--2005 Kurt Garloff, SUSE / Novell Inc.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; either version 2.1 of the License, or (at
|
||||
# your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
|
||||
# USA.
|
||||
#
|
||||
# Note: This template uses functions rc_XXX defined in /etc/rc.status on
|
||||
# UnitedLinux/SUSE/Novell based Linux distributions. However, it will work
|
||||
# on other distributions as well, by using the LSB (Linux Standard Base)
|
||||
# or RH functions or by open coding the needed functions.
|
||||
# Read http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/ if you prefer not
|
||||
# to use this template.
|
||||
#
|
||||
# chkconfig: 345 99 00
|
||||
# description: ipmievd daemon
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ipmievd
|
||||
# Required-Start: $syslog ipmi
|
||||
# Should-Start: $time
|
||||
# Required-Stop: $syslog ipmi
|
||||
# Should-Stop: $time
|
||||
# Default-Start: 3 4 5
|
||||
# Default-Stop: 0 1 2 6
|
||||
# Short-Description: ipmievd daemon to send events to syslog
|
||||
# Description: Start ipmievd to read events from BMC and
|
||||
# log them to syslog. Events correspond to hardware faults,
|
||||
# state transitions such as power on and off, and sensor
|
||||
# readings such as temperature, voltage and fan speed that
|
||||
# are abnormal.
|
||||
### END INIT INFO
|
||||
#
|
||||
|
||||
# Check for missing binaries (stale symlinks should not happen)
|
||||
# Note: Special treatment of stop for LSB conformance
|
||||
IPMIEVD_BIN=/usr/sbin/ipmievd
|
||||
test -x $IPMIEVD_BIN || { echo "$IPMIEVD_BIN not installed";
|
||||
if [ "$1" = "stop" ]; then exit 0;
|
||||
else exit 5; fi; }
|
||||
|
||||
# Check for existence of needed config file and read it
|
||||
IPMIEVD_CONFIG=/etc/sysconfig/ipmievd
|
||||
test -r $IPMIEVD_CONFIG || { echo "$IPMIEVD_CONFIG does not exist";
|
||||
if [ "$1" = "stop" ]; then exit 0;
|
||||
else exit 6; fi; }
|
||||
|
||||
# Read config
|
||||
. $IPMIEVD_CONFIG
|
||||
|
||||
if test -e /etc/rc.status; then
|
||||
# SUSE rc script library
|
||||
. /etc/rc.status
|
||||
else
|
||||
export LC_ALL=POSIX
|
||||
_cmd=$1
|
||||
declare -a _SMSG
|
||||
if test "${_cmd}" = "status"; then
|
||||
_SMSG=(running dead dead unused unknown reserved)
|
||||
_RC_UNUSED=3
|
||||
else
|
||||
_SMSG=(done failed failed missed failed skipped unused failed failed reserved)
|
||||
_RC_UNUSED=6
|
||||
fi
|
||||
if test -e /lib/lsb/init-functions; then
|
||||
# LSB
|
||||
. /lib/lsb/init-functions
|
||||
echo_rc()
|
||||
{
|
||||
if test ${_RC_RV} = 0; then
|
||||
log_success_msg " [${_SMSG[${_RC_RV}]}] "
|
||||
else
|
||||
log_failure_msg " [${_SMSG[${_RC_RV}]}] "
|
||||
fi
|
||||
}
|
||||
# TODO: Add checking for lockfiles
|
||||
checkproc() { return pidofproc ${1+"$@"} >/dev/null 2>&1; }
|
||||
elif test -e /etc/init.d/functions; then
|
||||
# RHAT
|
||||
. /etc/init.d/functions
|
||||
echo_rc()
|
||||
{
|
||||
#echo -n " [${_SMSG[${_RC_RV}]}] "
|
||||
if test ${_RC_RV} = 0; then
|
||||
success " [${_SMSG[${_RC_RV}]}] "
|
||||
else
|
||||
failure " [${_SMSG[${_RC_RV}]}] "
|
||||
fi
|
||||
}
|
||||
checkproc() { return status ${1+"$@"}; }
|
||||
start_daemon() { return daemon ${1+"$@"}; }
|
||||
else
|
||||
# emulate it
|
||||
echo_rc() { echo " [${_SMSG[${_RC_RV}]}] "; }
|
||||
fi
|
||||
rc_reset() { _RC_RV=0; }
|
||||
rc_failed()
|
||||
{
|
||||
if test -z "$1"; then
|
||||
_RC_RV=1;
|
||||
elif test "$1" != "0"; then
|
||||
_RC_RV=$1;
|
||||
fi
|
||||
return ${_RC_RV}
|
||||
}
|
||||
rc_check()
|
||||
{
|
||||
return rc_failed $?
|
||||
}
|
||||
rc_status()
|
||||
{
|
||||
rc_failed $?
|
||||
if test "$1" = "-r"; then _RC_RV=0; shift; fi
|
||||
if test "$1" = "-s"; then rc_failed 5; echo_rc; rc_failed 3; shift; fi
|
||||
if test "$1" = "-u"; then rc_failed ${_RC_UNUSED}; echo_rc; rc_failed 3; shift; fi
|
||||
if test "$1" = "-v"; then echo_rc; shift; fi
|
||||
if test "$1" = "-r"; then _RC_RV=0; shift; fi
|
||||
return ${_RC_RV}
|
||||
}
|
||||
rc_exit() { exit ${_RC_RV}; }
|
||||
rc_active()
|
||||
{
|
||||
if test -z "$RUNLEVEL"; then read RUNLEVEL REST < <(/sbin/runlevel); fi
|
||||
if test -e /etc/init.d/S[0-9][0-9]${1}; then return 0; fi
|
||||
return 1
|
||||
}
|
||||
fi
|
||||
|
||||
# Reset status of this service
|
||||
rc_reset
|
||||
|
||||
# Return values acc. to LSB for all commands but status:
|
||||
# 0 - success
|
||||
# 1 - generic or unspecified error
|
||||
# 2 - invalid or excess argument(s)
|
||||
# 3 - unimplemented feature (e.g. "reload")
|
||||
# 4 - user had insufficient privileges
|
||||
# 5 - program is not installed
|
||||
# 6 - program is not configured
|
||||
# 7 - program is not running
|
||||
# 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
|
||||
#
|
||||
# Note that starting an already running service, stopping
|
||||
# or restarting a not-running service as well as the restart
|
||||
# with force-reload (in case signaling is not supported) are
|
||||
# considered a success.
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting ipmievd "
|
||||
start_daemon $IPMIEVD_BIN $IPMIEVD_OPTIONS
|
||||
rc_status -v
|
||||
;;
|
||||
stop)
|
||||
echo -n "Shutting down ipmievd "
|
||||
killproc -TERM $IPMIEVD_BIN
|
||||
rc_status -v
|
||||
;;
|
||||
try-restart|condrestart)
|
||||
## Do a restart only if the service was active before.
|
||||
## Note: try-restart is now part of LSB (as of 1.9).
|
||||
## RH has a similar command named condrestart.
|
||||
if test "$1" = "condrestart"; then
|
||||
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
|
||||
fi
|
||||
$0 status
|
||||
if test $? = 0; then
|
||||
$0 restart
|
||||
else
|
||||
rc_reset # Not running is not a failure.
|
||||
fi
|
||||
rc_status
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
rc_status
|
||||
;;
|
||||
force-reload)
|
||||
echo -n "Reload service ipmievd "
|
||||
$0 try-restart
|
||||
rc_status
|
||||
;;
|
||||
reload)
|
||||
rc_failed 3
|
||||
rc_status -v
|
||||
;;
|
||||
status)
|
||||
echo -n "Checking for service ipmievd "
|
||||
checkproc $IPMIEVD_BIN
|
||||
rc_status -v
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload| reload}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
rc_exit
|
@ -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
|
@ -1,229 +0,0 @@
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x01","0x00","Chassis Number","R","R","0x00","CPU shutdown - Potential cause 'triple fault' a software address problem"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x02","0x01","Chassis Number","Failed Memory Card","Spare Memory Card","0x00","Memory Mirrored Failover Occurred - System running from mirrored memory image"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x02","0x04","Chassis Number","Memory Card","Completion Code (0x00=Success)","0x00","Memory hot replace event"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x02","0x05","Chassis Number","Memory Card","Memory Size (in 512MB units)","0x00","Memory hot add event"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x00","Chassis Number","Scalability Port Number","R","0x00","Scalability link down"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","Chassis Number","Scalability Port Number","R","0x00","Scalability link up"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x02","Chassis Number","Scalability Port Number","R","0x00","Scalability link double wide down"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x03","Chassis Number","Scalability Port Number","R","0x00","Scalability link double wide up"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x80","Chassis Number","Scalability Port Number","R","0x00","Scalability link PFA"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x81","Chassis Number","Scalability Port Number","R","0x00","Scalability link invalid port"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x82","Chassis Number","Scalability Port Number","R","0x00","Scalability link invalid node"
|
||||
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x83","Chassis Number","Scalability Port Number","R","0x00","Scalability link kill"
|
||||
"0xE0","0x00","0x00","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Device OK"
|
||||
"0xE0","0x00","0x01","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required ROM space not available"
|
||||
"0xE0","0x00","0x02","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required I/O Space not available"
|
||||
"0xE0","0x00","0x03","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required memory not available"
|
||||
"0xE0","0x00","0x04","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required memory below 1MB not available"
|
||||
"0xE0","0x00","0x05","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","ROM checksum failed"
|
||||
"0xE0","0x00","0x06","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","BIST failed"
|
||||
"0xE0","0x00","0x07","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Planar device missing or disabled by user"
|
||||
"0xE0","0x00","0x08","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","PCI device has an invalid PCI configuration space header"
|
||||
"0xE0","0x00","0x09","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","FRU information for added PCI device"
|
||||
"0xE0","0x00","0x0A","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","FRU information for removed PCI device"
|
||||
"0xE0","0x00","0x0B","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","A PCI device was removed, PCI FRU information is stored in next log entry"
|
||||
"0xE0","0x00","0x0C","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","A PCI device was added, PCI FRU information is stored in next log entry"
|
||||
"0xE0","0x00","0x0D","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Requested resources not available"
|
||||
"0xE0","0x00","0x13","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Planar video disabled due to add in video card"
|
||||
"0xE0","0x00","0x14","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","FRU information for PCI device partially disabled "
|
||||
"0xE0","0x00","0x15","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","A PCI device was partially disabled, PCI FRU information is stored in next log entry"
|
||||
"0xE0","0x00","0x16","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","A 33Mhz device is installed on a 66Mhz bus, PCI device information is stored in next log entry"
|
||||
"0xE0","0x00","0x17","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","FRU information, 33Mhz device installed on 66Mhz bus"
|
||||
"0xE0","0x00","0x18","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Merge cable missing"
|
||||
"0xE0","0x00","0x19","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Node 1 to Node 2 cable missing"
|
||||
"0xE0","0x00","0x1A","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Node 1 to Node 3 cable missing"
|
||||
"0xE0","0x00","0x1B","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Node 2 to Node 3 cable missing"
|
||||
"0xE0","0x00","0x1C","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Nodes could not merge"
|
||||
"0xE0","0x00","0x1D","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","No 8 way SMP cable"
|
||||
"0xE0","0x00","0x1E","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Primary North Bridge to PCI Host Bridge IB Link has failed"
|
||||
"0xE0","0x00","0x1F","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Redundant PCI Host Bridge IB Link has failed"
|
||||
"0xE0","0x00","0x00","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Device OK"
|
||||
"0xE0","0x00","0x01","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required ROM space not available"
|
||||
"0xE0","0x00","0x02","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required I/O Space not available"
|
||||
"0xE0","0x00","0x03","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required memory not available"
|
||||
"0xE0","0x00","0x04","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required memory below 1MB not available"
|
||||
"0xE0","0x00","0x05","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","ROM checksum failed"
|
||||
"0xE0","0x00","0x06","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","BIST failed"
|
||||
"0xE0","0x00","0x07","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Planar device missing or disabled by user"
|
||||
"0xE0","0x00","0x08","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","PCI device has an invalid PCI configuration space header"
|
||||
"0xE0","0x00","0x09","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","FRU information for added PCI device"
|
||||
"0xE0","0x00","0x0A","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","FRU information for removed PCI device"
|
||||
"0xE0","0x00","0x0B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","A PCI device was added, PCI FRU information is stored in next log entry"
|
||||
"0xE0","0x00","0x0C","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","A PCI device was removed, PCI FRU information is stored in next log entry"
|
||||
"0xE0","0x00","0x0D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Requested resources not available"
|
||||
"0xE0","0x00","0x13","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Planar video disabled due to add in video card"
|
||||
"0xE0","0x00","0x14","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","FRU information for PCI device partially disabled "
|
||||
"0xE0","0x00","0x15","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","A PCI device was partially disabled, PCI FRU information is stored in next log entry"
|
||||
"0xE0","0x00","0x16","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","A 33Mhz device is installed on a 66Mhz bus, PCI device information is stored in next log entry"
|
||||
"0xE0","0x00","0x17","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","FRU information, 33Mhz device installed on 66Mhz bus"
|
||||
"0xE0","0x00","0x18","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Merge cable missing"
|
||||
"0xE0","0x00","0x19","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Node 1 to Node 2 cable missing"
|
||||
"0xE0","0x00","0x1A","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Node 1 to Node 3 cable missing"
|
||||
"0xE0","0x00","0x1B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Node 2 to Node 3 cable missing"
|
||||
"0xE0","0x00","0x1C","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Nodes could not merge"
|
||||
"0xE0","0x00","0x1D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","No 8 way SMP cable"
|
||||
"0xE0","0x00","0x1E","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Primary North Bridge to PCI Host Bridge IB Link has failed"
|
||||
"0xE0","0x00","0x1F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Redundant PCI Host Bridge IB Link has failed"
|
||||
"0xE0","0x01","0x00","Chassis Number","Processor Number","R","R","R","R","R","R","R","R","0x00","Processor has failed BIST"
|
||||
"0xE0","0x01","0x01","Chassis Number","Processor Number","R","R","R","R","R","R","R","R","0x00","Unable to apply processor microcode update"
|
||||
"0xE0","0x01","0x02","Chassis Number","Processor Number","R","R","R","R","R","R","R","R","0x00","POST does not support current stepping level of processor"
|
||||
"0xE0","0x01","0x03","Chassis Number","Processor Number","R","R","R","R","R","R","R","R","0x00","CPU mismatch detected"
|
||||
"0xE0","0x01","0x04","Chassis Number","R","R","R","R","R","R","R","R","R","0x00","Invalid configuration of processor card."
|
||||
"0xE0","0x02","0x00","Chassis Number","Memory Card","Memory DIMM","R","R","R","R","R","R","R","0x00","Uncorrectable memory error occurred"
|
||||
"0xE0","0x02","0x01","Chassis Number","Memory Card","Memory DIMM","Failing Symbol","R","R","R","R","R","R","0x00","Correctable memory threshold occurred"
|
||||
"0xE0","0x02","0x02","0x00","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM enabled"
|
||||
"0xE0","0x02","0x02","0x01","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM disabled, failed ECC test"
|
||||
"0xE0","0x02","0x02","0x02","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM disabled, failed POST/BIOS memory test"
|
||||
"0xE0","0x02","0x02","0x03","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM disabled, non-supported memory device"
|
||||
"0xE0","0x02","0x02","0x04","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM disabled, non-matching or missing DIMM(s)"
|
||||
"0xE0","0x02","0x03","0x00","Chassis Number","Memory Card","R","R","R","R","R","R","R","0x00","Memory card enabled"
|
||||
"0xE0","0x02","0x03","0x01","Chassis Number","Memory Card","R","R","R","R","R","R","R","0x00","Memory card disabled"
|
||||
"0xE0","0x02","0x00","0x00","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM enabled"
|
||||
"0xE0","0x02","0x00","0x01","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, failed ECC test"
|
||||
"0xE0","0x02","0x00","0x02","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, failed POST/BIOS memory test"
|
||||
"0xE0","0x02","0x00","0x03","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, non-supported memory device"
|
||||
"0xE0","0x02","0x00","0x04","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, non-matching or missing DIMM(s)"
|
||||
"0xE0","0x02","0x00","0x05","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, multi-bit or multi-symbol error"
|
||||
"0xE0","0x02","0x01","0x00","Chassis","Failed Channel","R","R","R","R","R","R","R","0x01","AMB Failure Detected on Channel X During Last Boot"
|
||||
"0xE1","0x00","0x00","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","Unknown SERR/PERR detected on PCI bus"
|
||||
"0xE1","0x00","0x01","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Address of special cycle DPE"
|
||||
"0xE1","0x00","0x02","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Master read parity error"
|
||||
"0xE1","0x00","0x03","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Received target parity error"
|
||||
"0xE1","0x00","0x04","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Master write parity error"
|
||||
"0xE1","0x00","0x05","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Device signaled SERR"
|
||||
"0xE1","0x00","0x06","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Slave signaled parity error"
|
||||
"0xE1","0x00","0x07","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Signaled Target Abort"
|
||||
"0xE1","0x00","0x08","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","BUS_CORRECTABLE: Additional Correctable ECC Error"
|
||||
"0xE1","0x00","0x09","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Received Master Abort"
|
||||
"0xE1","0x00","0x0A","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Additional Uncorrectable ECC Error"
|
||||
"0xE1","0x00","0x0B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Split Completion Discarded"
|
||||
"0xE1","0x00","0x0C","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","BUS_CORRECTABLE: Correctable ECC Error"
|
||||
"0xE1","0x00","0x0D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Unexpected Split Completion"
|
||||
"0xE1","0x00","0x0E","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Uncorrectable ECC Error"
|
||||
"0xE1","0x00","0x0F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Received split completion error"
|
||||
"0xE1","0x00","0x11","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Address of special cycle DPE"
|
||||
"0xE1","0x00","0x12","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Master read parity error"
|
||||
"0xE1","0x00","0x13","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Received target parity error"
|
||||
"0xE1","0x00","0x14","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Master write parity error"
|
||||
"0xE1","0x00","0x15","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Device Signaled SERR"
|
||||
"0xE1","0x00","0x16","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Slave Signaled Parity Error"
|
||||
"0xE1","0x00","0x17","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Signaled Target Abort"
|
||||
"0xE1","0x00","0x18","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","BUS_CORRECTABLE: PCI-PCI bridge secondary error: Additional Correctable ECC Error"
|
||||
"0xE1","0x00","0x19","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Received Master Abort"
|
||||
"0xE1","0x00","0x1A","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Additional Uncorrectable ECC Error"
|
||||
"0xE1","0x00","0x1B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Split Completion Discarded"
|
||||
"0xE1","0x00","0x1C","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","BUS_CORRECTABLE: PCI-PCI bridge secondary error: Correctable ECC Error"
|
||||
"0xE1","0x00","0x1D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Unexpected Split Completion"
|
||||
"0xE1","0x00","0x1E","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Uncorrectable ECC Error"
|
||||
"0xE1","0x00","0x1F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Received split completion error"
|
||||
"0xE1","0x00","0x20","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","BUS_CORRECTABLE: PCI ECC Error (Corrected)"
|
||||
"0xE1","0x00","0x21","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI Bus Address Parity Error"
|
||||
"0xE1","0x00","0x22","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI Bus Data Parity Error"
|
||||
"0xE1","0x00","0x23","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: SERR# Asserted"
|
||||
"0xE1","0x00","0x24","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PERR Received by Calgary on a PCIX Split Completion"
|
||||
"0xE1","0x00","0x25","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Address"
|
||||
"0xE1","0x00","0x27","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: TCE Extent Error"
|
||||
"0xE1","0x00","0x29","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Page Fault"
|
||||
"0xE1","0x00","0x2B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Unauthorized Access"
|
||||
"0xE1","0x00","0x2D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Parity Error in DMA Read Data Buffer"
|
||||
"0xE1","0x00","0x2F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI Bus Time Out"
|
||||
"0xE1","0x00","0x31","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: DMA Delayed Read Timeout"
|
||||
"0xE1","0x00","0x33","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Internal Error on PCIX Split Completion"
|
||||
"0xE1","0x00","0x35","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: DMA Read Reply (RIO) Timeout"
|
||||
"0xE1","0x00","0x37","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Internal RAM Error on DMA Write"
|
||||
"0xE1","0x00","0x39","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: MVE Valid Bit Off"
|
||||
"0xE1","0x00","0x3B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: MVE Index Invalid"
|
||||
"0xE1","0x00","0x40","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: ECC Error (Corrected)"
|
||||
"0xE1","0x00","0x41","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: SERR# Detected"
|
||||
"0xE1","0x00","0x42","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI Bus Data Parity Error"
|
||||
"0xE1","0x00","0x43","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: No DEVSEL#"
|
||||
"0xE1","0x00","0x45","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Bus Time Out"
|
||||
"0xE1","0x00","0x47","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Retry Count Expired"
|
||||
"0xE1","0x00","0x49","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Target-Abort"
|
||||
"0xE1","0x00","0x4B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Size"
|
||||
"0xE1","0x00","0x4D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Access Not Enabled"
|
||||
"0xE1","0x00","0x4F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Internal RAM Error on MMIO Store"
|
||||
"0xE1","0x00","0x51","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Split Response Received"
|
||||
"0xE1","0x00","0x53","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCIX Split Completion Error Status Received"
|
||||
"0xE1","0x00","0x55","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Unexpected PCIX Split Completion Received"
|
||||
"0xE1","0x00","0x57","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCIX Split Completion Timeout"
|
||||
"0xE1","0x00","0x59","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Recoverable Error Summary Bit"
|
||||
"0xE1","0x00","0x5B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: CSR Error Summary Bit"
|
||||
"0xE1","0x00","0x5D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Internal RAM Error on MMIO Load"
|
||||
"0xE1","0x00","0x61","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Bad Command"
|
||||
"0xE1","0x00","0x63","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Length Field Invalid"
|
||||
"0xE1","0x00","0x65","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Load Greater Than 8 & No Write Buffer Enabled"
|
||||
"0xE1","0x00","0x67","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCIX Discontiguous Byte Enable Error"
|
||||
"0xE1","0x00","0x69","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: 4K Address Boundary Crossing Error"
|
||||
"0xE1","0x00","0x6B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Store Wrap State Machine Check"
|
||||
"0xE1","0x00","0x6D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Target State Machine Check"
|
||||
"0xE1","0x00","0x6F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Transaction PM/DW"
|
||||
"0xE1","0x00","0x71","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Transaction PM/DR"
|
||||
"0xE1","0x00","0x73","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Transaction PS/DW"
|
||||
"0xE1","0x00","0x75","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: DMA Write Command FIFO Parity Error"
|
||||
"0xE1","0x00","0x76","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI Secondary Status Register Dump"
|
||||
"0xE1","0x00","0x77","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI Secondary Status Register Dump"
|
||||
"0xE1","0x00","0x81","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PCI-to-PCI Bridge Discard Timer Error"
|
||||
"0xE1","0x00","0x01","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x01","SERR detected on PCI bus"
|
||||
"0xE1","0x00","0x02","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x01","PERR detected on PCI bus"
|
||||
"0xE1","0x01","0x00","R","R","Bank (LSB)","Bank (MSB)","Apic ID (LSB)","Apic ID (MSB)","CK4(LSB)","CK4","CK4","CK4(MSB)","0x00","Processor Error Information Data A"
|
||||
"0xE1","0x01","0x01","R","R","Address high (LSB)","Address high","Address high","Address high (MSB)","Address low (LSB)","Address low ","Address low ","Address low (MSB)","0x00","Processor Error Information Data B1"
|
||||
"0xE1","0x01","0x02","R","R","Timestamp high (LSB)","Timestamp high","Timestamp high","Timestamp high (MSB)","Timestamp Low (LSB)","Timestamp low","Timestamp low","Timestamp low (MSB)","0x00","Processor Error Information Data B2"
|
||||
"0xE1","0x01","0x03","R","R","MCA status register high (LSB)","MCA status register high","MCA status register high","MCA status register high (MSB)","MCA status register low (LSB)","MCA status register low","MCA status register low","MCA status register low (MSB)","0x00","Processor Error Information Data C"
|
||||
"0xE1","0x01","0x04","Chassis","0x00","Processor ID","R","R","R","R","R","R","R","0x00","Processor recoverable error"
|
||||
"0xE1","0x01","0x04","Chassis","0x01","Processor ID","R","R","R","R","R","R","R","0x00","Processor unrecoverable error"
|
||||
"0xE1","0x02","0x00","0x00","Failed Row","Spare Row","R","R","R","R","R","R","R","0x00","Memory sparing event, start 1"
|
||||
"0xE1","0x02","0x00","0x02","Failed Row","Spare Row","R","R","R","R","R","R","R","0x00","Memory sparing event, done 1"
|
||||
"0xE1","0x02","0x00","0x01","Failed Row 1","Failed Row 2","Spare Row 1","Spare Row 2","R","R","R","R","R","0x00","Memory sparing event, start 2"
|
||||
"0xE1","0x02","0x00","0x03","Failed Row 1","Failed Row 2","Spare Row 1","Spare Row 2","R","R","R","R","R","0x00","Memory sparing event, done 2"
|
||||
"0xE1","0x02","0x01","Failed Port","Spare Port","R","R","R","R","R","R","R","R","0x00","Memory mirroring failover occurred"
|
||||
"0xE1","0x02","0x00","0x00","R","R","R","R","R","R","R","R","R","0x01","Memory sparing event, start 1"
|
||||
"0xE1","0x02","0x00","0x02","R","R","R","R","R","R","R","R","R","0x01","Memory sparing event, done 1"
|
||||
"0xE1","0x04","0x00","0x00","FSB FERR/NERR Register","FSB FERR/NERR Register","Chassis Number","R","R","R","R","R","R","0x00","FSB A Fatal"
|
||||
"0xE1","0x04","0x00","0x01","FSB FERR/NERR Register","FSB FERR/NERR Register","Chassis Number","R","R","R","R","R","R","0x00","FSB A Nonfatal"
|
||||
"0xE1","0x04","0x00","0x02","FSB FERR/NERR Register","FSB FERR/NERR Register","Chassis Number","R","R","R","R","R","R","0x00","FSB B Fatal"
|
||||
"0xE1","0x04","0x00","0x03","FSB FERR/NERR Register","FSB FERR/NERR Register","Chassis Number","R","R","R","R","R","R","0x00","FSB B Nonfatal"
|
||||
"0xE1","0x05","0x00","0x02","Hi FERR or NERR Register","R","R","R","R","R","R","R","R","0x00","Lindenhurst Chipset Event: Hi Fatal"
|
||||
"0xE1","0x05","0x00","0x03","Hi FERR or NERR Register","R","R","R","R","R","R","R","R","0x00","Lindenhurst Chipset Event: Hi Nonfatal"
|
||||
"0xE1","0x05","0x01","0x02","Status Register Contents","R","R","R","R","R","R","R","R","0x00","Fatal internal north bridge error"
|
||||
"0xE1","0x05","0x01","0x03","Status Register Contents","R","R","R","R","R","R","R","R","0x00","Nonfatal internal north bridge error"
|
||||
"0xE1","0x05","0x01","0x04","Bus","Device","Function Number","R","R","R","R","R","R","0x00","Link Degrade Event"
|
||||
"0xE1","0x05","0x01","0x05","R","R","R","R","R","R","R","R","R","0x00","Spurious Memory Event"
|
||||
"0xE2","0x00","Register ID","R","First Fire Bit (0xFF=N/A)","Register Data (LSB)","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data (MSB)","0x00","PCI Industry Standard Register Dump"
|
||||
"0xE2","0x01","Register ID","R","First Fire Bit (0xFF if N/A)","Register Data (LSB)","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data (MSB)","0x00","PCI-X Industry Standard Register Dump"
|
||||
"0xE2","0x02","Register ID","R","First Fire Bit (0xFF if N/A)","Register Data (LSB)","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data (MSB)","0x00","PCI Express Industry Standard Register Dump"
|
||||
"0xE3","Platform ID","Register ID","R","R","R","R","R","R","Register Data (LSB)","Register Data","Register Data","Register Data (MSB)","0x00","RAW Hex Dump"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x00","0x00","R","R","R","0x00","PCI Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x01","0x00","R","R","R","0x00","Processor Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x02","0x00","R","R","R","0x00","Memory Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x00","R","R","R","0x00"," Scalability Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x07","R","R","0x00","Merge Failure - BIOS version is newer than secondary server BIOS"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x08","R","R","0x00","Merge Failure - BIOS version is older than secondary server BIOS"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x09","R","R","0x00","Merge Failure - Primary server booted standalone"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x0A","R","R","0x00","Merge Failure - Communication error occurred with secondary server"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x0B","R","R","0x00","Merge Failure - Timed out waiting for secondary server"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x10","R","R","0x00","Merge Failure - No path through partition"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x11","Expected Chassis Count","R","0x00","Merge Information - Expected chassis count"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x12","Actual Chassis Count","R","0x00","Merge Information - Actual chassis count"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x19","R","R","0x00","Merge Failure - No secondary servers found to merge"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x34","R","R","0x00","Merge Failure - Primary server booted standalone"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x35","R","R","0x00","Merge Failure - Communication error occurred with primary server"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x36","R","R","0x00","Merge Failure - Secondary server booted standalone"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x41","R","R","0x00","Merge Failure - Timeout occurred waiting for primary server"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x46","R","R","0x00","Merge Failure - BIOS version is newer than primary server BIOS"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x47","R","R","0x00","Merge Failure - BIOS version is older than primary server BIOS"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x52","R","R","0x00","Merge Failure - Scalability hardware not detected"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x53","R","R","0x00","Merge Failure - No partition descriptor found"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x54","R","R","0x00","Merge Failure - Error Reading partition descriptor"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x55","R","R","0x00","Merge Failure - Error Reading system UUID"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x56","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x57","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x58","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x59","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x5A","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x5B","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x5C","R","R","0x00","Merge Failure [Byte 13 value]"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x04","0x00","R","R","R","0x00","Bus PCI Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x05","0x00","R","R","R","0x00","Chipset Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x06","0x01","PostVersion","BMCVersion","R","0x00","Incompatible BIOS-BMC Power Executive support"
|
||||
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x06","0x02","R","R","R","0x00","Boot denied due to power limitations"
|
File diff suppressed because it is too large
Load Diff
10
csv-revision
10
csv-revision
@ -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
|
||||
)
|
241
doc/ipmievd.8.in
241
doc/ipmievd.8.in
@ -1,241 +0,0 @@
|
||||
.TH "ipmievd" "8" "" "Duncan Laurie" ""
|
||||
.SH "NAME"
|
||||
ipmievd \- IPMI event daemon for sending events to syslog
|
||||
.SH "SYNOPSIS"
|
||||
ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-d \fIN\fP\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
\fB\-I\fR \fIopen\fP <\fIopen\fR | \fIsel\fR> [<\fIoption\fP>]
|
||||
|
||||
ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
\fB\-I\fR \fIlan\fP \fB\-H\fR <\fIhostname\fP>
|
||||
[\fB\-p\fR <\fIport\fP>]
|
||||
[\fB\-U\fR <\fIusername\fP>]
|
||||
[\fB\-A\fR <\fIauthtype\fP>]
|
||||
[\fB\-L\fR <\fIprivlvl\fP>]
|
||||
[\fB\-a\fR|\fB\-E\fR|\fB\-P\fR|\fB\-f\fR <\fIpassword\fP>]
|
||||
[\fB\-o\fR <\fIoemtype\fP>]
|
||||
[\fB\-O\fR <\fIsel oem\fP>]
|
||||
\fIsel\fP [<\fIoption\fP>]
|
||||
|
||||
ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
\fB\-I\fR \fIlanplus\fP \fB\-H\fR <\fIhostname\fP>
|
||||
[\fB\-p\fR <\fIport\fP>]
|
||||
[\fB\-U\fR <\fIusername\fP>]
|
||||
[\fB\-L\fR <\fIprivlvl\fP>]
|
||||
[\fB\-a\fR|\fB\-E\fR|\fB\-P\fR|\fB\-f\fR <\fIpassword\fP>]
|
||||
[\fB\-o\fR <\fIoemtype\fP>]
|
||||
[\fB\-O\fR <\fIsel oem\fP>]
|
||||
[\fB\-C\fR <\fIciphersuite\fP>]
|
||||
\fIsel\fR [<\fIoption\fP>]
|
||||
.SH "DESCRIPTION"
|
||||
\fBipmievd\fP 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. It is able to run in one of two modes: either using the
|
||||
Event Message Buffer and asynchronous event notification from the
|
||||
OpenIPMI kernel driver or actively polling the contents of the
|
||||
SEL for new events. Upon receipt of an event via either mechanism
|
||||
it will be logged to syslog with the \fILOG_LOCAL4\fP facility.
|
||||
|
||||
It is based on the \fBipmitool\fR utility and shares the same IPMI
|
||||
interface support and session setup options. Please see the
|
||||
\fBipmitool\fR manpage for more information on supported IPMI
|
||||
interfaces.
|
||||
.SH "OPTIONS"
|
||||
.TP
|
||||
\fB\-a\fR
|
||||
Prompt for the remote server password.
|
||||
.TP
|
||||
\fB\-A\fR <\fIauthtype\fP>
|
||||
Specify an authentication type to use during IPMIv1.5 \fIlan\fP
|
||||
session activation. Supported types are NONE, PASSWORD, MD2, MD5, or OEM.
|
||||
.TP
|
||||
\fB\-c\fR
|
||||
Present output in CSV (comma separated variable) format.
|
||||
This is not available with all commands.
|
||||
.TP
|
||||
\fB\-C\fR <\fIciphersuite\fP>
|
||||
The remote server authentication, integrity, and encryption algorithms
|
||||
to use for IPMIv2 \fIlanplus\fP connections. See table 22\-19 in the
|
||||
IPMIv2 specification. The default is 3 which specifies RAKP\-HMAC\-SHA1
|
||||
authentication, HMAC\-SHA1\-96 integrity, and AES\-CBC\-128 encryption algorightms.
|
||||
.TP
|
||||
\fB\-E\fR
|
||||
The remote server password is specified by the environment
|
||||
variable \fIIPMI_PASSWORD\fP.
|
||||
.TP
|
||||
\fB\-f\fR <\fIpassword_file\fP>
|
||||
Specifies a file containing the remote server password. If this
|
||||
option is absent, or if password_file is empty, the password
|
||||
will default to NULL.
|
||||
.TP
|
||||
\fB\-h\fR
|
||||
Get basic usage help from the command line.
|
||||
.TP
|
||||
\fB\-H\fR <\fIaddress\fP>
|
||||
Remote server address, can be IP address or hostname. This
|
||||
option is required for \fIlan\fP and \fIlanplus\fP interfaces.
|
||||
.TP
|
||||
\fB\-I\fR <\fIinterface\fP>
|
||||
Selects IPMI interface to use. Supported interfaces that are
|
||||
compiled in are visible in the usage help output.
|
||||
.TP
|
||||
\fB\-L\fR <\fIprivlvl\fP>
|
||||
Force session privilege level. Can be CALLBACK, USER,
|
||||
OPERATOR, ADMIN. Default is ADMIN.
|
||||
.TP
|
||||
\fB\-m\fR <\fIlocal_address\fP>
|
||||
Set the local IPMB address. The default is 0x20 and there
|
||||
should be no need to change it for normal operation.
|
||||
.TP
|
||||
\fB\-o\fR <\fIoemtype\fP>
|
||||
Select OEM type to support. This usually involves minor hacks
|
||||
in place in the code to work around quirks in various BMCs from
|
||||
various manufacturers. Use \fI\-o list\fP to see a list of
|
||||
current supported OEM types.
|
||||
.TP
|
||||
\fB\-O\fR <\fIsel oem\fP>
|
||||
Open selected file and read OEM SEL event descriptions to be used
|
||||
during SEL listings. See examples in contrib dir for file format.
|
||||
.TP
|
||||
\fB\-p\fR <\fIport\fP>
|
||||
Remote server UDP port to connect to. Default is 623.
|
||||
.TP
|
||||
\fB\-P\fR <\fIpassword\fP>
|
||||
Remote server password is specified on the command line.
|
||||
If supported it will be obscured in the process list.
|
||||
\fBNote!\fR Specifying the password as a command line
|
||||
option is not recommended.
|
||||
.TP
|
||||
\fB\-S\fR <\fIsdr_cache_file\fP>
|
||||
Use local file for remote SDR cache. Using a local SDR cache
|
||||
can drastically increase performance for commands that require
|
||||
knowledge of the entire SDR to perform their function.
|
||||
.TP
|
||||
\fB\-t\fR <\fItarget_address\fP>
|
||||
Bridge IPMI requests to the remote target address.
|
||||
.TP
|
||||
\fB\-U\fR <\fIusername\fP>
|
||||
Remote server username, default is NULL user.
|
||||
.TP
|
||||
\fB\-d \fIN\fP\fR
|
||||
Use device number N to specify the /dev/ipmiN (or
|
||||
/dev/ipmi/N or /dev/ipmidev/N) device to use for in-band
|
||||
BMC communication. Used to target a specific BMC on a
|
||||
multi-node, multi-BMC system through the ipmi device
|
||||
driver interface. Default is 0.
|
||||
.TP
|
||||
\fB\-v\fR
|
||||
Increase verbose output level. This option may be specified
|
||||
multiple times to increase the level of debug output. If given
|
||||
three times you will get hexdumps of all incoming and
|
||||
outgoing packets.
|
||||
.TP
|
||||
\fB\-V\fR
|
||||
Display version information.
|
||||
|
||||
.LP
|
||||
If no password method is specified then ipmievd will prompt the
|
||||
user for a password. If no password is entered at the prompt,
|
||||
the remote server password will default to NULL.
|
||||
.SH "COMMANDS"
|
||||
.TP
|
||||
\fIhelp\fP
|
||||
This can be used to get command\-line help. It may also be
|
||||
placed at the end of commands to get option usage help.
|
||||
|
||||
> ipmievd help
|
||||
.br
|
||||
Commands:
|
||||
open Use OpenIPMI for asynchronous notification of events
|
||||
sel Poll SEL for notification of events
|
||||
|
||||
.TP
|
||||
\fIopen\fP
|
||||
This command starts ipmievd with the OpenIPMI event watching
|
||||
mechanism which relies on the Event Message Buffer feature of
|
||||
IPMI. This requires a properly installed and configured
|
||||
OpenIPMI driver on Linux and is only valid to be run through
|
||||
the \fIopen\fP interface. See the \fBipmitool\fR manpage
|
||||
and associated documentation for more information on setting
|
||||
up the OpenIPMI driver.
|
||||
|
||||
\fBNote\fR: Some BMC do not support the Event Message Buffer
|
||||
required for this command. Other BMCs claim to support it but
|
||||
do not actually deliver events to it. If this is the case please
|
||||
use the \fIsel\fP method.
|
||||
|
||||
.RS
|
||||
.TP
|
||||
\fIdaemon\fP
|
||||
Launch process as a daemon and reparent to init process.
|
||||
All messages will be sent to syslog. This is the default action.
|
||||
.TP
|
||||
\fInodaemon\fP
|
||||
Do NOT become a daemon, instead log all messages to stderr.
|
||||
.TP
|
||||
\fIpidfile\fP=<\fBfilename\fR>
|
||||
Save process ID to this file when in daemon mode. Defaults to
|
||||
/run/ipmievd.pid\fIN\fP (where \fIN\fP is the ipmi device
|
||||
number -- defaults to 0).
|
||||
.RE
|
||||
|
||||
.TP
|
||||
\fIsel\fP
|
||||
This command starts ipmievd with the SEL Polling event watching
|
||||
mechanism. This will poll the SEL periodically to determine if
|
||||
new events have been logged. This command should work with all
|
||||
BMCs and is capable of using the LAN interface as well to monitor
|
||||
a remote system and log its events to a local syslog.
|
||||
|
||||
.RS
|
||||
.TP
|
||||
\fIdaemon\fP
|
||||
Launch process as a daemon and reparent to init process.
|
||||
All messages will be sent to syslog. This is the default action.
|
||||
.TP
|
||||
\fInodaemon\fP
|
||||
Do NOT become a daemon, instead log all messages to stderr.
|
||||
.TP
|
||||
\fIpidfile\fP=<\fBfilename\fR>
|
||||
Save process ID to this file when in daemon mode. Defaults to
|
||||
/run/ipmievd.pid\fIN\fP (where \fIN\fP is the ipmi device
|
||||
number -- defaults to 0).
|
||||
.TP
|
||||
\fItimeout\fP=<\fBseconds\fR>
|
||||
Time between checks for SEL polling method. Default is 10 seconds.
|
||||
.RE
|
||||
.SH "EXAMPLES"
|
||||
.TP
|
||||
\fIExample 1\fP: Daemon process watching OpenIPMI for events
|
||||
|
||||
> ipmievd \-I open open daemon
|
||||
.TP
|
||||
\fIExample 2\fP: Local non\-daemon process checking remote SEL every 30 seconds
|
||||
|
||||
> ipmievd \-I lan \-H 1.2.3.4 \-f passfile sel nodaemon timeout=30
|
||||
.br
|
||||
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"
|
||||
.TP
|
||||
IPMItool Homepage
|
||||
http://ipmitool.sourceforge.net
|
||||
.TP
|
||||
Intelligent Platform Management Interface Specification
|
||||
http://www.intel.com/design/servers/ipmi
|
||||
.TP
|
||||
OpenIPMI Homepage
|
||||
http://openipmi.sourceforge.net
|
3861
doc/ipmitool.1.in
3861
doc/ipmitool.1.in
File diff suppressed because it is too large
Load Diff
@ -1,43 +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.
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
noinst_HEADERS = log.h bswap.h hpm2.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 \
|
||||
ipmi_strings.h ipmi_constants.h ipmi_user.h ipmi_pef.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_time.h
|
||||
|
@ -1,228 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <sys/types.h>
|
||||
#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
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef tboolean
|
||||
#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
|
||||
#endif
|
||||
#ifndef IPMI_UID_MAX
|
||||
# define IPMI_UID_MAX 63
|
||||
#endif
|
||||
|
||||
struct ipmi_intf;
|
||||
|
||||
struct valstr {
|
||||
uint32_t val;
|
||||
const char * str;
|
||||
};
|
||||
struct oemvalstr {
|
||||
uint32_t oem;
|
||||
uint16_t val;
|
||||
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);
|
||||
|
||||
int str2double(const char * str, double * double_ptr);
|
||||
int str2long(const char * str, int64_t * lng_ptr);
|
||||
int str2ulong(const char * str, uint64_t * ulng_ptr);
|
||||
int str2int(const char * str, int32_t * int_ptr);
|
||||
int str2uint(const char * str, uint32_t * uint_ptr);
|
||||
int str2short(const char * str, int16_t * shrt_ptr);
|
||||
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);
|
||||
}
|
||||
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);
|
||||
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 = (uint16_t)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 = (uint32_t)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 = (uint32_t)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)
|
||||
|
||||
#ifndef __min
|
||||
# define __min(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef __max
|
||||
# define __max(a, b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef __minlen
|
||||
# define __minlen(a, b) ({ int x=strlen(a); int y=strlen(b); (x < y) ? x : y;})
|
||||
#endif
|
||||
|
||||
#ifndef __maxlen
|
||||
# define __maxlen(a, b) ({ int x=strlen(a); int y=strlen(b); (x > y) ? x : y;})
|
||||
#endif
|
@ -1,93 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#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);
|
@ -1,308 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi_cc.h>
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define IPMI_BUF_SIZE 1024
|
||||
#define IPMI_MAX_MD_SIZE 0x20
|
||||
|
||||
#if HAVE_PRAGMA_PACK
|
||||
#define ATTRIBUTE_PACKING
|
||||
#else
|
||||
#define ATTRIBUTE_PACKING __attribute__ ((packed))
|
||||
#endif
|
||||
|
||||
|
||||
/* From table 13.16 of the IPMI v2 specification */
|
||||
#define IPMI_PAYLOAD_TYPE_IPMI 0x00
|
||||
#define IPMI_PAYLOAD_TYPE_SOL 0x01
|
||||
#define IPMI_PAYLOAD_TYPE_OEM 0x02
|
||||
#define IPMI_PAYLOAD_TYPE_RMCP_OPEN_REQUEST 0x10
|
||||
#define IPMI_PAYLOAD_TYPE_RMCP_OPEN_RESPONSE 0x11
|
||||
#define IPMI_PAYLOAD_TYPE_RAKP_1 0x12
|
||||
#define IPMI_PAYLOAD_TYPE_RAKP_2 0x13
|
||||
#define IPMI_PAYLOAD_TYPE_RAKP_3 0x14
|
||||
#define IPMI_PAYLOAD_TYPE_RAKP_4 0x15
|
||||
|
||||
extern int verbose;
|
||||
extern int csv_output;
|
||||
|
||||
struct ipmi_rq {
|
||||
struct {
|
||||
uint8_t netfn:6;
|
||||
uint8_t lun:2;
|
||||
uint8_t cmd;
|
||||
uint8_t target_cmd;
|
||||
uint16_t data_len;
|
||||
uint8_t *data;
|
||||
} msg;
|
||||
};
|
||||
|
||||
/*
|
||||
* This is what the sendrcv_v2() function would take as an argument. The common case
|
||||
* is for payload_type to be IPMI_PAYLOAD_TYPE_IPMI.
|
||||
*/
|
||||
struct ipmi_v2_payload {
|
||||
uint16_t payload_length;
|
||||
uint8_t payload_type;
|
||||
|
||||
union {
|
||||
|
||||
struct {
|
||||
uint8_t rq_seq;
|
||||
struct ipmi_rq *request;
|
||||
} ipmi_request;
|
||||
|
||||
struct {
|
||||
uint8_t rs_seq;
|
||||
struct ipmi_rs *response;
|
||||
} ipmi_response;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
uint8_t *request;
|
||||
} open_session_request;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
uint8_t *message;
|
||||
} rakp_1_message;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
uint8_t *message;
|
||||
} rakp_2_message;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
uint8_t *message;
|
||||
} rakp_3_message;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
uint8_t *message;
|
||||
} rakp_4_message;
|
||||
|
||||
struct {
|
||||
uint8_t data[IPMI_BUF_SIZE];
|
||||
uint16_t character_count;
|
||||
uint8_t packet_sequence_number;
|
||||
uint8_t acked_packet_number;
|
||||
uint8_t accepted_character_count;
|
||||
uint8_t is_nack; /* bool */
|
||||
uint8_t assert_ring_wor; /* bool */
|
||||
uint8_t generate_break; /* bool */
|
||||
uint8_t deassert_cts; /* bool */
|
||||
uint8_t deassert_dcd_dsr; /* bool */
|
||||
uint8_t flush_inbound; /* bool */
|
||||
uint8_t flush_outbound; /* bool */
|
||||
} sol_packet;
|
||||
|
||||
} payload;
|
||||
};
|
||||
|
||||
struct ipmi_rq_entry {
|
||||
struct ipmi_rq req;
|
||||
struct ipmi_intf *intf;
|
||||
uint8_t rq_seq;
|
||||
uint8_t *msg_data;
|
||||
int msg_len;
|
||||
int bridging_level;
|
||||
struct ipmi_rq_entry *next;
|
||||
};
|
||||
|
||||
struct ipmi_rs {
|
||||
uint8_t ccode;
|
||||
uint8_t data[IPMI_BUF_SIZE];
|
||||
|
||||
/*
|
||||
* Looks like this is the length of the entire packet, including the RMCP
|
||||
* stuff, then modified to be the length of the extra IPMI message data
|
||||
*/
|
||||
int data_len;
|
||||
|
||||
struct {
|
||||
uint8_t netfn;
|
||||
uint8_t cmd;
|
||||
uint8_t seq;
|
||||
uint8_t lun;
|
||||
} msg;
|
||||
|
||||
struct {
|
||||
uint8_t authtype;
|
||||
uint32_t seq;
|
||||
uint32_t id;
|
||||
uint8_t bEncrypted; /* IPMI v2 only */
|
||||
uint8_t bAuthenticated; /* IPMI v2 only */
|
||||
uint8_t payloadtype; /* IPMI v2 only */
|
||||
/* This is the total length of the payload or
|
||||
IPMI message. IPMI v2.0 requires this to
|
||||
be 2 bytes. Not really used for much. */
|
||||
uint16_t msglen;
|
||||
} session;
|
||||
|
||||
/*
|
||||
* A union of the different possible payload meta-data
|
||||
*/
|
||||
union {
|
||||
struct {
|
||||
uint8_t rq_addr;
|
||||
uint8_t netfn;
|
||||
uint8_t rq_lun;
|
||||
uint8_t rs_addr;
|
||||
uint8_t rq_seq;
|
||||
uint8_t rs_lun;
|
||||
uint8_t cmd;
|
||||
} ipmi_response;
|
||||
struct {
|
||||
uint8_t message_tag;
|
||||
uint8_t rakp_return_code;
|
||||
uint8_t max_priv_level;
|
||||
uint32_t console_id;
|
||||
uint32_t bmc_id;
|
||||
uint8_t auth_alg;
|
||||
uint8_t integrity_alg;
|
||||
uint8_t crypt_alg;
|
||||
} open_session_response;
|
||||
struct {
|
||||
uint8_t message_tag;
|
||||
uint8_t rakp_return_code;
|
||||
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];
|
||||
} 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];
|
||||
} rakp4_message;
|
||||
struct {
|
||||
uint8_t packet_sequence_number;
|
||||
uint8_t acked_packet_number;
|
||||
uint8_t accepted_character_count;
|
||||
uint8_t is_nack; /* bool */
|
||||
uint8_t transfer_unavailable; /* bool */
|
||||
uint8_t sol_inactive; /* bool */
|
||||
uint8_t transmit_overrun; /* bool */
|
||||
uint8_t break_detected; /* bool */
|
||||
} sol_packet;
|
||||
|
||||
} payload;
|
||||
};
|
||||
|
||||
#define IPMI_NETFN_CHASSIS 0x0
|
||||
#define IPMI_NETFN_BRIDGE 0x2
|
||||
#define IPMI_NETFN_SE 0x4
|
||||
#define IPMI_NETFN_APP 0x6
|
||||
#define IPMI_NETFN_FIRMWARE 0x8
|
||||
#define IPMI_NETFN_STORAGE 0xa
|
||||
#define IPMI_NETFN_TRANSPORT 0xc
|
||||
#define IPMI_NETFN_PICMG 0x2C
|
||||
#define IPMI_NETFN_DCGRP 0x2C
|
||||
#define IPMI_NETFN_OEM 0x2E
|
||||
#define IPMI_NETFN_ISOL 0x34
|
||||
#define IPMI_NETFN_TSOL 0x30
|
||||
|
||||
#define IPMI_BMC_SLAVE_ADDR 0x20
|
||||
#define IPMI_REMOTE_SWID 0x81
|
||||
|
||||
|
||||
/* 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,
|
||||
IPMI_OEM_BULL = 107,
|
||||
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,
|
||||
IPMI_OEM_DELL = 674,
|
||||
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_FUJITSU_SIEMENS = 10368,
|
||||
IPMI_OEM_AVOCENT = 10418,
|
||||
IPMI_OEM_PEPPERCON = 10437,
|
||||
IPMI_OEM_SUPERMICRO = 10876,
|
||||
IPMI_OEM_OSA = 11102,
|
||||
IPMI_OEM_GOOGLE = 11129,
|
||||
IPMI_OEM_PICMG = 12634,
|
||||
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;
|
||||
|
||||
extern const struct valstr completion_code_vals[];
|
@ -1,72 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
Thu Jan 11 09:32:41 2007
|
||||
francois.isabelle@ca.kontron.com
|
||||
|
||||
I just noticed that most modules refer to IPMI completion codes using
|
||||
hard coded values ...
|
||||
*/
|
||||
|
||||
/*
|
||||
* CC
|
||||
* See IPMI specification table 5-2 Generic Completion Codes
|
||||
*/
|
||||
|
||||
#define IPMI_CC_OK 0x00
|
||||
#define IPMI_CC_NODE_BUSY 0xc0
|
||||
#define IPMI_CC_INV_CMD 0xc1
|
||||
#define IPMI_CC_INV_CMD_FOR_LUN 0xc2
|
||||
#define IPMI_CC_TIMEOUT 0xc3
|
||||
#define IPMI_CC_OUT_OF_SPACE 0xc4
|
||||
#define IPMI_CC_RES_CANCELED 0xc5
|
||||
#define IPMI_CC_REQ_DATA_TRUNC 0xc6
|
||||
#define IPMI_CC_REQ_DATA_INV_LENGTH 0xc7
|
||||
#define IPMI_CC_REQ_DATA_FIELD_EXCEED 0xc8
|
||||
#define IPMI_CC_PARAM_OUT_OF_RANGE 0xc9
|
||||
#define IPMI_CC_CANT_RET_NUM_REQ_BYTES 0xca
|
||||
#define IPMI_CC_REQ_DATA_NOT_PRESENT 0xcb
|
||||
#define IPMI_CC_INV_DATA_FIELD_IN_REQ 0xcc
|
||||
#define IPMI_CC_ILL_SENSOR_OR_RECORD 0xcd
|
||||
#define IPMI_CC_RESP_COULD_NOT_BE_PRV 0xce
|
||||
#define IPMI_CC_CANT_RESP_DUPLI_REQ 0xcf
|
||||
#define IPMI_CC_CANT_RESP_SDRR_UPDATE 0xd0
|
||||
#define IPMI_CC_CANT_RESP_FIRM_UPDATE 0xd1
|
||||
#define IPMI_CC_CANT_RESP_BMC_INIT 0xd2
|
||||
#define IPMI_CC_DESTINATION_UNAVAILABLE 0xd3
|
||||
#define IPMI_CC_INSUFFICIENT_PRIVILEGES 0xd4
|
||||
#define IPMI_CC_NOT_SUPPORTED_PRESENT_STATE 0xd5
|
||||
#define IPMI_CC_ILLEGAL_COMMAND_DISABLED 0xd6
|
||||
#define IPMI_CC_UNSPECIFIED_ERROR 0xff
|
@ -1,195 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#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);
|
@ -1,224 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# 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
|
||||
#define IPMI_GET_USER_ACCESS 0x44
|
||||
#define IPMI_SET_USER_NAME 0x45
|
||||
#define IPMI_GET_USER_NAME 0x46
|
||||
#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.22 / 22.23) Set/Get Channel Access */
|
||||
typedef enum {
|
||||
ALERTING_ENABLED = 0,
|
||||
ALERTING_DISABLED = (1 << 5) /* See Table 22 */
|
||||
} alerting_t;
|
||||
|
||||
struct channel_access_t {
|
||||
uint8_t access_mode;
|
||||
alerting_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
|
||||
* From table 22-15 of the IPMI v2.0 spec
|
||||
*/
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct get_channel_auth_cap_rsp {
|
||||
uint8_t channel_number;
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t v20_data_available : 1; /* IPMI v2.0 data is available */
|
||||
uint8_t __reserved1 : 1;
|
||||
uint8_t enabled_auth_types : 6; /* IPMI v1.5 enabled auth types */
|
||||
#else
|
||||
uint8_t enabled_auth_types : 6; /* IPMI v1.5 enabled auth types */
|
||||
uint8_t __reserved1 : 1;
|
||||
uint8_t v20_data_available : 1; /* IPMI v2.0 data is available */
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved2 : 2;
|
||||
uint8_t kg_status : 1; /* two-key login status */
|
||||
uint8_t per_message_auth : 1; /* per-message authentication status */
|
||||
uint8_t user_level_auth : 1; /* user-level authentication status */
|
||||
uint8_t non_null_usernames : 1; /* one or more non-null users exist */
|
||||
uint8_t null_usernames : 1; /* one or more null usernames non-null pwds */
|
||||
uint8_t anon_login_enabled : 1; /* a null-named, null-pwd user exists */
|
||||
#else
|
||||
uint8_t anon_login_enabled : 1; /* a null-named, null-pwd user exists */
|
||||
uint8_t null_usernames : 1; /* one or more null usernames non-null pwds */
|
||||
uint8_t non_null_usernames : 1; /* one or more non-null users exist */
|
||||
uint8_t user_level_auth : 1; /* user-level authentication status */
|
||||
uint8_t per_message_auth : 1; /* per-message authentication status */
|
||||
uint8_t kg_status : 1; /* two-key login status */
|
||||
uint8_t __reserved2 : 2;
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved3 : 6;
|
||||
uint8_t ipmiv20_support : 1; /* channel supports IPMI v2.0 connections */
|
||||
uint8_t ipmiv15_support : 1; /* channel supports IPMI v1.5 connections */
|
||||
#else
|
||||
uint8_t ipmiv15_support : 1; /* channel supports IPMI v1.5 connections */
|
||||
uint8_t ipmiv20_support : 1; /* channel supports IPMI v2.0 connections */
|
||||
uint8_t __reserved3 : 6;
|
||||
#endif
|
||||
uint8_t oem_id[3]; /* IANA enterprise number for auth type */
|
||||
uint8_t oem_aux_data; /* Additional OEM specific data for oem auths */
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#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);
|
||||
|
||||
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);
|
||||
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_info(struct ipmi_intf * intf, uint8_t channel);
|
@ -1,267 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2008 Intel Corporation.
|
||||
* All rights reserved
|
||||
*
|
||||
* 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 THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
/* DCMI commands per DCMI 1.5 SPEC */
|
||||
|
||||
#define IPMI_DCMI 0xDC /* Group Extension Identification */
|
||||
#define IPMI_DCMI_COMPAT 0x01
|
||||
#define IPMI_DCMI_GETRED 0x02
|
||||
#define IPMI_DCMI_GETLMT 0x03
|
||||
#define IPMI_DCMI_SETLMT 0x04
|
||||
#define IPMI_DCMI_PWRACT 0x05
|
||||
#define IPMI_DCMI_GETASSET 0x06
|
||||
#define IPMI_DCMI_SETASSET 0x08
|
||||
#define IPMI_DCMI_GETMNGCTRLIDS 0x09
|
||||
#define IPMI_DCMI_SETMNGCTRLIDS 0x0A
|
||||
#define IPMI_DCMI_SETTERMALLIMIT 0x0B
|
||||
#define IPMI_DCMI_GETTERMALLIMIT 0x0C
|
||||
#define IPMI_DCMI_GETSNSR 0x07
|
||||
#define IPMI_DCMI_PWRMGT 0x08
|
||||
#define IPMI_DCMI_GETTEMPRED 0x10
|
||||
#define IPMI_DCMI_SETCONFPARAM 0x12
|
||||
#define IPMI_DCMI_GETCONFPARAM 0x13
|
||||
|
||||
#define IPMI_DCMI_CONFORM 0x0001
|
||||
#define IPMI_DCMI_1_1_CONFORM 0x0101
|
||||
#define IPMI_DCMI_1_5_CONFORM 0x0501
|
||||
|
||||
#define DCMI_MAX_BYTE_SIZE 0x10
|
||||
#define DCMI_MAX_BYTE_TEMP_READ_SIZE 0x08
|
||||
|
||||
#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;
|
||||
const char * str;
|
||||
const char * desc;
|
||||
};
|
||||
|
||||
/* make a struct for the return from the get limit command */
|
||||
struct power_limit {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint16_t reserved_1; /* second and third bytes are reserved */
|
||||
uint8_t action; /* fourth byte is the exception action */
|
||||
uint16_t limit; /* fifth through sixth byte are the power limit in watts */
|
||||
uint32_t correction; /* seventh - 10th bytes are the correction period */
|
||||
uint16_t reserved_2; /* 11th - 12th are reserved bytes */
|
||||
uint16_t sample; /* 13th - 14th are sample period time */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* make a struct for the return from the reading command */
|
||||
struct power_reading {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint16_t curr_pwr;
|
||||
uint16_t min_sample;
|
||||
uint16_t max_sample;
|
||||
uint16_t avg_pwr;
|
||||
uint32_t time_stamp; /* time since epoch */
|
||||
uint32_t sample;
|
||||
uint8_t state;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* make a struct for the return from the capabilities command */
|
||||
struct capabilities {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint16_t conformance;
|
||||
uint8_t revision;
|
||||
uint8_t data_byte1;
|
||||
uint8_t data_byte2;
|
||||
uint8_t data_byte3;
|
||||
uint8_t data_byte4;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* make a struct for the return from the sensor info command */
|
||||
struct sensor_info {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint8_t i_instances;
|
||||
uint8_t i_records;
|
||||
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* make a struct for the return from the get asset tag command */
|
||||
struct asset_tag {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint8_t length;
|
||||
const char tag[16];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* make a struct for the return from the set asset tag command */
|
||||
struct set_asset_tag {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint8_t length;
|
||||
const char tag[16];
|
||||
uint8_t *data;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* make a struct for the return from the get thermal limit command */
|
||||
struct thermal_limit {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
uint8_t exceptionActions;
|
||||
uint8_t tempLimit;
|
||||
uint16_t exceptionTime;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
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);
|
@ -1,364 +0,0 @@
|
||||
/****************************************************************************
|
||||
Copyright (c) 2008, Dell 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:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
- Neither the name of Dell Inc nor the names of its 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 THE COPYRIGHT OWNER OR CONTRIBUTORS 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.
|
||||
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
|
||||
/* Dell selector for LCD control - get and set unless specified */
|
||||
#define IPMI_DELL_LCD_STRING_SELECTOR 0xC1 /* RW get/set the user string */
|
||||
#define IPMI_DELL_LCD_CONFIG_SELECTOR 0xC2 /* RW set to user/default/none */
|
||||
#define IPMI_DELL_LCD_GET_CAPS_SELECTOR 0xCF /* RO use when available*/
|
||||
#define IPMI_DELL_LCD_STRINGEX_SELECTOR 0xD0 /* RW get/set the user string use first when available*/
|
||||
#define IPMI_DELL_LCD_STATUS_SELECTOR 0xE7 /* LCD string when config set to default.*/
|
||||
#define IPMI_DELL_PLATFORM_MODEL_NAME_SELECTOR 0xD1 /* LCD string when config set to default.*/
|
||||
|
||||
/* Dell defines for picking which string to use */
|
||||
#define IPMI_DELL_LCD_CONFIG_USER_DEFINED 0x00 /* use string set by user*/
|
||||
#define IPMI_DELL_LCD_CONFIG_DEFAULT 0x01 /* use platform model name*/
|
||||
#define IPMI_DELL_LCD_CONFIG_NONE 0x02 /* blank*/
|
||||
#define IPMI_DELL_LCD_iDRAC_IPV4ADRESS 0x04 /* use string set by user*/
|
||||
#define IPMI_DELL_LCD_IDRAC_MAC_ADDRESS 0x08 /* use platform model name*/
|
||||
#define IPMI_DELL_LCD_OS_SYSTEM_NAME 0x10 /* blank*/
|
||||
|
||||
#define IPMI_DELL_LCD_SERVICE_TAG 0x20 /* use string set by user*/
|
||||
#define IPMI_DELL_LCD_iDRAC_IPV6ADRESS 0x40 /* use string set by user*/
|
||||
#define IPMI_DELL_LCD_AMBEINT_TEMP 0x80 /* use platform model name*/
|
||||
#define IPMI_DELL_LCD_SYSTEM_WATTS 0x100 /* blank*/
|
||||
#define IPMI_DELL_LCD_ASSET_TAG 0x200
|
||||
|
||||
#define IPMI_DELL_LCD_ERROR_DISP_SEL 0x01 /* use platform model name*/
|
||||
#define IPMI_DELL_LCD_ERROR_DISP_VERBOSE 0x02 /* blank*/
|
||||
|
||||
#define IPMI_DELL_IDRAC_VALIDATOR 0xDD
|
||||
#define IPMI_DELL_POWER_CAP_STATUS 0xBA
|
||||
#define IPMI_DELL_AVG_POWER_CONSMP_HST 0xEB
|
||||
#define IPMI_DELL_PEAK_POWER_CONSMP_HST 0xEC
|
||||
#define SYSTEM_BOARD_SYSTEM_LEVEL_SENSOR_NUM 0x98
|
||||
|
||||
#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
|
||||
#define btuphr 0x01
|
||||
#define watt 0x00
|
||||
#define IPMI_DELL_POWER_CAP 0xEA
|
||||
#define percent 0x03
|
||||
|
||||
/* Not on all Dell servers. If there, use it.*/
|
||||
typedef struct _tag_ipmi_dell_lcd_caps
|
||||
{
|
||||
uint8_t parm_rev; /* 0x11 for IPMI 2.0 */
|
||||
uint8_t char_set; /* always 1 for printable ASCII 0x20-0x7E */
|
||||
uint8_t number_lines; /* 0-4, 1 for 9G. 10G tbd */
|
||||
uint8_t max_chars[4]; /* 62 for triathlon, 0 if not present (glacier) */
|
||||
/* [0] is max chars for line 1 */
|
||||
}IPMI_DELL_LCD_CAPS;
|
||||
|
||||
#define IPMI_DELL_LCD_STRING_LENGTH_MAX 62 /* Valid for 9G. Glacier ??. */
|
||||
#define IPMI_DELL_LCD_STRING1_SIZE 14
|
||||
#define IPMI_DELL_LCD_STRINGN_SIZE 16
|
||||
|
||||
/* vFlash subcommands */
|
||||
#define IPMI_GET_EXT_SD_CARD_INFO 0xA4
|
||||
|
||||
|
||||
typedef struct _tag_ipmi_dell_lcd_string
|
||||
{
|
||||
uint8_t parm_rev; /* 0x11 for IPMI 2.0 */
|
||||
uint8_t data_block_selector; /* 16-byte data block number to access, 0 based.*/
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint8_t encoding : 4; /* 0 is printable ASCII 7-bit */
|
||||
uint8_t length; /* 0 to max chars from lcd caps */
|
||||
uint8_t data[IPMI_DELL_LCD_STRING1_SIZE]; /* not zero terminated. */
|
||||
}selector_0_string;
|
||||
uint8_t selector_n_data[IPMI_DELL_LCD_STRINGN_SIZE];
|
||||
}lcd_string;
|
||||
} __attribute__ ((packed)) IPMI_DELL_LCD_STRING;
|
||||
|
||||
/* Only found on servers with more than 1 line. Use if available. */
|
||||
typedef struct _tag_ipmi_dell_lcd_stringex
|
||||
{
|
||||
uint8_t parm_rev; /* 0x11 for IPMI 2.0 */
|
||||
uint8_t line_number; /* LCD line number 1 to 4 */
|
||||
uint8_t data_block_selector; /* 16-byte data block number to access, 0 based.*/
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint8_t encoding : 4; /* 0 is printable ASCII 7-bit */
|
||||
uint8_t length; /* 0 to max chars from lcd caps */
|
||||
uint8_t data[IPMI_DELL_LCD_STRING1_SIZE]; /* not zero terminated. */
|
||||
} selector_0_string;
|
||||
uint8_t selector_n_data[IPMI_DELL_LCD_STRINGN_SIZE];
|
||||
} lcd_string;
|
||||
} __attribute__ ((packed)) IPMI_DELL_LCD_STRINGEX;
|
||||
|
||||
|
||||
typedef struct _lcd_status
|
||||
{
|
||||
char parametersel;
|
||||
char vKVM_status;
|
||||
char lock_status;
|
||||
char Resv1;
|
||||
char Resv;
|
||||
} __attribute__ ((packed)) LCD_STATUS;
|
||||
|
||||
typedef struct _lcd_mode
|
||||
{
|
||||
uint8_t parametersel;
|
||||
uint32_t lcdmode;
|
||||
uint16_t lcdquallifier;
|
||||
uint32_t capabilites;
|
||||
uint8_t error_display;
|
||||
uint8_t Resv;
|
||||
} __attribute__ ((packed)) LCD_MODE;
|
||||
|
||||
#define PARAM_REV_OFFSET (uint8_t)(0x1)
|
||||
#define VIRTUAL_MAC_OFFSET (uint8_t)(0x1)
|
||||
|
||||
#define LOM_MACTYPE_ETHERNET 0
|
||||
#define LOM_MACTYPE_ISCSI 1
|
||||
#define LOM_MACTYPE_RESERVED 3
|
||||
|
||||
#define LOM_ETHERNET_ENABLED 0
|
||||
#define LOM_ETHERNET_DISABLED 1
|
||||
#define LOM_ETHERNET_PLAYINGDEAD 2
|
||||
#define LOM_ETHERNET_RESERVED 3
|
||||
|
||||
#define LOM_ACTIVE 1
|
||||
#define LOM_INACTIVE 0
|
||||
|
||||
#define MACADDRESSLENGH 6
|
||||
#define MAX_LOM 8
|
||||
|
||||
|
||||
#define EMB_NIC_MAC_ADDRESS_11G (uint8_t)(0xDA)
|
||||
#define EMB_NIC_MAC_ADDRESS_9G_10G (uint8_t)(0xCB)
|
||||
|
||||
#define IMC_IDRAC_10G (uint8_t) (0x08)
|
||||
#define IMC_CMC (uint8_t) (0x09)
|
||||
#define IMC_IDRAC_11G_MONOLITHIC (uint8_t) (0x0A)
|
||||
#define IMC_IDRAC_11G_MODULAR (uint8_t) (0x0B)
|
||||
#define IMC_UNUSED (uint8_t) (0x0C)
|
||||
#define IMC_MASER_LITE_BMC (uint8_t) (0x0D)
|
||||
#define IMC_MASER_LITE_NU (uint8_t) (0x0E)
|
||||
#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
|
||||
{
|
||||
unsigned int BladSlotNumber : 4;
|
||||
unsigned int MacType : 2;
|
||||
unsigned int EthernetStatus : 2;
|
||||
unsigned int NICNumber : 5;
|
||||
unsigned int Reserved : 3;
|
||||
uint8_t MacAddressByte[MACADDRESSLENGH];
|
||||
} LOMMacAddressType;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
LOMMacAddressType LOMMacAddress [MAX_LOM];
|
||||
} EmbeddedNICMacAddressType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t MacAddressByte[MACADDRESSLENGH];
|
||||
} MacAddressType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
MacAddressType MacAddress [MAX_LOM];
|
||||
} EmbeddedNICMacAddressType_10G;
|
||||
|
||||
|
||||
|
||||
#define TRANSPORT_NETFN (uint8_t)(0xc)
|
||||
#define GET_LAN_PARAM_CMD (uint8_t)(0x02)
|
||||
#define MAC_ADDR_PARAM (uint8_t)(0x05)
|
||||
#define LAN_CHANNEL_NUMBER (uint8_t)(0x01)
|
||||
|
||||
#define IDRAC_NIC_NUMBER (uint8_t)(0x8)
|
||||
|
||||
#define TOTAL_N0_NICS_INDEX (uint8_t)(0x1)
|
||||
|
||||
|
||||
// 12g supported
|
||||
#define SET_NIC_SELECTION_12G_CMD (uint8_t)(0x28)
|
||||
#define GET_NIC_SELECTION_12G_CMD (uint8_t)(0x29)
|
||||
|
||||
// 11g supported
|
||||
#define SET_NIC_SELECTION_CMD (uint8_t)(0x24)
|
||||
#define GET_NIC_SELECTION_CMD (uint8_t)(0x25)
|
||||
#define GET_ACTIVE_NIC_CMD (uint8_t)(0xc1)
|
||||
#define POWER_EFFICENCY_CMD (uint8_t)(0xc0)
|
||||
#define SERVER_POWER_CONSUMPTION_CMD (uint8_t)(0x8F)
|
||||
|
||||
#define POWER_SUPPLY_INFO (uint8_t)(0xb0)
|
||||
#define IPMI_ENTITY_ID_POWER_SUPPLY (uint8_t)(0x0a)
|
||||
#define SENSOR_STATE_STR_SIZE (uint8_t)(64)
|
||||
#define SENSOR_NAME_STR_SIZE (uint8_t)(64)
|
||||
|
||||
#define GET_PWRMGMT_INFO_CMD (uint8_t)(0x9C)
|
||||
#define CLEAR_PWRMGMT_INFO_CMD (uint8_t)(0x9D)
|
||||
#define GET_PWR_HEADROOM_CMD (uint8_t)(0xBB)
|
||||
#define GET_PWR_CONSUMPTION_CMD (uint8_t)(0xB3)
|
||||
#define GET_FRONT_PANEL_INFO_CMD (uint8_t)0xb5
|
||||
|
||||
|
||||
typedef struct _ipmi_power_monitor
|
||||
{
|
||||
uint32_t cumStartTime;
|
||||
uint32_t cumReading;
|
||||
uint32_t maxPeakStartTime;
|
||||
uint32_t ampPeakTime;
|
||||
uint16_t ampReading;
|
||||
uint32_t wattPeakTime;
|
||||
uint16_t wattReading;
|
||||
} __attribute__ ((packed)) IPMI_POWER_MONITOR;
|
||||
|
||||
|
||||
#define MAX_POWER_FW_VERSION 8
|
||||
|
||||
typedef struct _ipmi_power_supply_infoo
|
||||
{
|
||||
/*No param_rev it is not a System Information Command */
|
||||
uint16_t ratedWatts;
|
||||
uint16_t ratedAmps;
|
||||
uint16_t ratedVolts;
|
||||
uint32_t vendorid;
|
||||
uint8_t FrimwareVersion[MAX_POWER_FW_VERSION];
|
||||
uint8_t Powersupplytype;
|
||||
uint16_t ratedDCWatts;
|
||||
uint16_t Resv;
|
||||
|
||||
} __attribute__ ((packed)) IPMI_POWER_SUPPLY_INFO;
|
||||
|
||||
|
||||
typedef struct ipmi_power_consumption_data
|
||||
{
|
||||
uint16_t actualpowerconsumption;
|
||||
uint16_t powerthreshold;
|
||||
uint16_t warningthreshold;
|
||||
uint8_t throttlestate;
|
||||
uint16_t maxpowerconsumption;
|
||||
uint16_t throttlepowerconsumption;
|
||||
uint16_t Resv;
|
||||
} __attribute__ ((packed)) IPMI_POWER_CONSUMPTION_DATA;
|
||||
|
||||
|
||||
typedef struct ipmi_inst_power_consumption_data
|
||||
{
|
||||
uint16_t instanpowerconsumption;
|
||||
uint16_t instanApms;
|
||||
uint16_t resv1;
|
||||
uint8_t resv;
|
||||
} __attribute__ ((packed)) IPMI_INST_POWER_CONSUMPTION_DATA;
|
||||
|
||||
typedef struct _ipmi_avgpower_consump_histroy
|
||||
{
|
||||
uint8_t parameterselector;
|
||||
uint16_t lastminutepower;
|
||||
uint16_t lasthourpower;
|
||||
uint16_t lastdaypower;
|
||||
uint16_t lastweakpower;
|
||||
|
||||
} __attribute__ ((packed)) IPMI_AVGPOWER_CONSUMP_HISTORY;
|
||||
|
||||
typedef struct _ipmi_power_consump_histroy
|
||||
{
|
||||
uint8_t parameterselector;
|
||||
uint16_t lastminutepower;
|
||||
uint16_t lasthourpower;
|
||||
uint16_t lastdaypower;
|
||||
uint16_t lastweakpower;
|
||||
uint32_t lastminutepowertime;
|
||||
uint32_t lasthourpowertime;
|
||||
uint32_t lastdaypowertime;
|
||||
uint32_t lastweekpowertime;
|
||||
} __attribute__ ((packed)) IPMI_POWER_CONSUMP_HISTORY;
|
||||
|
||||
|
||||
typedef struct _ipmi_delloem_power_cap
|
||||
{
|
||||
uint8_t parameterselector;
|
||||
uint16_t PowerCap;
|
||||
uint8_t unit;
|
||||
uint16_t MaximumPowerConsmp;
|
||||
uint16_t MinimumPowerConsmp;
|
||||
uint16_t totalnumpowersupp;
|
||||
uint16_t AvailablePower ;
|
||||
uint16_t SystemThrottling;
|
||||
uint16_t Resv;
|
||||
} __attribute__ ((packed)) IPMI_POWER_CAP;
|
||||
|
||||
typedef struct _power_headroom
|
||||
{
|
||||
uint16_t instheadroom;
|
||||
uint16_t peakheadroom;
|
||||
} __attribute__ ((packed)) POWER_HEADROOM;
|
||||
|
||||
typedef struct ipmi_vFlash_extended_info
|
||||
{
|
||||
uint8_t vflashcompcode;
|
||||
uint8_t sdcardstatus;
|
||||
uint32_t sdcardsize;
|
||||
uint32_t sdcardavailsize;
|
||||
uint8_t bootpartion;
|
||||
uint8_t Resv;
|
||||
} __attribute__ ((packed)) IPMI_DELL_SDCARD_INFO;
|
||||
|
||||
|
||||
typedef struct _SensorReadingType
|
||||
{
|
||||
uint8_t sensorReading;
|
||||
uint8_t sensorFlags;
|
||||
uint16_t sensorState;
|
||||
}SensorReadingType;
|
||||
uint16_t compareinputwattage(IPMI_POWER_SUPPLY_INFO* powersupplyinfo, uint16_t inputwattage);
|
||||
int ipmi_delloem_main(struct ipmi_intf * intf, int argc, char ** argv);
|
@ -1,50 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct entity_id {
|
||||
uint8_t id; /* physical entity id */
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t logical : 1; /* physical/logical */
|
||||
uint8_t instance : 7; /* instance number */
|
||||
#else
|
||||
uint8_t instance : 7; /* instance number */
|
||||
uint8_t logical : 1; /* physical/logical */
|
||||
#endif
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
@ -1,103 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
int ipmi_firewall_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#define BMC_GET_NETFN_SUPPORT 0x09
|
||||
#define BMC_GET_COMMAND_SUPPORT 0x0A
|
||||
#define BMC_GET_COMMAND_SUBFUNCTION_SUPPORT 0x0B
|
||||
#define BMC_GET_CONFIGURABLE_COMMANDS 0x0C
|
||||
#define BMC_GET_CONFIGURABLE_COMMAND_SUBFUNCTIONS 0x0D
|
||||
#define BMC_SET_COMMAND_ENABLES 0x60
|
||||
#define BMC_GET_COMMAND_ENABLES 0x61
|
||||
#define BMC_SET_COMMAND_SUBFUNCTION_ENABLES 0x62
|
||||
#define BMC_GET_COMMAND_SUBFUNCTION_ENABLES 0x63
|
||||
#define BMC_OEM_NETFN_IANA_SUPPORT 0x64
|
||||
|
||||
#define SET_COMMAND_ENABLE_BYTE (BMC_SET_COMMAND_ENABLES / 8)
|
||||
#define SET_COMMAND_ENABLE_BIT (BMC_SET_COMMAND_ENABLES % 8)
|
||||
|
||||
#define MAX_LUN 4
|
||||
#define MAX_NETFN 64
|
||||
#define MAX_NETFN_PAIR (MAX_NETFN/2)
|
||||
#define MAX_COMMAND 256
|
||||
#define MAX_SUBFN 32
|
||||
#define MAX_COMMAND_BYTES (MAX_COMMAND>>3)
|
||||
#define MAX_SUBFN_BYTES (MAX_SUBFN>>3)
|
||||
|
||||
// support is a bitfield with the following bits set...
|
||||
#define BIT_AVAILABLE 0x01
|
||||
#define BIT_CONFIGURABLE 0x02
|
||||
#define BIT_ENABLED 0x04
|
||||
|
||||
extern int verbose;
|
||||
|
||||
struct command_support {
|
||||
unsigned char support;
|
||||
unsigned char version[3];
|
||||
unsigned char subfn_support[MAX_SUBFN_BYTES];
|
||||
unsigned char subfn_config[MAX_SUBFN_BYTES];
|
||||
unsigned char subfn_enable[MAX_SUBFN_BYTES];
|
||||
};
|
||||
struct lun_netfn_support {
|
||||
unsigned char support;
|
||||
struct command_support command[MAX_COMMAND];
|
||||
unsigned char command_mask[MAX_COMMAND_BYTES];
|
||||
unsigned char config_mask[MAX_COMMAND_BYTES];
|
||||
unsigned char enable_mask[MAX_COMMAND_BYTES];
|
||||
};
|
||||
struct lun_support {
|
||||
unsigned char support;
|
||||
struct lun_netfn_support netfn[MAX_NETFN_PAIR];
|
||||
};
|
||||
struct bmc_fn_support {
|
||||
struct lun_support lun[MAX_LUN];
|
||||
};
|
||||
struct ipmi_function_params {
|
||||
int channel;
|
||||
int lun;
|
||||
int netfn;
|
||||
int command;
|
||||
int subfn;
|
||||
unsigned char force;
|
||||
};
|
||||
|
||||
static inline int bit_test(const unsigned char * bf, int n) {
|
||||
return !!(bf[n>>3]&(1<<(n%8)));
|
||||
}
|
||||
static inline void bit_set(unsigned char * bf, int n, int v) {
|
||||
bf[n>>3] = (bf[n>>3] & ~(1<<(n%8))) | ((v?1:0)<<(n%8));
|
||||
}
|
@ -1,664 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#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
|
||||
|
||||
enum {
|
||||
FRU_CHASSIS_PARTNO,
|
||||
FRU_CHASSIS_SERIAL,
|
||||
FRU_BOARD_MANUF,
|
||||
FRU_BOARD_PRODUCT,
|
||||
FRU_BOARD_SERIAL,
|
||||
FRU_BOARD_PARTNO,
|
||||
FRU_PRODUCT_MANUF,
|
||||
FRU_PRODUCT_NAME,
|
||||
FRU_PRODUCT_PARTNO,
|
||||
FRU_PRODUCT_VERSION,
|
||||
FRU_PRODUCT_SERIAL,
|
||||
FRU_PRODUCT_ASSET,
|
||||
};
|
||||
|
||||
struct fru_info {
|
||||
uint16_t size;
|
||||
uint8_t access:1;
|
||||
uint8_t max_read_size;
|
||||
uint8_t max_write_size;
|
||||
};
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_header {
|
||||
uint8_t version;
|
||||
union {
|
||||
struct {
|
||||
uint8_t internal;
|
||||
uint8_t chassis;
|
||||
uint8_t board;
|
||||
uint8_t product;
|
||||
uint8_t multi;
|
||||
} offset;
|
||||
uint8_t offsets[5];
|
||||
};
|
||||
uint8_t pad;
|
||||
uint8_t checksum;
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct fru_area_chassis {
|
||||
uint8_t area_ver;
|
||||
uint8_t type;
|
||||
uint16_t area_len;
|
||||
char * part;
|
||||
char * serial;
|
||||
};
|
||||
|
||||
struct fru_area_board {
|
||||
uint8_t area_ver;
|
||||
uint8_t lang;
|
||||
uint16_t area_len;
|
||||
uint32_t mfg_date_time;
|
||||
char * mfg;
|
||||
char * prod;
|
||||
char * serial;
|
||||
char * part;
|
||||
char * fru;
|
||||
};
|
||||
|
||||
struct fru_area_product {
|
||||
uint8_t area_ver;
|
||||
uint8_t lang;
|
||||
uint16_t area_len;
|
||||
char * mfg;
|
||||
char * name;
|
||||
char * part;
|
||||
char * version;
|
||||
char * serial;
|
||||
char * asset;
|
||||
char * fru;
|
||||
};
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
/* See Table 16-1 of "IPMI FRU Information Storage Specification" */
|
||||
struct fru_multirec_header {
|
||||
#define FRU_RECORD_TYPE_POWER_SUPPLY_INFORMATION 0x00
|
||||
#define FRU_RECORD_TYPE_DC_OUTPUT 0x01
|
||||
#define FRU_RECORD_TYPE_DC_LOAD 0x02
|
||||
#define FRU_RECORD_TYPE_MANAGEMENT_ACCESS 0x03
|
||||
#define FRU_RECORD_TYPE_BASE_COMPATIBILITY 0x04
|
||||
#define FRU_RECORD_TYPE_EXTENDED_COMPATIBILITY 0x05
|
||||
#define FRU_RECORD_TYPE_OEM_EXTENSION 0xc0
|
||||
uint8_t type;
|
||||
#define FRU_RECORD_FORMAT_EOL_MASK 0x80
|
||||
#define FRU_RECORD_FORMAT_VER_MASK 0x0F
|
||||
uint8_t format;
|
||||
uint8_t len;
|
||||
uint8_t record_checksum;
|
||||
uint8_t header_checksum;
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_multirec_powersupply {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint16_t capacity;
|
||||
#else
|
||||
uint16_t capacity:12;
|
||||
uint16_t __reserved1:4;
|
||||
#endif
|
||||
uint16_t peak_va;
|
||||
uint8_t inrush_current;
|
||||
uint8_t inrush_interval;
|
||||
uint16_t lowend_input1;
|
||||
uint16_t highend_input1;
|
||||
uint16_t lowend_input2;
|
||||
uint16_t highend_input2;
|
||||
uint8_t lowend_freq;
|
||||
uint8_t highend_freq;
|
||||
uint8_t dropout_tolerance;
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved2:3;
|
||||
uint8_t tach:1;
|
||||
uint8_t hotswap:1;
|
||||
uint8_t autoswitch:1;
|
||||
uint8_t pfc:1;
|
||||
uint8_t predictive_fail:1;
|
||||
#else
|
||||
uint8_t predictive_fail:1;
|
||||
uint8_t pfc:1;
|
||||
uint8_t autoswitch:1;
|
||||
uint8_t hotswap:1;
|
||||
uint8_t tach:1;
|
||||
uint8_t __reserved2:3;
|
||||
#endif
|
||||
uint16_t peak_cap_ht;
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t combined_voltage1:4;
|
||||
uint8_t combined_voltage2:4;
|
||||
#else
|
||||
uint8_t combined_voltage2:4;
|
||||
uint8_t combined_voltage1:4;
|
||||
#endif
|
||||
uint16_t combined_capacity;
|
||||
uint8_t rps_threshold;
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_multirec_dcoutput {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t standby:1;
|
||||
uint8_t __reserved:3;
|
||||
uint8_t output_number:4;
|
||||
#else
|
||||
uint8_t output_number:4;
|
||||
uint8_t __reserved:3;
|
||||
uint8_t standby:1;
|
||||
#endif
|
||||
short nominal_voltage;
|
||||
short max_neg_dev;
|
||||
short max_pos_dev;
|
||||
uint16_t ripple_and_noise;
|
||||
uint16_t min_current;
|
||||
uint16_t max_current;
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_multirec_dcload {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved:4;
|
||||
uint8_t output_number:4;
|
||||
#else
|
||||
uint8_t output_number:4;
|
||||
uint8_t __reserved:4;
|
||||
#endif
|
||||
short nominal_voltage;
|
||||
short min_voltage;
|
||||
short max_voltage;
|
||||
uint16_t ripple_and_noise;
|
||||
uint16_t min_current;
|
||||
uint16_t max_current;
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(push, 1)
|
||||
#endif
|
||||
/*
|
||||
* In accordance with Table 18-7 of "IPMI Platform Management FRU Information
|
||||
* Storage Definition v1.0"
|
||||
*/
|
||||
struct fru_multirec_mgmt {
|
||||
#define FRU_MULTIREC_MGMT_SUBTYPE_MIN 0x01
|
||||
#define FRU_MULTIREC_MGMT_SUBTYPE_MAX 0x07
|
||||
uint8_t subtype;
|
||||
#define FRU_MULTIREC_MGMT_SYSURL 0x01
|
||||
#define FRU_MULTIREC_MGMT_CMPURL 0x04
|
||||
#define FRU_MULTIREC_MGMT_URL_MINLEN 16
|
||||
#define FRU_MULTIREC_MGMT_URL_MAXLEN 256
|
||||
|
||||
#define FRU_MULTIREC_MGMT_SYSNAME 0x02
|
||||
#define FRU_MULTIREC_MGMT_CMPNAME 0x05
|
||||
#define FRU_MULTIREC_MGMT_NAME_MINLEN 8
|
||||
#define FRU_MULTIREC_MGMT_NAME_MAXLEN 64
|
||||
|
||||
#define FRU_MULTIREC_MGMT_SYSPINGADDR 0x03
|
||||
#define FRU_MULTIREC_MGMT_CMPPINGADDR 0x06
|
||||
#define FRU_MULTIREC_MGMT_PINGADDR_MINLEN 8
|
||||
#define FRU_MULTIREC_MGMT_PINGADDR_MAXLEN 64
|
||||
|
||||
#define FRU_MULTIREC_MGMT_UUID 0x07
|
||||
#define FRU_MULTIREC_MGMT_UUID_LEN 16
|
||||
|
||||
#define FRU_MULTIREC_MGMT_DATA_MAXLEN FRU_MULTIREC_MGMT_URL_MAXLEN
|
||||
uint8_t data[];
|
||||
} ATTRIBUTE_PACKING;
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_multirec_oem_header {
|
||||
unsigned char mfg_id[3];
|
||||
#define FRU_PICMG_BACKPLANE_P2P 0x04
|
||||
#define FRU_PICMG_ADDRESS_TABLE 0x10
|
||||
#define FRU_PICMG_SHELF_POWER_DIST 0x11
|
||||
#define FRU_PICMG_SHELF_ACTIVATION 0x12
|
||||
#define FRU_PICMG_SHMC_IP_CONN 0x13
|
||||
#define FRU_PICMG_BOARD_P2P 0x14
|
||||
#define FRU_AMC_CURRENT 0x16
|
||||
#define FRU_AMC_ACTIVATION 0x17
|
||||
#define FRU_AMC_CARRIER_P2P 0x18
|
||||
#define FRU_AMC_P2P 0x19
|
||||
#define FRU_AMC_CARRIER_INFO 0x1a
|
||||
#define FRU_UTCA_FRU_INFO_TABLE 0x20
|
||||
#define FRU_UTCA_CARRIER_MNG_IP 0x21
|
||||
#define FRU_UTCA_CARRIER_INFO 0x22
|
||||
#define FRU_UTCA_CARRIER_LOCATION 0x23
|
||||
#define FRU_UTCA_SHMC_IP_LINK 0x24
|
||||
#define FRU_UTCA_POWER_POLICY 0x25
|
||||
#define FRU_UTCA_ACTIVATION 0x26
|
||||
#define FRU_UTCA_PM_CAPABILTY 0x27
|
||||
#define FRU_UTCA_FAN_GEOGRAPHY 0x28
|
||||
#define FRU_UTCA_CLOCK_MAPPING 0x29
|
||||
#define FRU_UTCA_MSG_BRIDGE_POLICY 0x2A
|
||||
#define FRU_UTCA_OEM_MODULE_DESC 0x2B
|
||||
#define FRU_PICMG_CLK_CARRIER_P2P 0x2C
|
||||
#define FRU_PICMG_CLK_CONFIG 0x2D
|
||||
unsigned char record_id;
|
||||
unsigned char record_version;
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_guid {
|
||||
unsigned char guid[16];
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_link_desc {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned int desig_channel:6;
|
||||
unsigned int desig_if:2;
|
||||
unsigned int desig_port:4;
|
||||
#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
|
||||
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
|
||||
#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;
|
||||
#else
|
||||
unsigned int grouping:8;
|
||||
unsigned int ext:4;
|
||||
#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
|
||||
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
|
||||
#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;
|
||||
unsigned int desig_channel:6;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED 0x00
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED1 0x01
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_PCI_EXPRESS 0x02
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING1 0x03
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING2 0x04
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET 0x05
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO 0x06
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE 0x07
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
/* This is used in command, not in FRU */
|
||||
struct fru_picmgext_amc_link_info {
|
||||
unsigned char linkInfo[3];
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_amc_link_desc_core {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned int designator:12;
|
||||
unsigned int type:8;
|
||||
unsigned int ext:4;
|
||||
unsigned int grouping:8;
|
||||
#else
|
||||
unsigned int grouping:8;
|
||||
unsigned int ext:4;
|
||||
unsigned int type:8;
|
||||
unsigned int designator:12;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_amc_link_desc_extra {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned char asymetricMatch:2;
|
||||
unsigned char reserved:6;
|
||||
#else
|
||||
unsigned char reserved:6;
|
||||
unsigned char asymetricMatch:2;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_amc_link_desc {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
struct fru_picmgext_amc_link_desc_core core;/* lsb */
|
||||
struct fru_picmgext_amc_link_desc_extra extra;
|
||||
#else
|
||||
struct fru_picmgext_amc_link_desc_extra extra;
|
||||
struct fru_picmgext_amc_link_desc_core core;/* lsb */
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
#define FRU_PICMGEXT_OEM_SWFW 0x03
|
||||
#define OEM_SWFW_NBLOCK_OFFSET 0x05
|
||||
#define OEM_SWFW_FIELD_START_OFFSET 0x06
|
||||
|
||||
#define FRU_PICMGEXT_CHN_DESC_RECORD_SIZE 3
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_chn_desc {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned int remote_slot:8;
|
||||
unsigned int remote_chn:5;
|
||||
unsigned int local_chn:5;
|
||||
unsigned int res:14;
|
||||
#else
|
||||
unsigned int res:14;
|
||||
unsigned int local_chn:5;
|
||||
unsigned int remote_chn:5;
|
||||
unsigned int remote_slot:8;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_slot_desc {
|
||||
unsigned char chan_type;
|
||||
unsigned char slot_addr;
|
||||
unsigned char chn_count;
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#define FRU_PICMGEXT_DESIGN_IF_BASE 0x00
|
||||
#define FRU_PICMGEXT_DESIGN_IF_FABRIC 0x01
|
||||
#define FRU_PICMGEXT_DESIGN_IF_UPDATE_CHANNEL 0x02
|
||||
#define FRU_PICMGEXT_DESIGN_IF_RESERVED 0x03
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_carrier_activation_record {
|
||||
unsigned short max_internal_curr;
|
||||
unsigned char allowance_for_readiness;
|
||||
unsigned char module_activation_record_count;
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_activation_record {
|
||||
unsigned char ibmb_addr;
|
||||
unsigned char max_module_curr;
|
||||
unsigned char reserved;
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_carrier_p2p_record {
|
||||
unsigned char resource_id;
|
||||
unsigned char p2p_count;
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_carrier_p2p_descriptor {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned char remote_resource_id;
|
||||
unsigned short remote_port:5;
|
||||
unsigned short local_port:5;
|
||||
unsigned short reserved:6;
|
||||
#else
|
||||
unsigned short reserved:6;
|
||||
unsigned short local_port:5;
|
||||
unsigned short remote_port:5;
|
||||
unsigned char remote_resource_id;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_amc_p2p_record {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned char resource_id :4;
|
||||
unsigned char /* reserved */ :3;
|
||||
unsigned char record_type :1;
|
||||
#else
|
||||
unsigned char record_type :1;
|
||||
unsigned char /* reserved */ :3;
|
||||
unsigned char resource_id :4;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#define FRU_PICMGEXT_AMC_CHANNEL_DESC_RECORD_SIZE 3
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_amc_channel_desc_record {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned int lane0port :5;
|
||||
unsigned int lane1port :5;
|
||||
unsigned int lane2port :5;
|
||||
unsigned int lane3port :5;
|
||||
unsigned int /* reserved */ :12;
|
||||
#else
|
||||
unsigned int /* reserved */ :12;
|
||||
unsigned int lane3port :5;
|
||||
unsigned int lane2port :5;
|
||||
unsigned int lane1port :5;
|
||||
unsigned int lane0port :5;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#define FRU_PICMGEXT_AMC_LINK_DESC_RECORD_SIZE 5
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct fru_picmgext_amc_link_desc_record {
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_PCIE 0x02
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_PCIE_AS1 0x03
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_PCIE_AS2 0x04
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET 0x05
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO 0x06
|
||||
#define FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE 0x07
|
||||
|
||||
#define AMC_LINK_TYPE_EXT_PCIE_G1_NSSC 0x00
|
||||
#define AMC_LINK_TYPE_EXT_PCIE_G1_SSC 0x01
|
||||
#define AMC_LINK_TYPE_EXT_PCIE_G2_NSSC 0x02
|
||||
#define AMC_LINK_TYPE_EXT_PCIE_G2_SSC 0x03
|
||||
|
||||
#define AMC_LINK_TYPE_EXT_ETH_1000_BX 0x00
|
||||
#define AMC_LINK_TYPE_EXT_ETH_10G_XAUI 0x01
|
||||
|
||||
#define AMC_LINK_TYPE_EXT_STORAGE_FC 0x00
|
||||
#define AMC_LINK_TYPE_EXT_STORAGE_SATA 0x01
|
||||
#define AMC_LINK_TYPE_EXT_STORAGE_SAS 0x02
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned int channel_id :8;
|
||||
unsigned int port_flag_0 :1;
|
||||
unsigned int port_flag_1 :1;
|
||||
unsigned int port_flag_2 :1;
|
||||
unsigned int port_flag_3 :1;
|
||||
unsigned int type :8;
|
||||
unsigned int type_ext :4;
|
||||
unsigned int group_id :8;
|
||||
unsigned int asym_match :2;
|
||||
unsigned int /* reserved */ :30;
|
||||
#else
|
||||
unsigned int group_id :8;
|
||||
unsigned int type_ext :4;
|
||||
unsigned int type :8;
|
||||
unsigned int port_flag_3 :1;
|
||||
unsigned int port_flag_2 :1;
|
||||
unsigned int port_flag_1 :1;
|
||||
unsigned int port_flag_0 :1;
|
||||
unsigned int channel_id :8;
|
||||
|
||||
unsigned int /* reserved */ :30;
|
||||
unsigned int asym_match :2;
|
||||
#endif
|
||||
}ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#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;
|
||||
|
||||
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);
|
@ -1,240 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#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
|
@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Kontron Canada, 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <math.h>
|
||||
#include <ipmitool/bswap.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_entity.h>
|
||||
|
||||
int ipmi_gendev_main(struct ipmi_intf *, int, char **);
|
@ -1,787 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#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
|
||||
|
||||
/* 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;
|
||||
|
||||
#define TARGET_VER (0x01)
|
||||
#define ROLLBACK_VER (0x02)
|
||||
#define IMAGE_VER (0x04)
|
@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Kontron Canada, Inc. All Rights Reserved.
|
||||
*
|
||||
* Base on code from
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
|
||||
int ipmi_ime_main(struct ipmi_intf *, int, char **);
|
@ -1,270 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_oem.h>
|
||||
#include <ipmitool/ipmi_constants.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
/*
|
||||
* An enumeration that describes every possible session state for
|
||||
* an IPMIv2 / RMCP+ session.
|
||||
*/
|
||||
enum LANPLUS_SESSION_STATE {
|
||||
LANPLUS_STATE_PRESESSION = 0,
|
||||
LANPLUS_STATE_OPEN_SESSION_SENT,
|
||||
LANPLUS_STATE_OPEN_SESSION_RECEIEVED,
|
||||
LANPLUS_STATE_RAKP_1_SENT,
|
||||
LANPLUS_STATE_RAKP_2_RECEIVED,
|
||||
LANPLUS_STATE_RAKP_3_SENT,
|
||||
LANPLUS_STATE_ACTIVE,
|
||||
LANPLUS_STATE_CLOSE_SENT,
|
||||
};
|
||||
|
||||
|
||||
#define IPMI_AUTHCODE_BUFFER_SIZE 20
|
||||
#define IPMI_SIK_BUFFER_SIZE IPMI_MAX_MD_SIZE
|
||||
#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;
|
||||
uint8_t username[17];
|
||||
uint8_t authcode_set[IPMI_AUTHCODE_BUFFER_SIZE + 1];
|
||||
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 {
|
||||
int active;
|
||||
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;
|
||||
socklen_t addrlen;
|
||||
|
||||
/*
|
||||
* This struct holds state data specific to IPMI v2 / RMCP+ sessions
|
||||
*/
|
||||
struct {
|
||||
enum LANPLUS_SESSION_STATE session_state;
|
||||
|
||||
/* These are the algorithms agreed upon for the session */
|
||||
uint8_t requested_auth_alg;
|
||||
uint8_t requested_integrity_alg;
|
||||
uint8_t requested_crypt_alg;
|
||||
uint8_t auth_alg;
|
||||
uint8_t integrity_alg;
|
||||
uint8_t crypt_alg;
|
||||
uint8_t max_priv_level;
|
||||
|
||||
uint32_t console_id;
|
||||
uint32_t bmc_id;
|
||||
|
||||
/*
|
||||
* Values required for RAKP messages
|
||||
*/
|
||||
|
||||
/* Random number generated byt the console */
|
||||
uint8_t console_rand[16];
|
||||
/* Random number generated by the BMC */
|
||||
uint8_t bmc_rand[16];
|
||||
|
||||
uint8_t bmc_guid[16];
|
||||
uint8_t requested_role; /* As sent in the RAKP 1 message */
|
||||
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 */
|
||||
} v2_data;
|
||||
|
||||
|
||||
/*
|
||||
* This data is specific to the Serial Over Lan session
|
||||
*/
|
||||
struct {
|
||||
uint16_t max_inbound_payload_size;
|
||||
uint16_t max_outbound_payload_size;
|
||||
uint16_t port;
|
||||
uint8_t sequence_number;
|
||||
|
||||
/* This data describes the last SOL packet */
|
||||
uint8_t last_received_sequence_number;
|
||||
uint8_t last_received_byte_count;
|
||||
void (*sol_input_handler)(struct ipmi_rs * rsp);
|
||||
} sol_data;
|
||||
};
|
||||
|
||||
struct ipmi_cmd {
|
||||
int (*func)(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
const char * name;
|
||||
const char * desc;
|
||||
};
|
||||
|
||||
struct ipmi_intf_support {
|
||||
const char * name;
|
||||
int supported;
|
||||
};
|
||||
|
||||
struct ipmi_intf {
|
||||
char name[16];
|
||||
char desc[128];
|
||||
char *devfile;
|
||||
int fd;
|
||||
int opened;
|
||||
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;
|
||||
uint8_t target_ipmb_addr;
|
||||
uint32_t my_addr;
|
||||
uint32_t target_addr;
|
||||
uint8_t target_lun;
|
||||
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 devnum;
|
||||
|
||||
int (*setup)(struct ipmi_intf * 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);
|
||||
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);
|
||||
uint8_t ipmi_intf_get_bridging_level(const struct ipmi_intf *intf);
|
||||
|
||||
struct ipmi_intf * ipmi_intf_load(char * name);
|
||||
void ipmi_intf_print(struct ipmi_intf_support * intflist);
|
||||
|
||||
void ipmi_intf_session_set_hostname(struct ipmi_intf * intf, char * hostname);
|
||||
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_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_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
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004 Kontron Canada, Inc. All Rights Reserved.
|
||||
*
|
||||
* Base on code from
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
|
||||
int ipmi_kontronoem_main(struct ipmi_intf *, int, char **);
|
||||
int ipmi_kontronoem_set_large_buffer(struct ipmi_intf *, unsigned char size);
|
@ -1,52 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#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;
|
||||
};
|
@ -1,341 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#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 (0x7f) /* 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);
|
||||
|
||||
/**
|
||||
* Convert a binary GUID/UUID to a canonical hex string form.
|
||||
* If the version/encoding of the source data is unknown,
|
||||
* dump the source data as a simple hex string.
|
||||
*
|
||||
* @param[out] str The string representation of GUID
|
||||
* @param[in] data The source binary GUID data
|
||||
* @param[in] mode The conversion mode, use GUID_AUTO for automatic detection
|
||||
*
|
||||
* @returns The parsed GUID structure
|
||||
*/
|
||||
parsed_guid_t
|
||||
ipmi_guid2str(char *str, const void *data, ipmi_guid_mode_t mode);
|
||||
#define GUID_STR_MAXLEN 36 /* 8+4+4+4+12 bytes plus the dashes */
|
||||
|
||||
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);
|
@ -1,44 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
/* oem handler, see lib/ipmi_oem.c */
|
||||
struct ipmi_oem_handle {
|
||||
const char * name;
|
||||
const char * desc;
|
||||
int (*setup)(struct ipmi_intf * intf);
|
||||
};
|
||||
|
||||
void ipmi_oem_print(void);
|
||||
int ipmi_oem_setup(struct ipmi_intf * intf, char * oemtype);
|
||||
int ipmi_oem_active(struct ipmi_intf * intf, const char * oemtype);
|
@ -1,668 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004 Dell Computers. 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 Dell Computers, 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.
|
||||
* DELL COMPUTERS ("DELL") 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
|
||||
* DELL 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 DELL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
/* PEF */
|
||||
|
||||
struct pef_capabilities { /* "get pef capabilities" response */
|
||||
uint8_t version;
|
||||
uint8_t actions; /* mapped by PEF_ACTION_xxx */
|
||||
uint8_t event_filter_count;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
P_TRUE,
|
||||
P_SUPP,
|
||||
P_ACTV,
|
||||
P_ABLE,
|
||||
} flg_e;
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_table_entry {
|
||||
#define PEF_CONFIG_ENABLED 0x80
|
||||
#define PEF_CONFIG_PRECONFIGURED 0x40
|
||||
uint8_t config;
|
||||
#define PEF_ACTION_DIAGNOSTIC_INTERRUPT 0x20
|
||||
#define PEF_ACTION_OEM 0x10
|
||||
#define PEF_ACTION_POWER_CYCLE 0x08
|
||||
#define PEF_ACTION_RESET 0x04
|
||||
#define PEF_ACTION_POWER_DOWN 0x02
|
||||
#define PEF_ACTION_ALERT 0x01
|
||||
uint8_t action;
|
||||
#define PEF_POLICY_NUMBER_MASK 0x0f
|
||||
uint8_t policy_number;
|
||||
#define PEF_SEVERITY_NON_RECOVERABLE 0x20
|
||||
#define PEF_SEVERITY_CRITICAL 0x10
|
||||
#define PEF_SEVERITY_WARNING 0x08
|
||||
#define PEF_SEVERITY_OK 0x04
|
||||
#define PEF_SEVERITY_INFORMATION 0x02
|
||||
#define PEF_SEVERITY_MONITOR 0x01
|
||||
uint8_t severity;
|
||||
uint8_t generator_ID_addr;
|
||||
uint8_t generator_ID_lun;
|
||||
uint8_t sensor_type;
|
||||
#define PEF_SENSOR_NUMBER_MATCH_ANY 0xff
|
||||
uint8_t sensor_number;
|
||||
#define PEF_EVENT_TRIGGER_UNSPECIFIED 0x0
|
||||
#define PEF_EVENT_TRIGGER_THRESHOLD 0x1
|
||||
#define PEF_EVENT_TRIGGER_SENSOR_SPECIFIC 0x6f
|
||||
#define PEF_EVENT_TRIGGER_MATCH_ANY 0xff
|
||||
uint8_t event_trigger;
|
||||
uint8_t event_data_1_offset_mask[2];
|
||||
uint8_t event_data_1_AND_mask;
|
||||
uint8_t event_data_1_compare_1;
|
||||
uint8_t event_data_1_compare_2;
|
||||
uint8_t event_data_2_AND_mask;
|
||||
uint8_t event_data_2_compare_1;
|
||||
uint8_t event_data_2_compare_2;
|
||||
uint8_t event_data_3_AND_mask;
|
||||
uint8_t event_data_3_compare_1;
|
||||
uint8_t event_data_3_compare_2;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct desc_map { /* maps a description to a value/mask */
|
||||
const char *desc;
|
||||
uint32_t mask;
|
||||
};
|
||||
|
||||
struct bit_desc_map { /* description text container */
|
||||
#define BIT_DESC_MAP_LIST 0x1 /* index-based text array */
|
||||
#define BIT_DESC_MAP_ANY 0x2 /* bitwise, but only print 1st one */
|
||||
#define BIT_DESC_MAP_ALL 0x3 /* bitwise, print them all */
|
||||
uint32_t desc_map_type;
|
||||
struct desc_map desc_maps[128];
|
||||
};
|
||||
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
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
|
||||
#define PEF_POLICY_FLAGS_PREV_OK_SKIP 1
|
||||
#define PEF_POLICY_FLAGS_PREV_OK_NEXT_POLICY_SET 2
|
||||
#define PEF_POLICY_FLAGS_PREV_OK_NEXT_CHANNEL_IN_SET 3
|
||||
#define PEF_POLICY_FLAGS_PREV_OK_NEXT_DESTINATION_IN_SET 4
|
||||
uint8_t policy;
|
||||
#define PEF_POLICY_CHANNEL_MASK 0xf0
|
||||
#define PEF_POLICY_CHANNEL_SHIFT 4
|
||||
#define PEF_POLICY_DESTINATION_MASK 0x0f
|
||||
uint8_t chan_dest;
|
||||
#define PEF_POLICY_EVENT_SPECIFIC 0x80
|
||||
uint8_t alert_string_key;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_selector {
|
||||
#define PEF_CFGPARM_ID_REVISION_ONLY_MASK 0x80
|
||||
#define PEF_CFGPARM_ID_SET_IN_PROGRESS 0
|
||||
#define PEF_CFGPARM_ID_PEF_CONTROL 1
|
||||
#define PEF_CFGPARM_ID_PEF_ACTION 2
|
||||
#define PEF_CFGPARM_ID_PEF_STARTUP_DELAY 3
|
||||
#define PEF_CFGPARM_ID_PEF_ALERT_STARTUP_DELAY 4
|
||||
#define PEF_CFGPARM_ID_PEF_FILTER_TABLE_SIZE 5
|
||||
#define PEF_CFGPARM_ID_PEF_FILTER_TABLE_ENTRY 6
|
||||
#define PEF_CFGPARM_ID_PEF_FILTER_TABLE_DATA_1 7
|
||||
#define PEF_CFGPARM_ID_PEF_ALERT_POLICY_TABLE_SIZE 8
|
||||
#define PEF_CFGPARM_ID_PEF_ALERT_POLICY_TABLE_ENTRY 9
|
||||
#define PEF_CFGPARM_ID_SYSTEM_GUID 10
|
||||
#define PEF_CFGPARM_ID_PEF_ALERT_STRING_TABLE_SIZE 11
|
||||
#define PEF_CFGPARM_ID_PEF_ALERT_STRING_KEY 12
|
||||
#define PEF_CFGPARM_ID_PEF_ALERT_STRING_TABLE_ENTRY 13
|
||||
uint8_t id;
|
||||
uint8_t set;
|
||||
uint8_t block;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_set_in_progress {
|
||||
#define PEF_SET_IN_PROGRESS_COMMIT_WRITE 0x02
|
||||
#define PEF_SET_IN_PROGRESS 0x01
|
||||
uint8_t data1;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_control {
|
||||
#define PEF_CONTROL_ENABLE_ALERT_STARTUP_DELAY 0x08
|
||||
#define PEF_CONTROL_ENABLE_STARTUP_DELAY 0x04
|
||||
#define PEF_CONTROL_ENABLE_EVENT_MESSAGES 0x02
|
||||
#define PEF_CONTROL_ENABLE 0x01
|
||||
uint8_t data1;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_action {
|
||||
#define PEF_ACTION_ENABLE_DIAGNOSTIC_INTERRUPT 0x20
|
||||
#define PEF_ACTION_ENABLE_OEM 0x10
|
||||
#define PEF_ACTION_ENABLE_POWER_CYCLE 0x08
|
||||
#define PEF_ACTION_ENABLE_RESET 0x04
|
||||
#define PEF_ACTION_ENABLE_POWER_DOWN 0x02
|
||||
#define PEF_ACTION_ENABLE_ALERT 0x01
|
||||
uint8_t data1;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_startup_delay {
|
||||
uint8_t data1;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_alert_startup_delay {
|
||||
uint8_t data1;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_filter_table_size {
|
||||
#define PEF_FILTER_TABLE_SIZE_MASK 0x7f
|
||||
uint8_t data1;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#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
|
||||
uint8_t data1;
|
||||
struct pef_table_entry entry;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_filter_table_data_1 {
|
||||
uint8_t id;
|
||||
uint8_t cfg;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_policy_table_size {
|
||||
#define PEF_POLICY_TABLE_SIZE_MASK 0x7f
|
||||
uint8_t data1;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_policy_table_entry {
|
||||
#define PEF_POLICY_TABLE_ID_MASK 0x7f
|
||||
uint8_t data1;
|
||||
struct pef_policy_entry entry;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_system_guid {
|
||||
#define PEF_SYSTEM_GUID_USED_IN_PET 0x01
|
||||
uint8_t data1;
|
||||
uint8_t guid[16];
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_alert_string_table_size {
|
||||
#define PEF_ALERT_STRING_TABLE_SIZE_MASK 0x7f
|
||||
uint8_t data1;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_alert_string_keys {
|
||||
#define PEF_ALERT_STRING_ID_MASK 0x7f
|
||||
uint8_t data1;
|
||||
#define PEF_EVENT_FILTER_ID_MASK 0x7f
|
||||
uint8_t data2;
|
||||
#define PEF_ALERT_STRING_SET_ID_MASK 0x7f
|
||||
uint8_t data3;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_cfgparm_alert_string_table_entry {
|
||||
uint8_t id;
|
||||
uint8_t blockno;
|
||||
uint8_t block[16];
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
/* PEF - LAN */
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_lan_cfgparm_selector {
|
||||
#define PEF_LAN_CFGPARM_CH_REVISION_ONLY_MASK 0x80
|
||||
#define PEF_LAN_CFGPARM_CH_MASK 0x0f
|
||||
#define PEF_LAN_CFGPARM_ID_PET_COMMUNITY 16
|
||||
#define PEF_LAN_CFGPARM_ID_DEST_COUNT 17
|
||||
#define PEF_LAN_CFGPARM_ID_DESTTYPE 18
|
||||
#define PEF_LAN_CFGPARM_ID_DESTADDR 19
|
||||
uint8_t ch;
|
||||
uint8_t id;
|
||||
uint8_t set;
|
||||
uint8_t block;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_lan_cfgparm_dest_size {
|
||||
#define PEF_LAN_DEST_TABLE_SIZE_MASK 0x0f
|
||||
uint8_t data1;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_lan_cfgparm_dest_type {
|
||||
#define PEF_LAN_DEST_TYPE_ID_MASK 0x0f
|
||||
uint8_t dest;
|
||||
#define PEF_LAN_DEST_TYPE_ACK 0x80
|
||||
#define PEF_LAN_DEST_TYPE_MASK 0x07
|
||||
#define PEF_LAN_DEST_TYPE_PET 0
|
||||
#define PEF_LAN_DEST_TYPE_OEM_1 6
|
||||
#define PEF_LAN_DEST_TYPE_OEM_2 7
|
||||
uint8_t dest_type;
|
||||
uint8_t alert_timeout;
|
||||
#define PEF_LAN_RETRIES_MASK 0x07
|
||||
uint8_t retries;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_lan_cfgparm_dest_info {
|
||||
#define PEF_LAN_DEST_MASK 0x0f
|
||||
uint8_t dest;
|
||||
#define PEF_LAN_DEST_ADDRTYPE_MASK 0xf0
|
||||
#define PEF_LAN_DEST_ADDRTYPE_SHIFT 4
|
||||
#define PEF_LAN_DEST_ADDRTYPE_IPV4_MAC 0x00
|
||||
uint8_t addr_type;
|
||||
#define PEF_LAN_DEST_GATEWAY_USE_BACKUP 0x01
|
||||
uint8_t gateway;
|
||||
uint8_t ip[4];
|
||||
uint8_t mac[6];
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
/* PEF - Serial/PPP */
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_selector {
|
||||
#define PEF_SERIAL_CFGPARM_CH_REVISION_ONLY_MASK 0x80
|
||||
#define PEF_SERIAL_CFGPARM_CH_MASK 0x0f
|
||||
#define PEF_SERIAL_CFGPARM_ID_DEST_COUNT 16
|
||||
#define PEF_SERIAL_CFGPARM_ID_DESTINFO 17
|
||||
#define PEF_SERIAL_CFGPARM_ID_DEST_DIAL_STRING_COUNT 20
|
||||
#define PEF_SERIAL_CFGPARM_ID_DEST_DIAL_STRING 21
|
||||
#define PEF_SERIAL_CFGPARM_ID_TAP_ACCT_COUNT 24
|
||||
#define PEF_SERIAL_CFGPARM_ID_TAP_ACCT_INFO 25
|
||||
#define PEF_SERIAL_CFGPARM_ID_TAP_ACCT_PAGER_STRING 27
|
||||
uint8_t ch;
|
||||
uint8_t id;
|
||||
uint8_t set;
|
||||
uint8_t block;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_dest_size {
|
||||
#define PEF_SERIAL_DEST_TABLE_SIZE_MASK 0x0f
|
||||
uint8_t data1;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_dest_info {
|
||||
#define PEF_SERIAL_DEST_MASK 0x0f
|
||||
uint8_t dest;
|
||||
#define PEF_SERIAL_DEST_TYPE_ACK 0x80
|
||||
#define PEF_SERIAL_DEST_TYPE_MASK 0x0f
|
||||
#define PEF_SERIAL_DEST_TYPE_DIAL 0
|
||||
#define PEF_SERIAL_DEST_TYPE_TAP 1
|
||||
#define PEF_SERIAL_DEST_TYPE_PPP 2
|
||||
#define PEF_SERIAL_DEST_TYPE_BASIC_CALLBACK 3
|
||||
#define PEF_SERIAL_DEST_TYPE_PPP_CALLBACK 4
|
||||
#define PEF_SERIAL_DEST_TYPE_OEM_1 14
|
||||
#define PEF_SERIAL_DEST_TYPE_OEM_2 15
|
||||
uint8_t dest_type;
|
||||
uint8_t alert_timeout;
|
||||
#define PEF_SERIAL_RETRIES_MASK 0x77
|
||||
#define PEF_SERIAL_RETRIES_POST_CONNECT_MASK 0x70
|
||||
#define PEF_SERIAL_RETRIES_PRE_CONNECT_MASK 0x07
|
||||
uint8_t retries;
|
||||
#define PEF_SERIAL_DIALPAGE_STRING_ID_MASK 0xf0
|
||||
#define PEF_SERIAL_DIALPAGE_STRING_ID_SHIFT 4
|
||||
#define PEF_SERIAL_TAP_PAGE_SERVICE_ID_MASK 0x0f
|
||||
#define PEF_SERIAL_PPP_ACCT_IPADDR_ID_MASK 0xf0
|
||||
#define PEF_SERIAL_PPP_ACCT_IPADDR_ID_SHIFT 4
|
||||
#define PEF_SERIAL_PPP_ACCT_ID_MASK 0x0f
|
||||
#define PEF_SERIAL_CALLBACK_IPADDR_ID_MASK 0x0f
|
||||
#define PEF_SERIAL_CALLBACK_IPADDR_ID_SHIFT 4
|
||||
#define PEF_SERIAL_CALLBACK_ACCT_ID_MASK 0xf0
|
||||
uint8_t data5;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_dial_string_count {
|
||||
#define PEF_SERIAL_DIAL_STRING_COUNT_MASK 0x0f
|
||||
uint8_t data1;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_dial_string {
|
||||
#define PEF_SERIAL_DIAL_STRING_MASK 0x0f
|
||||
uint8_t data1;
|
||||
uint8_t data2;
|
||||
uint8_t data3;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_tap_acct_count {
|
||||
#define PEF_SERIAL_TAP_ACCT_COUNT_MASK 0x0f
|
||||
uint8_t data1;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_tap_acct_info {
|
||||
uint8_t data1;
|
||||
#define PEF_SERIAL_TAP_ACCT_INFO_DIAL_STRING_ID_MASK 0xf0
|
||||
#define PEF_SERIAL_TAP_ACCT_INFO_DIAL_STRING_ID_SHIFT 4
|
||||
#define PEF_SERIAL_TAP_ACCT_INFO_SVC_SETTINGS_ID_MASK 0x0f
|
||||
uint8_t data2;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct pef_serial_cfgparm_tap_svc_settings {
|
||||
uint8_t data1;
|
||||
#define PEF_SERIAL_TAP_CONFIRMATION_ACK_AFTER_ETX 0x0
|
||||
#define PEF_SERIAL_TAP_CONFIRMATION_211_ACK_AFTER_ETX 0x01
|
||||
#define PEF_SERIAL_TAP_CONFIRMATION_21X_ACK_AFTER_ETX 0x02
|
||||
uint8_t confirmation_flags;
|
||||
uint8_t service_type[3];
|
||||
uint8_t escape_mask[4];
|
||||
uint8_t timeout_parms[3];
|
||||
uint8_t retry_parms[2];
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
#if 0 /* FYI : config parm groupings */
|
||||
struct pef_config_parms { /* PEF */
|
||||
struct pef_cfgparm_set_in_progress;
|
||||
struct pef_cfgparm_control;
|
||||
struct pef_cfgparm_action;
|
||||
struct pef_cfgparm_startup_delay; /* in seconds, 1-based */
|
||||
struct pef_cfgparm_alert_startup_delay; /* in seconds, 1-based */
|
||||
struct pef_cfgparm_filter_table_size; /* 1-based, READ-ONLY */
|
||||
struct pef_cfgparm_filter_table_entry;
|
||||
struct pef_cfgparm_filter_table_data_1;
|
||||
struct pef_cfgparm_policy_table_size;
|
||||
struct pef_cfgparm_policy_table_entry;
|
||||
struct pef_cfgparm_system_guid;
|
||||
struct pef_cfgparm_alert_string_table_size;
|
||||
struct pef_cfgparm_alert_string_keys;
|
||||
struct pef_cfgparm_alert_string_table_entry;
|
||||
} ATTRIBUTE_PACKING;
|
||||
|
||||
struct pef_lan_config_parms { /* LAN */
|
||||
struct pef_lan_cfgparm_set_in_progress;
|
||||
struct pef_lan_cfgparm_auth_capabilities;
|
||||
struct pef_lan_cfgparm_auth_type;
|
||||
struct pef_lan_cfgparm_ip_address;
|
||||
struct pef_lan_cfgparm_ip_address_source;
|
||||
struct pef_lan_cfgparm_mac_address;
|
||||
struct pef_lan_cfgparm_subnet_mask;
|
||||
struct pef_lan_cfgparm_ipv4_header_parms;
|
||||
struct pef_lan_cfgparm_primary_rmcp_port;
|
||||
struct pef_lan_cfgparm_secondary_rmcp_port;
|
||||
struct pef_lan_cfgparm_bmc_generated_arp_control;
|
||||
struct pef_lan_cfgparm_gratuitous_arp;
|
||||
struct pef_lan_cfgparm_default_gateway_ipaddr;
|
||||
struct pef_lan_cfgparm_default_gateway_macaddr;
|
||||
struct pef_lan_cfgparm_backup_gateway_ipaddr;
|
||||
struct pef_lan_cfgparm_backup_gateway_macaddr;
|
||||
struct pef_lan_cfgparm_pet_community;
|
||||
struct pef_lan_cfgparm_destination_count;
|
||||
struct pef_lan_cfgparm_destination_type;
|
||||
struct pef_lan_cfgparm_destination_ipaddr;
|
||||
} ATTRIBUTE_PACKING;
|
||||
|
||||
struct pef_serial_config_parms { /* Serial/PPP */
|
||||
struct pef_serial_cfgparm_set_in_progress;
|
||||
struct pef_serial_cfgparm_auth_capabilities;
|
||||
struct pef_serial_cfgparm_auth_type;
|
||||
struct pef_serial_cfgparm_connection_mode;
|
||||
struct pef_serial_cfgparm_idle_timeout;
|
||||
struct pef_serial_cfgparm_callback_control;
|
||||
struct pef_serial_cfgparm_session_termination;
|
||||
struct pef_serial_cfgparm_ipmi_settings;
|
||||
struct pef_serial_cfgparm_mux_control;
|
||||
struct pef_serial_cfgparm_modem_ring_time;
|
||||
struct pef_serial_cfgparm_modem_init_string;
|
||||
struct pef_serial_cfgparm_modem_escape_sequence;
|
||||
struct pef_serial_cfgparm_modem_hangup_sequence;
|
||||
struct pef_serial_cfgparm_modem_dial_command;
|
||||
struct pef_serial_cfgparm_page_blackout_interval;
|
||||
struct pef_serial_cfgparm_pet_community;
|
||||
struct pef_serial_cfgparm_destination_count;
|
||||
struct pef_serial_cfgparm_destination_info;
|
||||
struct pef_serial_cfgparm_call_retry_interval;
|
||||
struct pef_serial_cfgparm_destination_settings;
|
||||
struct pef_serial_cfgparm_dialstring_count;
|
||||
struct pef_serial_cfgparm_dialstring_info;
|
||||
struct pef_serial_cfgparm_ipaddr_count;
|
||||
struct pef_serial_cfgparm_ipaddr_info;
|
||||
struct pef_serial_cfgparm_tap_acct_count;
|
||||
struct pef_serial_cfgparm_tap_acct_info;
|
||||
struct pef_serial_cfgparm_tap_acct_passwords; /* WRITE only */
|
||||
struct pef_serial_cfgparm_tap_pager_id_strings;
|
||||
struct pef_serial_cfgparm_tap_service_settings;
|
||||
struct pef_serial_cfgparm_terminal_mode_config;
|
||||
struct pef_serial_cfgparm_ppp_otions;
|
||||
struct pef_serial_cfgparm_ppp_primary_rmcp_port;
|
||||
struct pef_serial_cfgparm_ppp_secondary_rmcp_port;
|
||||
struct pef_serial_cfgparm_ppp_link_auth;
|
||||
struct pef_serial_cfgparm_ppp_chap_name;
|
||||
struct pef_serial_cfgparm_ppp_accm;
|
||||
struct pef_serial_cfgparm_ppp_snoop_accm;
|
||||
struct pef_serial_cfgparm_ppp_acct_count;
|
||||
struct pef_serial_cfgparm_ppp_acct_dialstring_selector;
|
||||
struct pef_serial_cfgparm_ppp_acct_ipaddrs;
|
||||
struct pef_serial_cfgparm_ppp_acct_user_names;
|
||||
struct pef_serial_cfgparm_ppp_acct_user_domains;
|
||||
struct pef_serial_cfgparm_ppp_acct_user_passwords; /* WRITE only */
|
||||
struct pef_serial_cfgparm_ppp_acct_auth_settings;
|
||||
struct pef_serial_cfgparm_ppp_acct_connect_hold_times;
|
||||
struct pef_serial_cfgparm_ppp_udp_proxy_ipheader;
|
||||
struct pef_serial_cfgparm_ppp_udp_proxy_xmit_bufsize;
|
||||
struct pef_serial_cfgparm_ppp_udp_proxy_recv_bufsize;
|
||||
struct pef_serial_cfgparm_ppp_remote_console_ipaddr;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#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
|
||||
#define IPMI_CMD_GET_CHANNEL_INFO 0x42
|
||||
#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);
|
||||
void ipmi_pef_print_hex(const char * text, uint32_t val);
|
||||
void ipmi_pef_print_1xd(const char * text, uint32_t val);
|
||||
void ipmi_pef_print_2xd(const char * text, uint8_t u1, uint8_t u2);
|
||||
void ipmi_pef_print_str(const char * text, const char * val);
|
||||
|
||||
int ipmi_pef_main(struct ipmi_intf * intf, int argc, char ** argv);
|
@ -1,121 +0,0 @@
|
||||
|
||||
/*
|
||||
(C) Kontron
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
/* PICMG version */
|
||||
#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
|
||||
#define PICMG_GET_ADDRESS_INFO_CMD 0x01
|
||||
#define PICMG_GET_SHELF_ADDRESS_INFO_CMD 0x02
|
||||
#define PICMG_SET_SHELF_ADDRESS_INFO_CMD 0x03
|
||||
#define PICMG_FRU_CONTROL_CMD 0x04
|
||||
#define PICMG_GET_FRU_LED_PROPERTIES_CMD 0x05
|
||||
#define PICMG_GET_LED_COLOR_CAPABILITIES_CMD 0x06
|
||||
#define PICMG_SET_FRU_LED_STATE_CMD 0x07
|
||||
#define PICMG_GET_FRU_LED_STATE_CMD 0x08
|
||||
#define PICMG_SET_IPMB_CMD 0x09
|
||||
#define PICMG_SET_FRU_POLICY_CMD 0x0A
|
||||
#define PICMG_GET_FRU_POLICY_CMD 0x0B
|
||||
#define PICMG_FRU_ACTIVATION_CMD 0x0C
|
||||
#define PICMG_GET_DEVICE_LOCATOR_RECORD_CMD 0x0D
|
||||
#define PICMG_SET_PORT_STATE_CMD 0x0E
|
||||
#define PICMG_GET_PORT_STATE_CMD 0x0F
|
||||
#define PICMG_COMPUTE_POWER_PROPERTIES_CMD 0x10
|
||||
#define PICMG_SET_POWER_LEVEL_CMD 0x11
|
||||
#define PICMG_GET_POWER_LEVEL_CMD 0x12
|
||||
#define PICMG_RENEGOTIATE_POWER_CMD 0x13
|
||||
#define PICMG_GET_FAN_SPEED_PROPERTIES_CMD 0x14
|
||||
#define PICMG_SET_FAN_LEVEL_CMD 0x15
|
||||
#define PICMG_GET_FAN_LEVEL_CMD 0x16
|
||||
#define PICMG_BUSED_RESOURCE_CMD 0x17
|
||||
|
||||
/* AMC.0 commands */
|
||||
#define PICMG_AMC_SET_PORT_STATE_CMD 0x19
|
||||
#define PICMG_AMC_GET_PORT_STATE_CMD 0x1A
|
||||
/* AMC.0 R2.0 commands */
|
||||
#define PICMG_AMC_SET_CLK_STATE_CMD 0x2C
|
||||
#define PICMG_AMC_GET_CLK_STATE_CMD 0x2D
|
||||
|
||||
/* Site Types */
|
||||
#define PICMG_ATCA_BOARD 0x00
|
||||
#define PICMG_POWER_ENTRY 0x01
|
||||
#define PICMG_SHELF_FRU 0x02
|
||||
#define PICMG_DEDICATED_SHMC 0x03
|
||||
#define PICMG_FAN_TRAY 0x04
|
||||
#define PICMG_FAN_FILTER_TRAY 0x05
|
||||
#define PICMG_ALARM 0x06
|
||||
#define PICMG_AMC 0x07
|
||||
#define PICMG_PMC 0x08
|
||||
#define PICMG_RTM 0x09
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct picmg_set_fru_activation_cmd {
|
||||
unsigned char picmg_id; /* always 0*/
|
||||
unsigned char fru_id; /* threshold setting mask */
|
||||
unsigned char fru_state; /* fru activation/deactivation */
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
typedef enum picmg_busres_board_cmd_types {
|
||||
PICMG_BUSRES_BOARD_CMD_QUERY =0,
|
||||
PICMG_BUSRES_BOARD_CMD_RELEASE,
|
||||
PICMG_BUSRES_BOARD_CMD_FORCE,
|
||||
PICMG_BUSRES_BOARD_CMD_BUS_FREE
|
||||
} t_picmg_busres_board_cmd_types ;
|
||||
|
||||
typedef enum picmg_busres_shmc_cmd_types {
|
||||
PICMG_BUSRES_SHMC_CMD_REQUEST =0,
|
||||
PICMG_BUSRES_SHMC_CMD_RELINQUISH,
|
||||
PICMG_BUSRES_SHMC_CMD_NOTIFY
|
||||
} t_picmg_busres_shmc_cmd_types ;
|
||||
|
||||
typedef enum picmg_busres_resource_id {
|
||||
PICMG_BUSRES_METAL_TEST_BUS_1=0,
|
||||
PICMG_BUSRES_METAL_TEST_BUS_2,
|
||||
PICMG_BUSRES_SYNC_CLOCK_GROUP_1,
|
||||
PICMG_BUSRES_SYNC_CLOCK_GROUP_2,
|
||||
PICMG_BUSRES_SYNC_CLOCK_GROUP_3
|
||||
} t_picmg_busres_resource_id;
|
||||
|
||||
const char *picmg_led_color_str(int color);
|
||||
|
||||
struct sAmcPortState {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned short lane0 : 1;
|
||||
unsigned short lane1 : 1;
|
||||
unsigned short lane2 : 1;
|
||||
unsigned short lane3 : 1;
|
||||
unsigned short type : 8;
|
||||
unsigned short type_ext : 4;
|
||||
unsigned char group_id : 8;
|
||||
#else
|
||||
unsigned char group_id : 8;
|
||||
unsigned short type_ext : 4;
|
||||
unsigned short type : 8;
|
||||
unsigned short lane3 : 1;
|
||||
unsigned short lane2 : 1;
|
||||
unsigned short lane1 : 1;
|
||||
unsigned short lane0 : 1;
|
||||
#endif
|
||||
|
||||
unsigned char state;
|
||||
};
|
||||
|
||||
|
||||
int ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv);
|
||||
uint8_t picmg_discover(struct ipmi_intf *intf);
|
||||
uint8_t ipmi_picmg_ipmb_address(struct ipmi_intf *intf);
|
@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Quanta Computer 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 Quanta Computer 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.
|
||||
* Quanta Computer Inc. 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,
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#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;
|
||||
|
||||
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);
|
@ -1,927 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <inttypes.h>
|
||||
#include <math.h>
|
||||
#include <ipmitool/bswap.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_entity.h>
|
||||
|
||||
int ipmi_sdr_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#define tos32(val, bits) ((val & ((1<<((bits)-1)))) ? (-((val) & (1<<((bits)-1))) | (val)) : (val))
|
||||
|
||||
#if WORDS_BIGENDIAN
|
||||
# define __TO_TOL(mtol) (uint16_t)(mtol & 0x3f)
|
||||
# define __TO_M(mtol) (int16_t)(tos32((((mtol & 0xff00) >> 8) | ((mtol & 0xc0) << 2)), 10))
|
||||
# define __TO_B(bacc) (int32_t)(tos32((((bacc & 0xff000000) >> 24) | ((bacc & 0xc00000) >> 14)), 10))
|
||||
# define __TO_ACC(bacc) (uint32_t)(((bacc & 0x3f0000) >> 16) | ((bacc & 0xf000) >> 6))
|
||||
# define __TO_ACC_EXP(bacc) (uint32_t)((bacc & 0xc00) >> 10)
|
||||
# define __TO_R_EXP(bacc) (int32_t)(tos32(((bacc & 0xf0) >> 4), 4))
|
||||
# define __TO_B_EXP(bacc) (int32_t)(tos32((bacc & 0xf), 4))
|
||||
#else
|
||||
# define __TO_TOL(mtol) (uint16_t)(BSWAP_16(mtol) & 0x3f)
|
||||
# define __TO_M(mtol) (int16_t)(tos32((((BSWAP_16(mtol) & 0xff00) >> 8) | ((BSWAP_16(mtol) & 0xc0) << 2)), 10))
|
||||
# define __TO_B(bacc) (int32_t)(tos32((((BSWAP_32(bacc) & 0xff000000) >> 24) | \
|
||||
((BSWAP_32(bacc) & 0xc00000) >> 14)), 10))
|
||||
# define __TO_ACC(bacc) (uint32_t)(((BSWAP_32(bacc) & 0x3f0000) >> 16) | ((BSWAP_32(bacc) & 0xf000) >> 6))
|
||||
# define __TO_ACC_EXP(bacc) (uint32_t)((BSWAP_32(bacc) & 0xc00) >> 10)
|
||||
# define __TO_R_EXP(bacc) (int32_t)(tos32(((BSWAP_32(bacc) & 0xf0) >> 4), 4))
|
||||
# define __TO_B_EXP(bacc) (int32_t)(tos32((BSWAP_32(bacc) & 0xf), 4))
|
||||
#endif
|
||||
|
||||
enum {
|
||||
ANALOG_SENSOR,
|
||||
DISCRETE_SENSOR,
|
||||
};
|
||||
|
||||
#define READING_UNAVAILABLE 0x20
|
||||
#define SCANNING_DISABLED 0x40
|
||||
#define EVENT_MSG_DISABLED 0x80
|
||||
|
||||
#define IS_READING_UNAVAILABLE(val) ((val) & READING_UNAVAILABLE)
|
||||
#define IS_SCANNING_DISABLED(val) (!((val) & SCANNING_DISABLED))
|
||||
#define IS_EVENT_MSG_DISABLED(val) (!((val) & EVENT_MSG_DISABLED))
|
||||
|
||||
#define GET_SDR_REPO_INFO 0x20
|
||||
#define GET_SDR_ALLOC_INFO 0x21
|
||||
|
||||
#define SDR_SENSOR_STAT_LO_NC (1<<0)
|
||||
#define SDR_SENSOR_STAT_LO_CR (1<<1)
|
||||
#define SDR_SENSOR_STAT_LO_NR (1<<2)
|
||||
#define SDR_SENSOR_STAT_HI_NC (1<<3)
|
||||
#define SDR_SENSOR_STAT_HI_CR (1<<4)
|
||||
#define SDR_SENSOR_STAT_HI_NR (1<<5)
|
||||
|
||||
#define GET_DEVICE_SDR_INFO 0x20
|
||||
#define GET_DEVICE_SDR 0x21
|
||||
#define GET_SENSOR_FACTORS 0x23
|
||||
#define GET_SENSOR_FACTORS 0x23
|
||||
#define SET_SENSOR_HYSTERESIS 0x24
|
||||
#define GET_SENSOR_HYSTERESIS 0x25
|
||||
#define SET_SENSOR_THRESHOLDS 0x26
|
||||
#define GET_SENSOR_THRESHOLDS 0x27
|
||||
#define SET_SENSOR_EVENT_ENABLE 0x28
|
||||
#define GET_SENSOR_EVENT_ENABLE 0x29
|
||||
#define GET_SENSOR_EVENT_STATUS 0x2b
|
||||
#define GET_SENSOR_READING 0x2d
|
||||
#define GET_SENSOR_TYPE 0x2f
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_repo_info_rs {
|
||||
uint8_t version; /* SDR version (51h) */
|
||||
uint16_t count; /* number of records */
|
||||
uint16_t free; /* free space in SDR */
|
||||
uint32_t add_stamp; /* last add timestamp */
|
||||
uint32_t erase_stamp; /* last del timestamp */
|
||||
uint8_t op_support; /* supported operations */
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
/* builtin (device) sdrs support */
|
||||
struct sdr_device_info_rs {
|
||||
unsigned char count; /* number of records */
|
||||
unsigned char flags; /* flags */
|
||||
unsigned char popChangeInd[3]; /* free space in SDR */
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
#define GET_SDR_RESERVE_REPO 0x22
|
||||
struct sdr_reserve_repo_rs {
|
||||
uint16_t reserve_id; /* reservation ID */
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
#define GET_SDR 0x23
|
||||
struct sdr_get_rq {
|
||||
uint16_t reserve_id; /* reservation ID */
|
||||
uint16_t id; /* record ID */
|
||||
uint8_t offset; /* offset into SDR */
|
||||
#define GET_SDR_ENTIRE_RECORD 0xff
|
||||
uint8_t length; /* length to read */
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_get_rs {
|
||||
uint16_t next; /* next record id */
|
||||
uint16_t id; /* record ID */
|
||||
uint8_t version; /* SDR version (51h) */
|
||||
#define SDR_RECORD_TYPE_FULL_SENSOR 0x01
|
||||
#define SDR_RECORD_TYPE_COMPACT_SENSOR 0x02
|
||||
#define SDR_RECORD_TYPE_EVENTONLY_SENSOR 0x03
|
||||
#define SDR_RECORD_TYPE_ENTITY_ASSOC 0x08
|
||||
#define SDR_RECORD_TYPE_DEVICE_ENTITY_ASSOC 0x09
|
||||
#define SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR 0x10
|
||||
#define SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR 0x11
|
||||
#define SDR_RECORD_TYPE_MC_DEVICE_LOCATOR 0x12
|
||||
#define SDR_RECORD_TYPE_MC_CONFIRMATION 0x13
|
||||
#define SDR_RECORD_TYPE_BMC_MSG_CHANNEL_INFO 0x14
|
||||
#define SDR_RECORD_TYPE_OEM 0xc0
|
||||
uint8_t type; /* record type */
|
||||
uint8_t length; /* remaining record bytes */
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_record_mask {
|
||||
union {
|
||||
struct {
|
||||
uint16_t assert_event; /* assertion event mask */
|
||||
uint16_t deassert_event; /* de-assertion event mask */
|
||||
uint16_t read; /* discrete reading mask */
|
||||
} ATTRIBUTE_PACKING discrete;
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint16_t reserved:1;
|
||||
uint16_t status_lnr:1;
|
||||
uint16_t status_lcr:1;
|
||||
uint16_t status_lnc:1;
|
||||
uint16_t assert_unr_high:1;
|
||||
uint16_t assert_unr_low:1;
|
||||
uint16_t assert_ucr_high:1;
|
||||
uint16_t assert_ucr_low:1;
|
||||
uint16_t assert_unc_high:1;
|
||||
uint16_t assert_unc_low:1;
|
||||
uint16_t assert_lnr_high:1;
|
||||
uint16_t assert_lnr_low:1;
|
||||
uint16_t assert_lcr_high:1;
|
||||
uint16_t assert_lcr_low:1;
|
||||
uint16_t assert_lnc_high:1;
|
||||
uint16_t assert_lnc_low:1;
|
||||
#else
|
||||
uint16_t assert_lnc_low:1;
|
||||
uint16_t assert_lnc_high:1;
|
||||
uint16_t assert_lcr_low:1;
|
||||
uint16_t assert_lcr_high:1;
|
||||
uint16_t assert_lnr_low:1;
|
||||
uint16_t assert_lnr_high:1;
|
||||
uint16_t assert_unc_low:1;
|
||||
uint16_t assert_unc_high:1;
|
||||
uint16_t assert_ucr_low:1;
|
||||
uint16_t assert_ucr_high:1;
|
||||
uint16_t assert_unr_low:1;
|
||||
uint16_t assert_unr_high:1;
|
||||
uint16_t status_lnc:1;
|
||||
uint16_t status_lcr:1;
|
||||
uint16_t status_lnr:1;
|
||||
uint16_t reserved:1;
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
uint16_t reserved_2:1;
|
||||
uint16_t status_unr:1;
|
||||
uint16_t status_ucr:1;
|
||||
uint16_t status_unc:1;
|
||||
uint16_t deassert_unr_high:1;
|
||||
uint16_t deassert_unr_low:1;
|
||||
uint16_t deassert_ucr_high:1;
|
||||
uint16_t deassert_ucr_low:1;
|
||||
uint16_t deassert_unc_high:1;
|
||||
uint16_t deassert_unc_low:1;
|
||||
uint16_t deassert_lnr_high:1;
|
||||
uint16_t deassert_lnr_low:1;
|
||||
uint16_t deassert_lcr_high:1;
|
||||
uint16_t deassert_lcr_low:1;
|
||||
uint16_t deassert_lnc_high:1;
|
||||
uint16_t deassert_lnc_low:1;
|
||||
#else
|
||||
uint16_t deassert_lnc_low:1;
|
||||
uint16_t deassert_lnc_high:1;
|
||||
uint16_t deassert_lcr_low:1;
|
||||
uint16_t deassert_lcr_high:1;
|
||||
uint16_t deassert_lnr_low:1;
|
||||
uint16_t deassert_lnr_high:1;
|
||||
uint16_t deassert_unc_low:1;
|
||||
uint16_t deassert_unc_high:1;
|
||||
uint16_t deassert_ucr_low:1;
|
||||
uint16_t deassert_ucr_high:1;
|
||||
uint16_t deassert_unr_low:1;
|
||||
uint16_t deassert_unr_high:1;
|
||||
uint16_t status_unc:1;
|
||||
uint16_t status_ucr:1;
|
||||
uint16_t status_unr:1;
|
||||
uint16_t reserved_2:1;
|
||||
#endif
|
||||
union {
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN /* settable threshold mask */
|
||||
uint16_t reserved:2;
|
||||
uint16_t unr:1;
|
||||
uint16_t ucr:1;
|
||||
uint16_t unc:1;
|
||||
uint16_t lnr:1;
|
||||
uint16_t lcr:1;
|
||||
uint16_t lnc:1;
|
||||
/* padding lower 8 bits */
|
||||
uint16_t readable:8;
|
||||
#else
|
||||
uint16_t readable:8;
|
||||
uint16_t lnc:1;
|
||||
uint16_t lcr:1;
|
||||
uint16_t lnr:1;
|
||||
uint16_t unc:1;
|
||||
uint16_t ucr:1;
|
||||
uint16_t unr:1;
|
||||
uint16_t reserved:2;
|
||||
#endif
|
||||
} ATTRIBUTE_PACKING set;
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN /* readable threshold mask */
|
||||
/* padding upper 8 bits */
|
||||
uint16_t settable:8;
|
||||
uint16_t reserved:2;
|
||||
uint16_t unr:1;
|
||||
uint16_t ucr:1;
|
||||
uint16_t unc:1;
|
||||
uint16_t lnr:1;
|
||||
uint16_t lcr:1;
|
||||
uint16_t lnc:1;
|
||||
#else
|
||||
uint16_t lnc:1;
|
||||
uint16_t lcr:1;
|
||||
uint16_t lnr:1;
|
||||
uint16_t unc:1;
|
||||
uint16_t ucr:1;
|
||||
uint16_t unr:1;
|
||||
uint16_t reserved:2;
|
||||
uint16_t settable:8;
|
||||
#endif
|
||||
} ATTRIBUTE_PACKING read;
|
||||
} ATTRIBUTE_PACKING;
|
||||
} ATTRIBUTE_PACKING threshold;
|
||||
} ATTRIBUTE_PACKING type;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_record_common_sensor {
|
||||
struct {
|
||||
uint8_t owner_id;
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t channel:4; /* channel number */
|
||||
uint8_t __reserved:2;
|
||||
uint8_t lun:2; /* sensor owner lun */
|
||||
#else
|
||||
uint8_t lun:2; /* sensor owner lun */
|
||||
uint8_t __reserved:2;
|
||||
uint8_t channel:4; /* channel number */
|
||||
#endif
|
||||
uint8_t sensor_num; /* unique sensor number */
|
||||
} ATTRIBUTE_PACKING keys;
|
||||
|
||||
struct entity_id entity;
|
||||
|
||||
struct {
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved:1;
|
||||
uint8_t scanning:1;
|
||||
uint8_t events:1;
|
||||
uint8_t thresholds:1;
|
||||
uint8_t hysteresis:1;
|
||||
uint8_t type:1;
|
||||
uint8_t event_gen:1;
|
||||
uint8_t sensor_scan:1;
|
||||
#else
|
||||
uint8_t sensor_scan:1;
|
||||
uint8_t event_gen:1;
|
||||
uint8_t type:1;
|
||||
uint8_t hysteresis:1;
|
||||
uint8_t thresholds:1;
|
||||
uint8_t events:1;
|
||||
uint8_t scanning:1;
|
||||
uint8_t __reserved:1;
|
||||
#endif
|
||||
} ATTRIBUTE_PACKING init;
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t ignore:1;
|
||||
uint8_t rearm:1;
|
||||
uint8_t hysteresis:2;
|
||||
uint8_t threshold:2;
|
||||
uint8_t event_msg:2;
|
||||
#else
|
||||
uint8_t event_msg:2;
|
||||
uint8_t threshold:2;
|
||||
uint8_t hysteresis:2;
|
||||
uint8_t rearm:1;
|
||||
uint8_t ignore:1;
|
||||
#endif
|
||||
} ATTRIBUTE_PACKING capabilities;
|
||||
uint8_t type;
|
||||
} ATTRIBUTE_PACKING sensor;
|
||||
|
||||
uint8_t event_type; /* event/reading type code */
|
||||
|
||||
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;
|
||||
uint8_t rate:3;
|
||||
uint8_t modifier:2;
|
||||
uint8_t pct:1;
|
||||
#else
|
||||
uint8_t pct:1;
|
||||
uint8_t modifier:2;
|
||||
uint8_t rate:3;
|
||||
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 */
|
||||
} ATTRIBUTE_PACKING type;
|
||||
} ATTRIBUTE_PACKING unit;
|
||||
} ATTRIBUTE_PACKING;
|
||||
|
||||
/* SDR Record Common Sensor header macros */
|
||||
#define IS_THRESHOLD_SENSOR(s) ((s)->event_type == 1)
|
||||
#define UNITS_ARE_DISCRETE(s) ((s)->unit.analog == 3)
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_record_compact_sensor {
|
||||
struct sdr_record_common_sensor cmn;
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved:2;
|
||||
uint8_t mod_type:2;
|
||||
uint8_t count:4;
|
||||
#else
|
||||
uint8_t count:4;
|
||||
uint8_t mod_type:2;
|
||||
uint8_t __reserved:2;
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t entity_inst:1;
|
||||
uint8_t mod_offset:7;
|
||||
#else
|
||||
uint8_t mod_offset:7;
|
||||
uint8_t entity_inst:1;
|
||||
#endif
|
||||
} ATTRIBUTE_PACKING share;
|
||||
|
||||
struct {
|
||||
struct {
|
||||
uint8_t positive;
|
||||
uint8_t negative;
|
||||
} ATTRIBUTE_PACKING hysteresis;
|
||||
} ATTRIBUTE_PACKING threshold;
|
||||
|
||||
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[16]; /* sensor ID string bytes, only if id_code != 0 */
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_record_eventonly_sensor {
|
||||
struct {
|
||||
uint8_t owner_id;
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t channel:4; /* channel number */
|
||||
uint8_t fru_owner:2; /* fru device owner lun */
|
||||
uint8_t lun:2; /* sensor owner lun */
|
||||
#else
|
||||
uint8_t lun:2; /* sensor owner lun */
|
||||
uint8_t fru_owner:2; /* fru device owner lun */
|
||||
uint8_t channel:4; /* channel number */
|
||||
#endif
|
||||
uint8_t sensor_num; /* unique sensor number */
|
||||
} ATTRIBUTE_PACKING keys;
|
||||
|
||||
struct entity_id entity;
|
||||
|
||||
uint8_t sensor_type; /* sensor type */
|
||||
uint8_t event_type; /* event/reading type code */
|
||||
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved:2;
|
||||
uint8_t mod_type:2;
|
||||
uint8_t count:4;
|
||||
#else
|
||||
uint8_t count:4;
|
||||
uint8_t mod_type:2;
|
||||
uint8_t __reserved:2;
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t entity_inst:1;
|
||||
uint8_t mod_offset:7;
|
||||
#else
|
||||
uint8_t mod_offset:7;
|
||||
uint8_t entity_inst:1;
|
||||
#endif
|
||||
} ATTRIBUTE_PACKING share;
|
||||
|
||||
uint8_t __reserved;
|
||||
uint8_t oem; /* reserved for OEM use */
|
||||
uint8_t id_code; /* sensor ID string type/length code */
|
||||
uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */
|
||||
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_record_full_sensor {
|
||||
struct sdr_record_common_sensor cmn;
|
||||
|
||||
#define SDR_SENSOR_L_LINEAR 0x00
|
||||
#define SDR_SENSOR_L_LN 0x01
|
||||
#define SDR_SENSOR_L_LOG10 0x02
|
||||
#define SDR_SENSOR_L_LOG2 0x03
|
||||
#define SDR_SENSOR_L_E 0x04
|
||||
#define SDR_SENSOR_L_EXP10 0x05
|
||||
#define SDR_SENSOR_L_EXP2 0x06
|
||||
#define SDR_SENSOR_L_1_X 0x07
|
||||
#define SDR_SENSOR_L_SQR 0x08
|
||||
#define SDR_SENSOR_L_CUBE 0x09
|
||||
#define SDR_SENSOR_L_SQRT 0x0a
|
||||
#define SDR_SENSOR_L_CUBERT 0x0b
|
||||
#define SDR_SENSOR_L_NONLINEAR 0x70
|
||||
|
||||
uint8_t linearization; /* 70h=non linear, 71h-7Fh=non linear, OEM */
|
||||
uint16_t mtol; /* M, tolerance */
|
||||
uint32_t bacc; /* accuracy, B, Bexp, Rexp */
|
||||
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved:5;
|
||||
uint8_t normal_min:1; /* normal min field specified */
|
||||
uint8_t normal_max:1; /* normal max field specified */
|
||||
uint8_t nominal_read:1; /* nominal reading field specified */
|
||||
#else
|
||||
uint8_t nominal_read:1; /* nominal reading field specified */
|
||||
uint8_t normal_max:1; /* normal max field specified */
|
||||
uint8_t normal_min:1; /* normal min field specified */
|
||||
uint8_t __reserved:5;
|
||||
#endif
|
||||
} ATTRIBUTE_PACKING analog_flag;
|
||||
|
||||
uint8_t nominal_read; /* nominal reading, raw value */
|
||||
uint8_t normal_max; /* normal maximum, raw value */
|
||||
uint8_t normal_min; /* normal minimum, raw value */
|
||||
uint8_t sensor_max; /* sensor maximum, raw value */
|
||||
uint8_t sensor_min; /* sensor minimum, raw value */
|
||||
|
||||
struct {
|
||||
struct {
|
||||
uint8_t non_recover;
|
||||
uint8_t critical;
|
||||
uint8_t non_critical;
|
||||
} ATTRIBUTE_PACKING upper;
|
||||
struct {
|
||||
uint8_t non_recover;
|
||||
uint8_t critical;
|
||||
uint8_t non_critical;
|
||||
} ATTRIBUTE_PACKING lower;
|
||||
struct {
|
||||
uint8_t positive;
|
||||
uint8_t negative;
|
||||
} ATTRIBUTE_PACKING hysteresis;
|
||||
} ATTRIBUTE_PACKING threshold;
|
||||
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[16]; /* sensor ID string bytes, only if id_code != 0 */
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_record_mc_locator {
|
||||
uint8_t dev_slave_addr;
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t __reserved2:4;
|
||||
uint8_t channel_num:4;
|
||||
#else
|
||||
uint8_t channel_num:4;
|
||||
uint8_t __reserved2:4;
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t pwr_state_notif:3;
|
||||
uint8_t __reserved3:1;
|
||||
uint8_t global_init:4;
|
||||
#else
|
||||
uint8_t global_init:4;
|
||||
uint8_t __reserved3:1;
|
||||
uint8_t pwr_state_notif:3;
|
||||
#endif
|
||||
uint8_t dev_support;
|
||||
uint8_t __reserved4[3];
|
||||
struct entity_id entity;
|
||||
uint8_t oem;
|
||||
uint8_t id_code;
|
||||
uint8_t id_string[16];
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct sdr_record_fru_locator {
|
||||
uint8_t dev_slave_addr;
|
||||
uint8_t device_id;
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t logical:1;
|
||||
uint8_t __reserved2:2;
|
||||
uint8_t lun:2;
|
||||
uint8_t bus:3;
|
||||
#else
|
||||
uint8_t bus:3;
|
||||
uint8_t lun:2;
|
||||
uint8_t __reserved2:2;
|
||||
uint8_t logical:1;
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t channel_num:4;
|
||||
uint8_t __reserved3:4;
|
||||
#else
|
||||
uint8_t __reserved3:4;
|
||||
uint8_t channel_num:4;
|
||||
#endif
|
||||
uint8_t __reserved4;
|
||||
uint8_t dev_type;
|
||||
uint8_t dev_type_modifier;
|
||||
struct entity_id entity;
|
||||
uint8_t oem;
|
||||
uint8_t id_code;
|
||||
uint8_t id_string[16];
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_record_generic_locator {
|
||||
uint8_t dev_access_addr;
|
||||
uint8_t dev_slave_addr;
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t channel_num:3;
|
||||
uint8_t lun:2;
|
||||
uint8_t bus:3;
|
||||
#else
|
||||
uint8_t bus:3;
|
||||
uint8_t lun:2;
|
||||
uint8_t channel_num:3;
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t addr_span:3;
|
||||
uint8_t __reserved1:5;
|
||||
#else
|
||||
uint8_t __reserved1:5;
|
||||
uint8_t addr_span:3;
|
||||
#endif
|
||||
uint8_t __reserved2;
|
||||
uint8_t dev_type;
|
||||
uint8_t dev_type_modifier;
|
||||
struct entity_id entity;
|
||||
uint8_t oem;
|
||||
uint8_t id_code;
|
||||
uint8_t id_string[16];
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_record_entity_assoc {
|
||||
struct entity_id entity; /* container entity ID and instance */
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t isrange:1;
|
||||
uint8_t islinked:1;
|
||||
uint8_t isaccessable:1;
|
||||
uint8_t __reserved:5;
|
||||
#else
|
||||
uint8_t __reserved:5;
|
||||
uint8_t isaccessable:1;
|
||||
uint8_t islinked:1;
|
||||
uint8_t isrange:1;
|
||||
#endif
|
||||
} flags;
|
||||
uint8_t entity_id_1; /* entity ID 1 | range 1 entity */
|
||||
uint8_t entity_inst_1; /* entity inst 1 | range 1 first instance */
|
||||
uint8_t entity_id_2; /* entity ID 2 | range 1 entity */
|
||||
uint8_t entity_inst_2; /* entity inst 2 | range 1 last instance */
|
||||
uint8_t entity_id_3; /* entity ID 3 | range 2 entity */
|
||||
uint8_t entity_inst_3; /* entity inst 3 | range 2 first instance */
|
||||
uint8_t entity_id_4; /* entity ID 4 | range 2 entity */
|
||||
uint8_t entity_inst_4; /* entity inst 4 | range 2 last instance */
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct sdr_record_oem {
|
||||
uint8_t *data;
|
||||
int data_len;
|
||||
};
|
||||
|
||||
/*
|
||||
* The Get SDR Repository Info response structure
|
||||
* From table 33-3 of the IPMI v2.0 spec
|
||||
*/
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct get_sdr_repository_info_rsp {
|
||||
uint8_t sdr_version;
|
||||
uint8_t record_count_lsb;
|
||||
uint8_t record_count_msb;
|
||||
uint8_t free_space[2];
|
||||
uint8_t most_recent_addition_timestamp[4];
|
||||
uint8_t most_recent_erase_timestamp[4];
|
||||
#if WORDS_BIGENDIAN
|
||||
uint8_t overflow_flag:1;
|
||||
uint8_t modal_update_support:2;
|
||||
uint8_t __reserved1:1;
|
||||
uint8_t delete_sdr_supported:1;
|
||||
uint8_t partial_add_sdr_supported:1;
|
||||
uint8_t reserve_sdr_repository_supported:1;
|
||||
uint8_t get_sdr_repository_allo_info_supported:1;
|
||||
#else
|
||||
uint8_t get_sdr_repository_allo_info_supported:1;
|
||||
uint8_t reserve_sdr_repository_supported:1;
|
||||
uint8_t partial_add_sdr_supported:1;
|
||||
uint8_t delete_sdr_supported:1;
|
||||
uint8_t __reserved1:1;
|
||||
uint8_t modal_update_support:2;
|
||||
uint8_t overflow_flag:1;
|
||||
#endif
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
struct ipmi_sdr_iterator {
|
||||
uint16_t reservation;
|
||||
int total;
|
||||
int next;
|
||||
int use_built_in;
|
||||
};
|
||||
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
struct sdr_record_list {
|
||||
uint16_t id;
|
||||
uint8_t version;
|
||||
uint8_t type;
|
||||
uint8_t length;
|
||||
uint8_t *raw;
|
||||
struct sdr_record_list *next;
|
||||
union {
|
||||
struct sdr_record_common_sensor *common;
|
||||
struct sdr_record_full_sensor *full;
|
||||
struct sdr_record_compact_sensor *compact;
|
||||
struct sdr_record_eventonly_sensor *eventonly;
|
||||
struct sdr_record_generic_locator *genloc;
|
||||
struct sdr_record_fru_locator *fruloc;
|
||||
struct sdr_record_mc_locator *mcloc;
|
||||
struct sdr_record_entity_assoc *entassoc;
|
||||
struct sdr_record_oem *oem;
|
||||
} ATTRIBUTE_PACKING record;
|
||||
} ATTRIBUTE_PACKING;
|
||||
#ifdef HAVE_PRAGMA_PACK
|
||||
#pragma pack(0)
|
||||
#endif
|
||||
|
||||
#define SENSOR_TYPE_MAX 0x2C
|
||||
|
||||
struct sensor_reading {
|
||||
char s_id[17]; /* name of the sensor */
|
||||
struct sdr_record_full_sensor *full;
|
||||
struct sdr_record_compact_sensor *compact;
|
||||
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 */
|
||||
uint8_t s_reading; /* value which was read */
|
||||
uint8_t s_data2; /* data2 value read */
|
||||
uint8_t s_data3; /* data3 value read */
|
||||
uint8_t s_has_analog_value; /* sensor has analog value */
|
||||
double s_a_val; /* read value converted to analog */
|
||||
char s_a_str[16]; /* analog value as a string */
|
||||
const char *s_a_units; /* analog value units string */
|
||||
};
|
||||
|
||||
/*
|
||||
* Determine if bridging is necessary to address a sensor at the given
|
||||
* address (_addr) and (_chan) via the interface (_intf).
|
||||
*
|
||||
* If the sensor is being addressed on channel zero, it resides on
|
||||
* IPMB-0. If the interface target IPMB-0 address is exactly the same as
|
||||
* the sensor address then the sensor resides on the target IPMB-0
|
||||
* so we don't need extra levels of bridging to address the sensor.
|
||||
* Or
|
||||
* If the sensor target address and channel match the interface target address
|
||||
* and channel then there is no extra levels of bridging required.
|
||||
*
|
||||
* Note:
|
||||
* The target IPMB-0 address is the address of the SDR repository that was
|
||||
* accessed using the user specified bridging command line arguments.
|
||||
* Access to any sensor on the target IPMB-0 can be addressed using the
|
||||
* target address and transit address in the interface.
|
||||
*/
|
||||
#define BRIDGE_TO_SENSOR(_intf, _addr, _chan) \
|
||||
( !((_chan == 0 && _intf->target_ipmb_addr && \
|
||||
_intf->target_ipmb_addr == _addr) || \
|
||||
(_addr == _intf->target_addr && _chan == _intf->target_channel)) )
|
||||
|
||||
|
||||
struct ipmi_sdr_iterator *ipmi_sdr_start(struct ipmi_intf *intf,
|
||||
int use_builtin);
|
||||
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);
|
||||
int ipmi_sdr_print_sdr(struct ipmi_intf *intf, uint8_t type);
|
||||
|
||||
int ipmi_sdr_print_name_from_rawentry(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,
|
||||
struct sdr_record_list *entry);
|
||||
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,
|
||||
uint8_t base, uint8_t modifier);
|
||||
struct sensor_reading *
|
||||
ipmi_sdr_read_sensor_value(struct ipmi_intf *intf,
|
||||
struct sdr_record_common_sensor *sensor,
|
||||
uint8_t sdr_record_type, int precision);
|
||||
const char *ipmi_sdr_get_thresh_status(struct sensor_reading *sr,
|
||||
const char *invalidstr);
|
||||
const char *ipmi_sdr_get_status(int, const char *, uint8_t stat);
|
||||
double sdr_convert_sensor_tolerance(struct sdr_record_full_sensor *sensor,
|
||||
uint8_t val);
|
||||
double sdr_convert_sensor_reading(struct sdr_record_full_sensor *sensor,
|
||||
uint8_t val);
|
||||
double sdr_convert_sensor_hysterisis(struct sdr_record_full_sensor *sensor,
|
||||
uint8_t val);
|
||||
uint8_t sdr_convert_sensor_value_to_raw(struct sdr_record_full_sensor *sensor,
|
||||
double val);
|
||||
struct ipmi_rs *ipmi_sdr_get_sensor_reading(struct ipmi_intf *intf,
|
||||
uint8_t sensor);
|
||||
struct ipmi_rs *ipmi_sdr_get_sensor_reading_ipmb(struct ipmi_intf *intf,
|
||||
uint8_t sensor,
|
||||
uint8_t target,
|
||||
uint8_t lun,
|
||||
uint8_t channel);
|
||||
struct ipmi_rs *ipmi_sdr_get_sensor_thresholds(struct ipmi_intf *intf,
|
||||
uint8_t sensor,
|
||||
uint8_t target, uint8_t lun, uint8_t channel);
|
||||
struct ipmi_rs *ipmi_sdr_get_sensor_hysteresis(struct ipmi_intf *intf,
|
||||
uint8_t sensor,
|
||||
uint8_t target, uint8_t lun, uint8_t channel);
|
||||
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);
|
||||
|
||||
struct sdr_record_list *ipmi_sdr_find_sdr_byentity(struct ipmi_intf *intf,
|
||||
struct entity_id *entity);
|
||||
struct sdr_record_list *ipmi_sdr_find_sdr_bynumtype(struct ipmi_intf *intf,
|
||||
uint16_t gen_id, uint8_t num, uint8_t type);
|
||||
struct sdr_record_list *ipmi_sdr_find_sdr_bysensortype(struct ipmi_intf *intf,
|
||||
uint8_t type);
|
||||
struct sdr_record_list *ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf,
|
||||
char *id);
|
||||
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_print_info(struct ipmi_intf *intf);
|
||||
void ipmi_sdr_print_discrete_state(struct ipmi_intf *intf,
|
||||
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,
|
||||
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,
|
||||
uint8_t sensor_num, uint8_t sensor_type,
|
||||
uint8_t event_type, int numeric_fmt,
|
||||
uint8_t target, uint8_t lun, uint8_t channel);
|
||||
int ipmi_sdr_print_sensor_event_enable(struct ipmi_intf *intf,
|
||||
uint8_t sensor_num, uint8_t sensor_type,
|
||||
uint8_t event_type, int numeric_fmt,
|
||||
uint8_t target, uint8_t lun, uint8_t channel);
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
* Methods to add SDRs to repository from built-in sensors or files
|
||||
*/
|
||||
int
|
||||
ipmi_sdr_add_from_sensors(struct ipmi_intf *intf, int maxslot);
|
||||
|
||||
int
|
||||
ipmi_sdr_add_from_file(struct ipmi_intf *intf, const char *ifile);
|
||||
|
||||
int
|
||||
ipmi_sdr_add_from_list(struct ipmi_intf *intf, const char *rangeList);
|
@ -1,688 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#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, 0x07, 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);
|
@ -1,151 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
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
|
||||
};
|
@ -1,77 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#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[];
|
||||
extern const struct valstr ipmi_netfn_vals[];
|
||||
extern const struct valstr ipmi_channel_activity_type_vals[];
|
||||
extern const struct valstr ipmi_privlvl_vals[];
|
||||
extern const struct valstr ipmi_bit_rate_vals[];
|
||||
extern const struct valstr ipmi_set_in_progress_vals[];
|
||||
extern const struct valstr ipmi_authtype_session_vals[];
|
||||
extern const struct valstr ipmi_authtype_vals[];
|
||||
extern const struct valstr ipmi_channel_protocol_vals[];
|
||||
extern const struct valstr ipmi_channel_medium_vals[];
|
||||
extern const struct valstr ipmi_chassis_power_control_vals[];
|
||||
extern const struct valstr ipmi_chassis_restart_cause_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;
|
||||
void ipmi_oem_info_init();
|
||||
void ipmi_oem_info_free();
|
||||
|
||||
extern const struct valstr picmg_frucontrol_vals[];
|
||||
extern const struct valstr picmg_clk_family_vals[];
|
||||
extern const struct oemvalstr picmg_clk_accuracy_vals[];
|
||||
extern const struct oemvalstr picmg_clk_resource_vals[];
|
||||
extern const struct oemvalstr picmg_clk_id_vals[];
|
||||
|
||||
extern const struct valstr picmg_busres_id_vals[];
|
||||
extern const struct valstr picmg_busres_board_cmd_vals[];
|
||||
extern const struct valstr picmg_busres_shmc_cmd_vals[];
|
||||
extern const struct oemvalstr picmg_busres_board_status_vals[];
|
||||
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[];
|
@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2014, Oracle and/or its affiliates. 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_sdr.h>
|
||||
|
||||
#define IPMI_NETFN_SUNOEM 0x2e
|
||||
|
||||
#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 **);
|
@ -1,90 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#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);
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2005 Tyan Computer Corp. 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
#define IPMI_TSOL_CMD_SENDKEY 0x03
|
||||
#define IPMI_TSOL_CMD_START 0x06
|
||||
#define IPMI_TSOL_CMD_STOP 0x02
|
||||
|
||||
#define IPMI_TSOL_DEF_PORT 6230
|
||||
|
||||
int ipmi_tsol_main(struct ipmi_intf *, int, char **);
|
@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Pigeon Point Systems. All right reserved
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/* 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);
|
@ -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>
|
@ -28,3 +28,6 @@ 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.
|
||||
|
||||
You acknowledge that this software is not designed or intended for use
|
||||
in the design, construction, operation or maintenance of any nuclear
|
||||
facility.
|
71
ipmitool/ChangeLog
Normal file
71
ipmitool/ChangeLog
Normal file
@ -0,0 +1,71 @@
|
||||
version 1.6.0
|
||||
* Add a README file
|
||||
* Add Solaris x86 interface plugin
|
||||
* Add support for building Solaris packages
|
||||
* Fix segfault when doing "sel list" (from Matthew Braithwaite)
|
||||
* Fix "chassis identify" on some BMCs (from ebrower@sourceforge)
|
||||
* Add command "bmc info" and related output (from ebrower@sourceforge)
|
||||
* Add support for IPMIv2 and Serial-over-LAN from Jeremy at Newisys
|
||||
* Add support for building RPMs as non-root user
|
||||
* Add new "shell" and "exec" commands
|
||||
* Lots of other contributed patches
|
||||
|
||||
version 1.5.9
|
||||
* 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
|
||||
|
||||
version 1.5.8
|
||||
* 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
|
||||
|
||||
version 1.5.7
|
||||
* Add IPMIv1.5 eratta fixes
|
||||
* Additions to FRU printing and FRU multirecords
|
||||
* Better handling of SDR printing
|
||||
* Contrib scripts for creating rrdtool graphs
|
||||
|
||||
version 1.5.6
|
||||
* 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
|
||||
|
||||
version 1.5.5
|
||||
* Add -U option for setting LAN username
|
||||
* Fix -v usage for plugin interfaces
|
||||
|
||||
version 1.5.4
|
||||
* Put interface plugin API into library
|
||||
* Fix ipmievd
|
||||
|
||||
version 1.5.3
|
||||
* Add -g option to work with grizzly bmc
|
||||
|
||||
version 1.5.2
|
||||
* Add support for setting gratuitous arp interval
|
||||
|
||||
version 1.5.1
|
||||
* Better SEL support
|
||||
* Fix display bug in SDR list
|
||||
|
||||
version 1.5.0
|
||||
* More robust UDP packet handling
|
||||
* Add Intel IMB driver support
|
||||
* Use autoconf/automake/libtool
|
||||
|
@ -27,11 +27,17 @@
|
||||
# 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.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
DOCDIR = $(docdir)
|
||||
DOCLIST = $(top_srcdir)/README $(top_srcdir)/COPYING $(top_srcdir)/AUTHORS $(top_srcdir)/ChangeLog
|
||||
DOCDIR = $(DESTDIR)/$(datadir)/doc/$(PACKAGE)
|
||||
DOCLIST = README COPYING AUTHORS 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,50 +47,13 @@ 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.txt
|
||||
|
||||
dist-hook:
|
||||
cp control/ipmitool.spec $(distdir)
|
||||
|
||||
.PHONY: install-pen-database uninstall-pen-database
|
||||
.INTERMEDIATE: %.o %.la enterprise-numbers
|
||||
|
||||
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) $< $(DESTDIR)$(IANADIR)/
|
||||
|
||||
uninstall-pen-database:
|
||||
-rm -rf $(DESTDIR)$(IANADIR)/enterprise-numbers
|
||||
|
||||
else
|
||||
|
||||
install-pen-database:
|
||||
@echo "*** NOT installing the IANA PEN database."
|
||||
@echo "*** Don't know how to download it."
|
||||
|
||||
uninstall-pen-database:
|
||||
@echo "*** NOT uninstalling the IANA PEN database."
|
||||
@echo "*** It was installed manually (if ever)."
|
||||
|
||||
endif
|
||||
|
||||
install-data-local: install-pen-database
|
||||
mkdir -p $(DESTDIR)$(DOCDIR)
|
||||
$(INSTALL_DATA) $(DOCLIST) $(DESTDIR)$(DOCDIR)
|
||||
|
||||
uninstall-local: uninstall-pen-database
|
||||
-rm -rf $(DESTDIR)$(DOCDIR)
|
||||
install-data-local:
|
||||
mkdir -p $(DOCDIR)
|
||||
install -m 644 $(DOCLIST) $(DOCDIR)
|
||||
|
||||
.PHONY: pkg
|
||||
pkg: PKG := ipmitool-@VERSION@-@OS@-@ARCH@
|
||||
@ -101,9 +70,14 @@ SRCDIR = ${shell cd $(top_srcdir) ; pwd | sed -e 's,^[^:\\/]:[\\/],/,'}
|
||||
RPMDIR = $(BUILDDIR)/rpmbuild
|
||||
|
||||
.PHONY: rpm
|
||||
rpm: dist
|
||||
@RPMBUILD@ -ta --define "_topdir $(RPMDIR)" $(distdir).tar.gz
|
||||
rpm: control/ipmitool.spec dist
|
||||
mkdir -p $(RPMDIR)/{BUILD,RPMS,SRPMS,SOURCES,SPECS,tmp}
|
||||
cp control/ipmitool.spec $(RPMDIR)/SPECS
|
||||
BUILDDIR=$(RPMDIR) CONFIGDIR=$(BUILDDIR)/control \
|
||||
@RPMBUILD@ -ba --rcfile $(SRCDIR)/control/rpmrc \
|
||||
$(RPMDIR)/SPECS/ipmitool.spec
|
||||
|
||||
.PHONY: clean-rpm
|
||||
clean-rpm:
|
||||
-rm -rf $(RPMDIR)
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
ipmitool
|
||||
Duncan Laurie
|
||||
ipmitool-devel@lists.sourceforge.net
|
||||
duncan@iceblink.org
|
||||
|
||||
Overview
|
||||
========
|
||||
@ -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,114 +126,11 @@ 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.
|
||||
|
||||
IPMB Dual Bridging in IPMITOOL
|
||||
-------------------------------
|
||||
|
||||
IPMI offers a standard messaging interface.
|
||||
|
||||
The following concepts are related to this messaging interface:
|
||||
|
||||
Channel type : Communication channel type (SMS/KCS, IPMB, LAN)
|
||||
Channel number : Channel descriptor
|
||||
Requester : Address of the requester
|
||||
Responder : Address of the responder
|
||||
NetFN : The logical function for the request/response.
|
||||
Command : The command number
|
||||
Sequence : An ID identifiying the request/response pair
|
||||
Message tracking : The ability to match request/response pair.
|
||||
|
||||
When a communication is issued through any of the channels, an application
|
||||
formats a request and expect a response.
|
||||
|
||||
Direct Command
|
||||
--------------
|
||||
The simplest form of communication is a "direct command" using SMS/KCS
|
||||
|
||||
Example:
|
||||
ipmitool raw 6 4
|
||||
55 00
|
||||
|
||||
This send raw command 4 (selftest) from netfn 6(application) to KCS, the driver
|
||||
takes care of 'message tracking' and provides the answer.
|
||||
|
||||
Hopefully, the application also includes a "human readable" instance of the API:
|
||||
ipmitool mc selftest
|
||||
Selftest: passed
|
||||
|
||||
Bridged Command
|
||||
---------------
|
||||
One slightly more complicated communication mode is the so-called
|
||||
"bridged command" using IPMB.
|
||||
|
||||
Example:
|
||||
ipmitool -m 0x94 -t 0x9a raw 6 4
|
||||
55 00
|
||||
|
||||
or
|
||||
|
||||
ipmitool -m 0x94 -t 0x9a mc selftest
|
||||
Selftest: passed
|
||||
|
||||
|
||||
This still sends the same command 4 (selftest) from netfn 6(application) to
|
||||
the target. However, to do so, the command is encapsulated (by the driver) and
|
||||
sent using the command 0x34 (send message) from netfn 6(application) to KCS.
|
||||
Then KCS is polled by the driver until a message has been received, then the
|
||||
driver uses command 0x33 (get message). The driver also tracks the message
|
||||
and makes sure the response matches the request. Then it decapsultates the
|
||||
message and gives the response back to the application.
|
||||
|
||||
Dual Bridged Command
|
||||
--------------------
|
||||
Things get a little more ugly when the application needs to reach a management
|
||||
controller sitting on an interface (or channel) not directly connected to the
|
||||
BMC/IPMC. In the case the application must encapsulate its message itself and
|
||||
request the IPMC to deal with message tracking itself.
|
||||
|
||||
Its been working well with IPMITOOL on the LAN interface with:
|
||||
ipmitool -H <ip> -U <user> -P <password> -B 0 -T 0x8a -m 0x20 -t 0x7a -b 7
|
||||
mc selftest
|
||||
|
||||
However, trying to dual bridge commands locally with :
|
||||
ipmitool -B 0 -T 0x9a -m 0x94 -t 0x7a -b 7 mc selftest didn't work
|
||||
(it returned the same data as ipmitool -m 0x20 -t 0x7a -b 7 mc selftest )
|
||||
|
||||
The reason was that the "openipmi" interface pluging didn't
|
||||
encapsulate/decapsulate the message and didn't even detect the intent
|
||||
to double bridge the request.
|
||||
|
||||
./src/ipmitool -B 0 -T 0x8a -m 0x94 -t 0x7a -b 7 mc selftest
|
||||
|
||||
-B 0 : transit channel for first bridge level (channel 0: IPMB-0)
|
||||
-T 0x8a : transit destination address (remote IPMC address)
|
||||
-m 0x94 : source address (local IPMC address on IPMB-0)
|
||||
-t 0x7a : remote target (AMC IPMB-L address)
|
||||
-b 7 : remote channel (channel 7: IPMB-L)
|
||||
|
||||
The transit source address (remote IPMC address on remote channel) is
|
||||
automatically assigned by the remote IPMC.
|
||||
|
||||
Payload Size Limit
|
||||
------------------
|
||||
Because some commands return a lot of data (fru read/get sdr) and because 2
|
||||
levels of encapsulation are used, some command will fail.
|
||||
|
||||
For instance this works.
|
||||
|
||||
ipmitool -H <ip> -U <user> -P <password> -B 0 -T 0x8a -m 0x94 -t 0x7a -b 7
|
||||
mc selftest
|
||||
|
||||
but this does not:
|
||||
|
||||
ipmitool -H <ip> -U <user> -P <password> -B 0 -T 0x8a -m 0x94 -t 0x7a -b 7
|
||||
fru print.
|
||||
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
@ -279,6 +176,7 @@ Commands:
|
||||
fru Print built-in FRU and scan SDR for FRU locators
|
||||
sel Print System Evelnt Log
|
||||
sol Configure IPMIv2.0 Serial-over-LAN
|
||||
isol Configure Intel IPMIv1.5 Serial-over-LAN
|
||||
user Configure BMC users
|
||||
channel Configure BMC channels
|
||||
session Print session information
|
||||
@ -396,16 +294,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
|
@ -29,17 +29,13 @@
|
||||
# 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.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
aclocal
|
||||
|
||||
case `uname` in
|
||||
Darwin*)
|
||||
glibtoolize --automake --copy
|
||||
;;
|
||||
*)
|
||||
libtoolize --automake --copy
|
||||
;;
|
||||
esac
|
||||
libtoolize --automake --copy
|
||||
|
||||
autoheader
|
||||
automake --foreign --add-missing --copy
|
281
ipmitool/configure.in
Normal file
281
ipmitool/configure.in
Normal file
@ -0,0 +1,281 @@
|
||||
dnl
|
||||
dnl autoconf for ipmitool
|
||||
dnl
|
||||
AC_INIT([src/ipmitool.c])
|
||||
AC_CANONICAL_SYSTEM
|
||||
AM_INIT_AUTOMAKE([ipmitool], [1.6.1])
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AC_CONFIG_SRCDIR([src/ipmitool.c])
|
||||
AC_PREREQ(2.50)
|
||||
AC_SUBST(ac_configure_args)
|
||||
|
||||
dnl check for requirements
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
AC_CHECK_PROG([RPMBUILD], [rpmbuild], [rpmbuild], [rpm])
|
||||
AC_CHECK_PROG([SED], [sed], [sed])
|
||||
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h])
|
||||
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/socket.h])
|
||||
AC_CHECK_HEADERS([sys/byteorder.h byteswap.h])
|
||||
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
AC_FUNC_MALLOC
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
AC_FUNC_STRTOD
|
||||
AC_CHECK_FUNCS([alarm gethostbyname socket select])
|
||||
AC_CHECK_FUNCS([memmove memset strchr strdup strerror])
|
||||
AC_CHECK_FUNCS([getpassphrase])
|
||||
|
||||
CFLAGS="$CFLAGS -fno-strict-aliasing"
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
LIBTOOL="$LIBTOOL --silent"
|
||||
|
||||
AC_SEARCH_LIBS([gethostbyname], [nsl])
|
||||
AC_SEARCH_LIBS([socket], [socket], [],
|
||||
[AC_CHECK_LIB([nsl], [socket],
|
||||
[LIBS="$LIBS -lsocket -lnsl"], [], [-lsocket])])
|
||||
|
||||
if test "x$prefix" = "xNONE"; then
|
||||
prefix="$ac_default_prefix"
|
||||
fi
|
||||
|
||||
if test "x$exec_prefix" = "xNONE"; then
|
||||
exec_prefix="$prefix"
|
||||
fi
|
||||
|
||||
dnl set some things so we build with GNU tools on Solaris
|
||||
case "$host_os" in
|
||||
solaris*)
|
||||
MAKE=gmake
|
||||
STRIP=gstrip
|
||||
LD=gld
|
||||
AR=gar
|
||||
# disable the linux-specific interfaces
|
||||
enable_intf_imb=no
|
||||
enable_intf_open=no
|
||||
enable_ipmievd=no
|
||||
enable_ipmishell=no
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(ARCH, $host_cpu)
|
||||
AC_SUBST(OS, $host_os)
|
||||
AC_SUBST(PSTAMP, $host)
|
||||
AC_SUBST(BASEDIR, $prefix)
|
||||
|
||||
dnl check for OpenSSL functionality
|
||||
AC_ARG_ENABLE([internal-md5],
|
||||
[AC_HELP_STRING([--enable-internal-md5],
|
||||
[enable internal MD5 library [default=no]])],
|
||||
[], [enable_internal_md5=no])
|
||||
|
||||
AC_CHECK_LIB([crypto], [EVP_aes_128_cbc],
|
||||
[if test "x$enable_internal_md5" != "xyes"; then
|
||||
have_crypto=yes; LIBS="$LIBS -lcrypto"
|
||||
fi], [have_crypto=no], [-lcrypto])
|
||||
|
||||
AC_CHECK_LIB([crypto], [MD5_Init],
|
||||
[if test "x$enable_internal_md5" != "xyes"; then
|
||||
if test "x$have_crypto" != "xyes"; then
|
||||
LIBS="$LIBS -lcrypto"
|
||||
have_md5=yes
|
||||
fi
|
||||
AC_DEFINE(HAVE_CRYPTO_MD5, [1], [Define to 1 if libcrypto supports MD5.])
|
||||
fi], [], [-lcrypto])
|
||||
|
||||
AC_CHECK_LIB([crypto], [MD2_Init],
|
||||
[if test "x$enable_internal_md5" != "xyes"; then
|
||||
if test "x$have_crypto" != "xyes" && test "x$have_md5" != "xyes"; then
|
||||
LIBS="$LIBS -lcrypto"
|
||||
have_md2=yes
|
||||
fi
|
||||
AC_DEFINE(HAVE_CRYPTO_MD2, [1], [Define to 1 if libcrypto supports MD2.])
|
||||
fi], [], [-lcrypto])
|
||||
|
||||
dnl enable IPMIv1.5 LAN interface
|
||||
AC_ARG_ENABLE([intf-lan],
|
||||
[AC_HELP_STRING([--enable-intf-lan],
|
||||
[enable IPMIv1.5 LAN interface [default=yes]])],
|
||||
[], [enable_intf_lan=yes])
|
||||
if test "x$enable_intf_lan" = "xstatic" || test "x$enable_intf_lan" = "xplugin"; then
|
||||
enable_intf_lan=yes
|
||||
fi
|
||||
if test "x$enable_intf_lan" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_LAN, [1], [Define to 1 to enable LAN IPMIv1.5 interface.])
|
||||
AC_SUBST(INTF_LAN, [lan])
|
||||
AC_SUBST(INTF_LAN_LIB, [libintf_lan.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lan/libintf_lan.la"
|
||||
fi
|
||||
|
||||
dnl enable IPMIv2.0 RMCP+ LAN interface
|
||||
AC_ARG_ENABLE([intf-lanplus],
|
||||
[AC_HELP_STRING([--enable-intf-lanplus],
|
||||
[enable IPMIv2.0 RMCP+ LAN interface [default=auto]])],
|
||||
[if test "x$enable_intf_lanplus" != "xno" && test "x$have_crypto" != "xyes"; then
|
||||
echo "** The lanplus interface requires an SSL library with EVP_aes_128_cbc defined."
|
||||
enable_intf_lanplus=no
|
||||
fi],
|
||||
[enable_intf_lanplus=$have_crypto])
|
||||
if test "x$enable_intf_lanplus" = "xstatic" || test "x$enable_intf_lanplus" = "xplugin"; then
|
||||
enable_intf_lanplus=yes
|
||||
fi
|
||||
if test "x$enable_intf_lanplus" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_LANPLUS, [1], [Define to 1 to enable LAN+ IPMIv2 interface.])
|
||||
AC_SUBST(INTF_LANPLUS, [lanplus])
|
||||
AC_SUBST(INTF_LANPLUS_LIB, [libintf_lanplus.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lanplus/libintf_lanplus.la"
|
||||
else
|
||||
enable_intf_lanplus=no
|
||||
fi
|
||||
|
||||
dnl look for OpenIPMI header files
|
||||
AC_ARG_WITH([kerneldir],
|
||||
[AC_HELP_STRING([--with-kerneldir=DIR],
|
||||
[set kernel include path to DIR])],
|
||||
[if test "x$with_kerneldir" = "xyes"; then
|
||||
with_kerneldir="/lib/modules/`uname -r`/build"
|
||||
fi
|
||||
CFLAGS="$CFLAGS -I ${with_kerneldir}/include"
|
||||
AC_SUBST(CFLAGS)
|
||||
if test -s ${with_kerneldir}/include/linux/version.h ; then
|
||||
kernelver=`grep UTS_RELEASE ${with_kerneldir}/include/linux/version.h | \
|
||||
sed 's/^\#define UTS_RELEASE \"\(2\.[0-9]\)\..*/\1/'`
|
||||
if test "x$kernelver" = "x2.6"; then
|
||||
CPPFLAGS="$CPPFLAGS -D__user="
|
||||
AC_SUBST(CPPFLAGS)
|
||||
fi
|
||||
fi])
|
||||
AC_CHECK_HEADER([linux/ipmi.h],
|
||||
[AC_DEFINE(HAVE_OPENIPMI_H, [1],
|
||||
[Define to 1 if you have the <linux/ipmi.h> header file.])],
|
||||
[echo "** Unable to find OpenIPMI header files. Using internal version."])
|
||||
|
||||
dnl enable Linux OpenIPMI interface
|
||||
AC_ARG_ENABLE([intf-open],
|
||||
[AC_HELP_STRING([--enable-intf-open],
|
||||
[enable Linux OpenIPMI interface [default=yes]])],
|
||||
[], [enable_intf_open=yes])
|
||||
if test "x$enable_intf_open" = "xstatic" || test "x$enable_intf_open" = "xplugin"; then
|
||||
enable_intf_open=yes
|
||||
fi
|
||||
if test "x$enable_intf_open" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_OPEN, [1], [Define to 1 to enable Linux OpenIPMI interface.])
|
||||
AC_SUBST(INTF_OPEN, [open])
|
||||
AC_SUBST(INTF_OPEN_LIB, [libintf_open.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB open/libintf_open.la"
|
||||
fi
|
||||
|
||||
dnl enable Intel IMB interface
|
||||
AC_ARG_ENABLE([intf-imb],
|
||||
[AC_HELP_STRING([--enable-intf-imb],
|
||||
[enable Intel IMB driver interface [default=yes]])],
|
||||
[], [enable_intf_imb=yes])
|
||||
if test "x$enable_intf_imb" = "xstatic" || test "x$enable_intf_imb" = "xplugin"; then
|
||||
enable_intf_imb=yes
|
||||
fi
|
||||
if test "x$enable_intf_imb" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_IMB, [1], [Define to 1 to enable Intel IMB interface.])
|
||||
AC_SUBST(INTF_IMB, [imb])
|
||||
AC_SUBST(INTF_IMB_LIB, [libintf_imb.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB imb/libintf_imb.la"
|
||||
fi
|
||||
|
||||
dnl enable Solaris LIPMI interface
|
||||
AC_CHECK_HEADER([sys/lipmi/lipmi_intf.h], [have_lipmi=yes], [have_lipmi=no])
|
||||
AC_ARG_ENABLE([intf-lipmi],
|
||||
[AC_HELP_STRING([--enable-intf-lipmi],
|
||||
[enable Solaris x86 IPMI interface [default=auto]])],
|
||||
[if test "x$enable_intf_lipmi" != "xno" && test "x$have_lipmi" != "xyes"; then
|
||||
echo "** Unable to build Solaris x86 IPMI interface support!"
|
||||
enable_intf_lipmi=no
|
||||
fi],
|
||||
[enable_intf_lipmi=$have_lipmi])
|
||||
if test "x$enable_intf_lipmi" = "xstatic" || test "x$enable_intf_lipmi" = "xplugin"; then
|
||||
enable_intf_lipmi=yes
|
||||
fi
|
||||
if test "x$enable_intf_lipmi" = "xyes"; then
|
||||
AC_DEFINE(IPMI_INTF_LIPMI, [1], [Define to 1 to enable Solaris LIPMI interface.])
|
||||
AC_SUBST(INTF_LIPMI, [lipmi])
|
||||
AC_SUBST(INTF_LIPMI_LIB, [libintf_lipmi.la])
|
||||
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lipmi/libintf_lipmi.la"
|
||||
fi
|
||||
|
||||
AC_SUBST(IPMITOOL_INTF_LIB)
|
||||
|
||||
dnl check for readline library to enable ipmi shell
|
||||
have_readline=no
|
||||
AC_SEARCH_LIBS([readline], [readline], [have_readline=yes],
|
||||
[AC_CHECK_LIB([readline], [readline],
|
||||
[have_readline=yes], [], [-lcurses])])
|
||||
AC_ARG_ENABLE([ipmishell],
|
||||
[AC_HELP_STRING([--enable-ipmishell],
|
||||
[enable IPMI shell interface [default=yes]])],
|
||||
[], [enable_ipmishell=yes])
|
||||
if test "x$enable_ipmishell" = "xyes" && test "x$have_readline" = "xyes"; then
|
||||
AC_DEFINE(HAVE_READLINE, [1], [Define to 1 if readline present.])
|
||||
LIBS="$LIBS -lcurses -lreadline"
|
||||
fi
|
||||
|
||||
dnl enable IPMI Event Daemon
|
||||
AC_ARG_ENABLE([ipmievd],
|
||||
[AC_HELP_STRING([--enable-ipmievd],
|
||||
[enable IPMI Event daemon [default=yes]])],
|
||||
[], [enable_ipmievd=yes])
|
||||
AM_CONDITIONAL(IPMIEVD, [test "x$enable_ipmievd" = "xyes"])
|
||||
if test "x$enable_ipmievd" = "xyes"; then
|
||||
AC_SUBST(IPMIEVD_BIN, [ipmievd])
|
||||
fi
|
||||
|
||||
dnl Enable -Wall -Werror
|
||||
AC_ARG_ENABLE([buildcheck],
|
||||
[AC_HELP_STRING([--enable-buildcheck],
|
||||
[enable -Wall -Werror for build testing [default=no]])],
|
||||
[if test "x$enable_buildcheck" != "xno"; then
|
||||
CFLAGS="$CFLAGS -Wall -Werror"
|
||||
fi], [])
|
||||
|
||||
AC_SUBST(CFLAGS)
|
||||
|
||||
dnl Generate files for build
|
||||
AC_CONFIG_FILES([Makefile
|
||||
doc/Makefile
|
||||
contrib/Makefile
|
||||
control/Makefile
|
||||
control/pkginfo
|
||||
control/prototype
|
||||
control/ipmitool.spec
|
||||
lib/Makefile
|
||||
include/Makefile
|
||||
include/ipmitool/Makefile
|
||||
src/Makefile
|
||||
src/plugins/Makefile
|
||||
src/plugins/lan/Makefile
|
||||
src/plugins/lanplus/Makefile
|
||||
src/plugins/open/Makefile
|
||||
src/plugins/imb/Makefile
|
||||
src/plugins/lipmi/Makefile])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_RESULT([ipmitool $VERSION])
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_RESULT([Interfaces])
|
||||
AC_MSG_RESULT([ lan : $enable_intf_lan])
|
||||
AC_MSG_RESULT([ lanplus : $enable_intf_lanplus])
|
||||
AC_MSG_RESULT([ open : $enable_intf_open])
|
||||
AC_MSG_RESULT([ imb : $enable_intf_imb])
|
||||
AC_MSG_RESULT([ lipmi : $enable_intf_lipmi])
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_RESULT([Extra tools])
|
||||
AC_MSG_RESULT([ ipmievd : $enable_ipmievd])
|
||||
AC_MSG_RESULT([])
|
||||
|
39
ipmitool/contrib/Makefile.am
Normal file
39
ipmitool/contrib/Makefile.am
Normal file
@ -0,0 +1,39 @@
|
||||
# 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.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
dist_pkgdata_DATA = bmclanconf ipmi.init README \
|
||||
collect_data.sh create_rrds.sh create_webpage_compact.sh create_webpage.sh
|
||||
|
@ -29,6 +29,11 @@
|
||||
# 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.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
#
|
||||
|
||||
|
||||
# This script is designed for Sun Fire LX50, V60x and V65x systems.
|
||||
@ -243,7 +248,7 @@ case `uname -s` in
|
||||
Linux)
|
||||
if [ X$IFACE != X ]; then
|
||||
if [ X$IP_ADDRESS = X ]; then
|
||||
IP_ADDRESS=`$IFCONFIG $IFACE | grep "inet addr" | awk -F"[:[:space:]]+" '{print $4}'`
|
||||
IP_ADDRESS=`$IFCONFIG $IFACE | grep inet | awk -F"[:[:space:]]+" '{print $4}'`
|
||||
fi
|
||||
if [ X$IP_NETMASK = X ]; then
|
||||
IP_NETMASK=`$IFCONFIG $IFACE | grep Bcast | awk -F"[:[:space:]]+" '{print $8}'`
|
@ -5,7 +5,7 @@ echo "Setting up OpenIPMI driver..."
|
||||
# load the ipmi modules
|
||||
modprobe ipmi_msghandler
|
||||
modprobe ipmi_devintf
|
||||
if ! modprobe ipmi_si_drv ; then
|
||||
if ! modprobe ipmi_kcs_drv ; then
|
||||
modprobe ipmi_si # try new module name
|
||||
fi
|
||||
|
@ -27,11 +27,15 @@
|
||||
# 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.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
EXTRA_DIST = pkginfo.in prototype.in \
|
||||
ipmitool.spec.in
|
||||
EXTRA_DIST = pkginfo.in prototype.in ipmitool.spec.in \
|
||||
rpmrc rpmmacros
|
||||
|
||||
dist-hook: pkginfo prototype
|
||||
|
149
ipmitool/control/ipmitool.spec.in
Normal file
149
ipmitool/control/ipmitool.spec.in
Normal file
@ -0,0 +1,149 @@
|
||||
Name: ipmitool
|
||||
Summary: ipmitool - Utility for IPMI control
|
||||
Version: @VERSION@
|
||||
Release: 1%{?_distro:.%{_distro}}
|
||||
Copyright: BSD
|
||||
Group: Utilities
|
||||
Packager: Duncan Laurie <duncan@iceblink.org>
|
||||
Source: ipmitool-@VERSION@.tar.gz
|
||||
Buildroot: /var/tmp/ipmitool-root
|
||||
|
||||
%description
|
||||
This package contains a utility for interfacing with devices that support
|
||||
the Intelligent Platform Management Interface specification. IPMI is
|
||||
an open standard for machine health, inventory, and remote power control.
|
||||
|
||||
This utility can communicate with IPMI-enabled devices through either a
|
||||
kernel driver such as OpenIPMI or over the RMCP LAN protocol defined in
|
||||
the IPMI specification. IPMIv2 adds support for encrypted LAN
|
||||
communications and remote Serial-over-LAN functionality.
|
||||
|
||||
It provides commands for reading the Sensor Data Repository (SDR) and
|
||||
displaying sensor values, displaying the contents of the System Event
|
||||
Log (SEL), printing Field Replaceable Unit (FRU) information, reading and
|
||||
setting LAN configuration, and chassis power control.
|
||||
|
||||
%prep
|
||||
if [ "$RPM_BUILD_ROOT" ] && [ "$RPM_BUILD_ROOT" != "/" ]; then
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
fi
|
||||
|
||||
%setup
|
||||
|
||||
%build
|
||||
./configure --with-kerneldir \
|
||||
--prefix=%{_prefix} \
|
||||
--bindir=%{_bindir} \
|
||||
--datadir=%{_datadir} \
|
||||
--includedir=%{_includedir} \
|
||||
--libdir=%{_libdir} \
|
||||
--mandir=%{_mandir} \
|
||||
--sysconfdir=%{_sysconfdir}
|
||||
make
|
||||
|
||||
%install
|
||||
make DESTDIR=$RPM_BUILD_ROOT install-strip
|
||||
|
||||
%clean
|
||||
if [ "$RPM_BUILD_ROOT" ] && [ "$RPM_BUILD_ROOT" != "/" ]; then
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
fi
|
||||
rm -rf $RPM_BUILD_DIR/ipmitool-@VERSION@
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/*
|
||||
%{_datadir}/ipmitool/*
|
||||
%doc %{_mandir}/man1/*
|
||||
%doc %{_datadir}/doc/ipmitool/*
|
||||
|
||||
%changelog
|
||||
* Wed Aug 18 2004 <duncan@iceblink.org> 1.6.0-1
|
||||
- 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
|
||||
|
||||
* Sat May 27 2004 <duncan@iceblink.org> 1.5.9-1
|
||||
- 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
|
||||
|
||||
* Tue Jan 27 2004 <duncan@iceblink.org> 1.5.8-1
|
||||
- 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
|
||||
|
||||
* Mon Jan 5 2004 <duncan@iceblink.org> 1.5.7-1
|
||||
- add IPMIv1.5 eratta fixes
|
||||
- additions to FRU printing and FRU multirecords
|
||||
- better handling of SDR printing
|
||||
- contrib scripts for creating rrdtool graphs
|
||||
|
||||
* Thu Dec 4 2003 <duncan@iceblink.org> 1.5.6-1
|
||||
- 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
|
||||
|
||||
* Tue Nov 25 2003 <duncan@iceblink.org> 1.5.5-1
|
||||
- Add -U option for setting LAN username
|
||||
- Fix -v usage for plugin interfaces
|
||||
|
||||
* Fri Nov 14 2003 <duncan@iceblink.org> 1.5.4-1
|
||||
- pull interface plugin api into library
|
||||
- fix ipmievd
|
||||
|
||||
* Fri Oct 31 2003 <duncan@iceblink.org> 1.5.3-1
|
||||
- add -g optin for pedantic ipmi-over-lan communication
|
||||
|
||||
* Fri Oct 24 2003 <duncan@iceblink.org> 1.5.2-1
|
||||
- add gratuitous arp interval setting
|
||||
|
||||
* Wed Oct 8 2003 <duncan@iceblink.org> 1.5.1-1
|
||||
- better SEL support
|
||||
- fix display bug in SDR list
|
||||
|
||||
* Fri Sep 5 2003 <duncan@iceblink.org> 1.5.0-1
|
||||
- use automake/autoconf/libtool
|
||||
- dynamic loading interface plugins
|
||||
|
||||
* Wed May 28 2003 <duncan@iceblink.org> 1.4.0-1
|
||||
- make UDP packet handling more robust
|
||||
- fix imb driver support
|
||||
|
||||
* Thu May 22 2003 <duncan@iceblink.org> 1.3-1
|
||||
- update manpage
|
||||
- rework of low-level network handling
|
||||
- add basic imb driver support
|
||||
|
||||
* Wed Apr 2 2003 <duncan@iceblink.org> 1.2-1
|
||||
- change command line option parsing
|
||||
- support for more chassis commands
|
||||
|
||||
* Tue Apr 1 2003 <duncan@iceblink.org> 1.1-1
|
||||
- minor fixes.
|
||||
|
||||
* Sun Mar 30 2003 <duncan@iceblink.org> 1.0-1
|
||||
- Initial release.
|
||||
|
@ -4,7 +4,7 @@ ARCH="@ARCH@"
|
||||
VERSION="@VERSION@"
|
||||
CATEGORY="system"
|
||||
VENDOR="Duncan Laurie"
|
||||
EMAIL="duncan@iceblink.org"
|
||||
EMAIL="duncan@sun.com"
|
||||
PSTAMP="@PSTAMP@"
|
||||
BASEDIR="@BASEDIR@"
|
||||
CLASSES="none"
|
@ -1,12 +1,7 @@
|
||||
i pkginfo
|
||||
d none bin ? ? ?
|
||||
f none bin/@PACKAGE@=../src/@PACKAGE@ 0755 root bin
|
||||
d none sbin ? ? ?
|
||||
f none sbin/ipmievd=../src/ipmievd 0755 root bin
|
||||
d none share ? ? ?
|
||||
d none share/man ? ? ?
|
||||
d none share/man/man1 ? ? ?
|
||||
f none share/man/man1/@PACKAGE@.1=../doc/@PACKAGE@.1 0644 root bin
|
||||
d none share/man/man8 ? ? ?
|
||||
f none share/man/man8/ipmievd.8=../doc/ipmievd.8 0644 root bin
|
||||
|
11
ipmitool/control/rpmmacros
Normal file
11
ipmitool/control/rpmmacros
Normal file
@ -0,0 +1,11 @@
|
||||
%_topdir %(echo $BUILDDIR)
|
||||
%_sourcedir %{_topdir}/..
|
||||
%_specdir %{_sourcedir}
|
||||
%_tmppath %{_topdir}/tmp
|
||||
%_builddir %{_topdir}/BUILD
|
||||
%_buildroot %{_topdir}/%{_tmppath}/%{name}-%{version}-root
|
||||
%_rpmdir %{_topdir}/RPMS
|
||||
%_srcrpmdir %{_topdir}/SRPMS
|
||||
%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
|
||||
%packager duncan@iceblink.org
|
||||
%distribution Sourceforge Build
|
1
ipmitool/control/rpmrc
Normal file
1
ipmitool/control/rpmrc
Normal file
@ -0,0 +1 @@
|
||||
macrofiles: /usr/lib/rpm/macros:/usr/lib/rpm/%{_target}/macros:/etc/rpm/macros.specspo:/etc/rpm/macros:/etc/rpm/%{_target}/macros:%(echo $CONFIGDIR)/rpmmacros
|
123
ipmitool/debian/changelog
Normal file
123
ipmitool/debian/changelog
Normal file
@ -0,0 +1,123 @@
|
||||
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@sun.com> 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@sun.com> 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@sun.com> 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@sun.com> 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@sun.com> 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@sun.com> 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@sun.com> 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@sun.com> 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@sun.com> 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@sun.com> 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@sun.com> Wed, 2 Apr 2003 17:44:17 -0700
|
||||
|
||||
ipmitool (1.1-1) unstable; urgency=low
|
||||
|
||||
* Minor fixes.
|
||||
|
||||
-- Duncan Laurie <duncan@sun.com> Tue, 1 Apr 2003 14:31:10 -0700
|
||||
|
||||
ipmitool (1.0-1) unstable; urgency=low
|
||||
|
||||
* Initial Release.
|
||||
|
||||
-- Duncan Laurie <duncan@sun.com> Sun, 30 Mar 2003 21:30:46 -0700
|
||||
|
12
ipmitool/debian/control
Normal file
12
ipmitool/debian/control
Normal file
@ -0,0 +1,12 @@
|
||||
Source: ipmitool
|
||||
Section: contrib
|
||||
Priority: optional
|
||||
Maintainer: Duncan Laurie <duncan@iceblink.org>
|
||||
Build-Depends: debhelper (>> 3.0.0)
|
||||
Standards-Version: 3.5.8
|
||||
|
||||
Package: ipmitool
|
||||
Architecture: i386 amd64
|
||||
Provides: ipmitool
|
||||
Description: Utility for IPMI control with kernel driver or LAN interface
|
||||
|
38
ipmitool/debian/copyright
Normal file
38
ipmitool/debian/copyright
Normal file
@ -0,0 +1,38 @@
|
||||
ipmitool
|
||||
Duncan Laurie <duncan@sun.com>
|
||||
http://www.iceblink.org/ipmitool/
|
||||
|
||||
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.
|
||||
|
||||
You acknowledge that this software is not designed or intended for use
|
||||
in the design, construction, operation or maintenance of any nuclear
|
||||
facility.
|
||||
|
3
ipmitool/debian/dirs
Normal file
3
ipmitool/debian/dirs
Normal file
@ -0,0 +1,3 @@
|
||||
usr/bin
|
||||
usr/share/ipmitool
|
||||
usr/share/doc/ipmitool
|
4
ipmitool/debian/docs
Normal file
4
ipmitool/debian/docs
Normal file
@ -0,0 +1,4 @@
|
||||
README
|
||||
COPYING
|
||||
AUTHORS
|
||||
ChangeLog
|
115
ipmitool/debian/rules
Executable file
115
ipmitool/debian/rules
Executable file
@ -0,0 +1,115 @@
|
||||
#!/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
|
||||
./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 config-stamp
|
||||
|
||||
# Add here commands to clean up after the build process.
|
||||
-$(MAKE) clean
|
||||
|
||||
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
|
||||
|
||||
# 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_installdebconf
|
||||
dh_installdocs
|
||||
# dh_installexamples
|
||||
# dh_installmenu
|
||||
# dh_installemacsen
|
||||
# dh_installpam
|
||||
# dh_installinit
|
||||
# dh_installcron
|
||||
# dh_installmanpages
|
||||
# dh_installinfo
|
||||
# dh_undocumented
|
||||
# dh_installchangelogs
|
||||
dh_link
|
||||
dh_strip
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
# You may want to make some executables suid here.
|
||||
# dh_suidregister
|
||||
dh_makeshlibs
|
||||
dh_installdeb
|
||||
# dh_perl
|
||||
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
|
||||
|
@ -27,10 +27,14 @@
|
||||
# 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.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
man_MANS = ipmitool.1 ipmievd.8
|
||||
man_MANS = ipmitool.1
|
||||
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
|
540
ipmitool/doc/ipmitool.1
Normal file
540
ipmitool/doc/ipmitool.1
Normal file
@ -0,0 +1,540 @@
|
||||
.TH "ipmitool" "1" "" "Duncan Laurie" ""
|
||||
.SH "NAME"
|
||||
.LP
|
||||
ipmitool \- utility for controlling IPMI-enabled devices
|
||||
.SH "SYNOPSIS"
|
||||
.LP
|
||||
ipmitool [\fB\-ghcvV\fR] \fB\-I\fR \fIlan\fP \fB\-H\fR \fIhostname\fP [\fB\-L\fR \fIprivlvl\fP] [\fB\-a\fR|\fB\-E\fR|\fB\-P\fR \fIpassword\fP] <\fIexpression\fP>
|
||||
.LP
|
||||
ipmitool [\fB\-ghcvV\fR] \fB\-I\fR \fIlanplus\fP \fB\-H\fR \fIhostname\fP [\fB\-L\fR \fIprivlvl\fP] [\fB\-a\fR|\fB\-E\fR|\fB\-P\fR \fIpassword\fP] <\fIexpression\fP>
|
||||
.LP
|
||||
ipmitool [\fB\-ghcvV\fR] \fB\-I\fR \fIopen\fP <\fIexpression\fP>
|
||||
.SH "DESCRIPTION"
|
||||
.LP
|
||||
This program lets you manage Intelligent Platform Management Interface
|
||||
(IPMI) functions of either the local system, via a kernel device driver,
|
||||
or a remote system, using IPMI V1.5 . These functions include printing
|
||||
FRU information, LAN configuration, sensor readings, and remote chassis
|
||||
power control.
|
||||
.SH "OPTIONS"
|
||||
.LP
|
||||
.TP
|
||||
\fB\-h\fR
|
||||
Get basic usage help from the command line.
|
||||
.TP
|
||||
\fB\-c\fR
|
||||
Display output with comma field separator instead of spaces. Not available with all commands.
|
||||
.TP
|
||||
\fB\-V\fR
|
||||
Display version information.
|
||||
.TP
|
||||
\fB\-v\fR
|
||||
Increase verbose output level. This option may be specified multiple times to increase the level of debug output.
|
||||
.TP
|
||||
\fB\-I\fR <\fIinterface\fP>
|
||||
Selects IPMI interface to use. Possible interfaces are \fIlan\fP, \fIlanplus\fP or \fIopen\fP.
|
||||
.TP
|
||||
\fB\-H\fR <\fIaddress\fP>
|
||||
Remote server address, can be IP address or hostname. This option is required for the LAN interface connection.
|
||||
.TP
|
||||
\fB\-U\fR <\fIusername\fP>
|
||||
Remote username, default is NULL user.
|
||||
.TP
|
||||
\fB\-L\fR <\fIprivlvl\fP>
|
||||
Force sessin privilege level. Can be CALLBACK, USER, OPERATOR, ADMIN. Default is USER.
|
||||
.TP
|
||||
\fB\-a\fR
|
||||
Promt for the remote server password, 16 character maximum. This is optional for the LAN interface, if a password is not provided the session will not be authenticated.
|
||||
.TP
|
||||
\fB\-E\fR
|
||||
The remote server password is specified by the environment variable \fBIPMI_PASSWORD\fR. This option is intended for shell scripts.
|
||||
.TP
|
||||
\fB\-f\fR <\fIfile\fP>
|
||||
Read remote server password from file.
|
||||
.TP
|
||||
\fB\-P\fR <\fIpassword\fP>
|
||||
Remote server password. \fBNote!\fR Specifying the password as a commandline option is not recommended since it will be visible in the process list.
|
||||
.SH "EXPRESSIONS"
|
||||
.LP
|
||||
.TP
|
||||
.I help
|
||||
This can be used to get command-line help on ipmitool commands. It may also be placed at the end of commands to get option usage help.
|
||||
.RS
|
||||
.PP
|
||||
ipmitool -I open help
|
||||
.br
|
||||
Commands: bmc, chassis, event, fru, lan, raw, sdr, sel, sensor, sol, isol, userinfo, channel
|
||||
.LP
|
||||
.PP
|
||||
ipmitool -I open chassis help
|
||||
.br
|
||||
Chassis Commands: status, power, identify, policy, restart_cause, poh
|
||||
.LP
|
||||
.PP
|
||||
ipmitool -I open chassis power help
|
||||
.br
|
||||
Chassis Power Commands: status, on, off, cycle, reset, diag, soft
|
||||
.LP
|
||||
.RE
|
||||
.TP
|
||||
\fIraw\fP <\fBnetfn\fR> <\fBcmd\fR> [\fBdata\fR]
|
||||
This will allow you to execute raw IPMI commands. For example to query the POH counter with a raw command:
|
||||
.RS
|
||||
.PP
|
||||
ipmitool -v -I open raw 0x0 0xf
|
||||
.br
|
||||
RAW REQ (netfn=0x0 cmd=0xf data_len=0)
|
||||
.br
|
||||
RAW RSP (5 bytes)
|
||||
.br
|
||||
3c 72 0c 00 00
|
||||
.LP
|
||||
.RE
|
||||
.TP
|
||||
.I channel
|
||||
.RS
|
||||
.TP
|
||||
\fIauthcap\fP <\fBchannel number\fR> <\fBmax priv\fR>
|
||||
This command will display information about the authentication capabilities of the slected channel at the specified privelige level.
|
||||
.RS
|
||||
.TP
|
||||
Possible privelige levels are:
|
||||
.br
|
||||
1 Callback level
|
||||
.br
|
||||
2 User level
|
||||
.br
|
||||
3 Operator level
|
||||
.br
|
||||
4 Administrator level
|
||||
.br
|
||||
5 OEM Proprietary level
|
||||
.LP
|
||||
.RE
|
||||
.TP
|
||||
\fIinfo\fP [\fBchannel number\fR]
|
||||
This command will display information about the selected channel. If no channel is given it will display information about the currently used channel:
|
||||
.RS
|
||||
.PP
|
||||
ipmitool -I open chaninfo
|
||||
.br
|
||||
Channel 0xf info:
|
||||
.br
|
||||
Channel Medium Type : System Interface
|
||||
.br
|
||||
Channel Protocol Type : KCS
|
||||
.br
|
||||
Session Support : session-less
|
||||
.br
|
||||
Active Session Count : 0
|
||||
.br
|
||||
Protocol Vendor ID : 7154
|
||||
.LP
|
||||
.RE
|
||||
.TP
|
||||
\fIuser\fP <\fBchannel number\fR> [\fBuser number\fR]
|
||||
This command will display information about configured user information on a specific LAN channel. This command will fail on system interfaces.
|
||||
.RS
|
||||
.PP
|
||||
ipmitool -I open channel user 6
|
||||
.br
|
||||
Maximum User IDs : 4
|
||||
.br
|
||||
Enabled User IDs : 1
|
||||
.br
|
||||
Fixed Name User IDs : 1
|
||||
.br
|
||||
Access Available : call-in / callback
|
||||
.br
|
||||
Link Authentication : disabled
|
||||
.br
|
||||
IPMI Messaging : enabled
|
||||
.LP
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
.I chassis
|
||||
.RS
|
||||
.TP
|
||||
.I status
|
||||
This command returns information about the high-level status of the system chassis and main power subsystem.
|
||||
.TP
|
||||
.I poh
|
||||
This command will return the Power-On Hours counter.
|
||||
.TP
|
||||
\fIidentify\fP <\fBinterval\fR>
|
||||
Control the front panel identify light. Default is 15. Use 0 to turn off.
|
||||
.TP
|
||||
.I restart_cause
|
||||
Query the chassis for the cause of the last system restart.
|
||||
.TP
|
||||
.I policy
|
||||
Set the chassis power policy in the event power failure.
|
||||
.RS
|
||||
.TP
|
||||
.I list
|
||||
Return supported policies.
|
||||
.TP
|
||||
.I always-on
|
||||
Turn on when power is restored.
|
||||
.TP
|
||||
.I previous
|
||||
Returned to previous state when power is restored.
|
||||
.TP
|
||||
.I always-off
|
||||
Stay off after power is restored.
|
||||
.RE
|
||||
.TP
|
||||
.I power
|
||||
Performs a chassis control command to view and change the power state.
|
||||
.RS
|
||||
.TP
|
||||
.I status
|
||||
Show current chassis power status.
|
||||
.TP
|
||||
.I on
|
||||
Power up chassis.
|
||||
.TP
|
||||
.I off
|
||||
Power down chassis into soft off (S4/S5 state). WARNING: this command does not initiate a clean shutdown of the operating system prior to powering down the system.
|
||||
.TP
|
||||
.I cycle
|
||||
This command provides a power off interval of at least 1 second. No action should occur if chassis power is in S4/S5 state, but it is recommended to check power state first and only issue a power cycle command if the system power is on or in lower sleep state than S4/S5.
|
||||
.TP
|
||||
.I reset
|
||||
This command will perform a hard reset.
|
||||
.TP
|
||||
.I diag
|
||||
Pulse a version of a diagnostic interrupt (NMI) that goes directly to the processor(s).
|
||||
.TP
|
||||
.I soft
|
||||
Initiate a soft\-shutdown of OS via ACPI by emulating a fatal overtemperature.
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
.I lan
|
||||
.RS
|
||||
.TP
|
||||
\fIprint\fP <\fBchannel\fR>
|
||||
Print the current configuration for the given channel.
|
||||
.TP
|
||||
\fIset\fP <\fBchannel\fR> <\fBparameter\fR>
|
||||
Set the given parameter on the given channel. Valid parameters are:
|
||||
.RS
|
||||
.TP
|
||||
\fIipaddr\fP <\fBx.x.x.x\fR>
|
||||
Set the IP address for this channel.
|
||||
.TP
|
||||
\fInetmask\fP <\fBx.x.x.x\fR>
|
||||
Set the netmask for this channel.
|
||||
.TP
|
||||
\fImacaddr\fP <\fBxx:xx:xx:xx:xx:xx\fR>
|
||||
Set the MAC adddress for this channel.
|
||||
.TP
|
||||
\fIdefgw\fP \fIipaddr\fP <\fBx.x.x.x\fR>
|
||||
Set the default gateway IP address.
|
||||
.TP
|
||||
\fIdefgw\fP \fImacaddr\fP <\fBxx:xx:xx:xx:xx:xx\fR>
|
||||
Set the default gateway MAC address.
|
||||
.TP
|
||||
\fIbakgw\fP \fIipaddr\fP <\fBx.x.x.x\fR>
|
||||
Set the backup gateway IP address.
|
||||
.TP
|
||||
\fIbakgw\fP \fImacaddr\fP <\fBxx:xx:xx:xx:xx:xx\fR>
|
||||
Set the backup gateway MAC address.
|
||||
.TP
|
||||
\fIpassword\fP <\fBpass\fR>
|
||||
Set the null user password.
|
||||
.TP
|
||||
\fIsnmp\fP <\fBcommunity string\fR>
|
||||
Set the SNMP community string.
|
||||
.TP
|
||||
\fIuser\fP
|
||||
Enable user access mode.
|
||||
.TP
|
||||
\fIaccess\fP <\fBon|off\fR>
|
||||
Set LAN channel access mode.
|
||||
.TP
|
||||
\fIipsrc\fP <\fBsource\fR>
|
||||
Set the IP address source:
|
||||
.br
|
||||
none = unspecified
|
||||
.br
|
||||
static = manually configured static IP address
|
||||
.br
|
||||
dhcp = address obtained by BMC running DHCP
|
||||
.br
|
||||
bios = address loaded by BIOS or system software
|
||||
.TP
|
||||
\fIarp\fP \fIrespond\fP <\fBon|off\fR>
|
||||
Set BMC generated ARP responses.
|
||||
.TP
|
||||
\fIarp\fP \fIgenerate\fP <\fBon|off\fR>
|
||||
Set BMC generated gratuitous ARPs.
|
||||
.TP
|
||||
\fIarp\fP \fIinterval\fP <\fBseconds\fR>
|
||||
Set BMC generated gratuitous ARP interval.
|
||||
.TP
|
||||
\fIauth\fP <\fBlevel,...\fR> <\fBtype,...\fR>
|
||||
Set the valid authtypes for a given auth level.
|
||||
.RS
|
||||
Levels:
|
||||
.B callback
|
||||
.B user
|
||||
.B operator
|
||||
.B admin
|
||||
.br
|
||||
Types:
|
||||
.B none
|
||||
.B md2
|
||||
.B md5
|
||||
.B key
|
||||
.RE
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
.I fru
|
||||
.RS
|
||||
.TP
|
||||
.I print
|
||||
This command will read all Field Replacable Unit inventory data and extract such information as serial number, part number, asset tags, and short strings describing the chassis, board, or product.
|
||||
.RE
|
||||
.TP
|
||||
.I sdr
|
||||
.RS
|
||||
.TP
|
||||
.I info
|
||||
This command will query the BMC for information about the SDR.
|
||||
.TP
|
||||
.I list
|
||||
This command will read the SDR and extract sensor information, then query each sensor and print its name, reading, and status.
|
||||
.RE
|
||||
.TP
|
||||
.I sensor
|
||||
.RS
|
||||
.TP
|
||||
.I list
|
||||
This command will list sensors and thresholds in a wide table format.
|
||||
.TP
|
||||
\fIget\fP <\fBid\fR> ... [\fBid\fR]
|
||||
This command will print info for sensors specified by name.
|
||||
.TP
|
||||
\fIthresh\fP <\fBid\fR> <\fBthreshold\fR> <\fBsetting\fR>
|
||||
This allows you to set a particular sensor threshold value. The sensor is specified by name.
|
||||
.RS
|
||||
.TP
|
||||
Valid thresholds are:
|
||||
.br
|
||||
unr Upper Non-Recoverable
|
||||
.br
|
||||
ucr Upper Critical
|
||||
.br
|
||||
unc Uperr Non-Critical
|
||||
.br
|
||||
lnc Lower Non-Critical
|
||||
.br
|
||||
lcr Lower Critical
|
||||
.br
|
||||
lnr Lower Non-Recoverable
|
||||
.LP
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
.I sel
|
||||
.RS
|
||||
.TP
|
||||
.I info
|
||||
This command will query the BMC for information about the SEL and its contents.
|
||||
.TP
|
||||
.I clear
|
||||
This command will clear the contents of the SEL. It cannot be undone so be careful.
|
||||
.TP
|
||||
.I list
|
||||
This command will list the contents of the SEL.
|
||||
.RE
|
||||
.TP
|
||||
.I session
|
||||
.RS
|
||||
.TP
|
||||
\fIinfo\fP <\fBparameter\fR> [\fBargument\fR]
|
||||
This command will query the BMC for information about its session capabilities and current sessions. Valid parameters are:
|
||||
.RS
|
||||
.TP
|
||||
\fIactive\fP
|
||||
Queries the BMC for information about the current session. That is, the session used to execute this command.
|
||||
.TP
|
||||
\fIall\fP
|
||||
Queries the BMC for information about all active sessions
|
||||
.TP
|
||||
\fIid\fP <\fBid\fR>
|
||||
Queries the BMC for information about the session with the specified ID. The ID should be specified in hex.
|
||||
.TP
|
||||
\fIhandle\fP <\fBhandle\fR>
|
||||
Queries the BMC for information about the session with the specified handle. The handle should be specified in hex.
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
.I sol
|
||||
.RS
|
||||
.TP
|
||||
\fIinfo\fP [\fBchannel\fR]
|
||||
Retrieve information about the Serial-Over-LAN configuration on the specified channel. If no channel is given, it will display SOL configuration data for the currently used channel.
|
||||
.RE
|
||||
.RS
|
||||
.TP
|
||||
\fIset\fP <\fBparameter\fR> <\fBvalue\fR> [\fBchannel\fR]
|
||||
Configure parameters for Serial Over Lan. If no channel is given, it will display SOL configuration data for the currently used channel. Configuration parameter updates are automatically guarded with the updates to the set-in-progress parameter.
|
||||
.RS
|
||||
.TP
|
||||
Valid parameters and values are:
|
||||
.br
|
||||
.TP
|
||||
set-in-progress
|
||||
set-complete set-in-progress commit-write
|
||||
.TP
|
||||
enabled
|
||||
true false
|
||||
.TP
|
||||
force-encryption
|
||||
true false
|
||||
.TP
|
||||
force-authentication
|
||||
true false
|
||||
.TP
|
||||
privilege-level
|
||||
user operator admin oem
|
||||
.TP
|
||||
character-accumulate-level
|
||||
Decimal number given in 5 milliseconds increments
|
||||
.TP
|
||||
character-send-threshold
|
||||
Decimal number
|
||||
.TP
|
||||
retry-count
|
||||
Decimal number. 0 indicates no retries after packet is transmitted.
|
||||
.TP
|
||||
retry-interval
|
||||
Decimal number in 10 millisend increments. 0 indicates that retries should be sent back to back.
|
||||
.TP
|
||||
non-volatile-bit-rate
|
||||
serial, 19.2, 38.4, 57.6, 115.2. Setting this value to serial indiates that the BMC should use the setting used by the IPMI over serial channel.
|
||||
.TP
|
||||
volatile-bit-rate
|
||||
serial, 19.2, 38.4, 57.6, 115.2. Setting this value to serial indiates that the BMC should use the setting used by the IPMI over serial channel.
|
||||
.LP
|
||||
.RE
|
||||
.RE
|
||||
.RS
|
||||
.TP
|
||||
.I activate
|
||||
This command causes ipmitool to enter Serial Over LAN mode, and is only available when using the lanplus interface. An RMCP+ connection is made to the BMC, the terminal is set to raw mode, and user input is sent to the serial console on the remote server. On exit, the the SOL payload mode is deactivated and the terminal is reset to its original settings.
|
||||
.RS
|
||||
.TP
|
||||
Special escape sequences are provided to control the SOL session:
|
||||
~. Terminate connection
|
||||
.br
|
||||
~^Z Suspend ipmitool
|
||||
.br
|
||||
~B Send break
|
||||
.br
|
||||
~~ Send the escape character by typing it twice
|
||||
.br
|
||||
~? Print the supported escape sequences
|
||||
.LP
|
||||
.RE
|
||||
.RE
|
||||
.RS
|
||||
.TP
|
||||
.I deactivate
|
||||
This command deactives Serial Over LAN mode on the BMC. Exiting Serial Over LAN mode should automatically cause this command to be sent to the BMC, but in the case of an unintentional exit from SOL mode, this command may be necessary to reset the state the BMC.
|
||||
.RE
|
||||
.RE
|
||||
.I isol
|
||||
.RS
|
||||
.TP
|
||||
.I setup
|
||||
Setup Serial-over-LAN: enable, setup authentication and set baud rate to 19200. This sub-command is specific to Intel motherboards.
|
||||
.RE
|
||||
.SH "OPEN INTERFACE"
|
||||
.LP
|
||||
The ipmitool \fIopen\fP interface utilizes the MontaVista OpenIPMI kernel device driver. This driver is present in 2.5.57 and later development kernels and in 2.4.21pre1 and later stable kernels. There are also IPMI driver kernel patches for different versions available from the OpenIPMI homepage.
|
||||
.LP
|
||||
The following kernel modules must be loaded in order for ipmitool to work:
|
||||
.TP
|
||||
.B ipmi_msghandler
|
||||
Incoming and outgoing message handler for IPMI interfaces.
|
||||
.TP
|
||||
.B ipmi_kcs_drv
|
||||
An IPMI Keyboard Controler Style (KCS) interface driver for the message handler.
|
||||
.TP
|
||||
.B ipmi_devintf
|
||||
Linux character device interface for the message handler.
|
||||
.LP
|
||||
Once they are loaded there will be a dynamic char device entry that must exist at \fB/dev/ipmi0\fR. Usually if this is the first dynamic device it will be major number \fB254\fR and minor number \fB0\fR so you would create the dev entry with:
|
||||
.LP
|
||||
.I mknod /dev/ipmi0 c 254 0
|
||||
.LP
|
||||
In order to force ipmitool to make use of the OpenIPMI device interface you can specifiy it on the command line:
|
||||
.PP
|
||||
ipmitool \-I open <expression>
|
||||
.SH "LIPMI INTERFACE"
|
||||
.LP
|
||||
The ipmitool \fIlipmi\fP interface uses the Solaris x86 IPMI kernel device driver.
|
||||
.LP
|
||||
You can tell ipmitool to use the Solaris IPMI driver with the \fB-I\fR option:
|
||||
.PP
|
||||
ipmitool \-I lipmi <expression>
|
||||
.SH "LAN INTERFACE"
|
||||
.LP
|
||||
The ipmitool \fIlan\fP interface communicates with the BMC over an Ethernet LAN connection using UDP under IPv4. UDP datagrams are formatted to contain IPMI request/response messages with a IPMI session headers and RMCP headers.
|
||||
.LP
|
||||
IPMI\-over\-LAN uses version 1 of the Remote Management Control Protocol (RMCP) to support \fIpre\-OS\fP and \fIOS\-absent\fP management. RMCP is a request\-response protocol delivered using UDP datagrams to port 623.
|
||||
.LP
|
||||
The LAN interface is an authenticatiod multi\-session connection; messages delivered to the BMC can (and should) be authenticated with a challenge/response protocol with either straight password/key or MD5 message\-digest algorithm. ipmitool will attempt to connect with administrator privilege level as this is required to perform chassis power functions.
|
||||
.LP
|
||||
You can tell ipmitool to use the lan interface with the \fB\-I\fR option:
|
||||
.PP
|
||||
ipmitool \-I lan \-H <hostname> [\-U username] [\-P password] <expression>
|
||||
.LP
|
||||
A hostname \fBmust\fR be given on the command line in order to use the lan interface with ipmitool. The password field is optional; if you do not provide a password on the command line ipmitool will attempt to connect without authentication. If you specify a password it will use MD5 authentication if supported by the BMC and straight password/key otherwise.
|
||||
.SH "LANPLUS INTERFACE"
|
||||
.LP
|
||||
Like the \fIlan\fP inteface, the \fIlanplus\fP interface communicates with the BMC over an Ethernet LAN connection using UDP under IPv4. The difference is that the \fIlanplus\fP interface uses the RMCP+ protocol as described in the IMPI v2.0 specification. RMCP+ allows for improved authentication and data integrity checks, as well as encryption and the ability to carry multiple types of payloads. Generic Serial Over LAN support requires RMCP+, so the ipmitool \fIsol activate\fP command requires the use of the \fIlanplus\fP interface.
|
||||
.LP
|
||||
RMCP+ session establishment uses a protocol call RAKP (Remote Authenticated Key-Exchange Protocol) which allows the negotiation of many options. ipmitool does not yet allow the user to specify the value of every option, defaulting to the most obvious settings, marked as required in the v2.0 specification. Authentication and integrity HMACS are produced with SHA1, and encryption is performed with AES-CBC-128. Role-level logins are not supported. ipmitool must be configured with the appropriate option for the \fIlanplus\fP interface to be available, as it is not enabled by default. This interface currently requires the OpenSSL library.
|
||||
.LP
|
||||
You can tell ipmitool to use the lanplus interface with the \fB\-I\fR option:
|
||||
.PP
|
||||
ipmitool \-I lanplus \-H <hostname> [\-U username] [\-P password] <expression>
|
||||
.LP
|
||||
The options available for the \fIlanplus\fP inteface are identical to those available for the \fIlan\fP inteface.
|
||||
.SH "FILES"
|
||||
.TP
|
||||
.I /dev/ipmi0
|
||||
This character device file is used by the OpenIPMI kernel driver.
|
||||
.SH "EXAMPLES"
|
||||
.LP
|
||||
If you want to remotely control the power of an IPMI\-over\-LAN enabled system you can use:
|
||||
.LP
|
||||
ipmitool \-I lan \-H 192.168.1.1 \-P password chassis power on
|
||||
.br
|
||||
Chassis Power Control: Up/On
|
||||
.LP
|
||||
ipmitool \-I lan \-H 192.168.1.1 \-P password chassis power status
|
||||
.br
|
||||
Chassis Power is on
|
||||
.SH "AUTHOR"
|
||||
.LP
|
||||
Duncan Laurie <duncan@iceblink.org>
|
||||
.SH "SEE ALSO"
|
||||
.LP
|
||||
.TP
|
||||
IPMItool Homepage
|
||||
http://ipmitool.sourceforge.net
|
||||
.TP
|
||||
Intelligent Platform Management Interface Specification
|
||||
http://www.intel.com/design/servers/ipmi/spec.htm
|
||||
.TP
|
||||
OpenIPMI project (MontaVista IPMI kernel driver)
|
||||
http://openipmi.sourceforge.net
|
||||
|
@ -27,6 +27,10 @@
|
||||
# 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.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
@ -27,15 +27,16 @@
|
||||
# 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.
|
||||
#
|
||||
# You acknowledge that this software is not designed or intended for use
|
||||
# in the design, construction, operation or maintenance of any nuclear
|
||||
# facility.
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
dist_pkgdata_DATA = oem_ibm_sel_map
|
||||
noinst_HEADERS = log.h bswap.h helper.h ipmi.h ipmi_intf.h \
|
||||
ipmi_chassis.h ipmi_entity.h ipmi_fru.h ipmi_lanp.h \
|
||||
ipmi_sdr.h ipmi_sel.h ipmi_sol.h ipmi_bmc.h ipmi_raw.h \
|
||||
ipmi_channel.h ipmi_sensor.h ipmi_event.h ipmi_session.h \
|
||||
ipmi_strings.h ipmi_constants.h ipmi_isol.h ipmi_user.h
|
||||
|
||||
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
|
@ -28,17 +28,19 @@
|
||||
* 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.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef IPMI_BSWAP_H
|
||||
#define IPMI_BSWAP_H
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#undef BSWAP_16
|
||||
#undef BSWAP_32
|
||||
|
||||
#if HAVE_BYTESWAP_H
|
||||
# include <byteswap.h>
|
||||
# define BSWAP_16(x) bswap_16(x)
|
||||
@ -48,3 +50,5 @@
|
||||
# define BSWAP_32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) |\
|
||||
(((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
|
||||
#endif
|
||||
|
||||
#endif /* IPMI_BSWAP_H */
|
@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Kontron Canada, Inc. All Rights Reserved.
|
||||
*
|
||||
* Base on code from
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -31,35 +28,41 @@
|
||||
* 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.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef IPMI_HELPER_H
|
||||
#define IPMI_HELPER_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_fru.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define RTM_FRU_FILE 0x00
|
||||
#define A1_AMC_FRU_FILE 0x01
|
||||
#define A2_AMC_FRU_FILE 0x02
|
||||
#define A3_AMC_FRU_FILE 0x03
|
||||
#define A4_AMC_FRU_FILE 0x04
|
||||
#define B1_AMC_FRU_FILE 0x05
|
||||
#define B2_AMC_FRU_FILE 0x06
|
||||
#define B3_AMC_FRU_FILE 0x07
|
||||
#define B4_AMC_FRU_FILE 0x08
|
||||
#define ON_CARRIER_FRU_FILE 0x09
|
||||
#define CONFIG_FILE 0x0A
|
||||
#define SHELF_MANAGER_FRU_FILE 0x0B
|
||||
struct valstr {
|
||||
unsigned short val;
|
||||
const char * str;
|
||||
};
|
||||
const char * val2str(unsigned short val, const struct valstr * vs);
|
||||
unsigned short str2val(const char * str, const struct valstr * vs);
|
||||
|
||||
#define MIN_ARGUMENT 0x02
|
||||
#define RTM_IPMB_L 0x90
|
||||
unsigned short buf2short(unsigned char * buf);
|
||||
uint32_t buf2long(unsigned char * buf);
|
||||
const char * buf2str(unsigned char * buf, int len);
|
||||
void printbuf(const unsigned char * buf, int len, const char * desc);
|
||||
void signal_handler(int sig, void * handler);
|
||||
unsigned char ipmi_csum(unsigned char * d, int s);
|
||||
FILE * ipmi_open_file(const char * file, int flags);
|
||||
|
||||
#define MAX_FILE_NUMBER 8
|
||||
/* this voltag is specified in AMC.0 specification Table 3-10 */
|
||||
#define AMC_VOLTAGE 12 /*volts*/
|
||||
#define ipmi_open_file_read(file) ipmi_open_file(file, 0)
|
||||
#define ipmi_open_file_write(file) ipmi_open_file(file, 1)
|
||||
|
||||
#define SIZE_OF_GUID 16
|
||||
#define FRU_RADIAL_IPMB0_LINK_MAPPING 0x15
|
||||
#define SIG_IGNORE(s) ((void)signal((s), SIG_IGN))
|
||||
#define SIG_DEFAULT(s) ((void)signal((s), SIG_DFL))
|
||||
#define SIG_HANDLE(s,h) ((void)signal_handler((s), (h)))
|
||||
|
||||
#define min(a, b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
#endif /* IPMI_HELPER_H */
|
||||
|
||||
int ipmi_ekanalyzer_main(struct ipmi_intf *, int, char **);
|
247
ipmitool/include/ipmitool/ipmi.h
Normal file
247
ipmitool/include/ipmitool/ipmi.h
Normal file
@ -0,0 +1,247 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_H
|
||||
#define IPMI_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <netinet/in.h>
|
||||
#include <ipmitool/helper.h>
|
||||
|
||||
#define IPMI_BUF_SIZE 1024
|
||||
|
||||
/* From table 13.16 of the IPMI v2 specification */
|
||||
#define IPMI_PAYLOAD_TYPE_IPMI 0x00
|
||||
#define IPMI_PAYLOAD_TYPE_SOL 0x01
|
||||
#define IPMI_PAYLOAD_TYPE_RMCP_OPEN_REQUEST 0x10
|
||||
#define IPMI_PAYLOAD_TYPE_RMCP_OPEN_RESPONSE 0x11
|
||||
#define IPMI_PAYLOAD_TYPE_RAKP_1 0x12
|
||||
#define IPMI_PAYLOAD_TYPE_RAKP_2 0x13
|
||||
#define IPMI_PAYLOAD_TYPE_RAKP_3 0x14
|
||||
#define IPMI_PAYLOAD_TYPE_RAKP_4 0x15
|
||||
|
||||
|
||||
extern int verbose;
|
||||
extern int csv_output;
|
||||
|
||||
struct ipmi_rq {
|
||||
struct {
|
||||
unsigned char netfn;
|
||||
unsigned char cmd;
|
||||
unsigned short data_len;
|
||||
unsigned char *data;
|
||||
} msg;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* This is what the sendrcv_v2() function would take as an argument. The common case
|
||||
* is for payload_type to be IPMI_PAYLOAD_TYPE_IPMI.
|
||||
*/
|
||||
struct ipmi_v2_payload {
|
||||
unsigned short payload_length;
|
||||
unsigned char payload_type;
|
||||
|
||||
union {
|
||||
|
||||
struct {
|
||||
unsigned char rq_seq;
|
||||
struct ipmi_rq * request;
|
||||
} ipmi_request;
|
||||
|
||||
struct {
|
||||
unsigned char rs_seq;
|
||||
struct ipmi_rs * response;
|
||||
} ipmi_response;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
unsigned char * request;
|
||||
} open_session_request;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
unsigned char * message;
|
||||
} rakp_1_message;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
unsigned char * message;
|
||||
} rakp_2_message;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
unsigned char * message;
|
||||
} rakp_3_message;
|
||||
|
||||
/* Only used internally by the lanplus interface */
|
||||
struct {
|
||||
unsigned char * message;
|
||||
} rakp_4_message;
|
||||
|
||||
struct {
|
||||
unsigned char data[IPMI_BUF_SIZE];
|
||||
unsigned short character_count;
|
||||
unsigned char packet_sequence_number;
|
||||
unsigned char acked_packet_number;
|
||||
unsigned char accepted_character_count;
|
||||
unsigned char is_nack; /* bool */
|
||||
unsigned char assert_ring_wor; /* bool */
|
||||
unsigned char generate_break; /* bool */
|
||||
unsigned char deassert_cts; /* bool */
|
||||
unsigned char deassert_dcd_dsr; /* bool */
|
||||
unsigned char flush_inbound; /* bool */
|
||||
unsigned char flush_outbound; /* bool */
|
||||
} sol_packet;
|
||||
|
||||
} payload;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct ipmi_rq_entry {
|
||||
struct ipmi_rq req;
|
||||
struct ipmi_intf * intf;
|
||||
unsigned char rq_seq;
|
||||
unsigned char * msg_data;
|
||||
int msg_len;
|
||||
struct ipmi_rq_entry * next;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
struct ipmi_rs {
|
||||
unsigned char ccode;
|
||||
unsigned char data[IPMI_BUF_SIZE];
|
||||
|
||||
/*
|
||||
* Looks like this is the length of the entire packet, including the RMCP
|
||||
* stuff, then modified to be the length of the extra IPMI message data
|
||||
*/
|
||||
int data_len;
|
||||
|
||||
struct {
|
||||
unsigned char netfn;
|
||||
unsigned char cmd;
|
||||
unsigned char seq;
|
||||
unsigned char lun;
|
||||
} msg;
|
||||
|
||||
struct {
|
||||
unsigned char authtype;
|
||||
uint32_t seq;
|
||||
uint32_t id;
|
||||
unsigned char bEncrypted; /* IPMI v2 only */
|
||||
unsigned char bAuthenticated; /* IPMI v2 only */
|
||||
unsigned char payloadtype; /* IPMI v2 only */
|
||||
/* This is the total length of the payload or
|
||||
IPMI message. IPMI v2.0 requires this to
|
||||
be 2 bytes. Not really used for much. */
|
||||
unsigned short msglen;
|
||||
} session;
|
||||
|
||||
|
||||
/*
|
||||
* A union of the different possible payload meta-data
|
||||
*/
|
||||
union {
|
||||
struct {
|
||||
unsigned char rq_addr;
|
||||
unsigned char netfn;
|
||||
unsigned char rq_lun;
|
||||
unsigned char rs_addr;
|
||||
unsigned char rq_seq;
|
||||
unsigned char rs_lun;
|
||||
unsigned char cmd;
|
||||
} ipmi_response;
|
||||
struct {
|
||||
unsigned char message_tag;
|
||||
unsigned char rakp_return_code;
|
||||
unsigned char max_priv_level;
|
||||
unsigned int console_id;
|
||||
unsigned int bmc_id;
|
||||
unsigned char auth_alg;
|
||||
unsigned char integrity_alg;
|
||||
unsigned char crypt_alg;
|
||||
} open_session_response;
|
||||
struct {
|
||||
unsigned char message_tag;
|
||||
unsigned char rakp_return_code;
|
||||
unsigned int console_id;
|
||||
unsigned char bmc_rand[16]; /* Random number generated by the BMC */
|
||||
unsigned char bmc_guid[16];
|
||||
unsigned char key_exchange_auth_code[20];
|
||||
} rakp2_message;
|
||||
struct {
|
||||
unsigned char message_tag;
|
||||
unsigned char rakp_return_code;
|
||||
unsigned int console_id;
|
||||
unsigned char integrity_check_value[20];
|
||||
} rakp4_message;
|
||||
struct {
|
||||
unsigned char packet_sequence_number;
|
||||
unsigned char acked_packet_number;
|
||||
unsigned char accepted_character_count;
|
||||
unsigned char is_nack; /* bool */
|
||||
unsigned char transfer_unavailable; /* bool */
|
||||
unsigned char sol_inactive; /* bool */
|
||||
unsigned char transmit_overrun; /* bool */
|
||||
unsigned char break_detected; /* bool */
|
||||
} sol_packet;
|
||||
|
||||
} payload;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#define IPMI_NETFN_CHASSIS 0x0
|
||||
#define IPMI_NETFN_BRIDGE 0x2
|
||||
#define IPMI_NETFN_SE 0x4
|
||||
#define IPMI_NETFN_APP 0x6
|
||||
#define IPMI_NETFN_FIRMWARE 0x8
|
||||
#define IPMI_NETFN_STORAGE 0xa
|
||||
#define IPMI_NETFN_TRANSPORT 0xc
|
||||
#define IPMI_NETFN_ISOL 0x34
|
||||
|
||||
#define IPMI_BMC_SLAVE_ADDR 0x20
|
||||
#define IPMI_REMOTE_SWID 0x81
|
||||
|
||||
extern const struct valstr completion_code_vals[25];
|
||||
|
||||
#endif /* IPMI_H */
|
86
ipmitool/include/ipmitool/ipmi_bmc.h
Normal file
86
ipmitool/include/ipmitool/ipmi_bmc.h
Normal file
@ -0,0 +1,86 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_BMC_H
|
||||
#define IPMI_BMC_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_SET_GLOBAL_ENABLES 0x2e
|
||||
#define BMC_GET_GLOBAL_ENABLES 0x2f
|
||||
|
||||
int ipmi_bmc_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...
|
||||
*/
|
||||
struct ipm_devid_rsp {
|
||||
unsigned char device_id;
|
||||
unsigned char device_revision;
|
||||
unsigned char fw_rev1;
|
||||
unsigned char fw_rev2;
|
||||
unsigned char ipmi_version;
|
||||
unsigned char adtl_device_support;
|
||||
unsigned char manufacturer_id[3];
|
||||
unsigned char product_id[2];
|
||||
unsigned char aux_fw_rev[4];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define IPM_DEV_DEVICE_ID_SDR_MASK (0x80) /* 1 = provides SDRs */
|
||||
#define IPM_DEV_DEVICE_ID_REV_MASK (0x07) /* 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)
|
||||
|
||||
#endif /*IPMI_BMC_H*/
|
230
ipmitool/include/ipmitool/ipmi_channel.h
Normal file
230
ipmitool/include/ipmitool/ipmi_channel.h
Normal file
@ -0,0 +1,230 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_CHANNEL_H
|
||||
#define IPMI_CHANNEL_H
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
#define IPMI_GET_CHANNEL_AUTH_CAP 0x38
|
||||
#define IPMI_GET_CHANNEL_ACCESS 0x41
|
||||
#define IPMI_GET_CHANNEL_INFO 0x42
|
||||
#define IPMI_SET_USER_ACCESS 0x43
|
||||
#define IPMI_GET_USER_ACCESS 0x44
|
||||
#define IPMI_SET_USER_NAME 0x45
|
||||
#define IPMI_GET_USER_NAME 0x46
|
||||
#define IPMI_SET_USER_PASSWORD 0x47
|
||||
|
||||
|
||||
/*
|
||||
* The Get Authentication Capabilities response structure
|
||||
* From table 22-15 of the IPMI v2.0 spec
|
||||
*/
|
||||
struct get_channel_auth_cap_rsp {
|
||||
unsigned char channel_number;
|
||||
#if WORDS_BIGENDIAN
|
||||
unsigned char v20_data_available : 1; /* IPMI v2.0 data is available */
|
||||
unsigned char __reserved1 : 1;
|
||||
unsigned char enabled_auth_types : 6; /* IPMI v1.5 enabled auth types */
|
||||
#else
|
||||
unsigned char enabled_auth_types : 6; /* IPMI v1.5 enabled auth types */
|
||||
unsigned char __reserved1 : 1;
|
||||
unsigned char v20_data_available : 1; /* IPMI v2.0 data is available */
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
unsigned char __reserved2 : 2;
|
||||
unsigned char kg_status : 1; /* two-key login status */
|
||||
unsigned char per_message_auth : 1; /* per-message authentication status */
|
||||
unsigned char user_level_auth : 1; /* user-level authentication status */
|
||||
unsigned char non_null_usernames : 1; /* one or more non-null users exist */
|
||||
unsigned char null_usernames : 1; /* one or more null usernames non-null pwds */
|
||||
unsigned char anon_login_enabled : 1; /* a null-named, null-pwd user exists */
|
||||
#else
|
||||
unsigned char anon_login_enabled : 1; /* a null-named, null-pwd user exists */
|
||||
unsigned char null_usernames : 1; /* one or more null usernames non-null pwds */
|
||||
unsigned char non_null_usernames : 1; /* one or more non-null users exist */
|
||||
unsigned char user_level_auth : 1; /* user-level authentication status */
|
||||
unsigned char per_message_auth : 1; /* per-message authentication status */
|
||||
unsigned char kg_status : 1; /* two-key login status */
|
||||
unsigned char __reserved2 : 2;
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
unsigned char __reserved3 : 6;
|
||||
unsigned char ipmiv15_support : 1; /* channel supports IPMI v1.5 connections */
|
||||
unsigned char ipmiv20_support : 1; /* channel supports IPMI v2.0 connections */
|
||||
#else
|
||||
unsigned char ipmiv20_support : 1; /* channel supports IPMI v2.0 connections */
|
||||
unsigned char ipmiv15_support : 1; /* channel supports IPMI v1.5 connections */
|
||||
unsigned char __reserved3 : 6;
|
||||
#endif
|
||||
unsigned char oem_id[3]; /* IANA enterprise number for auth type */
|
||||
unsigned char oem_aux_data; /* Additional OEM specific data for oem auths */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* The Get Channel Info response structure
|
||||
* From table 22-29 of the IPMI v2.0 spec
|
||||
*/
|
||||
struct get_channel_info_rsp {
|
||||
#if WORDS_BIGENDIAN
|
||||
unsigned char __reserved1 : 4;
|
||||
unsigned char channel_number : 4; /* channel number */
|
||||
#else
|
||||
unsigned char channel_number : 4; /* channel number */
|
||||
unsigned char __reserved1 : 4;
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
unsigned char __reserved2 : 1;
|
||||
unsigned char channel_medium : 7; /* Channel medium type per table 6-3 */
|
||||
#else
|
||||
unsigned char channel_medium : 7; /* Channel medium type per table 6-3 */
|
||||
unsigned char __reserved2 : 1;
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
unsigned char __reserved3 : 3;
|
||||
unsigned char channel_protocol : 5; /* Channel protocol per table 6-2 */
|
||||
#else
|
||||
unsigned char channel_protocol : 5; /* Channel protocol per table 6-2 */
|
||||
unsigned char __reserved3 : 3;
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
unsigned char session_support : 2; /* Description of session support */
|
||||
unsigned char active_sessions : 6; /* Count of active sessions */
|
||||
#else
|
||||
unsigned char active_sessions : 6; /* Count of active sessions */
|
||||
unsigned char session_support : 2; /* Description of session support */
|
||||
#endif
|
||||
unsigned char vendor_id[3]; /* For OEM that specified the protocol */
|
||||
unsigned char aux_info[2]; /* Not used*/
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* The Get Channel Access response structure
|
||||
* From table 22-28 of the IPMI v2.0 spec
|
||||
*/
|
||||
struct get_channel_access_rsp {
|
||||
#if WORDS_BIGENDIAN
|
||||
unsigned char __reserved1 : 2;
|
||||
unsigned char alerting : 1;
|
||||
unsigned char per_message_auth : 1;
|
||||
unsigned char user_level_auth : 1;
|
||||
unsigned char access_mode : 3;
|
||||
#else
|
||||
unsigned char access_mode : 3;
|
||||
unsigned char user_level_auth : 1;
|
||||
unsigned char per_message_auth : 1;
|
||||
unsigned char alerting : 1;
|
||||
unsigned char __reserved1 : 2;
|
||||
#endif
|
||||
#if WORDS_BIGENDIAN
|
||||
unsigned char __reserved2 : 4;
|
||||
unsigned char channel_priv_limit : 4; /* Channel privilege level limit */
|
||||
#else
|
||||
unsigned char channel_priv_limit : 4; /* Channel privilege level limit */
|
||||
unsigned char __reserved2 : 4;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
struct get_user_access_rsp {
|
||||
#if WORDS_BIGENDIAN
|
||||
unsigned char __reserved1 : 2;
|
||||
unsigned char max_user_ids : 6;
|
||||
unsigned char __reserved2 : 2;
|
||||
unsigned char enabled_user_ids : 6;
|
||||
unsigned char __reserved3 : 2;
|
||||
unsigned char fixed_user_ids : 6;
|
||||
unsigned char __reserved4 : 1;
|
||||
unsigned char callin_callback : 1;
|
||||
unsigned char link_auth : 1;
|
||||
unsigned char ipmi_messaging : 1;
|
||||
unsigned char privilege_limit : 4;
|
||||
#else
|
||||
unsigned char max_user_ids : 6;
|
||||
unsigned char __reserved1 : 2;
|
||||
unsigned char enabled_user_ids : 6;
|
||||
unsigned char __reserved2 : 2;
|
||||
unsigned char fixed_user_ids : 6;
|
||||
unsigned char __reserved3 : 2;
|
||||
unsigned char privilege_limit : 4;
|
||||
unsigned char ipmi_messaging : 1;
|
||||
unsigned char link_auth : 1;
|
||||
unsigned char callin_callback : 1;
|
||||
unsigned char __reserved4 : 1;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct set_user_access_data {
|
||||
#if WORDS_BIGENDIAN
|
||||
unsigned char change_bits : 1;
|
||||
unsigned char callin_callback : 1;
|
||||
unsigned char link_auth : 1;
|
||||
unsigned char ipmi_messaging : 1;
|
||||
unsigned char channel : 4;
|
||||
unsigned char __reserved1 : 2;
|
||||
unsigned char user_id : 6;
|
||||
unsigned char __reserved2 : 4;
|
||||
unsigned char privilege_limit : 4;
|
||||
unsigned char __reserved3 : 4;
|
||||
unsigned char session_limit : 4;
|
||||
#else
|
||||
unsigned char channel : 4;
|
||||
unsigned char ipmi_messaging : 1;
|
||||
unsigned char link_auth : 1;
|
||||
unsigned char callin_callback : 1;
|
||||
unsigned char change_bits : 1;
|
||||
unsigned char user_id : 6;
|
||||
unsigned char __reserved1 : 2;
|
||||
unsigned char privilege_limit : 4;
|
||||
unsigned char __reserved2 : 4;
|
||||
unsigned char session_limit : 4;
|
||||
unsigned char __reserved3 : 4;
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
int ipmi_channel_main(struct ipmi_intf *, int, char **);
|
||||
int ipmi_get_channel_auth_cap(struct ipmi_intf * intf, unsigned char channel, unsigned char priv);
|
||||
int ipmi_get_channel_info(struct ipmi_intf * intf, unsigned char channel);
|
||||
|
||||
#endif /*IPMI_CHANNEL_H*/
|
@ -28,9 +28,14 @@
|
||||
* 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.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef IPMI_CHASSIS_H
|
||||
#define IPMI_CHASSIS_H
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
@ -46,7 +51,6 @@
|
||||
#define IPMI_CHASSIS_POLICY_PREVIOUS 0x1
|
||||
#define IPMI_CHASSIS_POLICY_ALWAYS_OFF 0x0
|
||||
|
||||
int ipmi_chassis_power_status(struct ipmi_intf * intf);
|
||||
int ipmi_chassis_power_control(struct ipmi_intf * intf, uint8_t ctl);
|
||||
int ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
int ipmi_power_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
int ipmi_chassis_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /*IPMI_CHASSIS_H*/
|
@ -28,17 +28,23 @@
|
||||
* 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.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef IPMI_CONSTANTS_H
|
||||
#define IPMI_CONSTANTS_H
|
||||
|
||||
|
||||
/*
|
||||
* COMMANDS
|
||||
*/
|
||||
#define IPMI_GET_SDR_REPOSITORY_INFO 0x20
|
||||
#define IPMI_SOL_ACTIVATING 0x20
|
||||
#define IPMI_SET_SOL_CONFIG_PARAMETERS 0x21
|
||||
#define IPMI_GET_SOL_CONFIG_PARAMETERS 0x22
|
||||
#define IMPI_SOL_ACTIVATING 0x20
|
||||
#define IMPI_SET_SOL_CONFIG_PARAMETERS 0x21
|
||||
#define IMPI_GET_SOL_CONFIG_PARAMETERS 0x22
|
||||
#define IPMI_SET_USER_ACCESS 0x43
|
||||
#define IPMI_GET_USER_ACCESS 0x44
|
||||
#define IPMI_SET_USER_NAME 0x45
|
||||
@ -49,8 +55,6 @@
|
||||
#define IPMI_SUSPEND_RESUME_PAYLOAD_ENCRYPTYION 0x55
|
||||
#define IPMI_GET_SEL_TIME 0x48
|
||||
#define IPMI_SET_SEL_TIME 0x49
|
||||
#define IPMI_SET_USER_PAYLOAD_ACCESS 0x4c
|
||||
#define IPMI_GET_USER_PAYLOAD_ACCESS 0x4d
|
||||
|
||||
#define IPMI_1_5_AUTH_TYPE_BIT_NONE 0x01
|
||||
#define IPMI_1_5_AUTH_TYPE_BIT_MD2 0x02
|
||||
@ -66,68 +70,14 @@
|
||||
#define IPMI_SESSION_AUTHTYPE_OEM 0x5
|
||||
#define IPMI_SESSION_AUTHTYPE_RMCP_PLUS 0x6
|
||||
|
||||
#define IPMI_SESSION_PRIV_UNSPECIFIED 0x0
|
||||
#define IPMI_SESSION_PRIV_CALLBACK 0x1
|
||||
#define IPMI_SESSION_PRIV_USER 0x2
|
||||
#define IPMI_SESSION_PRIV_OPERATOR 0x3
|
||||
#define IPMI_SESSION_PRIV_ADMIN 0x4
|
||||
#define IPMI_SESSION_PRIV_OEM 0x5
|
||||
#define IPMI_SESSION_PRIV_NOACCESS 0xF
|
||||
|
||||
#define IPMI_SET_IN_PROGRESS_SET_COMPLETE 0x00
|
||||
#define IPMI_SET_IN_PROGRESS_IN_PROGRESS 0x01
|
||||
#define IPMI_SET_IN_PROGRESS_COMMIT_WRITE 0x02
|
||||
|
||||
#define IPMI_CHANNEL_MEDIUM_RESERVED 0x0
|
||||
#define IPMI_CHANNEL_MEDIUM_IPMB_I2C 0x1
|
||||
#define IPMI_CHANNEL_MEDIUM_ICMB_1 0x2
|
||||
#define IPMI_CHANNEL_MEDIUM_ICMB_09 0x3
|
||||
#define IPMI_CHANNEL_MEDIUM_LAN 0x4
|
||||
#define IPMI_CHANNEL_MEDIUM_SERIAL 0x5
|
||||
#define IPMI_CHANNEL_MEDIUM_LAN_OTHER 0x6
|
||||
#define IPMI_CHANNEL_MEDIUM_SMBUS_PCI 0x7
|
||||
#define IPMI_CHANNEL_MEDIUM_SMBUS_1 0x8
|
||||
#define IPMI_CHANNEL_MEDIUM_SMBUS_2 0x9
|
||||
#define IPMI_CHANNEL_MEDIUM_USB_1 0xa
|
||||
#define IPMI_CHANNEL_MEDIUM_USB_2 0xb
|
||||
#define IPMI_CHANNEL_MEDIUM_SYSTEM 0xc
|
||||
|
||||
#define IPMI_CHASSIS_CTL_POWER_DOWN 0x0
|
||||
#define IPMI_CHASSIS_CTL_POWER_UP 0x1
|
||||
#define IPMI_CHASSIS_CTL_POWER_CYCLE 0x2
|
||||
#define IPMI_CHASSIS_CTL_HARD_RESET 0x3
|
||||
#define IPMI_CHASSIS_CTL_PULSE_DIAG 0x4
|
||||
#define IPMI_CHASSIS_CTL_ACPI_SOFT 0x5
|
||||
|
||||
#define IPMI_CHASSIS_POLICY_NO_CHANGE 0x3
|
||||
#define IPMI_CHASSIS_POLICY_ALWAYS_ON 0x2
|
||||
#define IPMI_CHASSIS_POLICY_PREVIOUS 0x1
|
||||
#define IPMI_CHASSIS_POLICY_ALWAYS_OFF 0x0
|
||||
|
||||
#define IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS 0
|
||||
#define IPMI_CHASSIS_BOOTPARAM_SVCPART_SELECT 1
|
||||
#define IPMI_CHASSIS_BOOTPARAM_SVCPART_SCAN 2
|
||||
#define IPMI_CHASSIS_BOOTPARAM_FLAG_VALID 3
|
||||
#define IPMI_CHASSIS_BOOTPARAM_INFO_ACK 4
|
||||
#define IPMI_CHASSIS_BOOTPARAM_BOOT_FLAGS 5
|
||||
#define IPMI_CHASSIS_BOOTPARAM_INIT_INFO 6
|
||||
#define IPMI_CHASSIS_BOOTPARAM_INIT_MBOX 7
|
||||
|
||||
/* From table 13-17 of the IPMI v2 specification */
|
||||
#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 */
|
||||
#define IPMI_CRYPT_NONE 0x00
|
||||
#define IPMI_CRYPT_AES_CBC_128 0x01
|
||||
#define IPMI_CRYPT_XRC4_128 0x02
|
||||
#define IPMI_CRYPT_XRC4_40 0x03
|
||||
#endif /*IPMI_CONSTANTS_H*/
|
133
ipmitool/include/ipmitool/ipmi_entity.h
Normal file
133
ipmitool/include/ipmitool/ipmi_entity.h
Normal file
@ -0,0 +1,133 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_ENTITY_H
|
||||
#define IPMI_ENTITY_H
|
||||
|
||||
#include <ipmitool/helper.h>
|
||||
|
||||
const struct valstr entity_id_vals[] __attribute__((unused)) = {
|
||||
{ 0x00, "Unspecified" },
|
||||
{ 0x01, "Other" },
|
||||
{ 0x02, "Unknown" },
|
||||
{ 0x03, "Processor" },
|
||||
{ 0x04, "Disk or Disk Bay" },
|
||||
{ 0x05, "Peripheral Bay" },
|
||||
{ 0x06, "System Management Module" },
|
||||
{ 0x07, "System Board" },
|
||||
{ 0x08, "Memory Module" },
|
||||
{ 0x09, "Processor Module" },
|
||||
{ 0x0a, "Power Supply" },
|
||||
{ 0x0b, "Add-in Card" },
|
||||
{ 0x0c, "Front Panel Board" },
|
||||
{ 0x0d, "Back Panel Board" },
|
||||
{ 0x0e, "Power System Board" },
|
||||
{ 0x0f, "Drive Backplane" },
|
||||
{ 0x10, "System Internal Expansion Board" },
|
||||
{ 0x11, "Other System Board" },
|
||||
{ 0x12, "Processor Board" },
|
||||
{ 0x13, "Power Unit" },
|
||||
{ 0x14, "Power Module" },
|
||||
{ 0x15, "Power Management" },
|
||||
{ 0x16, "Chassis Back Panel Board" },
|
||||
{ 0x17, "System Chassis" },
|
||||
{ 0x18, "Sub-Chassis" },
|
||||
{ 0x19, "Other Chassis Board" },
|
||||
{ 0x1a, "Disk Drive Bay" },
|
||||
{ 0x1b, "Peripheral Bay" },
|
||||
{ 0x1c, "Device Bay" },
|
||||
{ 0x1d, "Fan Device" },
|
||||
{ 0x1e, "Cooling Unit" },
|
||||
{ 0x1f, "Cable/Interconnect" },
|
||||
{ 0x20, "Memory Device" },
|
||||
{ 0x21, "System Management Software" },
|
||||
{ 0x22, "BIOS" },
|
||||
{ 0x23, "Operating System" },
|
||||
{ 0x24, "System Bus" },
|
||||
{ 0x25, "Group" },
|
||||
{ 0x26, "Remote Management Device" },
|
||||
{ 0x27, "External Environment" },
|
||||
{ 0x28, "Battery" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
const struct valstr device_type_vals[] __attribute__((unused)) = {
|
||||
{ 0x00, "Reserved" },
|
||||
{ 0x01, "Reserved" },
|
||||
{ 0x02, "DS1624 temperature sensor" },
|
||||
{ 0x03, "DS1621 temperature sensor" },
|
||||
{ 0x04, "LM75 Temperature Sensor" },
|
||||
{ 0x05, "Heceta ASIC" },
|
||||
{ 0x06, "Reserved" },
|
||||
{ 0x07, "Reserved" },
|
||||
{ 0x08, "EEPROM, 24C01" },
|
||||
{ 0x09, "EEPROM, 24C02" },
|
||||
{ 0x0a, "EEPROM, 24C04" },
|
||||
{ 0x0b, "EEPROM, 24C08" },
|
||||
{ 0x0c, "EEPROM, 24C16" },
|
||||
{ 0x0d, "EEPROM, 24C17" },
|
||||
{ 0x0e, "EEPROM, 24C32" },
|
||||
{ 0x0f, "EEPROM, 24C64" },
|
||||
{ 0x1000, "IPMI FRU Inventory" },
|
||||
{ 0x1001, "DIMM Memory ID" },
|
||||
{ 0x1002, "IPMI FRU Inventory" },
|
||||
{ 0x1003, "System Processor Cartridge FRU" },
|
||||
{ 0x11, "Reserved" },
|
||||
{ 0x12, "Reserved" },
|
||||
{ 0x13, "Reserved" },
|
||||
{ 0x14, "PCF 8570 256 byte RAM" },
|
||||
{ 0x15, "PCF 8573 clock/calendar" },
|
||||
{ 0x16, "PCF 8574A I/O Port" },
|
||||
{ 0x17, "PCF 8583 clock/calendar" },
|
||||
{ 0x18, "PCF 8593 clock/calendar" },
|
||||
{ 0x19, "Clock calendar" },
|
||||
{ 0x1a, "PCF 8591 A/D, D/A Converter" },
|
||||
{ 0x1b, "I/O Port" },
|
||||
{ 0x1c, "A/D Converter" },
|
||||
{ 0x1d, "D/A Converter" },
|
||||
{ 0x1e, "A/D, D/A Converter" },
|
||||
{ 0x1f, "LCD Controler/Driver" },
|
||||
{ 0x20, "Core Logic (Chip set) Device" },
|
||||
{ 0x21, "LMC6874 Intelligent Battery controller" },
|
||||
{ 0x22, "Intelligent Batter controller" },
|
||||
{ 0x23, "Combo Management ASIC" },
|
||||
{ 0x24, "Maxim 1617 Temperature Sensor" },
|
||||
{ 0xbf, "Other/Unspecified" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
#endif /* IPMI_ENTITY_H */
|
||||
|
@ -28,11 +28,20 @@
|
||||
* 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.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef IPMI_EVENT_H
|
||||
#define IPMI_EVENT_H
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
|
||||
extern struct ipmi_intf ipmi_lan_intf;
|
||||
int ipmi_event_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /*IPMI_EVENT_H*/
|
227
ipmitool/include/ipmitool/ipmi_fru.h
Normal file
227
ipmitool/include/ipmitool/ipmi_fru.h
Normal file
@ -0,0 +1,227 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_FRU_H
|
||||
#define IPMI_FRU_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define GET_FRU_INFO 0x10
|
||||
#define GET_FRU_DATA 0x11
|
||||
#define SET_FRU_DATA 0x12
|
||||
|
||||
enum {
|
||||
FRU_CHASSIS_PARTNO,
|
||||
FRU_CHASSIS_SERIAL,
|
||||
FRU_BOARD_MANUF,
|
||||
FRU_BOARD_PRODUCT,
|
||||
FRU_BOARD_SERIAL,
|
||||
FRU_BOARD_PARTNO,
|
||||
FRU_PRODUCT_MANUF,
|
||||
FRU_PRODUCT_NAME,
|
||||
FRU_PRODUCT_PARTNO,
|
||||
FRU_PRODUCT_VERSION,
|
||||
FRU_PRODUCT_SERIAL,
|
||||
FRU_PRODUCT_ASSET,
|
||||
};
|
||||
|
||||
struct fru_info {
|
||||
unsigned short size;
|
||||
unsigned char access : 1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fru_header {
|
||||
unsigned char version;
|
||||
struct {
|
||||
unsigned char internal;
|
||||
unsigned char chassis;
|
||||
unsigned char board;
|
||||
unsigned char product;
|
||||
unsigned char multi;
|
||||
} offset;
|
||||
unsigned char pad;
|
||||
unsigned char checksum;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fru_area_chassis {
|
||||
unsigned char area_ver;
|
||||
unsigned char type;
|
||||
unsigned short area_len;
|
||||
char * part;
|
||||
char * serial;
|
||||
};
|
||||
|
||||
struct fru_area_board {
|
||||
unsigned char area_ver;
|
||||
unsigned char lang;
|
||||
unsigned short area_len;
|
||||
uint32_t mfg_date_time;
|
||||
char * mfg;
|
||||
char * prod;
|
||||
char * serial;
|
||||
char * part;
|
||||
char * fru;
|
||||
};
|
||||
|
||||
struct fru_area_product {
|
||||
unsigned char area_ver;
|
||||
unsigned char lang;
|
||||
unsigned short area_len;
|
||||
char * mfg;
|
||||
char * name;
|
||||
char * part;
|
||||
char * version;
|
||||
char * serial;
|
||||
char * asset;
|
||||
char * fru;
|
||||
};
|
||||
|
||||
struct fru_multirec_header {
|
||||
#define FRU_RECORD_TYPE_POWER_SUPPLY_INFORMATION 0x00
|
||||
#define FRU_RECORD_TYPE_DC_OUTPUT 0x01
|
||||
#define FRU_RECORD_TYPE_DC_LOAD 0x02
|
||||
#define FRU_RECORD_TYPE_MANAGEMENT_ACCESS 0x03
|
||||
#define FRU_RECORD_TYPE_BASE_COMPATIBILITY 0x04
|
||||
#define FRU_RECORD_TYPE_EXTENDED_COMPATIBILITY 0x05
|
||||
unsigned char type;
|
||||
unsigned char format;
|
||||
unsigned char len;
|
||||
unsigned char record_checksum;
|
||||
unsigned char header_checksum;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fru_multirec_powersupply {
|
||||
#if WORDS_BIGENDIAN
|
||||
unsigned short capacity;
|
||||
#else
|
||||
unsigned short capacity : 12;
|
||||
unsigned short __reserved1 : 4;
|
||||
#endif
|
||||
unsigned short peak_va;
|
||||
unsigned char inrush_current;
|
||||
unsigned char inrush_interval;
|
||||
unsigned short lowend_input1;
|
||||
unsigned short highend_input1;
|
||||
unsigned short lowend_input2;
|
||||
unsigned short highend_input2;
|
||||
unsigned char lowend_freq;
|
||||
unsigned char highend_freq;
|
||||
unsigned char dropout_tolerance;
|
||||
#if WORDS_BIGENDIAN
|
||||
unsigned char __reserved2 : 3;
|
||||
unsigned char tach : 1;
|
||||
unsigned char hotswap : 1;
|
||||
unsigned char autoswitch : 1;
|
||||
unsigned char pfc : 1;
|
||||
unsigned char predictive_fail : 1;
|
||||
#else
|
||||
unsigned char predictive_fail : 1;
|
||||
unsigned char pfc : 1;
|
||||
unsigned char autoswitch : 1;
|
||||
unsigned char hotswap : 1;
|
||||
unsigned char tach : 1;
|
||||
unsigned char __reserved2 : 3;
|
||||
#endif
|
||||
unsigned short peak_cap_ht;
|
||||
#if WORDS_BIGENDIAN
|
||||
unsigned char combined_voltage1 : 4;
|
||||
unsigned char combined_voltage2 : 4;
|
||||
#else
|
||||
unsigned char combined_voltage2 : 4;
|
||||
unsigned char combined_voltage1 : 4;
|
||||
#endif
|
||||
unsigned short combined_capacity;
|
||||
unsigned char rps_threshold;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
static const char * combined_voltage_desc[] __attribute__((unused)) = {
|
||||
"12 V", "-12 V", "5 V", "3.3 V"
|
||||
};
|
||||
|
||||
struct fru_multirec_dcoutput {
|
||||
#if WORDS_BIGENDIAN
|
||||
unsigned char standby : 1;
|
||||
unsigned char __reserved : 3;
|
||||
unsigned char output_number : 4;
|
||||
#else
|
||||
unsigned char output_number : 4;
|
||||
unsigned char __reserved : 3;
|
||||
unsigned char standby : 1;
|
||||
#endif
|
||||
short nominal_voltage;
|
||||
short max_neg_dev;
|
||||
short max_pos_dev;
|
||||
unsigned short ripple_and_noise;
|
||||
unsigned short min_current;
|
||||
unsigned short max_current;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fru_multirec_dcload {
|
||||
#if WORDS_BIGENDIAN
|
||||
unsigned char __reserved : 4;
|
||||
unsigned char output_number : 4;
|
||||
#else
|
||||
unsigned char output_number : 4;
|
||||
unsigned char __reserved : 4;
|
||||
#endif
|
||||
short nominal_voltage;
|
||||
short min_voltage;
|
||||
short max_voltage;
|
||||
unsigned short ripple_and_noise;
|
||||
unsigned short min_current;
|
||||
unsigned short max_current;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
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"
|
||||
};
|
||||
|
||||
void ipmi_print_fru(struct ipmi_intf *, unsigned char);
|
||||
int ipmi_fru_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* IPMI_FRU_H */
|
172
ipmitool/include/ipmitool/ipmi_intf.h
Normal file
172
ipmitool/include/ipmitool/ipmi_intf.h
Normal file
@ -0,0 +1,172 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_INTF_H
|
||||
#define IPMI_INTF_H
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_constants.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
/*
|
||||
* An enumeration that describes every possible session state for
|
||||
* an IPMIv2 / RMCP+ session.
|
||||
*/
|
||||
enum LANPLUS_SESSION_STATE {
|
||||
LANPLUS_STATE_PRESESSION = 0,
|
||||
LANPLUS_STATE_OPEN_SESSION_SENT,
|
||||
LANPLUS_STATE_OPEN_SESSION_RECEIEVED,
|
||||
LANPLUS_STATE_RAKP_1_SENT,
|
||||
LANPLUS_STATE_RAKP_2_RECEIVED,
|
||||
LANPLUS_STATE_RAKP_3_SENT,
|
||||
LANPLUS_STATE_ACTIVE,
|
||||
LANPLUS_STATE_CLOSE_SENT,
|
||||
};
|
||||
|
||||
|
||||
#define IPMI_AUTHCODE_BUFFER_SIZE 20
|
||||
#define IPMI_SIK_BUFFER_SIZE 20
|
||||
#define IPMI_KG_BUFFER_SIZE 21 /* key plus null byte */
|
||||
|
||||
struct ipmi_session {
|
||||
unsigned char hostname[64];
|
||||
unsigned char username[16];
|
||||
unsigned char authcode[IPMI_AUTHCODE_BUFFER_SIZE + 1];
|
||||
unsigned char challenge[16];
|
||||
unsigned char authtype;
|
||||
unsigned char authtype_set;
|
||||
unsigned char privlvl;
|
||||
int password;
|
||||
int port;
|
||||
int active;
|
||||
|
||||
uint32_t session_id;
|
||||
uint32_t in_seq;
|
||||
uint32_t out_seq;
|
||||
uint32_t timeout;
|
||||
|
||||
struct sockaddr_in addr;
|
||||
socklen_t addrlen;
|
||||
|
||||
/*
|
||||
* This struct holds state data specific to IMPI v2 / RMCP+ sessions
|
||||
*/
|
||||
struct {
|
||||
enum LANPLUS_SESSION_STATE session_state;
|
||||
|
||||
/* These are the algorithms agreed upon for the session */
|
||||
unsigned char auth_alg;
|
||||
unsigned char integrity_alg;
|
||||
unsigned char crypt_alg;
|
||||
unsigned char max_priv_level;
|
||||
|
||||
uint32_t console_id;
|
||||
uint32_t bmc_id;
|
||||
|
||||
/*
|
||||
* Values required for RAKP mesages
|
||||
*/
|
||||
|
||||
/* Random number generated byt the console */
|
||||
unsigned char console_rand[16];
|
||||
/* Random number generated by the BMC */
|
||||
unsigned char bmc_rand[16];
|
||||
|
||||
unsigned char bmc_guid[16];
|
||||
unsigned char requested_role; /* As sent in the RAKP 1 message */
|
||||
unsigned char rakp2_return_code;
|
||||
|
||||
unsigned char sik[IPMI_SIK_BUFFER_SIZE]; /* Session integrity key */
|
||||
unsigned char kg[IPMI_KG_BUFFER_SIZE]; /* BMC key */
|
||||
unsigned char k1[20]; /* Used for Integrity checking? */
|
||||
unsigned char k2[20]; /* First 16 bytes used for AES */
|
||||
} v2_data;
|
||||
|
||||
|
||||
/*
|
||||
* This data is specific to the Serial Over Lan session
|
||||
*/
|
||||
struct {
|
||||
uint16_t max_inbound_payload_size;
|
||||
uint16_t max_outbound_payload_size;
|
||||
uint16_t port;
|
||||
unsigned char sequence_number;
|
||||
|
||||
/* This data describes the last SOL packet */
|
||||
unsigned char last_received_sequence_number;
|
||||
unsigned char last_received_byte_count;
|
||||
void (*sol_input_handler)(struct ipmi_rs * rsp);
|
||||
} sol_data;
|
||||
};
|
||||
|
||||
|
||||
struct ipmi_intf {
|
||||
char name[16];
|
||||
char desc[128];
|
||||
int fd;
|
||||
int opened;
|
||||
int abort;
|
||||
int thump;
|
||||
|
||||
struct ipmi_session * session;
|
||||
unsigned int my_addr;
|
||||
unsigned int target_addr;
|
||||
|
||||
int (*setup)(struct ipmi_intf * 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);
|
||||
};
|
||||
|
||||
struct ipmi_intf * ipmi_intf_load(char * name);
|
||||
void ipmi_intf_print(void);
|
||||
|
||||
void ipmi_intf_session_set_hostname(struct ipmi_intf * intf, char * hostname);
|
||||
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, unsigned char privlvl);
|
||||
void ipmi_intf_session_set_port(struct ipmi_intf * intf, int port);
|
||||
void ipmi_intf_session_set_authtype(struct ipmi_intf * intf, unsigned char authtype);
|
||||
|
||||
#endif /* IPMI_INTF_H */
|
@ -28,9 +28,14 @@
|
||||
* 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.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef IPMI_ISOL_H
|
||||
#define IPMI_ISOL_H
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
@ -40,15 +45,11 @@
|
||||
|
||||
#define ISOL_ENABLE_PARAM 0x01
|
||||
#define ISOL_AUTHENTICATION_PARAM 0x02
|
||||
|
||||
#define ISOL_ENABLE_FLAG 0x01
|
||||
#define ISOL_PRIVILEGE_LEVEL_USER 0x02
|
||||
#define ISOL_BAUD_RATE_PARAM 0x05
|
||||
|
||||
#define ISOL_PREFERRED_BAUD_RATE 0x07
|
||||
|
||||
struct isol_config_parameters {
|
||||
uint8_t enabled;
|
||||
uint8_t privilege_level;
|
||||
uint8_t bit_rate;
|
||||
};
|
||||
#define ISOL_PREFERRED_BAUD_RATE 0x07
|
||||
|
||||
int ipmi_isol_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* IPMI_SOL_H */
|
@ -28,9 +28,14 @@
|
||||
* 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.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef IPMI_LANP_H
|
||||
#define IPMI_LANP_H
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
@ -41,20 +46,10 @@
|
||||
# define IPMI_LAN_SUSPEND_ARP_GRAT (1)
|
||||
#define IPMI_LAN_GET_STAT 0x04
|
||||
|
||||
#define IPMI_CHANNEL_NUMBER_MAX 0xe
|
||||
#define IPMI_CHANNEL_NUMBER_MAX 0xd
|
||||
|
||||
#define IPMI_LANP_TIMEOUT 3
|
||||
#define IPMI_LANP_RETRIES 10
|
||||
#define IPMI_LANP_WRITE_UNLOCK 0
|
||||
#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)
|
||||
extern const struct valstr ipmi_privlvl_vals[];
|
||||
extern const struct valstr ipmi_authtype_vals[];
|
||||
|
||||
enum {
|
||||
IPMI_LANP_SET_IN_PROGRESS,
|
||||
@ -62,59 +57,21 @@ enum {
|
||||
IPMI_LANP_AUTH_TYPE_ENABLE,
|
||||
IPMI_LANP_IP_ADDR,
|
||||
IPMI_LANP_IP_ADDR_SRC,
|
||||
IPMI_LANP_MAC_ADDR, /* 5 */
|
||||
IPMI_LANP_MAC_ADDR,
|
||||
IPMI_LANP_SUBNET_MASK,
|
||||
IPMI_LANP_IP_HEADER,
|
||||
IPMI_LANP_PRI_RMCP_PORT,
|
||||
IPMI_LANP_SEC_RMCP_PORT,
|
||||
IPMI_LANP_BMC_ARP, /* 10 */
|
||||
IPMI_LANP_BMC_ARP,
|
||||
IPMI_LANP_GRAT_ARP,
|
||||
IPMI_LANP_DEF_GATEWAY_IP,
|
||||
IPMI_LANP_DEF_GATEWAY_MAC,
|
||||
IPMI_LANP_BAK_GATEWAY_IP,
|
||||
IPMI_LANP_BAK_GATEWAY_MAC, /* 15 */
|
||||
IPMI_LANP_BAK_GATEWAY_MAC,
|
||||
IPMI_LANP_SNMP_STRING,
|
||||
IPMI_LANP_NUM_DEST,
|
||||
IPMI_LANP_DEST_TYPE,
|
||||
IPMI_LANP_DEST_ADDR,
|
||||
IPMI_LANP_VLAN_ID, /* 20 */
|
||||
IPMI_LANP_VLAN_PRIORITY,
|
||||
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,
|
||||
@ -124,6 +81,43 @@ enum {
|
||||
IPMI_LANP_CHAN_ACCESS_MODE=201,
|
||||
};
|
||||
|
||||
static struct lan_param {
|
||||
int cmd;
|
||||
int size;
|
||||
char desc[24];
|
||||
unsigned char * 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" },
|
||||
{ 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" },
|
||||
{ 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" },
|
||||
{ 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" },
|
||||
{ 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_OEM_ALERT_STRING, 28, "OEM Alert String" },
|
||||
{ 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" },
|
||||
{ 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*/
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user