mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-07-01 02:03:50 +00:00
Compare commits
1 Commits
IPMITOOL_1
...
IPMITOOL_1
Author | SHA1 | Date | |
---|---|---|---|
83620456c4 |
@ -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.
|
||||
|
@ -1,79 +1,3 @@
|
||||
version 1.8.9 released 2007-03-06
|
||||
* Added initial AMC ekey query operation support
|
||||
* Improvements to ekeying support (PICMG 3.x only)
|
||||
* Added initial interactive edition support for multirec; added IANA
|
||||
verification before interpreting PICMG records.
|
||||
* Added edit support for AMC activation "Maximum Internal Current"
|
||||
* Fix bug generating garbage on the screen when handling GetDeviceId
|
||||
and sol traffic occurs
|
||||
* Added ability to map OEM sensor types to OEM description string using
|
||||
IANA number; moved IANA number table
|
||||
* Fix lan set access command to use value already saved within
|
||||
parameters for PEF and authentication
|
||||
* Fix bug in cmd ipmitool lan stats get 1
|
||||
* Add support to allow ipmitool/ipmievd to target specific device
|
||||
nodes on multi-BMC systems
|
||||
* Add support for name+privilege lookup for lanplus sessions
|
||||
* Fix time_t conversion bug for 64-bit OS
|
||||
* Added prefix of hostname on sel ipmievd sessions
|
||||
* Fixed FWUM Get Info
|
||||
* Fix ipmievd fd closing bug
|
||||
* Add set-in-progress flag support to chassis bootdev
|
||||
* Added new chassis bootdev options
|
||||
* Add sol payload enable/disable comman
|
||||
* Fix SOL set errors when commit-write not supported
|
||||
* Fix reset of session timeout for lanplus interface
|
||||
* Fixed lan interface accessibility timeout handling
|
||||
* Fix bug with Function Get Channel Cipher Suites command when
|
||||
more than 1 page used.
|
||||
* Fix missing firmware firewall top-level command
|
||||
* Fix bug in SOL keepalive functionality
|
||||
* Fix SOLv2 NACK and retry handling for Intel ESB2 BMC
|
||||
* Added ipmi_sel_get_oem_sensor* APIs
|
||||
* Added HPM.1 support
|
||||
* Fix segfault when incorrect oem option supplied
|
||||
* Fix bus problem with spd command
|
||||
* Fix segfault in SOL when remote BMC does not return packet
|
||||
* Adjust packet length for AMC.0 retricting IPMB packets to 32 bytes
|
||||
* Added lan packet size reduction mechanism
|
||||
* Fix bug with sendMessage of bad length with different target
|
||||
* Fix for big endian (PPC) architecture
|
||||
* NetBSD fixes
|
||||
* Fix segfault and channel problem with user priv command
|
||||
* Add support for bus/chan on i2c raw command
|
||||
* Add freeipmi interface support
|
||||
* Add remote spd printing
|
||||
* Add better detection of linux/compiler.h to config
|
||||
* Makefile changes to fix makedistcheck, etc.
|
||||
|
||||
version 1.8.8
|
||||
* Fix segfaults in sensor data repository list
|
||||
* Fix ipmievd to open interface before daemonizing
|
||||
* Fix IPMIv1.5 authtype NONE to ignore supplied password
|
||||
* Fix cipher suite display bug in lan print
|
||||
* Fix typo in IPMIv2 SOL output when sending break
|
||||
* Fix improper LUN handling with Tyan SOL
|
||||
* Add LUN support to OpenIPMI interface
|
||||
* Add support for Kontron OEM commands
|
||||
* Update to Kontron Firmware Update command
|
||||
|
||||
version 1.8.7
|
||||
* Remove nuclear clause from license
|
||||
* Add Sun OEM command for blades
|
||||
* Increase argument size for raw commands in shell/exec
|
||||
* Fix handling of LUNs for LAN interfaces
|
||||
* Add IPMIv2 SOL loopback test
|
||||
* Add support for IBM OEM SEL messages
|
||||
* Disable file paranoia checks on read files by default
|
||||
* Support IPMIv2 SOL on older Intel boxes
|
||||
* Display message and exit if keepalive fails during SOL
|
||||
* Add support for setting VLAN id and priority
|
||||
* Add support for FreeBSD OpenIPMI-compatible driver
|
||||
* Add support for IPMIv2 Firmware Firewall
|
||||
* Fix gcc4 compile warnings
|
||||
* Make ipmievd generate pidfile
|
||||
* Add initscripts for ipmievd
|
||||
|
||||
version 1.8.6
|
||||
* Fix memory corruption when sending encrypted SOL traffic
|
||||
* Add keepalive timer to IPMIv2 SOL sessions
|
||||
|
@ -27,9 +27,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.
|
||||
|
||||
DOCDIR = $(datadir)/doc/$(PACKAGE)
|
||||
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) \
|
||||
debian/changelog debian/control debian/copyright \
|
||||
@ -48,11 +52,8 @@ dist-hook:
|
||||
cp control/ipmitool.spec $(distdir)
|
||||
|
||||
install-data-local:
|
||||
mkdir -p $(DESTDIR)$(DOCDIR)
|
||||
$(INSTALL_DATA) $(DOCLIST) $(DESTDIR)$(DOCDIR)
|
||||
|
||||
uninstall-local:
|
||||
-rm -rf $(DESTDIR)$(DOCDIR)
|
||||
mkdir -p $(DOCDIR)
|
||||
install -m 644 $(DOCLIST) $(DOCDIR)
|
||||
|
||||
.PHONY: pkg
|
||||
pkg: PKG := ipmitool-@VERSION@-@OS@-@ARCH@
|
||||
@ -79,3 +80,4 @@ rpm: control/ipmitool.spec dist
|
||||
.PHONY: clean-rpm
|
||||
clean-rpm:
|
||||
-rm -rf $(RPMDIR)
|
||||
|
||||
|
@ -29,6 +29,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.
|
||||
|
||||
aclocal
|
||||
libtoolize --automake --copy
|
||||
|
@ -3,7 +3,7 @@ dnl autoconf for ipmitool
|
||||
dnl
|
||||
AC_INIT([src/ipmitool.c])
|
||||
AC_CANONICAL_SYSTEM
|
||||
AM_INIT_AUTOMAKE([ipmitool], [1.8.9])
|
||||
AM_INIT_AUTOMAKE([ipmitool], [1.8.6])
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AC_CONFIG_SRCDIR([src/ipmitool.c])
|
||||
AC_PREREQ(2.50)
|
||||
@ -18,7 +18,7 @@ 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([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h paths.h termios.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])
|
||||
|
||||
@ -91,17 +91,6 @@ solaris*)
|
||||
enable_intf_bmc=no
|
||||
enable_ipmishell=no
|
||||
;;
|
||||
*freebsd*)
|
||||
enable_intf_imb=no
|
||||
enable_intf_lipmi=no
|
||||
enable_intf_bmc=no
|
||||
;;
|
||||
*netbsd*)
|
||||
enable_intf_imb=no
|
||||
enable_intf_lipmi=no
|
||||
enable_intf_bmc=no
|
||||
enable_intf_open=no
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(ARCH, $host_cpu)
|
||||
@ -183,8 +172,6 @@ else
|
||||
enable_intf_lanplus=no
|
||||
fi
|
||||
|
||||
ORIG_CPPFLAGS=$CPPFLAGS
|
||||
|
||||
dnl look for OpenIPMI header files
|
||||
AC_ARG_WITH([kerneldir],
|
||||
[AC_HELP_STRING([--with-kerneldir=DIR],
|
||||
@ -194,8 +181,6 @@ AC_ARG_WITH([kerneldir],
|
||||
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/'`
|
||||
@ -204,73 +189,10 @@ AC_ARG_WITH([kerneldir],
|
||||
AC_SUBST(CPPFLAGS)
|
||||
fi
|
||||
fi])
|
||||
|
||||
AH_TEMPLATE([HAVE_LINUX_COMPILER_H], [])
|
||||
AC_MSG_CHECKING([for linux/compiler.h])
|
||||
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([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])
|
||||
AC_ARG_ENABLE([intf-free],
|
||||
[AC_HELP_STRING([--enable-intf-free],
|
||||
[enable FreeIPMI IPMI interface [default=auto]])],
|
||||
[if test "x$enable_intf_free" != "xno" && test "x$have_free" != "xyes"; then
|
||||
echo "** Unable to build FreeIPMI interface support!"
|
||||
enable_intf_free=no
|
||||
fi],
|
||||
[enable_intf_free=$have_free])
|
||||
if test "x$enable_intf_free" = "xstatic" || test "x$enable_intf_free" = "xplugin"; then
|
||||
enable_intf_free=yes
|
||||
fi
|
||||
if test "x$enable_intf_free" = "xyes"; then
|
||||
dnl Determine if you got the right FreeIPMI version
|
||||
AC_MSG_CHECKING([for good libfreeipmi version])
|
||||
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_good=yes,ac_free_version_good=no)
|
||||
AC_MSG_RESULT($ac_free_version_good)
|
||||
if test "x$ac_free_version_good" = "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"
|
||||
else
|
||||
enable_intf_free=no
|
||||
fi
|
||||
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."])])
|
||||
[echo "** Unable to find OpenIPMI header files. Using internal version."])
|
||||
|
||||
dnl set RPM distro tag for use in RPM name
|
||||
AC_ARG_WITH([rpm-distro],
|
||||
@ -278,13 +200,6 @@ AC_ARG_WITH([rpm-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],
|
||||
@ -358,8 +273,8 @@ AC_ARG_ENABLE([ipmishell],
|
||||
[enable IPMI shell interface [default=yes]])],
|
||||
[], [enable_ipmishell=yes])
|
||||
if test "x$enable_ipmishell" = "xyes"; then
|
||||
AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses readline termcap])
|
||||
AC_SEARCH_LIBS([initscr], [ncurses curses], [have_curses=yes])
|
||||
AC_SEARCH_LIBS([tgetent], [readline ncurses curses termcap])
|
||||
AC_SEARCH_LIBS([initscr], [curses ncurses], [have_curses=yes])
|
||||
AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes])
|
||||
if test "x$have_curses" = "xyes" && test "x$have_readline" = "xyes"; then
|
||||
AC_DEFINE(HAVE_READLINE, [1], [Define to 1 if readline present.])
|
||||
@ -376,14 +291,6 @@ AC_ARG_ENABLE([buildcheck],
|
||||
|
||||
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]])],
|
||||
[if test "x$enable_file_security" != "xno"; then
|
||||
AC_DEFINE(ENABLE_FILE_SECURITY, [1], [Define to 1 for extra file security.])
|
||||
fi], [])
|
||||
|
||||
dnl Generate files for build
|
||||
AC_CONFIG_FILES([Makefile
|
||||
doc/Makefile
|
||||
@ -401,7 +308,6 @@ AC_CONFIG_FILES([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/lipmi/Makefile])
|
||||
@ -415,7 +321,6 @@ 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([ free : $enable_intf_free])
|
||||
AC_MSG_RESULT([ imb : $enable_intf_imb])
|
||||
AC_MSG_RESULT([ bmc : $enable_intf_bmc])
|
||||
AC_MSG_RESULT([ lipmi : $enable_intf_lipmi])
|
||||
|
@ -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 = README oem_ibm_sel_map \
|
||||
bmclanconf ipmi.init.basic ipmi.init.redhat \
|
||||
ipmievd.init.redhat ipmievd.init.suse ipmievd.init.debian \
|
||||
dist_pkgdata_DATA = README
|
||||
|
||||
dist_pkgdata_SCRIPTS = bmclanconf ipmi.init.basic ipmi.init.redhat \
|
||||
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.
|
||||
|
@ -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=/var/run/$NAME.pid
|
||||
SCRIPTNAME=/etc/init.d/$NAME
|
||||
|
||||
# Gracefully exit if the package has been removed.
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
. /etc/default/rcS
|
||||
|
||||
# Options used by ipmievd.
|
||||
#
|
||||
# "open" uses the asynchronous event notification from the OpenIPMI
|
||||
# kernel driver, "sel" uses active polling of the contents of the SEL
|
||||
# for new events.
|
||||
#
|
||||
# Need to force 'daemon' mode, to make sure messages are sent to
|
||||
# syslog and the program forks into the background.
|
||||
#
|
||||
# Se ipmievd(8) for more info.
|
||||
IPMIEVD_OPTIONS="open daemon"
|
||||
|
||||
# Read config file if it is present.
|
||||
[ -f /etc/default/$NAME ] && . /etc/default/$NAME
|
||||
|
||||
#
|
||||
# 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,202 +0,0 @@
|
||||
"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 added, 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 removed, 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","0x0E","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","0x0F","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","0x10","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","0x11","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","0x12","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","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","0x0E","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","0x0F","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","0x10","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","0x11","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","0x12","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","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","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","0x03","0x00","Chassis Number","Memory Card","R","R","R","R","R","R","R","R","0x00","Memory card enabled"
|
||||
"0xE0","0x03","0x00","Chassis Number","Memory Card","R","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)"
|
||||
"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","PERR: 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","PERR: 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","PERR: 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","PERR: 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","PERR: 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","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"
|
||||
"0xE2","0x00","Register ID","R","First Fire Bit","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","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"
|
@ -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
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
Name: ipmitool
|
||||
Summary: ipmitool - Utility for IPMI control
|
||||
Version: @VERSION@
|
||||
Release: @RPM_RELEASE@%{?_distro:.%{_distro}}
|
||||
Release: 1%{?_distro:.%{_distro}}
|
||||
License: BSD
|
||||
Group: Utilities
|
||||
Packager: Duncan Laurie <duncan@iceblink.org>
|
||||
Source: %{name}-%{version}.tar.gz
|
||||
Source: ipmitool-@VERSION@.tar.gz
|
||||
Buildroot: /var/tmp/ipmitool-root
|
||||
|
||||
%description
|
||||
@ -50,91 +50,18 @@ make DESTDIR=$RPM_BUILD_ROOT install-strip
|
||||
if [ "$RPM_BUILD_ROOT" ] && [ "$RPM_BUILD_ROOT" != "/" ]; then
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
fi
|
||||
rm -rf $RPM_BUILD_DIR/ipmitool-@VERSION@
|
||||
|
||||
%files
|
||||
%defattr(755,root,root)
|
||||
%attr(755,root,root) %{_bindir}/*
|
||||
%attr(755,root,root) %{_sbindir}/*
|
||||
%{_mandir}/man*/*
|
||||
%doc %{_datadir}/doc/ipmitool
|
||||
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/*
|
||||
%{_sbindir}/*
|
||||
%{_datadir}/ipmitool/*
|
||||
%doc %{_mandir}/man1/*
|
||||
%doc %{_mandir}/man8/*
|
||||
%doc %{_datadir}/doc/ipmitool/*
|
||||
|
||||
%changelog
|
||||
* Tue Mar 6 2007 <pere@hungry.com> 1.8.9-1
|
||||
- Added initial AMC ekey query operation support
|
||||
- Improvements to ekeying support (PICMG 3.x only)
|
||||
- Added initial interactive edition support for multirec; added IANA
|
||||
verification before interpreting PICMG records.
|
||||
- Added edit support for AMC activation "Maximum Internal Current"
|
||||
- Fix bug generating garbage on the screen when handling GetDeviceId
|
||||
and sol traffic occurs
|
||||
- Added ability to map OEM sensor types to OEM description string using
|
||||
IANA number; moved IANA number table
|
||||
- Fix lan set access command to use value already saved within parameters
|
||||
for PEF and authentication
|
||||
- Fix bug in cmd ipmitool lan stats get 1
|
||||
- Add support to allow ipmitool/ipmievd to target specific device nodes
|
||||
on multi-BMC systems
|
||||
- Add support for name+privilege lookup for lanplus sessions
|
||||
- Fix time_t conversion bug for 64-bit OS
|
||||
- Added prefix of hostname on sel ipmievd sessions
|
||||
- Fixed FWUM Get Info
|
||||
- Fix ipmievd fd closing bug
|
||||
- Add set-in-progress flag support to chassis bootdev
|
||||
- Added new chassis bootdev options
|
||||
- Add sol payload enable/disable comman
|
||||
- Fix SOL set errors when commit-write not supported
|
||||
- Fix reset of session timeout for lanplus interface
|
||||
- Fixed lan interface accessibility timeout handling
|
||||
- Fix bug with Function Get Channel Cipher Suites command when more
|
||||
than 1 page used.
|
||||
- Fix missing firmware firewall top-level command
|
||||
- Fix bug in SOL keepalive functionality
|
||||
- Fix SOLv2 NACK and retry handling for Intel ESB2 BMC
|
||||
- Added ipmi_sel_get_oem_sensor* APIs
|
||||
- Added HPM.1 support
|
||||
- Fix segfault when incorrect oem option supplied
|
||||
- Fix bus problem with spd command
|
||||
- Fix segfault in SOL when remote BMC does not return packet
|
||||
- Adjust packet length for AMC.0 retricting IPMB packets to 32 bytes
|
||||
- Added lan packet size reduction mechanism
|
||||
- Fix bug with sendMessage of bad length with different target
|
||||
- Fix for big endian (PPC) architecture
|
||||
- NetBSD fixes
|
||||
- Fix segfault and channel problem with user priv command
|
||||
- Add support for bus/chan on i2c raw command
|
||||
- Add freeipmi interface support
|
||||
- Add remote spd printing
|
||||
- Add better detection of linux/compiler.h to config
|
||||
- Makefile changes to fix makedistcheck, etc.
|
||||
|
||||
* Tue May 02 2006 <duncan@iceblink.org> 1.8.8-1
|
||||
- Fix segfaults in sensor data repository list
|
||||
- Fix ipmievd to open interface before daemonizing
|
||||
- Fix IPMIv1.5 authtype NONE to ignore supplied password
|
||||
- Fix cipher suite display bug in lan print
|
||||
- Fix typo in IPMIv2 SOL output when sending break
|
||||
- Fix improper LUN handling with Tyan SOL
|
||||
- Add LUN support to OpenIPMI interface
|
||||
- Add support for Kontron OEM commands
|
||||
- Update to Kontron Firmware Update command
|
||||
|
||||
* Sun Mar 19 2006 <duncan@iceblink.org> 1.8.7-1
|
||||
- Add Sun OEM command for blades
|
||||
- Increase argument size for raw commands in shell/exec
|
||||
- Fix handling of LUNs for LAN interfaces
|
||||
- Add IPMIv2 SOL loopback test
|
||||
- Add support for IBM OEM SEL messages
|
||||
- Disable file paranoia checks on read files by default
|
||||
- Support IPMIv2 SOL on older Intel boxes
|
||||
- Display message and exit if keepalive fails during SOL
|
||||
- Add support for setting VLAN id and priority
|
||||
- Add support for FreeBSD OpenIPMI-compatible driver
|
||||
- Add support for IPMIv2 Firmware Firewall
|
||||
- Fix gcc4 compile warnings
|
||||
- Make ipmievd generate pidfile
|
||||
- Add initscripts for ipmievd
|
||||
|
||||
* Mon Jan 17 2006 <duncan@iceblink.org> 1.8.6-1
|
||||
- Fix memory corruption when sending encrypted SOL traffic
|
||||
- Add keepalive timer to IPMIv2 SOL sessions
|
||||
|
@ -1,53 +1,3 @@
|
||||
ipmitool (1.8.7-2) unstable; urgency=low
|
||||
|
||||
* Fix typo in init.d/ipmievd. (Closes: #361309)
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Sat, 8 Apr 2006 06:44:31 +0200
|
||||
|
||||
ipmitool (1.8.7-1) unstable; urgency=low
|
||||
|
||||
* New upstream version.
|
||||
- Dropped nuclear clause from the copyright. Updated debian/copyright
|
||||
to reflect this.
|
||||
- ipmievd now store pid in /var/run/ipmievd.pid. Adjust init.d
|
||||
script to use it.
|
||||
* Rename /etc/default/ipmievd variable IPMIEVD_OPTS is renamed to
|
||||
IPMIEVD_OPTIONS to stay compatible with upstream and other
|
||||
distributions. Add backwards compatibility code with a warning to
|
||||
the users of the old variable.
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Sun, 26 Mar 2006 21:11:08 +0200
|
||||
|
||||
ipmitool (1.8.6-2) unstable; urgency=low
|
||||
|
||||
* Add ia64 as an supported arch. (Closes: #355930)
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Fri, 10 Mar 2006 23:34:50 +0100
|
||||
|
||||
ipmitool (1.8.6-1) unstable; urgency=low
|
||||
|
||||
* New upstream version.
|
||||
- Avoid crashing when setting lan IP address. (Closes: #351205)
|
||||
* Avoid changing history by reverding upstream change
|
||||
to email addresses in debian/changelog.
|
||||
* Correct typo in control file: Suggest -> Suggests. Thanks
|
||||
to Philipp Matthias Hahn for the report.
|
||||
* Add init.d/ipmievd script. Based on script from Elmar Hoffmann,
|
||||
slightly modified to use lsb-base functions. Added dependency on
|
||||
lsb-base. (Closes: #345994)
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Sun, 26 Feb 2006 10:31:14 +0100
|
||||
|
||||
ipmitool (1.8.2-2) unstable; urgency=low
|
||||
|
||||
* Add build-dependency on 'libreadline5-dev | libreadline-dev' to make
|
||||
sure all archs get readline support. (Closes: #326341)
|
||||
* Add build-dependency on libssl-dev to enable SSL support on
|
||||
all archs.
|
||||
* Updated Standards-Version to 3.6.2.1. (No updates required)
|
||||
|
||||
-- Petter Reinholdtsen <pere@debian.org> Sat, 3 Sep 2005 19:18:51 +0200
|
||||
|
||||
ipmitool (1.8.2-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
@ -3,13 +3,13 @@ Section: utils
|
||||
Priority: optional
|
||||
Maintainer: Petter Reinholdtsen <pere@debian.org>
|
||||
Uploaders: Duncan Laurie <duncan@iceblink.org>
|
||||
Build-Depends: debhelper (>> 4.0.0), libreadline5-dev | libreadline-dev, libssl-dev
|
||||
Standards-Version: 3.6.2.1
|
||||
Build-Depends: debhelper (>> 4.0.0),
|
||||
Standards-Version: 3.6.1
|
||||
|
||||
Package: ipmitool
|
||||
Architecture: i386 amd64 ia64
|
||||
Depends: ${shlibs:Depends}, lsb-base
|
||||
Suggests: openipmi
|
||||
Architecture: i386 amd64
|
||||
Depends: ${shlibs:Depends}
|
||||
Suggest: openipmi
|
||||
Description: utility for IPMI control with kernel driver or LAN interface
|
||||
A utility for managing and configuring devices that support the
|
||||
Intelligent Platform Management Interface. IPMI is an open standard
|
||||
|
@ -34,3 +34,7 @@ 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.
|
||||
|
@ -1,99 +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=/var/run/$NAME.pid
|
||||
SCRIPTNAME=/etc/init.d/$NAME
|
||||
|
||||
# Gracefully exit if the package has been removed.
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
. /etc/default/rcS
|
||||
|
||||
# Options used by ipmievd.
|
||||
#
|
||||
# "open" uses the asynchronous event notification from the OpenIPMI
|
||||
# kernel driver, "sel" uses active polling of the contents of the SEL
|
||||
# for new events.
|
||||
#
|
||||
# Need to force 'daemon' mode, to make sure messages are sent to
|
||||
# syslog and the program forks into the background.
|
||||
#
|
||||
# Se ipmievd(8) for more info.
|
||||
IPMIEVD_OPTIONS="open daemon"
|
||||
|
||||
# Read config file if it is present.
|
||||
[ -f /etc/default/$NAME ] && . /etc/default/$NAME
|
||||
|
||||
# Backwards compatibility with version 1.8.6-2 and 1.8.6-1. The
|
||||
# variable was renamed to be compatible with upstream, SuSe and RedHat.
|
||||
if [ -n "$IPMIEVD_OPTS" ]; then
|
||||
echo "warning: /etc/default/$NAME variable IPMIEVD_OPTS should be renamed to IPMIEVD_OPTIONS"
|
||||
IPMIEVD_OPTIONS="$IPMIEVD_OPTS"
|
||||
fi
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service.
|
||||
#
|
||||
d_start() {
|
||||
start-stop-daemon --start --quiet --exec $DAEMON -- $IPMIEVD_OPTIONS
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service.
|
||||
#
|
||||
d_stop() {
|
||||
start-stop-daemon --stop --quiet --name $NAME --exec $DAEMON
|
||||
}
|
||||
|
||||
CODE=0
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_begin_msg "Starting $DESC" "$NAME"
|
||||
d_start || CODE=$?
|
||||
[ "$VERBOSE" != no ] && log_end_msg $CODE
|
||||
exit $CODE
|
||||
;;
|
||||
stop)
|
||||
log_begin_msg "Stopping $DESC" "$NAME"
|
||||
d_stop || CODE=$?
|
||||
log_end_msg $CODE
|
||||
exit $CODE
|
||||
;;
|
||||
restart|force-reload)
|
||||
log_begin_msg "Restarting $DESC" "$NAME"
|
||||
d_stop || true
|
||||
sleep 1
|
||||
d_start || CODE=$?
|
||||
log_end_msg $CODE
|
||||
exit $CODE
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -91,7 +91,6 @@ binary-common:
|
||||
dh_testroot
|
||||
dh_installdocs
|
||||
dh_installchangelogs
|
||||
dh_installinit --name ipmievd
|
||||
dh_link
|
||||
dh_strip
|
||||
dh_compress
|
||||
|
@ -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
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
.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]
|
||||
ipmievd [\fB\-c\fR|\fB\-h\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]
|
||||
@ -13,7 +13,6 @@ ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
[\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]
|
||||
@ -23,7 +22,6 @@ ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
[\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"
|
||||
@ -46,7 +44,7 @@ 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.
|
||||
session activation. Supported types are NONE, PASSWORD, MD5, or OEM.
|
||||
.TP
|
||||
\fB\-c\fR
|
||||
Present output in CSV (comma separated variable) format.
|
||||
@ -92,10 +90,6 @@ 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
|
||||
@ -116,13 +110,6 @@ Bridge IPMI requests to the remote target address.
|
||||
\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
|
||||
@ -171,11 +158,6 @@ 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
|
||||
/var/run/ipmievd.pid\fIN\fP (where \fIN\fP is the ipmi device
|
||||
number -- defaults to 0).
|
||||
.RE
|
||||
|
||||
.TP
|
||||
@ -194,11 +176,6 @@ 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
|
||||
/var/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.
|
||||
|
@ -2,7 +2,7 @@
|
||||
.SH "NAME"
|
||||
ipmitool \- utility for controlling IPMI\-enabled devices
|
||||
.SH "SYNOPSIS"
|
||||
ipmitool [\fB\-c\fR|\fB\-h\fR|\fB\-d \fIN\fP\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
ipmitool [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
\fB\-I\fR \fIopen\fP <\fIcommand\fP>
|
||||
|
||||
ipmitool [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
@ -13,7 +13,6 @@ ipmitool [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
[\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\-e\fR <\fIesc_char\fP>]
|
||||
<\fIcommand\fP>
|
||||
|
||||
@ -24,7 +23,6 @@ ipmitool [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
|
||||
[\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>]
|
||||
[\fB\-k\fR <\fIkg_key\fP>]
|
||||
[\fB\-e\fR <\fIesc_char\fP>]
|
||||
@ -51,7 +49,7 @@ 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.
|
||||
session activation. Supported types are NONE, PASSWORD, MD5, or OEM.
|
||||
.TP
|
||||
\fB\-c\fR
|
||||
Present output in CSV (comma separated variable) format.
|
||||
@ -105,10 +103,6 @@ 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
|
||||
@ -130,13 +124,6 @@ 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
|
||||
@ -763,20 +750,6 @@ Set BMC generated gratuitous ARPs.
|
||||
|
||||
Set BMC generated gratuitous ARP interval.
|
||||
.TP
|
||||
\fIvlan id\fP <\fBoff\fR|\fBid\fR>
|
||||
.br
|
||||
|
||||
Disable VLAN operation or enable VLAN and set the ID.
|
||||
.br
|
||||
ID: value of the virtual lan identifier between 1 and 4094 inclusive.
|
||||
.TP
|
||||
\fIvlan priority\fP <\fBpriority\fR>
|
||||
.br
|
||||
|
||||
Set the priority associated with VLAN frames.
|
||||
.br
|
||||
ID: priority of the virtual lan frames between 0 and 7 inclusive.
|
||||
.TP
|
||||
\fIauth\fP <\fBlevel\fR,\fB...\fR> <\fBtype\fR,\fB...\fR>
|
||||
.br
|
||||
|
||||
@ -1528,16 +1501,6 @@ on the cipher suite ID found in the IPMIv2.0 specification in table
|
||||
22\-19. The default cipher suite is \fI3\fP which specifies
|
||||
RAKP\-HMAC\-SHA1 authentication, HMAC\-SHA1\-96 integrity, and AES\-CBC\-128
|
||||
encryption algorightms.
|
||||
|
||||
.SH "FREE INTERFACE"
|
||||
.LP
|
||||
The ipmitool \fIfree\fP interface utilizes the FreeIPMI libfreeipmi
|
||||
drivers.
|
||||
.LP
|
||||
You can tell ipmitool to use the FreeIPMI interface with the -I option:
|
||||
.PP
|
||||
ipmitool \fB\-I\fR \fIfree\fP <\fIcommand\fP>
|
||||
|
||||
.SH "EXAMPLES"
|
||||
.TP
|
||||
\fIExample 1\fP: Listing remote sensors
|
||||
@ -1600,6 +1563,4 @@ http://www.intel.com/design/servers/ipmi
|
||||
.TP
|
||||
OpenIPMI Homepage
|
||||
http://openipmi.sourceforge.net
|
||||
.TP
|
||||
FreeIPMI Homepage
|
||||
http://www.gnu.org/software/freeipmi/
|
||||
|
||||
|
@ -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,18 @@
|
||||
# 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
|
||||
|
||||
noinst_HEADERS = log.h bswap.h helper.h ipmi.h ipmi_cc.h ipmi_intf.h \
|
||||
ipmi_chassis.h ipmi_entity.h ipmi_fru.h ipmi_hpmfwupg.h ipmi_lanp.h \
|
||||
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_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_isol.h ipmi_sunoem.h ipmi_picmg.h \
|
||||
ipmi_fwum.h ipmi_main.h ipmi_tsol.h ipmi_firewall.h \
|
||||
ipmi_kontronoem.h
|
||||
ipmi_fwum.h ipmi_main.h ipmi_tsol.h
|
||||
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_BSWAP_H
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_HELPER_H
|
||||
@ -38,29 +42,11 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
|
||||
struct ipmi_intf;
|
||||
|
||||
struct valstr {
|
||||
uint16_t val;
|
||||
const char * str;
|
||||
};
|
||||
struct oemvalstr {
|
||||
uint16_t oem;
|
||||
uint16_t val;
|
||||
const char * str;
|
||||
};
|
||||
|
||||
const char * val2str(uint16_t val, const struct valstr * vs);
|
||||
const char * oemval2str(uint16_t oem,uint16_t val, const struct oemvalstr * vs);
|
||||
uint16_t str2val(const char * str, const struct valstr * vs);
|
||||
void print_valstr(const struct valstr * vs, const char * title, int loglevel);
|
||||
void print_valstr_2col(const struct valstr * vs, const char * title, int loglevel);
|
||||
@ -72,7 +58,7 @@ const char * buf2str(uint8_t * buf, int len);
|
||||
void printbuf(const uint8_t * buf, int len, const char * desc);
|
||||
uint8_t ipmi_csum(uint8_t * d, int s);
|
||||
FILE * ipmi_open_file(const char * file, int rw);
|
||||
void ipmi_start_daemon(struct ipmi_intf *intf);
|
||||
void ipmi_start_daemon(void);
|
||||
|
||||
#define ipmi_open_file_read(file) ipmi_open_file(file, 0)
|
||||
#define ipmi_open_file_write(file) ipmi_open_file(file, 1)
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_H
|
||||
@ -39,8 +43,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi_cc.h>
|
||||
|
||||
|
||||
#define IPMI_BUF_SIZE 1024
|
||||
|
||||
@ -236,21 +238,6 @@ struct ipmi_rs {
|
||||
#define IPMI_BMC_SLAVE_ADDR 0x20
|
||||
#define IPMI_REMOTE_SWID 0x81
|
||||
|
||||
|
||||
/* These values are IANA numbers */
|
||||
typedef enum IPMI_OEM {
|
||||
IPMI_OEM_UNKNOWN = 0,
|
||||
IPMI_OEM_SUN = 42,
|
||||
IPMI_OEM_NOKIA = 94,
|
||||
IPMI_OEM_INTEL = 343,
|
||||
IPMI_OEM_TYAN = 6653,
|
||||
IPMI_OEM_NEWISYS = 9237,
|
||||
IPMI_OEM_SUPERMICRO = 10876,
|
||||
IPMI_OEM_GOOGLE = 11129,
|
||||
IPMI_OEM_PICMG = 12634,
|
||||
IPMI_OEM_KONTRON = 15000,
|
||||
} IPMI_OEM;
|
||||
|
||||
extern const struct valstr completion_code_vals[];
|
||||
|
||||
#endif /* IPMI_H */
|
||||
|
@ -1,76 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_CC_H
|
||||
#define IPMI_CC_H
|
||||
|
||||
/*
|
||||
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
|
||||
|
||||
|
||||
#endif /*IPMI_CC_H*/
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_CHANNEL_H
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_CHASSIS_H
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_CONSTANTS_H
|
||||
@ -51,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
|
||||
@ -105,15 +107,6 @@
|
||||
#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
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_ENTITY_H
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_EVENT_H
|
||||
|
@ -1,106 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_FIREWALL_H
|
||||
#define IPMI_FIREWALL_H
|
||||
|
||||
#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));
|
||||
}
|
||||
|
||||
#endif /*IPMI_FIREWALL_H */
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_FRU_H
|
||||
@ -118,7 +122,7 @@ struct fru_multirec_header {
|
||||
#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
|
||||
#define FRU_RECORD_TYPE_PICMG_EXTENSION 0xc0
|
||||
uint8_t type;
|
||||
uint8_t format;
|
||||
uint8_t len;
|
||||
@ -207,7 +211,7 @@ struct fru_multirec_dcload {
|
||||
uint16_t max_current;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fru_multirec_oem_header {
|
||||
struct fru_multirec_picmgext_header {
|
||||
unsigned char mfg_id[3];
|
||||
#define FRU_PICMG_BACKPLANE_P2P 0x04
|
||||
#define FRU_PICMG_ADDRESS_TABLE 0x10
|
||||
@ -252,57 +256,6 @@ struct fru_picmgext_link_desc {
|
||||
#endif
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
#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
|
||||
|
||||
/* This is used in command, not in FRU */
|
||||
struct fru_picmgext_amc_link_info {
|
||||
unsigned char linkInfo[3];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
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__ ((packed));
|
||||
|
||||
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__ ((packed));
|
||||
|
||||
|
||||
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__ ((packed));
|
||||
|
||||
|
||||
struct fru_picmgext_chn_desc {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
unsigned char remote_slot:8;
|
||||
@ -323,17 +276,11 @@ struct fru_picmgext_slot_desc {
|
||||
unsigned char chn_count;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define FRU_PICMGEXT_DESIGN_IF_BASE 0x00
|
||||
#define FRU_PICMGEXT_DESIGN_IF_FABRIC 0x01
|
||||
#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
|
||||
|
||||
struct fru_picmgext_carrier_activation_record {
|
||||
unsigned short max_internal_curr;
|
||||
unsigned char allowance_for_readiness;
|
||||
unsigned char module_activation_record_count;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct fru_picmgext_activation_record {
|
||||
unsigned char ibmb_addr;
|
||||
unsigned char max_module_curr;
|
||||
@ -371,7 +318,5 @@ static const char *chassis_type_desc[] __attribute__ ((unused)) = {
|
||||
|
||||
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);
|
||||
int ipmi_spd_print(uint8_t *data, int len);
|
||||
int ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id);
|
||||
|
||||
#endif /* IPMI_FRU_H */
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_KFWUM_H
|
||||
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistribution of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistribution in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Sun Microsystems, Inc. or the names of
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* This software is provided "AS IS," without a warranty of any kind.
|
||||
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
|
||||
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
|
||||
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
|
||||
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
|
||||
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
|
||||
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
|
||||
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
|
||||
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
|
||||
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
|
||||
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_HPMFWUPG_H
|
||||
#define IPMI_HPMFWUPG_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
int ipmi_hpmfwupg_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* IPMI_KFWUM_H */
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_INTF_H
|
||||
@ -106,7 +110,6 @@ struct ipmi_session {
|
||||
uint8_t integrity_alg;
|
||||
uint8_t crypt_alg;
|
||||
uint8_t max_priv_level;
|
||||
uint8_t lookupbit;
|
||||
|
||||
uint32_t console_id;
|
||||
uint32_t bmc_id;
|
||||
@ -174,8 +177,6 @@ struct ipmi_intf {
|
||||
uint8_t target_lun;
|
||||
uint8_t target_channel;
|
||||
|
||||
uint8_t devnum;
|
||||
|
||||
int (*setup)(struct ipmi_intf * intf);
|
||||
int (*open)(struct ipmi_intf * intf);
|
||||
void (*close)(struct ipmi_intf * intf);
|
||||
@ -193,7 +194,6 @@ 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);
|
||||
void ipmi_intf_session_set_cipher_suite_id(struct ipmi_intf * intf, uint8_t cipher_suite_id);
|
||||
void ipmi_intf_session_set_sol_escape_char(struct ipmi_intf * intf, char sol_escape_char);
|
||||
void ipmi_intf_session_set_kgkey(struct ipmi_intf * intf, char * kgkey);
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_ISOL_H
|
||||
|
@ -1,45 +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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_KONTRONOEM_H
|
||||
#define IPMI_KONTRONOEM_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
|
||||
int ipmi_kontronoem_main(struct ipmi_intf *, int, char **);
|
||||
|
||||
#endif /* IPMI_KONTRONOEM_H */
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_LANP_H
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_MAIN_H
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_MC_H
|
||||
|
@ -26,6 +26,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_OEM_H
|
||||
|
@ -28,6 +28,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 DELL 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_PEF_H
|
||||
|
@ -1,90 +1,75 @@
|
||||
|
||||
/*
|
||||
(C) Kontron
|
||||
*/
|
||||
|
||||
#ifndef _IPMI_PICMG_H_
|
||||
#define _IPMI_PICMG_H_
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
/* 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
|
||||
|
||||
/* 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
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
(C) Kontron
|
||||
*/
|
||||
|
||||
#ifndef _IPMI_PICMG_H_
|
||||
#define _IPMI_PICMG_H_
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
/* 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
|
||||
|
||||
/* 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
|
||||
|
||||
|
||||
|
||||
struct picmg_set_fru_activation_cmd {
|
||||
unsigned char picmg_id; /* always 0*/
|
||||
unsigned char fru_id; /* threshold setting mask */
|
||||
unsigned char fru_id; /* threshold setting mask */
|
||||
unsigned char fru_state; /* fru activation/deactivation */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* the LED color capabilities */
|
||||
static const char* led_color_str[] __attribute__((unused)) = {
|
||||
"reserved",
|
||||
static unsigned char* led_color_str[] = {
|
||||
"reserved",
|
||||
"BLUE",
|
||||
"RED",
|
||||
"GREEN",
|
||||
"AMBER",
|
||||
"ORANGE",
|
||||
"WHITE",
|
||||
"AMBER",
|
||||
"ORANGE",
|
||||
"WHITE",
|
||||
"reserved"
|
||||
};
|
||||
|
||||
|
||||
|
||||
static const char* amc_link_type_str[] __attribute__((unused)) = {
|
||||
" FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED",
|
||||
" FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED1",
|
||||
" FRU_PICMGEXT_AMC_LINK_TYPE_PCI_EXPRESS",
|
||||
" FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING1",
|
||||
" FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING2",
|
||||
" FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET",
|
||||
" FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO",
|
||||
" FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE",
|
||||
};
|
||||
|
||||
int ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv);
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
int ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv);
|
||||
|
||||
#endif
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_RAW_H
|
||||
@ -36,9 +40,7 @@
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
int ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
struct ipmi_rs * ipmi_master_write_read(struct ipmi_intf * intf, uint8_t bus, uint8_t addr,
|
||||
uint8_t * wdata, uint8_t wsize, uint8_t rsize);
|
||||
struct ipmi_rs * ipmi_master_write_read(struct ipmi_intf * intf, uint8_t addr, uint8_t * wdata, uint8_t wsize, uint8_t rsize);
|
||||
int ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
int ipmi_rawspd_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
|
||||
#endif /* IPMI_RAW_H */
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_SDR_H
|
||||
@ -159,7 +163,7 @@ struct sdr_record_mask {
|
||||
struct {
|
||||
uint16_t assert_event; /* assertion event mask */
|
||||
uint16_t deassert_event; /* de-assertion event mask */
|
||||
uint16_t read; /* discrete reading mask */
|
||||
uint16_t read; /* discrete reaading mask */
|
||||
} discrete;
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN
|
||||
@ -232,52 +236,44 @@ struct sdr_record_mask {
|
||||
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;
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN /* settable threshold mask */
|
||||
uint8_t reserved:2;
|
||||
uint8_t unr:1;
|
||||
uint8_t ucr:1;
|
||||
uint8_t unc:1;
|
||||
uint8_t lnr:1;
|
||||
uint8_t lcr:1;
|
||||
uint8_t lnc:1;
|
||||
#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;
|
||||
uint8_t lnc:1;
|
||||
uint8_t lcr:1;
|
||||
uint8_t lnr:1;
|
||||
uint8_t unc:1;
|
||||
uint8_t ucr:1;
|
||||
uint8_t unr:1;
|
||||
uint8_t reserved:2;
|
||||
#endif
|
||||
} 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;
|
||||
} set;
|
||||
struct {
|
||||
#if WORDS_BIGENDIAN /* readable threshold mask */
|
||||
uint8_t reserved:2;
|
||||
uint8_t unr:1;
|
||||
uint8_t ucr:1;
|
||||
uint8_t unc:1;
|
||||
uint8_t lnr:1;
|
||||
uint8_t lcr:1;
|
||||
uint8_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;
|
||||
uint8_t lnc:1;
|
||||
uint8_t lcr:1;
|
||||
uint8_t lnr:1;
|
||||
uint8_t unc:1;
|
||||
uint8_t ucr:1;
|
||||
uint8_t unr:1;
|
||||
uint8_t reserved:2;
|
||||
#endif
|
||||
} read;
|
||||
};
|
||||
} read;
|
||||
} threshold;
|
||||
} type;
|
||||
} __attribute__ ((packed));
|
||||
@ -730,10 +726,7 @@ struct ipmi_sdr_iterator {
|
||||
|
||||
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_full_sensor *full;
|
||||
@ -771,9 +764,8 @@ static const char *unit_desc[] __attribute__ ((unused)) = {
|
||||
"overflow", "underrun", "collision", "packets", "messages",
|
||||
"characters", "error", "correctable error", "uncorrectable error",};
|
||||
|
||||
/* sensor type codes (IPMI v1.5 table 36.3)
|
||||
/ Updated to v2.0 Table 42-3, Sensor Type Codes */
|
||||
#define SENSOR_TYPE_MAX 0x2C
|
||||
/* sensor type codes (IPMI v1.5 table 36.3) */
|
||||
#define SENSOR_TYPE_MAX 0x29
|
||||
static const char *sensor_type_desc[] __attribute__ ((unused)) = {
|
||||
"reserved",
|
||||
"Temperature", "Voltage", "Current", "Fan",
|
||||
@ -788,8 +780,7 @@ static const char *sensor_type_desc[] __attribute__ ((unused)) = {
|
||||
"OS Boot", "OS Critical Stop", "Slot / Connector",
|
||||
"System ACPI Power State", "Watchdog", "Platform Alert",
|
||||
"Entity Presence", "Monitor ASIC", "LAN",
|
||||
"Management Subsystem Health", "Battery","Session Audit",
|
||||
"Version Change","FRU State" };
|
||||
"Management Subsystem Health", "Battery"};
|
||||
|
||||
struct ipmi_sdr_iterator *ipmi_sdr_start(struct ipmi_intf *intf);
|
||||
struct sdr_get_rs *ipmi_sdr_get_next_header(struct ipmi_intf *intf,
|
||||
@ -805,20 +796,15 @@ int ipmi_sdr_print_listentry(struct ipmi_intf *intf,
|
||||
char *ipmi_sdr_get_unit_string(uint8_t type, uint8_t base, uint8_t modifier);
|
||||
const char *ipmi_sdr_get_status(struct sdr_record_full_sensor *sensor,
|
||||
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 target);
|
||||
struct ipmi_rs *ipmi_sdr_get_sensor_thresholds(struct ipmi_intf *intf,
|
||||
uint8_t sensor);
|
||||
struct ipmi_rs *ipmi_sdr_get_sensor_hysteresis(struct ipmi_intf *intf,
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_SEL_H
|
||||
@ -115,67 +119,6 @@ struct ipmi_event_sensor_types {
|
||||
const char * desc;
|
||||
};
|
||||
|
||||
/* The sel module uses the "iana" number to select the appropriate array at run time
|
||||
This table if for iana number 15000 ( Kontron ), you can add you own OEM sensor types
|
||||
using a similar constuct, look for switch(iana) in ipmi_sel.c
|
||||
*/
|
||||
static struct ipmi_event_sensor_types oem_kontron_event_types[] __attribute__((unused)) = {
|
||||
|
||||
/* event type details uses an oem event type */
|
||||
{ 0xC0 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info", NULL },
|
||||
{ 0xC0 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info", NULL },
|
||||
|
||||
{ 0xC1 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Push Button" },
|
||||
{ 0xC1 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Bridge Reset" },
|
||||
{ 0xC1 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Backplane" },
|
||||
{ 0xC1 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hotswap Fault" },
|
||||
{ 0xC1 , 0x04 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hotswap Healty" },
|
||||
{ 0xC1 , 0x05 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Unknown" },
|
||||
{ 0xC1 , 0x06 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "ITP" },
|
||||
{ 0xC1 , 0x07 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hardware Watchdog" },
|
||||
{ 0xC1 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Software Reset" },
|
||||
|
||||
/* Uses standard digital reading type */
|
||||
{ 0xC2 , 0xFF , 0xff, IPMI_EVENT_CLASS_DIGITAL , "SDRR Init Agent", NULL },
|
||||
|
||||
/* based on PICMG IPMB-0 Link state sensor */
|
||||
{ 0xC3 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "IPMB-L Link State", "IPMB L Disabled" },
|
||||
{ 0xC3 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "IPMB-L Link State", "IPMB L Enabled" },
|
||||
|
||||
{ 0xC4 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Push Button" },
|
||||
{ 0xC4 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Hardware Power Failure" },
|
||||
{ 0xC4 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Unknown" },
|
||||
{ 0xC4 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Hardware Watchdog" },
|
||||
{ 0xC4 , 0x04 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Soft Reset" },
|
||||
{ 0xC4 , 0x05 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Warm Reset" },
|
||||
{ 0xC4 , 0x06 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Cold Reset" },
|
||||
{ 0xC4 , 0x07 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "IPMI Command" },
|
||||
{ 0xC4 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Setup Reset (Save CMOS)" },
|
||||
{ 0xC4 , 0x09 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Power Up Reset" },
|
||||
|
||||
/* event type details uses a standard */
|
||||
{ 0xC5 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Information Agent", NULL },
|
||||
|
||||
{ 0xC6 , 0x0E , 0xff, IPMI_EVENT_CLASS_DISCRETE , "POST Value", "Post Error (see data2)" },
|
||||
|
||||
{ 0xC7 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Upgrade" },
|
||||
{ 0xC7 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Rollback(error)" },
|
||||
{ 0xC7 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Errors (watchdog)" },
|
||||
{ 0xC7 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Manual Rollback" },
|
||||
{ 0xC7 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "Firmware Watchdog Bite, reset occured" },
|
||||
|
||||
{ 0xC8 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Not Loaded" },
|
||||
{ 0xC8 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Initializing" },
|
||||
{ 0xC8 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Ready" },
|
||||
{ 0xC8 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Failure (see data2)" },
|
||||
|
||||
{ 0xC9 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Started" },
|
||||
{ 0xC9 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Pass" },
|
||||
{ 0xC9 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Fail" },
|
||||
/* END */
|
||||
{ 0x00, 0x00, 0xff, 0x00, NULL, NULL },
|
||||
};
|
||||
|
||||
static struct ipmi_event_sensor_types generic_event_types[] __attribute__((unused)) = {
|
||||
/* Threshold Based States */
|
||||
{ 0x01, 0x00, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-critical going low " },
|
||||
@ -577,11 +520,23 @@ static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unu
|
||||
{ 0xF2, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Module Handle Opened" },
|
||||
{ 0xF2, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Quiesced" },
|
||||
|
||||
{ 0xC0, 0x00, 0xff, 0x00, "OEM", "OEM Specific" },
|
||||
{ 0xC0, 0x00, 0xff, 0x00, "OEM", NULL },
|
||||
|
||||
{ 0x00, 0x00, 0x00, 0x00, NULL, NULL },
|
||||
};
|
||||
|
||||
|
||||
/* These values are IANA numbers */
|
||||
typedef enum IPMI_OEM {
|
||||
IPMI_OEM_UNKNOWN = 0,
|
||||
IPMI_OEM_SUN = 42,
|
||||
IPMI_OEM_INTEL = 343,
|
||||
IPMI_OEM_TYAN = 6653,
|
||||
IPMI_OEM_NEWISYS = 9237,
|
||||
IPMI_OEM_SUPERMICRO = 10876,
|
||||
IPMI_OEM_KONTRON = 15000,
|
||||
} IPMI_OEM;
|
||||
|
||||
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);
|
||||
@ -594,6 +549,5 @@ uint16_t ipmi_sel_get_std_entry(struct ipmi_intf * intf, uint16_t id, struct sel
|
||||
char * get_newisys_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec);
|
||||
IPMI_OEM ipmi_get_oem(struct ipmi_intf * intf);
|
||||
char * ipmi_get_oem_desc(struct ipmi_intf * intf, struct sel_event_record * rec);
|
||||
int ipmi_sel_oem_init(const char * filename);
|
||||
|
||||
#endif /* IPMI_SEL_H */
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_SENSOR_H
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_SESSION_H
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_SOL_H
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_STRINGS_H
|
||||
@ -53,8 +57,5 @@ extern const struct valstr ipmi_integrity_algorithms[];
|
||||
extern const struct valstr ipmi_encryption_algorithms[];
|
||||
extern const struct valstr ipmi_oem_info[];
|
||||
|
||||
extern const struct oemvalstr ipmi_oem_sdr_type_vals[];
|
||||
|
||||
|
||||
|
||||
#endif /*IPMI_STRINGS_H*/
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_SUNOEM_H
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_TSOL_H
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_USER_H
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef IPMITOOL_LOG_H
|
||||
|
@ -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.
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/include
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
@ -37,8 +41,7 @@ libipmitool_la_SOURCES = helper.c ipmi_sdr.c ipmi_sel.c ipmi_sol.c ipmi_pef.c \
|
||||
dimm_spd.c ipmi_sensor.c ipmi_channel.c ipmi_event.c \
|
||||
ipmi_session.c ipmi_strings.c ipmi_user.c ipmi_raw.c \
|
||||
ipmi_oem.c ipmi_isol.c ipmi_sunoem.c ipmi_fwum.c ipmi_picmg.c \
|
||||
ipmi_main.c ipmi_tsol.c ipmi_firewall.c ipmi_kontronoem.c \
|
||||
ipmi_hpmfwupg.c
|
||||
ipmi_main.c ipmi_tsol.c
|
||||
|
||||
libipmitool_la_LDFLAGS = -export-dynamic
|
||||
libipmitool_la_LIBADD = -lm
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
@ -669,74 +673,13 @@ const struct valstr jedec_id5_vals[] = {
|
||||
};
|
||||
|
||||
int
|
||||
ipmi_spd_print(uint8_t *spd_data, int len)
|
||||
{
|
||||
int size;
|
||||
|
||||
if (len < 92)
|
||||
return -1; /* we need first 91 bytes to do our thing */
|
||||
|
||||
size = spd_data[5] * (spd_data[31] << 2);
|
||||
printf(" Memory Size : %d MB\n", size);
|
||||
printf(" Memory Type : %s\n",
|
||||
val2str(spd_data[2], spd_memtype_vals));
|
||||
printf(" Voltage Intf : %s\n",
|
||||
val2str(spd_data[8], spd_voltage_vals));
|
||||
printf(" Error Detect/Cor : %s\n",
|
||||
val2str(spd_data[11], spd_config_vals));
|
||||
|
||||
/* handle jedec table bank continuation values */
|
||||
printf(" Manufacturer : ");
|
||||
if (spd_data[64] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[64], jedec_id1_vals));
|
||||
else {
|
||||
if (spd_data[65] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[65], jedec_id2_vals));
|
||||
else {
|
||||
if (spd_data[66] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[66], jedec_id3_vals));
|
||||
else {
|
||||
if (spd_data[67] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[67],
|
||||
jedec_id4_vals));
|
||||
else
|
||||
printf("%s\n",
|
||||
val2str(spd_data[68],
|
||||
jedec_id5_vals));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (spd_data[73]) {
|
||||
char part[19];
|
||||
memcpy(part, spd_data+73, 18);
|
||||
part[18] = 0;
|
||||
printf(" Part Number : %s\n", part);
|
||||
}
|
||||
|
||||
printf(" Serial Number : %02x%02x%02x%02x\n",
|
||||
spd_data[95], spd_data[96], spd_data[97], spd_data[98]);
|
||||
|
||||
if (verbose) {
|
||||
printf("\n");
|
||||
printbuf(spd_data, len, "SPD DATA");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id)
|
||||
ipmi_spd_print(struct ipmi_intf * intf, uint8_t id)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct fru_info fru;
|
||||
uint8_t spd_data[256], msg_data[4];
|
||||
int len, offset;
|
||||
int len, offset, size;
|
||||
|
||||
msg_data[0] = id;
|
||||
|
||||
@ -803,8 +746,53 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id)
|
||||
offset += len;
|
||||
} while (offset < fru.size);
|
||||
|
||||
/* now print spd info */
|
||||
ipmi_spd_print(spd_data, offset);
|
||||
if (verbose > 1)
|
||||
printbuf(spd_data, offset, "SPD DATA");
|
||||
|
||||
if (offset < 92)
|
||||
return -1; /* we need first 91 bytes to do our thing */
|
||||
|
||||
size = spd_data[5] * (spd_data[31] << 2);
|
||||
printf(" Memory Size : %d MB\n", size);
|
||||
printf(" Memory Type : %s\n",
|
||||
val2str(spd_data[2], spd_memtype_vals));
|
||||
printf(" Voltage Intf : %s\n",
|
||||
val2str(spd_data[8], spd_voltage_vals));
|
||||
printf(" Error Detect/Cor : %s\n",
|
||||
val2str(spd_data[11], spd_config_vals));
|
||||
|
||||
/* handle jedec table bank continuation values */
|
||||
printf(" Manufacturer : ");
|
||||
if (spd_data[64] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[64], jedec_id1_vals));
|
||||
else {
|
||||
if (spd_data[65] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[65], jedec_id2_vals));
|
||||
else {
|
||||
if (spd_data[66] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[66], jedec_id3_vals));
|
||||
else {
|
||||
if (spd_data[67] != 0x7f)
|
||||
printf("%s\n",
|
||||
val2str(spd_data[67],
|
||||
jedec_id4_vals));
|
||||
else
|
||||
printf("%s\n",
|
||||
val2str(spd_data[68],
|
||||
jedec_id5_vals));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (spd_data[73]) {
|
||||
char part[19];
|
||||
memcpy(part, spd_data+73, 18);
|
||||
part[18] = 0;
|
||||
printf(" Part Number : %s\n", part);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -49,13 +53,9 @@
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PATHS_H
|
||||
# include <paths.h>
|
||||
#else
|
||||
# define _PATH_VARRUN "/var/run/"
|
||||
# include <paths.h> /* For _PATH_TTY */
|
||||
#endif
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/log.h>
|
||||
|
||||
@ -99,13 +99,13 @@ void printbuf(const uint8_t * buf, int len, const char * desc)
|
||||
if (verbose < 1)
|
||||
return;
|
||||
|
||||
fprintf(stderr, "%s (%d bytes)\r\n", desc, len);
|
||||
fprintf(stderr, "%s (%d bytes)\n", desc, len);
|
||||
for (i=0; i<len; i++) {
|
||||
if (((i%16) == 0) && (i != 0))
|
||||
fprintf(stderr, "\r\n");
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, " %2.2x", buf[i]);
|
||||
}
|
||||
fprintf(stderr, "\r\n");
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
const char * val2str(uint16_t val, const struct valstr *vs)
|
||||
@ -124,35 +124,6 @@ const char * val2str(uint16_t val, const struct valstr *vs)
|
||||
return un_str;
|
||||
}
|
||||
|
||||
const char * oemval2str(uint16_t oem, uint16_t val,
|
||||
const struct oemvalstr *vs)
|
||||
{
|
||||
static char un_str[32];
|
||||
int i;
|
||||
|
||||
for (i = 0; vs[i].oem != 0x00 && vs[i].str != NULL; i++) {
|
||||
/* FIXME: for now on we assume PICMG capability on all IANAs */
|
||||
if
|
||||
(
|
||||
(
|
||||
vs[i].oem == oem
|
||||
||
|
||||
vs[i].oem == IPMI_OEM_PICMG
|
||||
)
|
||||
&&
|
||||
vs[i].val == val
|
||||
)
|
||||
{
|
||||
return vs[i].str;
|
||||
}
|
||||
}
|
||||
|
||||
memset(un_str, 0, 32);
|
||||
snprintf(un_str, 32, "OEM reserved #%02x", val);
|
||||
|
||||
return un_str;
|
||||
}
|
||||
|
||||
uint16_t str2val(const char *str, const struct valstr *vs)
|
||||
{
|
||||
int i;
|
||||
@ -181,7 +152,7 @@ print_valstr(const struct valstr * vs, const char * title, int loglevel)
|
||||
|
||||
if (title != NULL) {
|
||||
if (loglevel < 0)
|
||||
printf("\n%s:\n\n", title);
|
||||
printf("\n%s:\n\n");
|
||||
else
|
||||
lprintf(loglevel, "\n%s:\n", title);
|
||||
}
|
||||
@ -230,7 +201,7 @@ print_valstr_2col(const struct valstr * vs, const char * title, int loglevel)
|
||||
|
||||
if (title != NULL) {
|
||||
if (loglevel < 0)
|
||||
printf("\n%s:\n\n", title);
|
||||
printf("\n%s:\n\n");
|
||||
else
|
||||
lprintf(loglevel, "\n%s:\n", title);
|
||||
}
|
||||
@ -308,18 +279,6 @@ ipmi_open_file(const char * file, int rw)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef ENABLE_FILE_SECURITY
|
||||
if (!rw) {
|
||||
/* on read skip the extra checks */
|
||||
fp = fopen(file, "r");
|
||||
if (fp == NULL) {
|
||||
lperror(LOG_ERR, "Unable to open file %s", file);
|
||||
return NULL;
|
||||
}
|
||||
return fp;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* it exists - only regular files, not links */
|
||||
if (S_ISREG(st1.st_mode) == 0) {
|
||||
lprintf(LOG_ERR, "File %s has invalid mode: %d",
|
||||
@ -375,7 +334,7 @@ ipmi_open_file(const char * file, int rw)
|
||||
}
|
||||
|
||||
void
|
||||
ipmi_start_daemon(struct ipmi_intf *intf)
|
||||
ipmi_start_daemon(void)
|
||||
{
|
||||
pid_t pid;
|
||||
int fd;
|
||||
@ -419,7 +378,7 @@ ipmi_start_daemon(struct ipmi_intf *intf)
|
||||
close(fd);
|
||||
}
|
||||
#else
|
||||
if (setpgid(0, 0) == -1)
|
||||
if (setpgrp() == -1)
|
||||
exit(1);
|
||||
pid = (pid_t) fork();
|
||||
if (pid < 0 || pid > 0)
|
||||
@ -429,12 +388,11 @@ ipmi_start_daemon(struct ipmi_intf *intf)
|
||||
chdir("/");
|
||||
umask(0);
|
||||
|
||||
for (fd=0; fd<64; fd++) {
|
||||
if (fd != intf->fd)
|
||||
close(fd);
|
||||
}
|
||||
for (fd=0; fd<64; fd++)
|
||||
close(fd);
|
||||
|
||||
open("/dev/null", O_RDWR);
|
||||
dup(0);
|
||||
dup(0);
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -140,9 +144,9 @@ ipmi_get_channel_auth_cap(struct ipmi_intf * intf,
|
||||
(auth_cap.kg_status) ? "non-zero" : "default (all zeroes)");
|
||||
|
||||
printf("Per message authentication : %sabled\n",
|
||||
(auth_cap.per_message_auth) ? "dis" : "en");
|
||||
(auth_cap.per_message_auth) ? "en" : "dis");
|
||||
printf("User level authentication : %sabled\n",
|
||||
(auth_cap.user_level_auth) ? "dis" : "en");
|
||||
(auth_cap.user_level_auth) ? "en" : "dis");
|
||||
|
||||
printf("Non-null user names exist : %s\n",
|
||||
(auth_cap.non_null_usernames) ? "yes" : "no");
|
||||
@ -222,16 +226,16 @@ ipmi_get_channel_info(struct ipmi_intf * intf, uint8_t channel)
|
||||
|
||||
printf(" Session Support : ");
|
||||
switch (channel_info.session_support) {
|
||||
case 0x0:
|
||||
case 0x00:
|
||||
printf("session-less\n");
|
||||
break;
|
||||
case 0x1:
|
||||
case 0x40:
|
||||
printf("single-session\n");
|
||||
break;
|
||||
case 0x2:
|
||||
case 0x80:
|
||||
printf("multi-session\n");
|
||||
break;
|
||||
case 0x3:
|
||||
case 0xc0:
|
||||
default:
|
||||
printf("session-based\n");
|
||||
break;
|
||||
@ -593,10 +597,12 @@ ipmi_get_channel_cipher_suites(struct ipmi_intf * intf,
|
||||
if (rsp->data_len >= 1)
|
||||
channel = rsp->data[0];
|
||||
|
||||
while ((rsp->data_len > 1) && (rsp->data_len == 17) && (list_index < 0x3F))
|
||||
|
||||
while ((rsp->data_len > 1) && (list_index < 0x3F))
|
||||
{
|
||||
//
|
||||
//
|
||||
// We got back cipher suite data -- store it.
|
||||
//
|
||||
//printf("copying data to offset %d\n", offset);
|
||||
//printbuf(rsp->data + 1, rsp->data_len - 1, "this is the data");
|
||||
memcpy(cipher_suite_data + offset, rsp->data + 1, rsp->data_len - 1);
|
||||
@ -620,16 +626,6 @@ ipmi_get_channel_cipher_suites(struct ipmi_intf * intf,
|
||||
}
|
||||
}
|
||||
|
||||
/* Copy last chunk */
|
||||
if(rsp->data_len > 1)
|
||||
{
|
||||
//
|
||||
// We got back cipher suite data -- store it.
|
||||
//printf("copying data to offset %d\n", offset);
|
||||
//printbuf(rsp->data + 1, rsp->data_len - 1, "this is the data");
|
||||
memcpy(cipher_suite_data + offset, rsp->data + 1, rsp->data_len - 1);
|
||||
offset += rsp->data_len - 1;
|
||||
}
|
||||
|
||||
//
|
||||
// We can chomp on all our data now.
|
||||
@ -850,7 +846,7 @@ ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
else
|
||||
{
|
||||
uint8_t ch = 0xe;
|
||||
if (argc == 3)
|
||||
if (argc == 4)
|
||||
ch = (uint8_t)strtol(argv[2], NULL, 0);
|
||||
retval = ipmi_get_channel_cipher_suites(intf,
|
||||
argv[1], // ipmi | sol
|
||||
@ -866,3 +862,4 @@ ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -172,7 +176,7 @@ ipmi_chassis_identify(struct ipmi_intf * intf, char * arg)
|
||||
printf("default (15 seconds)\n");
|
||||
} else {
|
||||
if (identify_data.force_on != 0) {
|
||||
printf("indefinite\n");
|
||||
printf("indefinate\n");
|
||||
} else {
|
||||
if (identify_data.interval == 0)
|
||||
printf("off\n");
|
||||
@ -448,10 +452,8 @@ ipmi_chassis_set_bootparam(struct ipmi_intf * intf, uint8_t param, uint8_t * dat
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
if (param != 0) {
|
||||
lprintf(LOG_ERR, "Set Chassis Boot Parameter %d failed: %s",
|
||||
param, val2str(rsp->ccode, completion_code_vals));
|
||||
}
|
||||
lprintf(LOG_ERR, "Set Chassis Boot Parameter %d failed: %s",
|
||||
param, val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -499,49 +501,22 @@ ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
|
||||
printf("Boot parameter %d is %s\n", rsp->data[1] & 0x7f,
|
||||
(rsp->data[1] & 0x80) ? "invalid/locked" : "valid/unlocked");
|
||||
printf("Boot parameter data: %s\n", buf2str(rsp->data+2, rsp->data_len - 2));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_chassis_set_bootdev(struct ipmi_intf * intf, char * arg, uint8_t *iflags)
|
||||
ipmi_chassis_set_bootdev(struct ipmi_intf * intf, char * arg, int clearcmos)
|
||||
{
|
||||
uint8_t flags[5];
|
||||
int rc = 0;
|
||||
int use_progress = 1;
|
||||
|
||||
if (use_progress) {
|
||||
/* set set-in-progress flag */
|
||||
memset(flags, 0, 5);
|
||||
flags[0] = 0x01;
|
||||
rc = ipmi_chassis_set_bootparam(intf,
|
||||
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS, flags, 1);
|
||||
if (rc < 0)
|
||||
use_progress = 0;
|
||||
}
|
||||
|
||||
memset(flags, 0, 5);
|
||||
flags[0] = 0x01;
|
||||
flags[1] = 0x01;
|
||||
rc = ipmi_chassis_set_bootparam(intf, IPMI_CHASSIS_BOOTPARAM_INFO_ACK,
|
||||
flags, 2);
|
||||
|
||||
if (rc < 0) {
|
||||
if (use_progress) {
|
||||
/* set-in-progress = set-complete */
|
||||
memset(flags, 0, 5);
|
||||
ipmi_chassis_set_bootparam(intf,
|
||||
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
|
||||
flags, 1);
|
||||
}
|
||||
rc = ipmi_chassis_set_bootparam(intf, 4, flags, 2);
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (iflags == NULL)
|
||||
memset(flags, 0, 5);
|
||||
else
|
||||
memcpy(flags, iflags, sizeof (flags));
|
||||
|
||||
memset(flags, 0, 5);
|
||||
if (arg == NULL)
|
||||
flags[1] = 0x00;
|
||||
else if (strncmp(arg, "none", 4) == 0)
|
||||
@ -569,42 +544,17 @@ ipmi_chassis_set_bootdev(struct ipmi_intf * intf, char * arg, uint8_t *iflags)
|
||||
flags[1] = 0x18;
|
||||
else {
|
||||
lprintf(LOG_ERR, "Invalid argument: %s", arg);
|
||||
if (use_progress) {
|
||||
/* set-in-progress = set-complete */
|
||||
memset(flags, 0, 5);
|
||||
ipmi_chassis_set_bootparam(intf,
|
||||
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
|
||||
flags, 1);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (clearcmos)
|
||||
flags[1] |= 0x80;
|
||||
|
||||
/* set flag valid bit */
|
||||
flags[0] |= 0x80;
|
||||
|
||||
rc = ipmi_chassis_set_bootparam(intf, IPMI_CHASSIS_BOOTPARAM_BOOT_FLAGS,
|
||||
flags, 5);
|
||||
if (rc == 0) {
|
||||
if (use_progress) {
|
||||
/* set-in-progress = commit-write */
|
||||
memset(flags, 0, 5);
|
||||
flags[0] = 0x02;
|
||||
ipmi_chassis_set_bootparam(intf,
|
||||
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
|
||||
flags, 1);
|
||||
}
|
||||
|
||||
flags[0] = 0x80;
|
||||
rc = ipmi_chassis_set_bootparam(intf, 5, flags, 5);
|
||||
if (rc == 0)
|
||||
printf("Set Boot Device to %s\n", arg);
|
||||
}
|
||||
|
||||
if (use_progress) {
|
||||
/* set-in-progress = set-complete */
|
||||
memset(flags, 0, 5);
|
||||
ipmi_chassis_set_bootparam(intf,
|
||||
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
|
||||
flags, 1);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -701,7 +651,7 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
int rc = 0;
|
||||
|
||||
if ((argc == 0) || (strncmp(argv[0], "help", 4) == 0)) {
|
||||
lprintf(LOG_NOTICE, "Chassis Commands: status, power, identify, policy, restart_cause, poh, bootdev, bootparam, selftest");
|
||||
lprintf(LOG_NOTICE, "Chassis Commands: status, power, identify, policy, restart_cause, poh, bootdev, selftest");
|
||||
}
|
||||
else if (strncmp(argv[0], "status", 6) == 0) {
|
||||
rc = ipmi_chassis_status(intf);
|
||||
@ -802,7 +752,7 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
lprintf(LOG_NOTICE, "bootparam set <option> [value ...]");
|
||||
} else {
|
||||
if (strncmp(argv[2], "bootflag", 8) == 0)
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[3], NULL);
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[3], 0);
|
||||
else
|
||||
lprintf(LOG_NOTICE, "bootparam set <option> [value ...]");
|
||||
}
|
||||
@ -814,7 +764,6 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
else if (strncmp(argv[0], "bootdev", 7) == 0) {
|
||||
if ((argc < 2) || (strncmp(argv[1], "help", 4) == 0)) {
|
||||
lprintf(LOG_NOTICE, "bootdev <device> [clear-cmos=yes|no]");
|
||||
lprintf(LOG_NOTICE, "bootdev <device> [options=help,...]");
|
||||
lprintf(LOG_NOTICE, " none : Do not change boot device order");
|
||||
lprintf(LOG_NOTICE, " pxe : Force PXE boot");
|
||||
lprintf(LOG_NOTICE, " disk : Force boot from default Hard-drive");
|
||||
@ -822,116 +771,17 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
lprintf(LOG_NOTICE, " diag : Force boot from Diagnostic Partition");
|
||||
lprintf(LOG_NOTICE, " cdrom : Force boot from CD/DVD");
|
||||
lprintf(LOG_NOTICE, " bios : Force boot into BIOS Setup");
|
||||
lprintf(LOG_NOTICE, " floppy: Force boot from Floppy/primary removable media");
|
||||
} else {
|
||||
if (argc < 3)
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], 0);
|
||||
else if (strncmp(argv[2], "clear-cmos=", 11) == 0) {
|
||||
if (strncmp(argv[2]+11, "yes", 3) == 0) {
|
||||
uint8_t flags[5] = {0, (1<<7), 0, 0, 0};
|
||||
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], flags);
|
||||
} else
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
|
||||
}
|
||||
else if (strncmp(argv[2], "options=", 8) == 0) {
|
||||
char *token;
|
||||
char *saveptr = NULL;
|
||||
int optionError = 0;
|
||||
unsigned char flags[5];
|
||||
static struct {
|
||||
char *name;
|
||||
int i;
|
||||
unsigned char mask;
|
||||
unsigned char value;
|
||||
char *desc;
|
||||
} options[] = {
|
||||
/* data 1 */
|
||||
{"valid", 0, (1<<7), (1<<7),
|
||||
"Boot flags valid"},
|
||||
{"persistent", 0, (1<<6), (1<<6),
|
||||
"Changes are persistent for all future boots"},
|
||||
{"efiboot", 0, (1<<5), (1<<5),
|
||||
"Extensible Firmware Interface Boot (EFI)"},
|
||||
|
||||
/* data 2 */
|
||||
{"clear-cmos", 1, (1<<7), (1<<7),
|
||||
"CMOS clear"},
|
||||
{"lockkbd", 1, (1<<6), (1<<6),
|
||||
"Lock Keyboard"},
|
||||
/* data2[5:2] is parsed elsewhere */
|
||||
{"screenblank", 1, (1<<1), (1<<1),
|
||||
"Screen Blank"},
|
||||
{"lockoutreset", 1, (1<<0), (1<<0),
|
||||
"Lock out Resetbuttons"},
|
||||
|
||||
/* data 3 */
|
||||
{"lockout_power", 2, (1<<7), (1<<7),
|
||||
"Lock out (power off/sleep request) via Power Button"},
|
||||
{"verbose=default", 2, (3<<5), (0<<5),
|
||||
"Request quiet BIOS display"},
|
||||
{"verbose=no", 2, (3<<5), (1<<5),
|
||||
"Request quiet BIOS display"},
|
||||
{"verbose=yes", 2, (3<<5), (2<<5),
|
||||
"Request verbose BIOS display"},
|
||||
{"force_pet", 2, (1<<4), (1<<4),
|
||||
"Force progress event traps"},
|
||||
{"upw_bypass", 2, (1<<3), (1<<3),
|
||||
"User password bypass"},
|
||||
{"lockout_sleep", 2, (1<<2), (1<<2),
|
||||
"Log Out Sleep Button"},
|
||||
{"cons_redirect=default", 2, (3<<0), (0<<0),
|
||||
"Console redirection occurs per BIOS configuration setting"},
|
||||
{"cons_redirect=skip", 2, (3<<0), (1<<0),
|
||||
"Suppress (skip) console redirection if enabled"},
|
||||
{"cons_redirect=enable", 2, (3<<0), (2<<0),
|
||||
"Suppress (skip) console redirection if enabled"},
|
||||
|
||||
/* data 4 */
|
||||
/* data4[7:4] reserved */
|
||||
/* data4[3] BIOS Shared Mode Override, not implemented here */
|
||||
/* data4[2:0] BIOS Mux Control Override, not implemented here */
|
||||
|
||||
/* data5 reserved */
|
||||
|
||||
{NULL} /* End marker */
|
||||
}, *op;
|
||||
|
||||
memset(&flags[0], 0, sizeof(flags));
|
||||
token = strtok_r(argv[2] + 8, ",", &saveptr);
|
||||
while (token != NULL) {
|
||||
int i;
|
||||
|
||||
if (strcmp(token, "help") == 0) {
|
||||
optionError = 1;
|
||||
break;
|
||||
}
|
||||
for (op = options; op->name != NULL; ++op) {
|
||||
if (strcmp(token, op->name) == 0) {
|
||||
flags[op->i] &= op->mask;
|
||||
flags[op->i] |= op->value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (op->name == NULL) {
|
||||
/* Option not found */
|
||||
optionError = 1;
|
||||
lprintf(LOG_ERR, "Invalid option: %s", token);
|
||||
}
|
||||
token = strtok_r(NULL, ",", &saveptr);
|
||||
}
|
||||
if (optionError) {
|
||||
lprintf(LOG_NOTICE, "Legal options are:");
|
||||
lprintf(LOG_NOTICE, "\thelp:\tprint this message");
|
||||
for (op = options; op->name != NULL; ++op) {
|
||||
lprintf(LOG_NOTICE, "\t%s:\t%s", op->name, op->desc);
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], flags);
|
||||
if (strncmp(argv[2]+11, "yes", 3) == 0)
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], 1);
|
||||
else
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], 0);
|
||||
}
|
||||
else
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
|
||||
rc = ipmi_chassis_set_bootdev(intf, argv[1], 0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -53,7 +57,7 @@
|
||||
#include <ipmitool/ipmi_sdr.h>
|
||||
|
||||
|
||||
static void
|
||||
static int
|
||||
ipmi_event_msg_print(struct ipmi_intf * intf, struct platform_event_msg * pmsg)
|
||||
{
|
||||
struct sel_event_record sel_event;
|
||||
@ -71,7 +75,7 @@ ipmi_event_msg_print(struct ipmi_intf * intf, struct platform_event_msg * pmsg)
|
||||
sel_event.sel_type.standard_type.event_data[0] = pmsg->event_data[0];
|
||||
sel_event.sel_type.standard_type.event_data[1] = pmsg->event_data[1];
|
||||
sel_event.sel_type.standard_type.event_data[2] = pmsg->event_data[2];
|
||||
|
||||
|
||||
if (verbose)
|
||||
ipmi_sel_print_extended_entry_verbose(intf, &sel_event);
|
||||
else
|
||||
@ -523,10 +527,10 @@ ipmi_event_fromfile(struct ipmi_intf * intf, char * file)
|
||||
|
||||
/* clip off trailing and leading whitespace */
|
||||
ptr--;
|
||||
while (isspace((int)*ptr) && ptr >= buf)
|
||||
while (isspace(*ptr) && ptr >= buf)
|
||||
*ptr-- = '\0';
|
||||
ptr = buf;
|
||||
while (isspace((int)*ptr))
|
||||
while (isspace(*ptr))
|
||||
ptr++;
|
||||
if (strlen(ptr) == 0)
|
||||
continue;
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@ -1,586 +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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Tue Mar 7 14:36:12 2006
|
||||
* <stephane.filion@ca.kontron.com>
|
||||
*
|
||||
* This code implements an Kontron OEM proprietary commands.
|
||||
*/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi_fru.h>
|
||||
|
||||
|
||||
extern int verbose;
|
||||
extern int read_fru_area(struct ipmi_intf * intf, struct fru_info *fru,
|
||||
uint8_t id, uint32_t offset, uint32_t length,
|
||||
uint8_t *frubuf);
|
||||
extern int write_fru_area(struct ipmi_intf * intf, struct fru_info *fru,
|
||||
unsigned char id, unsigned int soffset,
|
||||
unsigned int doffset, unsigned int length,
|
||||
unsigned char *pFrubuf);
|
||||
|
||||
extern char * get_fru_area_str(uint8_t * data, uint32_t * offset);
|
||||
|
||||
|
||||
|
||||
static void ipmi_kontron_help(void);
|
||||
static int ipmi_kontron_set_serial_number(struct ipmi_intf * intf);
|
||||
static int ipmi_kontron_set_mfg_date (struct ipmi_intf * intf);
|
||||
|
||||
|
||||
|
||||
int
|
||||
ipmi_kontronoem_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (argc == 0)
|
||||
ipmi_kontron_help();
|
||||
else if (strncmp(argv[0], "help", 4) == 0)
|
||||
ipmi_kontron_help();
|
||||
|
||||
else if(!strncmp(argv[0], "setsn", 5))
|
||||
{
|
||||
if(argc >= 1)
|
||||
{
|
||||
if(ipmi_kontron_set_serial_number(intf) > 0)
|
||||
{
|
||||
printf("FRU serial number setted successfully\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("FRU serial number set failed\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("fru setsn\n");
|
||||
}
|
||||
}
|
||||
else if(!strncmp(argv[0], "setmfgdate", 5))
|
||||
{
|
||||
if(argc >= 1)
|
||||
{
|
||||
if(ipmi_kontron_set_mfg_date(intf) > 0)
|
||||
{
|
||||
printf("FRU manufacturing date setted successfully\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("FRU manufacturing date set failed\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("fru setmfgdate\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
printf("Invalid Kontron command: %s", argv[0]);
|
||||
ipmi_kontron_help();
|
||||
rc = -1;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
static void ipmi_kontron_help(void)
|
||||
{
|
||||
printf("Kontron Commands: setsn setmfgdate\n");
|
||||
}
|
||||
|
||||
/* ipmi_fru_set_serial_number - Set the Serial Number in FRU
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
* @id: fru id
|
||||
*
|
||||
* returns -1 on error
|
||||
* returns 1 if successful
|
||||
*/
|
||||
static int
|
||||
ipmi_kontron_set_serial_number(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
struct ipmi_rq req;
|
||||
struct fru_info fru;
|
||||
struct fru_header header;
|
||||
uint8_t msg_data[4];
|
||||
char *sn;
|
||||
uint8_t sn_size, checksum;
|
||||
uint8_t *fru_data;
|
||||
char *fru_area;
|
||||
uint32_t fru_data_offset, fru_data_offset_tmp, board_sec_len, prod_sec_len, i;
|
||||
|
||||
sn = NULL;
|
||||
fru_data = NULL;
|
||||
|
||||
memset(msg_data, 0, 4);
|
||||
msg_data[0] = 0xb4;
|
||||
msg_data[1] = 0x90;
|
||||
msg_data[2] = 0x91;
|
||||
msg_data[3] = 0x8b;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = 0x3E;
|
||||
req.msg.cmd = 0x0C;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
|
||||
/* Set Lun, necessary for this oem command */
|
||||
req.msg.lun = 0x03;
|
||||
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
{
|
||||
printf(" Device not present (No Response)\n");
|
||||
return -11;
|
||||
}
|
||||
|
||||
if (rsp->ccode > 0)
|
||||
{
|
||||
printf(" This option is not implemented for this board\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
sn_size = rsp->data_len;
|
||||
|
||||
sn = malloc(sn_size + 1);
|
||||
|
||||
if(sn == NULL)
|
||||
{
|
||||
printf("Out of memory!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(sn, 0, sn_size + 1);
|
||||
memcpy(sn, rsp->data, sn_size);
|
||||
|
||||
if(verbose >= 1)
|
||||
{
|
||||
printf("Original serial number is : [%s]\n", sn);
|
||||
}
|
||||
|
||||
|
||||
|
||||
memset(msg_data, 0, 4);
|
||||
msg_data[0] = 0;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_FRU_INFO;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
printf(" Device not present (No Response)\n");
|
||||
free(sn);
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
printf(" Device not present (%s)\n",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
free(sn);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
fru.size = (rsp->data[1] << 8) | rsp->data[0];
|
||||
fru.access = rsp->data[2] & 0x1;
|
||||
|
||||
if (fru.size < 1) {
|
||||
printf(" Invalid FRU size %d", fru.size);
|
||||
free(sn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* retrieve the FRU header
|
||||
*/
|
||||
msg_data[0] = 0;
|
||||
msg_data[1] = 0;
|
||||
msg_data[2] = 0;
|
||||
msg_data[3] = 8;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_FRU_DATA;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
{
|
||||
printf(" Device not present (No Response)\n");
|
||||
free(sn);
|
||||
return(-1);
|
||||
}
|
||||
if (rsp->ccode > 0)
|
||||
{
|
||||
printf(" Device not present (%s)\n",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
free(sn);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (verbose > 1)
|
||||
printbuf(rsp->data, rsp->data_len, "FRU DATA");
|
||||
|
||||
memcpy(&header, rsp->data + 1, 8);
|
||||
|
||||
if (header.version != 1)
|
||||
{
|
||||
printf(" Unknown FRU header version 0x%02x",
|
||||
header.version);
|
||||
free(sn);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/* Set the Board Section */
|
||||
board_sec_len = (header.offset.product * 8) - (header.offset.board * 8);
|
||||
|
||||
|
||||
fru_data = malloc( fru.size);
|
||||
|
||||
if(fru_data == NULL)
|
||||
{
|
||||
printf("Out of memory!");
|
||||
free(sn);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
memset(fru_data, 0, fru.size);
|
||||
if(read_fru_area(intf ,&fru ,0 ,(header.offset.board * 8) ,board_sec_len , fru_data) < 0)
|
||||
{
|
||||
free(sn);
|
||||
free(fru_data);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*Position at Board Manufacturer*/
|
||||
fru_data_offset = (header.offset.board * 8) + 6;
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
|
||||
|
||||
/*Position at Board Product Name*/
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
|
||||
|
||||
fru_data_offset_tmp = fru_data_offset;
|
||||
|
||||
/*Position at Serial Number*/
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset_tmp);
|
||||
|
||||
fru_data_offset ++;
|
||||
|
||||
if(strlen(fru_area) != sn_size)
|
||||
{
|
||||
printf("The length of the serial number in the FRU Board Area is wrong.\n");
|
||||
free(sn);
|
||||
free(fru_data);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/* Copy the new serial number in the board section saved in memory*/
|
||||
memcpy(fru_data + fru_data_offset, sn, sn_size);
|
||||
|
||||
checksum = 0;
|
||||
/* Calculate Header Checksum */
|
||||
for( i = (header.offset.board * 8); i < (((header.offset.board * 8)+board_sec_len) - 2) ; i ++ )
|
||||
{
|
||||
checksum += fru_data[i];
|
||||
}
|
||||
checksum = (~checksum) + 1;
|
||||
|
||||
|
||||
fru_data[(header.offset.board * 8)+board_sec_len - 1] = checksum;
|
||||
|
||||
/* Write the new FRU Board section */
|
||||
if(write_fru_area(intf, &fru, 0, (header.offset.board * 8), (header.offset.board * 8), board_sec_len, fru_data) < 0)
|
||||
{
|
||||
free(sn);
|
||||
free(fru_data);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/* Set the Product Section */
|
||||
prod_sec_len = (header.offset.multi * 8) - (header.offset.product * 8);
|
||||
|
||||
if(read_fru_area(intf ,&fru ,0 ,(header.offset.product * 8) ,prod_sec_len , fru_data) < 0)
|
||||
{
|
||||
free(sn);
|
||||
free(fru_data);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*Position at Product Manufacturer*/
|
||||
fru_data_offset = (header.offset.product * 8) + 3;
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
|
||||
|
||||
/*Position at Product Name*/
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
|
||||
|
||||
/*Position at Product Part*/
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
|
||||
|
||||
/*Position at Product Version*/
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
|
||||
|
||||
|
||||
|
||||
fru_data_offset_tmp = fru_data_offset;
|
||||
|
||||
/*Position at Serial Number*/
|
||||
fru_area = get_fru_area_str(fru_data, &fru_data_offset_tmp);
|
||||
|
||||
fru_data_offset ++;
|
||||
|
||||
if(strlen(fru_area) != sn_size)
|
||||
{
|
||||
free(sn);
|
||||
free(fru_data);
|
||||
printf("The length of the serial number in the FRU Product Area is wrong.\n");
|
||||
return(-1);
|
||||
|
||||
}
|
||||
|
||||
/* Copy the new serial number in the product section saved in memory*/
|
||||
memcpy(fru_data + fru_data_offset, sn, sn_size);
|
||||
|
||||
checksum = 0;
|
||||
/* Calculate Header Checksum */
|
||||
for( i = (header.offset.product * 8); i < (((header.offset.product * 8)+prod_sec_len) - 2) ; i ++ )
|
||||
{
|
||||
checksum += fru_data[i];
|
||||
}
|
||||
checksum = (~checksum) + 1;
|
||||
|
||||
|
||||
fru_data[(header.offset.product * 8)+prod_sec_len - 1] = checksum;
|
||||
|
||||
/* Write the new FRU Board section */
|
||||
if(write_fru_area(intf, &fru, 0, (header.offset.product * 8), (header.offset.product * 8), prod_sec_len, fru_data) < 0)
|
||||
{
|
||||
free(sn);
|
||||
free(fru_data);
|
||||
return -1;
|
||||
}
|
||||
|
||||
free(sn);
|
||||
free(fru_data);
|
||||
|
||||
return(1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* ipmi_fru_set_mfg_date - Set the Manufacturing Date in FRU
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
* @id: fru id
|
||||
*
|
||||
* returns -1 on error
|
||||
* returns 1 if successful
|
||||
*/
|
||||
static int
|
||||
ipmi_kontron_set_mfg_date (struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
struct ipmi_rq req;
|
||||
struct fru_info fru;
|
||||
struct fru_header header;
|
||||
uint8_t msg_data[4];
|
||||
uint8_t mfg_date[3];
|
||||
|
||||
uint32_t board_sec_len, i;
|
||||
uint8_t *fru_data, checksum;
|
||||
|
||||
|
||||
|
||||
|
||||
memset(msg_data, 0, 4);
|
||||
msg_data[0] = 0xb4;
|
||||
msg_data[1] = 0x90;
|
||||
msg_data[2] = 0x91;
|
||||
msg_data[3] = 0x8b;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = 0x3E;
|
||||
req.msg.cmd = 0x0E;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
/* Set Lun temporary, necessary for this oem command */
|
||||
req.msg.lun = 0x03;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
{
|
||||
printf("Device not present (No Response)\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (rsp->ccode > 0)
|
||||
{
|
||||
printf("This option is not implemented for this board\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if(rsp->data_len != 3)
|
||||
{
|
||||
printf("Invalid response for the Manufacturing date\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
memset(mfg_date, 0, 3);
|
||||
memcpy(mfg_date, rsp->data, 3);
|
||||
|
||||
memset(msg_data, 0, 4);
|
||||
msg_data[0] = 0;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_FRU_INFO;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
printf(" Device not present (No Response)\n");
|
||||
return(-1);
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
printf(" Device not present (%s)\n",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return(-1);
|
||||
}
|
||||
|
||||
fru.size = (rsp->data[1] << 8) | rsp->data[0];
|
||||
fru.access = rsp->data[2] & 0x1;
|
||||
|
||||
if (fru.size < 1) {
|
||||
printf(" Invalid FRU size %d", fru.size);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* retrieve the FRU header
|
||||
*/
|
||||
msg_data[0] = 0;
|
||||
msg_data[1] = 0;
|
||||
msg_data[2] = 0;
|
||||
msg_data[3] = 8;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = GET_FRU_DATA;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
{
|
||||
printf(" Device not present (No Response)\n");
|
||||
return(-1);
|
||||
}
|
||||
if (rsp->ccode > 0)
|
||||
{
|
||||
printf(" Device not present (%s)\n",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (verbose > 1)
|
||||
printbuf(rsp->data, rsp->data_len, "FRU DATA");
|
||||
|
||||
memcpy(&header, rsp->data + 1, 8);
|
||||
|
||||
if (header.version != 1)
|
||||
{
|
||||
printf(" Unknown FRU header version 0x%02x",
|
||||
header.version);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
board_sec_len = (header.offset.product * 8) - (header.offset.board * 8);
|
||||
|
||||
fru_data = malloc( fru.size);
|
||||
|
||||
if(fru_data == NULL)
|
||||
{
|
||||
printf("Out of memory!");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
memset(fru_data, 0, fru.size);
|
||||
if(read_fru_area(intf ,&fru ,0 ,(header.offset.board * 8) ,board_sec_len , fru_data) < 0)
|
||||
{
|
||||
free(fru_data);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/* Copy the new manufacturing date in the board section saved in memory*/
|
||||
memcpy(fru_data + (header.offset.board * 8) + 3, mfg_date, 3);
|
||||
|
||||
checksum = 0;
|
||||
/* Calculate Header Checksum */
|
||||
for( i = (header.offset.board * 8); i < (((header.offset.board * 8)+board_sec_len) - 2) ; i ++ )
|
||||
{
|
||||
checksum += fru_data[i];
|
||||
}
|
||||
checksum = (~checksum) + 1;
|
||||
|
||||
fru_data[(header.offset.board * 8)+board_sec_len - 1] = checksum;
|
||||
|
||||
/* Write the new FRU Board section */
|
||||
if(write_fru_area(intf, &fru, 0, (header.offset.board * 8), (header.offset.board * 8), board_sec_len, fru_data) < 0)
|
||||
{
|
||||
free(fru_data);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
free(fru_data);
|
||||
return(1);
|
||||
}
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -272,7 +276,7 @@ __set_lan_param(struct ipmi_intf * intf, uint8_t chan,
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[32];
|
||||
|
||||
|
||||
if (param < 0)
|
||||
return -1;
|
||||
|
||||
@ -394,10 +398,9 @@ ipmi_lanp_unlock(struct ipmi_intf * intf, uint8_t chan)
|
||||
rc = __set_lan_param(intf, chan, IPMI_LANP_SET_IN_PROGRESS, &val, 1, 0);
|
||||
if (rc < 0) {
|
||||
lprintf(LOG_DEBUG, "LAN Parameter Commit not supported");
|
||||
val = IPMI_LANP_WRITE_UNLOCK;
|
||||
__set_lan_param(intf, chan, IPMI_LANP_SET_IN_PROGRESS, &val, 0, 0);
|
||||
}
|
||||
|
||||
val = IPMI_LANP_WRITE_UNLOCK;
|
||||
__set_lan_param(intf, chan, IPMI_LANP_SET_IN_PROGRESS, &val, 1, 0);
|
||||
}
|
||||
|
||||
/* set_lan_param - Wrap LAN parameter write with set-in-progress lock
|
||||
@ -449,7 +452,7 @@ lan_set_arp_interval(struct ipmi_intf * intf,
|
||||
struct lan_param *lp;
|
||||
uint8_t interval;
|
||||
int rc = 0;
|
||||
|
||||
|
||||
lp = get_lan_param(intf, chan, IPMI_LANP_GRAT_ARP);
|
||||
if (lp == NULL)
|
||||
return -1;
|
||||
@ -457,7 +460,7 @@ lan_set_arp_interval(struct ipmi_intf * intf,
|
||||
return -1;
|
||||
|
||||
if (ival != 0) {
|
||||
interval = ((uint8_t)atoi((const char *)ival) * 2) - 1;
|
||||
interval = ((uint8_t)atoi(ival) * 2) - 1;
|
||||
rc = set_lan_param(intf, chan, IPMI_LANP_GRAT_ARP, &interval, 1);
|
||||
} else {
|
||||
interval = lp->data[0];
|
||||
@ -521,7 +524,7 @@ lan_set_arp_respond(struct ipmi_intf * intf,
|
||||
static char priv_level_to_char(unsigned char priv_level)
|
||||
{
|
||||
char ret = 'X';
|
||||
|
||||
|
||||
switch (priv_level)
|
||||
{
|
||||
case IPMI_SESSION_PRIV_CALLBACK:
|
||||
@ -734,26 +737,12 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
|
||||
printf("%-24s: %02x:%02x:%02x:%02x:%02x:%02x\n", p->desc,
|
||||
p->data[0], p->data[1], p->data[2], p->data[3], p->data[4], p->data[5]);
|
||||
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_VLAN_ID);
|
||||
if (p != NULL && p->data != NULL) {
|
||||
int id = ((p->data[1] & 0x0f) << 8) + p->data[0];
|
||||
if (p->data[1] & 0x80)
|
||||
printf("%-24s: %d\n", p->desc, id);
|
||||
else
|
||||
printf("%-24s: Disabled\n", p->desc);
|
||||
}
|
||||
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_VLAN_PRIORITY);
|
||||
if (p != NULL && p->data != NULL)
|
||||
printf("%-24s: %d\n", p->desc, p->data[0] & 0x07);
|
||||
|
||||
/* Determine supported Cipher Suites -- Requires two calls */
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_RMCP_CIPHER_SUPPORT);
|
||||
if (p == NULL)
|
||||
return -1;
|
||||
else if (p->data != NULL)
|
||||
{
|
||||
unsigned char cipher_suite_count = p->data[0];
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_RMCP_CIPHERS);
|
||||
if (p == NULL)
|
||||
return -1;
|
||||
@ -762,8 +751,9 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
|
||||
|
||||
/* Now we're dangerous. There are only 15 fixed cipher
|
||||
suite IDs, but the spec allows for 16 in the return data.*/
|
||||
if ((p->data != NULL) && (p->data_len <= 17))
|
||||
if ((p->data != NULL) && (p->data_len <= 16))
|
||||
{
|
||||
unsigned char cipher_suite_count = p->data[0];
|
||||
unsigned int i;
|
||||
for (i = 0; (i < 16) && (i < cipher_suite_count); ++i)
|
||||
{
|
||||
@ -779,6 +769,7 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* RMCP+ Messaging Cipher Suite Privilege Levels */
|
||||
/* These are the privilege levels for the 15 fixed cipher suites */
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_RMCP_PRIV_LEVELS);
|
||||
@ -802,7 +793,7 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
|
||||
priv_level_to_char(p->data[7] & 0x0F),
|
||||
priv_level_to_char(p->data[7] >> 4),
|
||||
priv_level_to_char(p->data[8] & 0x0F));
|
||||
|
||||
|
||||
/* Now print a legend */
|
||||
printf("%-24s: %s\n", "", " X=Cipher Suite Unused");
|
||||
printf("%-24s: %s\n", "", " c=CALLBACK");
|
||||
@ -871,7 +862,7 @@ ipmi_lan_set_auth(struct ipmi_intf * intf, uint8_t chan, char * level, char * ty
|
||||
data[2] = authtype;
|
||||
else if (strncasecmp(p, "admin", 5) == 0)
|
||||
data[3] = authtype;
|
||||
else
|
||||
else
|
||||
lprintf(LOG_WARNING, "Invalid authentication level: %s", p);
|
||||
p = strchr(p, ',');
|
||||
if (p)
|
||||
@ -897,7 +888,7 @@ ipmi_lan_set_password(struct ipmi_intf * intf,
|
||||
data[1] = 0x02; /* set password */
|
||||
|
||||
if (password != NULL)
|
||||
memcpy(data+2, password, __min(strlen((const char *)password), 16));
|
||||
memcpy(data+2, password, __min(strlen(password), 16));
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
@ -919,7 +910,7 @@ ipmi_lan_set_password(struct ipmi_intf * intf,
|
||||
/* adjust our session password
|
||||
* or we will no longer be able to communicate with BMC
|
||||
*/
|
||||
ipmi_intf_session_set_password(intf, (char *)password);
|
||||
ipmi_intf_session_set_password(intf, password);
|
||||
printf("Password %s for user %d\n",
|
||||
(password == NULL) ? "cleared" : "set", userid);
|
||||
|
||||
@ -1004,90 +995,37 @@ ipmi_set_channel_access(struct ipmi_intf * intf, uint8_t channel, uint8_t enable
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t rqdata[3];
|
||||
uint8_t byteEnable;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
|
||||
/* RETREIVE VALUE IN NVRAM */
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = 0x41; /* Get Channel Access Command */
|
||||
req.msg.data = rqdata;
|
||||
req.msg.data_len = 2;
|
||||
|
||||
memset(rqdata, 0, 2);
|
||||
rqdata[0] = channel & 0xf;
|
||||
rqdata[1] = 0x40; /* retreive NV */
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to Get Channel Access for channel %d", channel);
|
||||
return -1;
|
||||
} else if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Set Channel Access for channel %d failed: %s",
|
||||
channel, val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
} else {
|
||||
byteEnable = *(rsp->data + 0);
|
||||
}
|
||||
|
||||
/* SAVE TO NVRAM */
|
||||
memset(&req, 0, sizeof(req));
|
||||
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = 0x40; /* Set Channel Access Command */
|
||||
req.msg.cmd = 0x40;
|
||||
req.msg.data = rqdata;
|
||||
req.msg.data_len = 3;
|
||||
|
||||
/* SAVE TO NVRAM */
|
||||
memset(rqdata, 0, 3);
|
||||
rqdata[0] = channel & 0xf;
|
||||
rqdata[1] = 0x40 | (byteEnable & 0x38); /* use previously set values */
|
||||
rqdata[1] = 0x40; /* set pef enabled, per-msg auth enabled */
|
||||
if (enable != 0)
|
||||
rqdata[1] |= 0x2; /* set always available if enable is set */
|
||||
rqdata[2] = 0x44; /* set channel privilege limit to ADMIN */
|
||||
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to Set Channel Access for channel %d", channel);
|
||||
return -1;
|
||||
} else if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Set Channel Access for channel %d failed: %s",
|
||||
channel, val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* RETREIVE VALUE IN NVRAM */
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = 0x41; /* Get Channel Access Command */
|
||||
req.msg.data = rqdata;
|
||||
req.msg.data_len = 2;
|
||||
|
||||
memset(rqdata, 0, 2);
|
||||
rqdata[0] = channel & 0xf;
|
||||
rqdata[1] = 0x80; /* retreive NV */
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to Get Channel Access for channel %d", channel);
|
||||
return -1;
|
||||
} else if (rsp->ccode > 0) {
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Set Channel Access for channel %d failed: %s",
|
||||
channel, val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
} else {
|
||||
byteEnable = *(rsp->data + 0);
|
||||
}
|
||||
|
||||
/* SAVE TO CURRENT */
|
||||
memset(&req, 0, sizeof(req));
|
||||
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = 0x40; /* Set Channel Access Command */
|
||||
req.msg.data = rqdata;
|
||||
req.msg.data_len = 3;
|
||||
|
||||
memset(rqdata, 0, 3);
|
||||
rqdata[0] = channel & 0xf;
|
||||
rqdata[1] = 0x80 | (byteEnable & 0x38); /* use previously set values */
|
||||
rqdata[1] = 0x80; /* set pef enabled, per-msg auth enabled */
|
||||
if (enable != 0)
|
||||
rqdata[1] |= 0x2; /* set always available if enable is set */
|
||||
rqdata[2] = 0x84; /* set channel privilege limit to ADMIN */
|
||||
@ -1096,7 +1034,8 @@ ipmi_set_channel_access(struct ipmi_intf * intf, uint8_t channel, uint8_t enable
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to Set Channel Access for channel %d", channel);
|
||||
return -1;
|
||||
} else if (rsp->ccode > 0) {
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Set Channel Access for channel %d failed: %s",
|
||||
channel, val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
@ -1121,7 +1060,7 @@ ipmi_set_user_access(struct ipmi_intf * intf, uint8_t channel, uint8_t userid)
|
||||
rqdata[1] = userid & 0x3f;
|
||||
rqdata[2] = 0x4;
|
||||
rqdata[3] = 0;
|
||||
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = 0x43;
|
||||
@ -1174,7 +1113,7 @@ get_cmdline_cipher_suite_priv_data(char * arg, uint8_t * buf)
|
||||
}
|
||||
|
||||
/*
|
||||
* The first byte is reserved (0). The rest of the buffer is setup
|
||||
* The first byte is reservered (0). The resst of the buffer is setup
|
||||
* so that each nibble holds the maximum privilege level available for
|
||||
* that cipher suite number. The number of nibbles (15) matches the number
|
||||
* of fixed cipher suite IDs. This command documentation mentions 16 IDs
|
||||
@ -1189,7 +1128,7 @@ get_cmdline_cipher_suite_priv_data(char * arg, uint8_t * buf)
|
||||
|
||||
for (i = 0; i < 15; ++i)
|
||||
{
|
||||
unsigned char priv_level = IPMI_SESSION_PRIV_ADMIN;
|
||||
unsigned char priv_level;
|
||||
|
||||
switch (arg[i])
|
||||
{
|
||||
@ -1217,7 +1156,7 @@ get_cmdline_cipher_suite_priv_data(char * arg, uint8_t * buf)
|
||||
ret = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (ret != 0)
|
||||
break;
|
||||
else
|
||||
@ -1234,7 +1173,7 @@ get_cmdline_cipher_suite_priv_data(char * arg, uint8_t * buf)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1270,11 +1209,9 @@ static void ipmi_lan_set_usage(void)
|
||||
lprintf(LOG_NOTICE, " user Enable default user for this channel");
|
||||
lprintf(LOG_NOTICE, " access <on|off> Enable or disable access to this channel");
|
||||
lprintf(LOG_NOTICE, " alert <on|off> Enable or disable PEF alerting for this channel");
|
||||
lprintf(LOG_NOTICE, " arp respond <on|off> Enable or disable BMC ARP responding");
|
||||
lprintf(LOG_NOTICE, " arp response <on|off> Enable or disable BMC ARP responding");
|
||||
lprintf(LOG_NOTICE, " arp generate <on|off> Enable or disable BMC gratuitous ARP generation");
|
||||
lprintf(LOG_NOTICE, " arp interval <seconds> Set gratuitous ARP generation interval");
|
||||
lprintf(LOG_NOTICE, " vlan id <off|<id>> Disable or enable VLAN and set ID (1-4094)");
|
||||
lprintf(LOG_NOTICE, " vlan priority <priority> Set vlan priority (0-7)");
|
||||
lprintf(LOG_NOTICE, " auth <level> <type,..> Set channel authentication types");
|
||||
lprintf(LOG_NOTICE, " level = CALLBACK, USER, OPERATOR, ADMIN");
|
||||
lprintf(LOG_NOTICE, " type = NONE, MD2, MD5, PASSWORD, OEM");
|
||||
@ -1292,57 +1229,6 @@ static void ipmi_lan_set_usage(void)
|
||||
lprintf(LOG_NOTICE, " O = OEM\n");
|
||||
}
|
||||
|
||||
static void
|
||||
ipmi_lan_set_vlan_usage(void)
|
||||
{
|
||||
lprintf(LOG_NOTICE,
|
||||
"lan set <channel> vlan id <id>\n"
|
||||
"lan set <channel> vlan id off\n"
|
||||
"lan set <channel> vlan priority <priority>\n");
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_lan_set_vlan_id(struct ipmi_intf * intf, uint8_t chan, char *string)
|
||||
{
|
||||
uint8_t data[2];
|
||||
int rc;
|
||||
|
||||
if (string == NULL) {
|
||||
data[0] = 0;
|
||||
data[1] = 0;
|
||||
}
|
||||
else {
|
||||
int id = atoi(string);
|
||||
|
||||
if (id < 1 || id > 4094) {
|
||||
lprintf(LOG_NOTICE, "vlan id must be between 1 and 4094.");
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
data[0] = (uint8_t)id;
|
||||
data[1] = (uint8_t)(id >> 8) | 0x80;
|
||||
}
|
||||
}
|
||||
rc = set_lan_param(intf, chan, IPMI_LANP_VLAN_ID, data, 2);
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_lan_set_vlan_priority(struct ipmi_intf * intf, uint8_t chan, char *string)
|
||||
{
|
||||
uint8_t data;
|
||||
int rc;
|
||||
int priority = atoi(string);
|
||||
|
||||
if (priority < 0 || priority > 7) {
|
||||
lprintf(LOG_NOTICE, "vlan priority must be between 0 and 7.");
|
||||
return -1;
|
||||
}
|
||||
data = (uint8_t)priority;
|
||||
rc = set_lan_param(intf, chan, IPMI_LANP_VLAN_PRIORITY, &data, 1);
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
@ -1401,7 +1287,7 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
"example: lan set 7 arp gratuitous off\n");
|
||||
}
|
||||
else if (strncmp(argv[2], "interval", 8) == 0) {
|
||||
rc = lan_set_arp_interval(intf, chan, (uint8_t *)argv[3]);
|
||||
rc = lan_set_arp_interval(intf, chan, argv[3]);
|
||||
}
|
||||
else if (strncmp(argv[2], "generate", 8) == 0) {
|
||||
if (argc < 4)
|
||||
@ -1451,7 +1337,6 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
" static = static address (manually configured)\n"
|
||||
" dhcp = address obtained by BMC running DHCP\n"
|
||||
" bios = address loaded by BIOS or system software\n");
|
||||
return 0;
|
||||
}
|
||||
else if (strncmp(argv[2], "none", 4) == 0)
|
||||
data[0] = 0;
|
||||
@ -1475,7 +1360,7 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
/* session password
|
||||
* not strictly a lan setting, but its used for lan connections */
|
||||
else if (strncmp(argv[1], "password", 8) == 0) {
|
||||
rc = ipmi_lan_set_password(intf, 1, (uint8_t *)argv[2]);
|
||||
rc = ipmi_lan_set_password(intf, 1, argv[2]);
|
||||
}
|
||||
/* snmp community string */
|
||||
else if (strncmp(argv[1], "snmp", 4) == 0) {
|
||||
@ -1552,25 +1437,6 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
rc = set_lan_param(intf, chan, IPMI_LANP_BAK_GATEWAY_MAC, data, 6);
|
||||
}
|
||||
}
|
||||
else if (strncasecmp(argv[1], "vlan", 4) == 0) {
|
||||
if (argc < 4 || strncmp(argv[2], "help", 4) == 0) {
|
||||
ipmi_lan_set_vlan_usage();
|
||||
}
|
||||
else if (strncasecmp(argv[2], "id", 2) == 0) {
|
||||
if (strncasecmp(argv[3], "off", 3) == 0) {
|
||||
ipmi_lan_set_vlan_id(intf, chan, NULL);
|
||||
}
|
||||
else {
|
||||
ipmi_lan_set_vlan_id(intf, chan, argv[3]);
|
||||
}
|
||||
}
|
||||
else if (strncasecmp(argv[2], "priority", 8) == 0) {
|
||||
ipmi_lan_set_vlan_priority(intf, chan, argv[3]);
|
||||
}
|
||||
else {
|
||||
ipmi_lan_set_vlan_usage();
|
||||
}
|
||||
}
|
||||
/* set PEF alerting on or off */
|
||||
else if (strncasecmp(argv[1], "alert", 5) == 0) {
|
||||
if (argc < 3) {
|
||||
@ -1613,7 +1479,7 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
else {
|
||||
ipmi_lan_set_usage();
|
||||
}
|
||||
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -1696,7 +1562,6 @@ ipmi_lan_alert_print(struct ipmi_intf * intf, uint8_t channel, uint8_t alert)
|
||||
paddr->data[10], paddr->data[11], paddr->data[12]);
|
||||
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -1890,6 +1755,7 @@ ipmi_lan_alert(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
uint8_t alert;
|
||||
uint8_t channel = 1;
|
||||
struct lan_param * p;
|
||||
|
||||
if (argc < 1 ||
|
||||
strncasecmp(argv[0], "help", 4) == 0) {
|
||||
@ -1960,12 +1826,9 @@ ipmi_lan_alert(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
static int
|
||||
ipmi_lan_stats_get(struct ipmi_intf * intf, uint8_t chan)
|
||||
{
|
||||
struct lan_param * p;
|
||||
uint8_t medium;
|
||||
int rc = 0;
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[2];
|
||||
uint16_t statsTemp;
|
||||
|
||||
if (chan < 1 || chan > IPMI_CHANNEL_NUMBER_MAX) {
|
||||
lprintf(LOG_ERR, "Invalid Channel %d", chan);
|
||||
@ -1981,65 +1844,76 @@ ipmi_lan_stats_get(struct ipmi_intf * intf, uint8_t chan)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* From here, we are ready to get the stats */
|
||||
{
|
||||
/* From here, we are ready to get the stats */
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[2];
|
||||
uint16_t statsTemp;
|
||||
uint16_t * pStatsTemp;
|
||||
|
||||
|
||||
msg_data[0] = chan;
|
||||
msg_data[1] = 0; /* Don't clear */
|
||||
msg_data[0] = chan;
|
||||
msg_data[1] = 0; /* Don't clear */
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_TRANSPORT;
|
||||
req.msg.cmd = IPMI_LAN_GET_STAT;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 2;
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_TRANSPORT;
|
||||
req.msg.cmd = IPMI_LAN_GET_STAT;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 2;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_INFO, "Get LAN Stats command failed");
|
||||
return 0;
|
||||
}
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_INFO, "Get LAN Stats command failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_INFO, "Get LAN Stats command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return 0;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_INFO, "Get LAN Stats command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (verbose > 1)
|
||||
{
|
||||
uint8_t counter;
|
||||
printf("--- Rx Stats ---\n");
|
||||
for(counter=0;counter<18;counter+=2)
|
||||
{
|
||||
printf("%02X", *(rsp->data + counter));
|
||||
printf(" %02X - ", *(rsp->data + counter+1));
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
if (verbose > 1) {
|
||||
uint8_t counter;
|
||||
printf("--- Rx Stats ---\n");
|
||||
for (counter=0; counter<18; counter+=2) {
|
||||
printf("%02X", *(rsp->data + counter));
|
||||
printf(" %02X - ", *(rsp->data + counter+1));
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
statsTemp = ((*(rsp->data + 0)) << 8) | (*(rsp->data + 1));
|
||||
printf("IP Rx Packet : %d\n", statsTemp);
|
||||
|
||||
statsTemp = ((*(rsp->data + 0)) << 8) | (*(rsp->data + 1));
|
||||
printf("IP Rx Packet : %d\n", statsTemp);
|
||||
statsTemp = ((*(rsp->data + 2)) << 8) | (*(rsp->data + 3));
|
||||
printf("IP Rx Header Errors : %u\n", statsTemp);
|
||||
|
||||
statsTemp = ((*(rsp->data + 2)) << 8) | (*(rsp->data + 3));
|
||||
printf("IP Rx Header Errors : %u\n", statsTemp);
|
||||
statsTemp = ((*(rsp->data + 4)) << 8) | (*(rsp->data + 5));
|
||||
printf("IP Rx Address Errors : %u\n", statsTemp);
|
||||
|
||||
statsTemp = ((*(rsp->data + 4)) << 8) | (*(rsp->data + 5));
|
||||
printf("IP Rx Address Errors : %u\n", statsTemp);
|
||||
statsTemp = ((*(rsp->data + 6)) << 8) | (*(rsp->data + 7));
|
||||
printf("IP Rx Fragmented : %u\n", statsTemp);
|
||||
|
||||
statsTemp = ((*(rsp->data + 6)) << 8) | (*(rsp->data + 7));
|
||||
printf("IP Rx Fragmented : %u\n", statsTemp);
|
||||
statsTemp = ((*(rsp->data + 8)) << 8) | (*(rsp->data + 9));
|
||||
printf("IP Tx Packet : %u\n", statsTemp);
|
||||
|
||||
statsTemp = ((*(rsp->data + 8)) << 8) | (*(rsp->data + 9));
|
||||
printf("IP Tx Packet : %u\n", statsTemp);
|
||||
statsTemp = ((*(rsp->data +10)) << 8) | (*(rsp->data +11));
|
||||
printf("UDP Rx Packet : %u\n", statsTemp);
|
||||
|
||||
statsTemp = ((*(rsp->data +10)) << 8) | (*(rsp->data +11));
|
||||
printf("UDP Rx Packet : %u\n", statsTemp);
|
||||
statsTemp = ((*(rsp->data + 12)) << 8) | (*(rsp->data + 13));
|
||||
printf("RMCP Rx Valid : %u\n", statsTemp);
|
||||
|
||||
statsTemp = ((*(rsp->data + 12)) << 8) | (*(rsp->data + 13));
|
||||
printf("RMCP Rx Valid : %u\n", statsTemp);
|
||||
statsTemp = ((*(rsp->data + 14)) << 8) | (*(rsp->data + 15));
|
||||
printf("UDP Proxy Packet Received : %u\n", statsTemp);
|
||||
|
||||
statsTemp = ((*(rsp->data + 14)) << 8) | (*(rsp->data + 15));
|
||||
printf("UDP Proxy Packet Received : %u\n", statsTemp);
|
||||
statsTemp = ((*(rsp->data + 16)) << 8) | (*(rsp->data + 17));
|
||||
printf("UDP Proxy Packet Dropped : %u\n", statsTemp);
|
||||
|
||||
statsTemp = ((*(rsp->data + 16)) << 8) | (*(rsp->data + 17));
|
||||
printf("UDP Proxy Packet Dropped : %u\n", statsTemp);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
@ -2048,11 +1922,9 @@ ipmi_lan_stats_get(struct ipmi_intf * intf, uint8_t chan)
|
||||
static int
|
||||
ipmi_lan_stats_clear(struct ipmi_intf * intf, uint8_t chan)
|
||||
{
|
||||
struct lan_param * p;
|
||||
uint8_t medium;
|
||||
int rc = 0;
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[2];
|
||||
|
||||
if (chan < 1 || chan > IPMI_CHANNEL_NUMBER_MAX) {
|
||||
lprintf(LOG_ERR, "Invalid Channel %d", chan);
|
||||
@ -2068,27 +1940,36 @@ ipmi_lan_stats_clear(struct ipmi_intf * intf, uint8_t chan)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* From here, we are ready to get the stats */
|
||||
msg_data[0] = chan;
|
||||
msg_data[1] = 1; /* Clear */
|
||||
{
|
||||
/* From here, we are ready to get the stats */
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[2];
|
||||
uint16_t statsTemp;
|
||||
uint16_t * pStatsTemp;
|
||||
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_TRANSPORT;
|
||||
req.msg.cmd = IPMI_LAN_GET_STAT;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 2;
|
||||
msg_data[0] = chan;
|
||||
msg_data[1] = 1; /* Clear */
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_INFO, "Get LAN Stats command failed");
|
||||
return 0;
|
||||
}
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_TRANSPORT;
|
||||
req.msg.cmd = IPMI_LAN_GET_STAT;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 2;
|
||||
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_INFO, "Get LAN Stats command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return 0;
|
||||
}
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_INFO, "Get LAN Stats command failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_INFO, "Get LAN Stats command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
@ -2113,60 +1994,63 @@ int
|
||||
ipmi_lanp_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
int rc = 0;
|
||||
uint8_t chan = find_lan_channel(intf, 1);
|
||||
uint8_t chan = 0x0e;
|
||||
|
||||
if (argc == 0 || (strncmp(argv[0], "help", 4) == 0)) {
|
||||
print_lan_usage();
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (strncmp(argv[0], "printconf", 9) == 0 ||
|
||||
strncmp(argv[0], "print", 5) == 0)
|
||||
{
|
||||
if (
|
||||
(strncmp(argv[0], "printconf", 9) == 0)
|
||||
||
|
||||
(strncmp(argv[0], "print", 5) == 0)
|
||||
)
|
||||
{
|
||||
if (argc > 1)
|
||||
chan = (uint8_t)strtol(argv[1], NULL, 0);
|
||||
if (chan < 1 || chan > IPMI_CHANNEL_NUMBER_MAX)
|
||||
{
|
||||
lprintf(LOG_ERR, "Invalid channel: %d", chan);
|
||||
{
|
||||
lprintf(LOG_ERR, "Invalid channel: %d", chan);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
rc = ipmi_lan_print(intf, chan);
|
||||
}
|
||||
else if (strncmp(argv[0], "set", 3) == 0)
|
||||
{
|
||||
rc = ipmi_lan_set(intf, argc-1, &(argv[1]));
|
||||
rc = ipmi_lan_set(intf, argc-1, &(argv[1]));
|
||||
}
|
||||
else if (strncmp(argv[0], "alert", 5) == 0)
|
||||
{
|
||||
rc = ipmi_lan_alert(intf, argc-1, &(argv[1]));
|
||||
}
|
||||
else if (strncmp(argv[0], "stats", 5) == 0)
|
||||
{
|
||||
if(argc == 1)
|
||||
{
|
||||
print_lan_usage();
|
||||
rc = ipmi_lan_alert(intf, argc-1, &(argv[1]));
|
||||
}
|
||||
else if (strncmp(argv[0], "stats", 5) == 0)
|
||||
{
|
||||
if(argc == 1)
|
||||
{
|
||||
print_lan_usage();
|
||||
return -1;
|
||||
}
|
||||
else if (argc > 2)
|
||||
chan = (uint8_t)strtol(argv[2], NULL, 0);
|
||||
|
||||
if (chan < 1 || chan > IPMI_CHANNEL_NUMBER_MAX)
|
||||
{
|
||||
lprintf(LOG_ERR, "Invalid channel: %d", chan);
|
||||
}
|
||||
else if (argc > 2)
|
||||
chan = (uint8_t)strtol(argv[2], NULL, 0);
|
||||
|
||||
if (chan < 2 || chan > IPMI_CHANNEL_NUMBER_MAX)
|
||||
{
|
||||
lprintf(LOG_ERR, "Invalid channel: %d", chan);
|
||||
return -1;
|
||||
}
|
||||
else if (strncmp(argv[1], "get", 3) == 0)
|
||||
rc = ipmi_lan_stats_get(intf, chan);
|
||||
else if (strncmp(argv[1], "clear", 5) == 0)
|
||||
rc = ipmi_lan_stats_clear(intf, chan);
|
||||
else
|
||||
print_lan_usage();
|
||||
}
|
||||
else if (strncmp(argv[1], "get", 3) == 0)
|
||||
rc = ipmi_lan_stats_get(intf, chan);
|
||||
else if (strncmp(argv[1], "clear", 5) == 0)
|
||||
rc = ipmi_lan_stats_clear(intf, chan);
|
||||
else
|
||||
print_lan_usage();
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
lprintf(LOG_NOTICE, "Invalid LAN command: %s", argv[0]);
|
||||
rc = -1;
|
||||
}
|
||||
lprintf(LOG_NOTICE, "Invalid LAN command: %s", argv[0]);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -56,7 +60,6 @@
|
||||
#include <ipmitool/ipmi_lanp.h>
|
||||
#include <ipmitool/ipmi_chassis.h>
|
||||
#include <ipmitool/ipmi_mc.h>
|
||||
#include <ipmitool/ipmi_firewall.h>
|
||||
#include <ipmitool/ipmi_sensor.h>
|
||||
#include <ipmitool/ipmi_channel.h>
|
||||
#include <ipmitool/ipmi_session.h>
|
||||
@ -71,9 +74,9 @@
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_ALL_OPTIONS
|
||||
# define OPTION_STRING "I:hVvcgsEao:H:d:P:f:U:p:C:L:A:t:m:S:l:b:e:k:O:"
|
||||
# define OPTION_STRING "I:hVvcgsEao:H:P:f:U:p:C:L:A:t:m:S:l:b:e:k:"
|
||||
#else
|
||||
# define OPTION_STRING "I:hVvcH:f:U:p:d:S:"
|
||||
# define OPTION_STRING "I:hVvcH:f:U:p:S:"
|
||||
#endif
|
||||
|
||||
extern int verbose;
|
||||
@ -216,7 +219,6 @@ ipmi_option_usage(const char * progname, struct ipmi_cmd * cmdlist, struct ipmi_
|
||||
lprintf(LOG_NOTICE, " -V Show version information");
|
||||
lprintf(LOG_NOTICE, " -v Verbose (can use multiple times)");
|
||||
lprintf(LOG_NOTICE, " -c Display output in comma separated format");
|
||||
lprintf(LOG_NOTICE, " -d N Specify a /dev/ipmiN device to use (default=0)");
|
||||
lprintf(LOG_NOTICE, " -I intf Interface to use");
|
||||
lprintf(LOG_NOTICE, " -H hostname Remote host name for LAN interface");
|
||||
lprintf(LOG_NOTICE, " -p port Remote RMCP port [default=623]");
|
||||
@ -229,7 +231,6 @@ ipmi_option_usage(const char * progname, struct ipmi_cmd * cmdlist, struct ipmi_
|
||||
lprintf(LOG_NOTICE, " -C ciphersuite Cipher suite to be used by lanplus interface");
|
||||
lprintf(LOG_NOTICE, " -k key Use Kg key for IPMIv2 authentication");
|
||||
lprintf(LOG_NOTICE, " -L level Remote session privilege level [default=ADMINISTRATOR]");
|
||||
lprintf(LOG_NOTICE, " Append a '+' to use name/privilege lookup in RAKP1");
|
||||
lprintf(LOG_NOTICE, " -A authtype Force use of auth type NONE, PASSWORD, MD2, MD5 or OEM");
|
||||
lprintf(LOG_NOTICE, " -P password Remote session password");
|
||||
lprintf(LOG_NOTICE, " -E Read password from IPMI_PASSWORD environment variable");
|
||||
@ -238,7 +239,6 @@ ipmi_option_usage(const char * progname, struct ipmi_cmd * cmdlist, struct ipmi_
|
||||
lprintf(LOG_NOTICE, " -l lun Set destination lun for raw commands");
|
||||
lprintf(LOG_NOTICE, " -t address Bridge request to remote target address");
|
||||
lprintf(LOG_NOTICE, " -o oemtype Setup for OEM (use 'list' to see available OEM types)");
|
||||
lprintf(LOG_NOTICE, " -O seloem Use file for OEM SEL event descriptions");
|
||||
#endif
|
||||
lprintf(LOG_NOTICE, "");
|
||||
|
||||
@ -271,7 +271,6 @@ ipmi_main(int argc, char ** argv,
|
||||
uint8_t target_channel = 0;
|
||||
uint8_t target_lun = 0;
|
||||
uint8_t my_addr = 0;
|
||||
uint8_t lookupbit = 0x10; /* use name-only lookup by default */
|
||||
int authtype = -1;
|
||||
char * tmp = NULL;
|
||||
char * hostname = NULL;
|
||||
@ -282,9 +281,7 @@ ipmi_main(int argc, char ** argv,
|
||||
char * oemtype = NULL;
|
||||
char * sdrcache = NULL;
|
||||
char * kgkey = NULL;
|
||||
char * seloem = NULL;
|
||||
int port = 0;
|
||||
int devnum = 0;
|
||||
int cipher_suite_id = 3; /* See table 22-19 of the IPMIv2 spec */
|
||||
int argflag, i, found;
|
||||
int rc = -1;
|
||||
@ -327,9 +324,6 @@ ipmi_main(int argc, char ** argv,
|
||||
rc = 0;
|
||||
goto out_free;
|
||||
break;
|
||||
case 'd':
|
||||
devnum = atoi(optarg);
|
||||
break;
|
||||
case 'p':
|
||||
port = atoi(optarg);
|
||||
break;
|
||||
@ -454,15 +448,9 @@ ipmi_main(int argc, char ** argv,
|
||||
}
|
||||
break;
|
||||
case 'L':
|
||||
i = strlen(optarg);
|
||||
if ((i > 0) && (optarg[i-1] == '+')) {
|
||||
lookupbit = 0;
|
||||
optarg[i-1] = 0;
|
||||
}
|
||||
privlvl = str2val(optarg, ipmi_privlvl_vals);
|
||||
if (privlvl == 0xFF) {
|
||||
if (privlvl == 0xFF)
|
||||
lprintf(LOG_WARN, "Invalid privilege level %s", optarg);
|
||||
}
|
||||
break;
|
||||
case 'A':
|
||||
authtype = str2val(optarg, ipmi_authtype_session_vals);
|
||||
@ -482,13 +470,6 @@ ipmi_main(int argc, char ** argv,
|
||||
case 'e':
|
||||
sol_escape_char = optarg[0];
|
||||
break;
|
||||
case 'O':
|
||||
seloem = strdup(optarg);
|
||||
if (seloem == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
goto out_free;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
ipmi_option_usage(progname, cmdlist, intflist);
|
||||
@ -577,7 +558,6 @@ ipmi_main(int argc, char ** argv,
|
||||
ipmi_intf_session_set_privlvl(intf,
|
||||
IPMI_SESSION_PRIV_ADMIN); /* default */
|
||||
|
||||
ipmi_intf_session_set_lookupbit(intf, lookupbit);
|
||||
ipmi_intf_session_set_sol_escape_char(intf, sol_escape_char);
|
||||
ipmi_intf_session_set_cipher_suite_id(intf, cipher_suite_id);
|
||||
|
||||
@ -587,8 +567,6 @@ ipmi_main(int argc, char ** argv,
|
||||
/* setup destination channel if given */
|
||||
intf->target_channel = target_channel ;
|
||||
|
||||
intf->devnum = devnum;
|
||||
|
||||
/* setup IPMB local and target address if given */
|
||||
intf->my_addr = my_addr ? : IPMI_BMC_SLAVE_ADDR;
|
||||
if (target_addr > 0) {
|
||||
@ -605,11 +583,6 @@ ipmi_main(int argc, char ** argv,
|
||||
ipmi_sdr_list_cache_fromfile(intf, sdrcache);
|
||||
}
|
||||
|
||||
/* Parse SEL OEM file if given */
|
||||
if (seloem != NULL) {
|
||||
ipmi_sel_oem_init(seloem);
|
||||
}
|
||||
|
||||
intf->cmdlist = cmdlist;
|
||||
|
||||
/* now we finally run the command */
|
||||
@ -638,8 +611,6 @@ ipmi_main(int argc, char ** argv,
|
||||
free(password);
|
||||
if (oemtype != NULL)
|
||||
free(oemtype);
|
||||
if (seloem != NULL)
|
||||
free(seloem);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -412,7 +416,7 @@ ipmi_mc_get_guid(struct ipmi_intf * intf)
|
||||
}
|
||||
|
||||
if (rsp->data_len == sizeof(struct ipmi_guid)) {
|
||||
char tbuf[40];
|
||||
uint8_t tbuf[40];
|
||||
time_t s;
|
||||
memset(tbuf, 0, 40);
|
||||
memset(&guid, 0, sizeof(struct ipmi_guid));
|
||||
@ -564,13 +568,9 @@ ipmi_mc_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
else if (strncmp(argv[0], "setenables", 10) == 0) {
|
||||
rc = ipmi_mc_set_enables(intf, argc-1, &(argv[1]));
|
||||
}
|
||||
else if (!strncmp(argv[0], "selftest", 8)) {
|
||||
else if (!strncmp(argv[0], "selftest", 8)) {
|
||||
rc = ipmi_mc_get_selftest(intf);
|
||||
}
|
||||
else {
|
||||
lprintf(LOG_ERR, "Invalid mc/bmc command: %s", argv[0]);
|
||||
rc = -1;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
@ -26,6 +26,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.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@ -35,10 +39,8 @@
|
||||
#include <ipmitool/ipmi_constants.h>
|
||||
#include <ipmitool/log.h>
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi_sel.h>
|
||||
|
||||
static int ipmi_oem_supermicro(struct ipmi_intf * intf);
|
||||
static int ipmi_oem_ibm(struct ipmi_intf * intf);
|
||||
|
||||
static struct ipmi_oem_handle ipmi_oem_list[] = {
|
||||
{
|
||||
@ -58,12 +60,7 @@ static struct ipmi_oem_handle ipmi_oem_list[] = {
|
||||
name: "icts",
|
||||
desc: "IPMI 2.0 ICTS compliance support",
|
||||
},
|
||||
{
|
||||
name: "ibm",
|
||||
desc: "IBM OEM support",
|
||||
setup: ipmi_oem_ibm,
|
||||
},
|
||||
{ 0 }
|
||||
{ 0 },
|
||||
};
|
||||
|
||||
/* Supermicro IPMIv2 BMCs use OEM authtype */
|
||||
@ -74,17 +71,6 @@ ipmi_oem_supermicro(struct ipmi_intf * intf)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_oem_ibm(struct ipmi_intf * intf)
|
||||
{
|
||||
char * filename;
|
||||
if ((filename = getenv("IPMI_OEM_IBM_DATAFILE")) == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to read IPMI_OEM_IBM_DATAFILE from environment");
|
||||
return -1;
|
||||
}
|
||||
return ipmi_sel_oem_init((const char *)filename);
|
||||
}
|
||||
|
||||
/* ipmi_oem_print - print list of OEM handles
|
||||
*/
|
||||
void
|
||||
@ -110,6 +96,7 @@ int
|
||||
ipmi_oem_setup(struct ipmi_intf * intf, char * oemtype)
|
||||
{
|
||||
struct ipmi_oem_handle * oem;
|
||||
int i;
|
||||
int rc = 0;
|
||||
|
||||
if (strncmp(oemtype, "help", 4) == 0 ||
|
||||
@ -119,13 +106,18 @@ ipmi_oem_setup(struct ipmi_intf * intf, char * oemtype)
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (oem=ipmi_oem_list; oem->name != NULL; oem++) {
|
||||
for (oem=ipmi_oem_list, i=0; i < sizeof(ipmi_oem_list)/sizeof(struct ipmi_oem_handle); oem++, i++) {
|
||||
if (oem->name == NULL)
|
||||
continue;
|
||||
if (strncmp(oemtype, oem->name, strlen(oem->name)) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (oem->name == NULL)
|
||||
if (oem->name == NULL) {
|
||||
/* nothing was found */
|
||||
lprintf(LOG_ERR, "OEM support not found for \"%s\"", oemtype);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* save pointer for later use */
|
||||
intf->oem = oem;
|
||||
@ -158,3 +150,4 @@ ipmi_oem_active(struct ipmi_intf * intf, const char * oemtype)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,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 DELL 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.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@ -307,7 +311,7 @@ ipmi_pef_print_lan_dest(struct ipmi_intf * intf, uint8_t ch, uint8_t dest)
|
||||
"PET community");
|
||||
else {
|
||||
rsp->data[19] = '\0';
|
||||
ipmi_pef_print_str("PET Community", (const char *)&rsp->data[1]);
|
||||
ipmi_pef_print_str("PET Community", &rsp->data[1]);
|
||||
}
|
||||
}
|
||||
ipmi_pef_print_dec("ACK timeout/retry (secs)", timeout);
|
||||
@ -730,7 +734,6 @@ ipmi_pef_get_status(struct ipmi_intf * intf)
|
||||
struct ipmi_rq req;
|
||||
struct pef_cfgparm_selector psel;
|
||||
char tbuf[40];
|
||||
uint32_t timei;
|
||||
time_t ts;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
@ -742,12 +745,11 @@ ipmi_pef_get_status(struct ipmi_intf * intf)
|
||||
"Last S/W processed ID");
|
||||
return;
|
||||
}
|
||||
memcpy(&timei, rsp->data, sizeof(timei));
|
||||
#if WORDS_BIGENDIAN
|
||||
timei = BSWAP_32(timei);
|
||||
ts = (time_t)(rsp->data[0]<<24 + rsp->data[1]<<16 + rsp->data[2]<<8 + rsp->data[3]);
|
||||
#else
|
||||
ts = (time_t)(*(long *)rsp->data);
|
||||
#endif
|
||||
ts = (time_t)timei;
|
||||
|
||||
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&ts));
|
||||
|
||||
ipmi_pef_print_str("Last SEL addition", tbuf);
|
||||
@ -845,7 +847,6 @@ int ipmi_pef_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
// PEF subcommand handling
|
||||
*/
|
||||
int help = 0;
|
||||
int rc = 0;
|
||||
|
||||
if (!argc || !strncmp(argv[0], "info", 4))
|
||||
ipmi_pef_get_info(intf);
|
||||
@ -859,14 +860,11 @@ int ipmi_pef_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
ipmi_pef_list_entries(intf);
|
||||
else {
|
||||
help = 1;
|
||||
rc = -1;
|
||||
lprintf(LOG_ERR, "Invalid PEF command: '%s'\n", argv[0]);
|
||||
}
|
||||
|
||||
if (help)
|
||||
lprintf(LOG_NOTICE, "PEF commands: info status policy list");
|
||||
else if (!verbose)
|
||||
printf("\n");
|
||||
|
||||
return rc;
|
||||
return 0;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@ -39,10 +43,9 @@
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi_raw.h>
|
||||
#include <ipmitool/ipmi_fru.h>
|
||||
#include <ipmitool/ipmi_strings.h>
|
||||
|
||||
#define IPMI_I2C_MASTER_MAX_SIZE 0x40 /* 64 bytes */
|
||||
#define IPMI_I2C_MASTER_MAX_SIZE 0x40
|
||||
|
||||
/* ipmi_master_write_read - Perform I2C write/read transactions
|
||||
*
|
||||
@ -50,7 +53,6 @@
|
||||
* IPMI interface. It has a maximum transfer size of 32 bytes.
|
||||
*
|
||||
* @intf: ipmi interface
|
||||
* @bus: channel number, i2c bus id and type
|
||||
* @addr: i2c slave address
|
||||
* @wdata: data to write
|
||||
* @wsize: length of data to write (max 64 bytes)
|
||||
@ -59,8 +61,7 @@
|
||||
* Returns pointer to IPMI Response
|
||||
*/
|
||||
struct ipmi_rs *
|
||||
ipmi_master_write_read(struct ipmi_intf * intf, uint8_t bus, uint8_t addr,
|
||||
uint8_t * wdata, uint8_t wsize, uint8_t rsize)
|
||||
ipmi_master_write_read(struct ipmi_intf * intf, uint8_t addr, uint8_t * wdata, uint8_t wsize, uint8_t rsize)
|
||||
{
|
||||
struct ipmi_rq req;
|
||||
struct ipmi_rs * rsp;
|
||||
@ -82,7 +83,7 @@ ipmi_master_write_read(struct ipmi_intf * intf, uint8_t bus, uint8_t addr,
|
||||
req.msg.data_len = 3;
|
||||
|
||||
memset(rqdata, 0, IPMI_I2C_MASTER_MAX_SIZE + 3);
|
||||
rqdata[0] = bus; /* channel number, bus id, bus type */
|
||||
rqdata[0] = 0x00; /* channel number, bus id, bus type */
|
||||
rqdata[1] = addr; /* slave address */
|
||||
rqdata[2] = rsize; /* number of bytes to read */
|
||||
|
||||
@ -127,49 +128,9 @@ ipmi_master_write_read(struct ipmi_intf * intf, uint8_t bus, uint8_t addr,
|
||||
return rsp;
|
||||
}
|
||||
|
||||
#define RAW_SPD_SIZE 256
|
||||
|
||||
int
|
||||
ipmi_rawspd_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
uint8_t i2cbus = 0;
|
||||
uint8_t i2caddr = 0;
|
||||
uint8_t spd_data[RAW_SPD_SIZE];
|
||||
int i;
|
||||
|
||||
memset(spd_data, 0, RAW_SPD_SIZE);
|
||||
|
||||
if (argc < 2 || strncmp(argv[0], "help", 4) == 0) {
|
||||
lprintf(LOG_NOTICE, "usage: spd <i2cbus> <i2caddr>");
|
||||
return 0;
|
||||
}
|
||||
|
||||
i2cbus = (uint8_t)strtoul(argv[0], NULL, 0);
|
||||
i2caddr = (uint8_t)strtoul(argv[1], NULL, 0);
|
||||
|
||||
i2cbus = ((i2cbus & 7) << 1) | 1;
|
||||
|
||||
for (i = 0; i < RAW_SPD_SIZE; i+= IPMI_I2C_MASTER_MAX_SIZE) {
|
||||
rsp = ipmi_master_write_read(intf, i2cbus, i2caddr,
|
||||
(uint8_t *)&i, 1, IPMI_I2C_MASTER_MAX_SIZE);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to perform I2C Master Write-Read");
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy(spd_data+i, rsp->data, IPMI_I2C_MASTER_MAX_SIZE);
|
||||
}
|
||||
|
||||
ipmi_spd_print(spd_data, i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rawi2c_usage(void)
|
||||
{
|
||||
lprintf(LOG_NOTICE, "usage: i2c [bus=public|# [chan=#]] <i2caddr> <read bytes> [write data]");
|
||||
lprintf(LOG_NOTICE, " bus=public is default");
|
||||
lprintf(LOG_NOTICE, " chan=0 is default, bus= must be specified to use chan=");
|
||||
lprintf(LOG_NOTICE, "usage: i2c <i2caddr> <read bytes> [write data]");
|
||||
}
|
||||
|
||||
int
|
||||
@ -180,41 +141,20 @@ ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
uint8_t i2caddr = 0;
|
||||
uint8_t rsize = 0;
|
||||
uint8_t wsize = 0;
|
||||
unsigned int rbus = 0;
|
||||
uint8_t bus = 0;
|
||||
int i = 0;
|
||||
int i;
|
||||
|
||||
/* handle bus= argument */
|
||||
if (argc > 2 && strncmp(argv[0], "bus=", 4) == 0) {
|
||||
i = 1;
|
||||
if (strncmp(argv[0], "bus=public", 10) == 0)
|
||||
bus = 0;
|
||||
else if (sscanf(argv[0], "bus=%u", &rbus) == 1)
|
||||
bus = ((rbus & 7) << 1) | 1;
|
||||
else
|
||||
bus = 0;
|
||||
|
||||
/* handle channel= argument
|
||||
* the bus= argument must be supplied first on command line */
|
||||
if (argc > 3 && strncmp(argv[1], "chan=", 5) == 0) {
|
||||
i = 2;
|
||||
if (sscanf(argv[1], "chan=%u", &rbus) == 1)
|
||||
bus |= rbus << 4;
|
||||
}
|
||||
}
|
||||
|
||||
if ((argc-i) < 2 || strncmp(argv[0], "help", 4) == 0) {
|
||||
if (argc < 2 || strncmp(argv[0], "help", 4) == 0) {
|
||||
rawi2c_usage();
|
||||
return 0;
|
||||
}
|
||||
else if (argc-i-2 > IPMI_I2C_MASTER_MAX_SIZE) {
|
||||
else if (argc-2 > IPMI_I2C_MASTER_MAX_SIZE) {
|
||||
lprintf(LOG_ERR, "Raw command input limit (%d bytes) exceeded",
|
||||
IPMI_I2C_MASTER_MAX_SIZE);
|
||||
return -1;
|
||||
}
|
||||
|
||||
i2caddr = (uint8_t)strtoul(argv[i++], NULL, 0);
|
||||
rsize = (uint8_t)strtoul(argv[i++], NULL, 0);
|
||||
i2caddr = (uint8_t)strtoul(argv[0], NULL, 0);
|
||||
rsize = (uint8_t)strtoul(argv[1], NULL, 0);
|
||||
|
||||
if (i2caddr == 0) {
|
||||
lprintf(LOG_ERR, "Invalid I2C address 0");
|
||||
@ -223,7 +163,7 @@ ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
}
|
||||
|
||||
memset(wdata, 0, IPMI_I2C_MASTER_MAX_SIZE);
|
||||
for (; i < argc; i++) {
|
||||
for (i=2; i<argc; i++) {
|
||||
uint8_t val = (uint8_t)strtol(argv[i], NULL, 0);
|
||||
wdata[i-2] = val;
|
||||
wsize++;
|
||||
@ -233,7 +173,7 @@ ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
i2caddr, rsize, wsize);
|
||||
printbuf(wdata, wsize, "WRITE DATA");
|
||||
|
||||
rsp = ipmi_master_write_read(intf, bus, i2caddr, wdata, wsize, rsize);
|
||||
rsp = ipmi_master_write_read(intf, i2caddr, wdata, wsize, rsize);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to perform I2C Master Write-Read");
|
||||
return -1;
|
||||
@ -248,9 +188,6 @@ ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
if (verbose || wsize == 0)
|
||||
printf("Read %d bytes from I2C device %02Xh\n", rsp->data_len, i2caddr);
|
||||
|
||||
if (rsp->data_len < rsize)
|
||||
return -1;
|
||||
|
||||
/* print the raw response buffer */
|
||||
for (i=0; i<rsp->data_len; i++) {
|
||||
if (((i%16) == 0) && (i != 0))
|
||||
@ -282,6 +219,8 @@ ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
struct ipmi_rq req;
|
||||
uint8_t netfn, cmd, lun;
|
||||
int i;
|
||||
unsigned long ufn;
|
||||
|
||||
uint8_t data[256];
|
||||
|
||||
if (argc < 2 || strncmp(argv[0], "help", 4) == 0) {
|
||||
@ -310,7 +249,7 @@ ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
memset(data, 0, sizeof(data));
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = netfn;
|
||||
req.msg.lun = lun;
|
||||
req.msg.lun = lun;
|
||||
req.msg.cmd = cmd;
|
||||
req.msg.data = data;
|
||||
|
||||
@ -355,3 +294,4 @@ ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@ -56,7 +60,6 @@ extern int verbose;
|
||||
static int use_built_in; /* Uses DeviceSDRs instead of SDRR */
|
||||
static int sdr_max_read_len = GET_SDR_ENTIRE_RECORD;
|
||||
static int sdr_extended = 0;
|
||||
static long sdriana = 0;
|
||||
|
||||
static struct sdr_record_list *sdr_list_head = NULL;
|
||||
static struct sdr_record_list *sdr_list_tail = NULL;
|
||||
@ -93,6 +96,7 @@ ipmi_sdr_get_unit_string(uint8_t type, uint8_t base, uint8_t modifier)
|
||||
|
||||
return unitstr;
|
||||
}
|
||||
|
||||
/* sdr_convert_sensor_reading - convert raw sensor reading
|
||||
*
|
||||
* @sensor: sensor record
|
||||
@ -167,161 +171,7 @@ sdr_convert_sensor_reading(struct sdr_record_full_sensor *sensor, uint8_t val)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/* sdr_convert_sensor_hysterisis - convert raw sensor hysterisis
|
||||
*
|
||||
* Even though spec says histerisis should be computed using Mx+B
|
||||
* formula, B is irrelevant when doing raw comparison
|
||||
*
|
||||
* threshold rearm point is computed using threshold +/- hysterisis
|
||||
* with the full formula however B can't be applied in raw comparisons
|
||||
*
|
||||
* @sensor: sensor record
|
||||
* @val: raw sensor reading
|
||||
*
|
||||
* returns floating-point sensor reading
|
||||
*/
|
||||
double
|
||||
sdr_convert_sensor_hysterisis(struct sdr_record_full_sensor *sensor, uint8_t val)
|
||||
{
|
||||
int m, k1, k2;
|
||||
double result;
|
||||
|
||||
m = __TO_M(sensor->mtol);
|
||||
|
||||
k1 = __TO_B_EXP(sensor->bacc);
|
||||
k2 = __TO_R_EXP(sensor->bacc);
|
||||
|
||||
switch (sensor->unit.analog) {
|
||||
case 0:
|
||||
result = (double) (((m * val)) * pow(10, k2));
|
||||
break;
|
||||
case 1:
|
||||
if (val & 0x80)
|
||||
val++;
|
||||
/* Deliberately fall through to case 2. */
|
||||
case 2:
|
||||
result = (double) (((m * (int8_t) val) ) * pow(10, k2));
|
||||
break;
|
||||
default:
|
||||
/* Oops! This isn't an analog sensor. */
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
switch (sensor->linearization & 0x7f) {
|
||||
case SDR_SENSOR_L_LN:
|
||||
result = log(result);
|
||||
break;
|
||||
case SDR_SENSOR_L_LOG10:
|
||||
result = log10(result);
|
||||
break;
|
||||
case SDR_SENSOR_L_LOG2:
|
||||
result = (double) (log(result) / log(2.0));
|
||||
break;
|
||||
case SDR_SENSOR_L_E:
|
||||
result = exp(result);
|
||||
break;
|
||||
case SDR_SENSOR_L_EXP10:
|
||||
result = pow(10.0, result);
|
||||
break;
|
||||
case SDR_SENSOR_L_EXP2:
|
||||
result = pow(2.0, result);
|
||||
break;
|
||||
case SDR_SENSOR_L_1_X:
|
||||
result = pow(result, -1.0); /*1/x w/o exception */
|
||||
break;
|
||||
case SDR_SENSOR_L_SQR:
|
||||
result = pow(result, 2.0);
|
||||
break;
|
||||
case SDR_SENSOR_L_CUBE:
|
||||
result = pow(result, 3.0);
|
||||
break;
|
||||
case SDR_SENSOR_L_SQRT:
|
||||
result = sqrt(result);
|
||||
break;
|
||||
case SDR_SENSOR_L_CUBERT:
|
||||
result = cbrt(result);
|
||||
break;
|
||||
case SDR_SENSOR_L_LINEAR:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/* sdr_convert_sensor_tolerance - convert raw sensor reading
|
||||
*
|
||||
* @sensor: sensor record
|
||||
* @val: raw sensor reading
|
||||
*
|
||||
* returns floating-point sensor tolerance(interpreted)
|
||||
*/
|
||||
double
|
||||
sdr_convert_sensor_tolerance(struct sdr_record_full_sensor *sensor, uint8_t val)
|
||||
{
|
||||
int m, k2;
|
||||
double result;
|
||||
|
||||
m = __TO_M(sensor->mtol);
|
||||
k2 = __TO_R_EXP(sensor->bacc);
|
||||
|
||||
switch (sensor->unit.analog) {
|
||||
case 0:
|
||||
/* as suggested in section 30.4.1 of IPMI 1.5 spec */
|
||||
result = (double) ((((m * (double)val/2)) ) * pow(10, k2));
|
||||
break;
|
||||
case 1:
|
||||
if (val & 0x80)
|
||||
val++;
|
||||
/* Deliberately fall through to case 2. */
|
||||
case 2:
|
||||
result = (double) (((m * ((double)((int8_t) val)/2))) * pow(10, k2));
|
||||
break;
|
||||
default:
|
||||
/* Oops! This isn't an analog sensor. */
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
switch (sensor->linearization & 0x7f) {
|
||||
case SDR_SENSOR_L_LN:
|
||||
result = log(result);
|
||||
break;
|
||||
case SDR_SENSOR_L_LOG10:
|
||||
result = log10(result);
|
||||
break;
|
||||
case SDR_SENSOR_L_LOG2:
|
||||
result = (double) (log(result) / log(2.0));
|
||||
break;
|
||||
case SDR_SENSOR_L_E:
|
||||
result = exp(result);
|
||||
break;
|
||||
case SDR_SENSOR_L_EXP10:
|
||||
result = pow(10.0, result);
|
||||
break;
|
||||
case SDR_SENSOR_L_EXP2:
|
||||
result = pow(2.0, result);
|
||||
break;
|
||||
case SDR_SENSOR_L_1_X:
|
||||
result = pow(result, -1.0); /*1/x w/o exception */
|
||||
break;
|
||||
case SDR_SENSOR_L_SQR:
|
||||
result = pow(result, 2.0);
|
||||
break;
|
||||
case SDR_SENSOR_L_CUBE:
|
||||
result = pow(result, 3.0);
|
||||
break;
|
||||
case SDR_SENSOR_L_SQRT:
|
||||
result = sqrt(result);
|
||||
break;
|
||||
case SDR_SENSOR_L_CUBERT:
|
||||
result = cbrt(result);
|
||||
break;
|
||||
case SDR_SENSOR_L_LINEAR:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -432,13 +282,12 @@ ipmi_sdr_get_sensor_reading(struct ipmi_intf *intf, uint8_t sensor)
|
||||
* @intf: ipmi interface
|
||||
* @sensor: sensor id
|
||||
* @target: IPMB target address
|
||||
* @lun: sensor lun
|
||||
*
|
||||
* returns ipmi response structure
|
||||
*/
|
||||
struct ipmi_rs *
|
||||
ipmi_sdr_get_sensor_reading_ipmb(struct ipmi_intf *intf, uint8_t sensor,
|
||||
uint8_t target, uint8_t lun)
|
||||
uint8_t target)
|
||||
{
|
||||
struct ipmi_rq req;
|
||||
struct ipmi_rs *rsp;
|
||||
@ -519,10 +368,7 @@ ipmi_sdr_get_sensor_type_desc(const uint8_t type)
|
||||
if (type < 0xc0)
|
||||
snprintf(desc, 32, "reserved #%02x", type);
|
||||
else
|
||||
{
|
||||
snprintf(desc, 32, oemval2str(sdriana,type,ipmi_oem_sdr_type_vals),
|
||||
type);
|
||||
}
|
||||
snprintf(desc, 32, "OEM reserved #%02x", type);
|
||||
return desc;
|
||||
}
|
||||
|
||||
@ -629,7 +475,7 @@ ipmi_sdr_get_header(struct ipmi_intf *intf, struct ipmi_sdr_iterator *itr)
|
||||
continue;
|
||||
} else if (rsp->ccode == 0xc5) {
|
||||
/* lost reservation */
|
||||
lprintf(LOG_DEBUG, "SDR reservation %04x cancelled. "
|
||||
lprintf(LOG_DEBUG, "SDR reserveration %04x cancelled. "
|
||||
"Sleeping a bit and retrying...",
|
||||
itr->reservation);
|
||||
|
||||
@ -651,9 +497,6 @@ ipmi_sdr_get_header(struct ipmi_intf *intf, struct ipmi_sdr_iterator *itr)
|
||||
}
|
||||
}
|
||||
|
||||
if (!rsp)
|
||||
return NULL;
|
||||
|
||||
lprintf(LOG_DEBUG, "SDR record ID : 0x%04x", itr->next);
|
||||
|
||||
memcpy(&sdr_rs, rsp->data, sizeof (sdr_rs));
|
||||
@ -1083,6 +926,7 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
|
||||
int i = 0, validread = 1, do_unit = 1;
|
||||
double val = 0.0, creading = 0.0;
|
||||
struct ipmi_rs *rsp;
|
||||
uint8_t min_reading, max_reading;
|
||||
|
||||
if (sensor == NULL)
|
||||
return -1;
|
||||
@ -1104,7 +948,7 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
|
||||
desc, sensor->keys.sensor_num);
|
||||
validread = 0;
|
||||
}
|
||||
else if (rsp->ccode > 0) {
|
||||
if (rsp->ccode > 0) {
|
||||
if (rsp->ccode == 0xcb) {
|
||||
/* sensor not found */
|
||||
validread = 0;
|
||||
@ -1122,6 +966,14 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
|
||||
} else if (IS_SCANNING_DISABLED(rsp->data[1])) {
|
||||
/* Sensor Scanning Disabled */
|
||||
validread = 0;
|
||||
if (rsp->data[0] != 0) {
|
||||
/* we might still get a valid reading */
|
||||
val =
|
||||
sdr_convert_sensor_reading(sensor,
|
||||
rsp->data[0]);
|
||||
if (val != 0.0)
|
||||
validread = 1;
|
||||
}
|
||||
} else if (rsp->data[0] != 0) {
|
||||
/* convert RAW reading into units */
|
||||
val = sdr_convert_sensor_reading(sensor, rsp->data[0]);
|
||||
@ -1222,7 +1074,7 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
|
||||
i += snprintf(sval, sizeof (sval), "%.*f %s",
|
||||
(val == (int) val) ? 0 : 2, val,
|
||||
do_unit ? unitstr : "");
|
||||
else if (rsp && IS_SCANNING_DISABLED(rsp->data[1]))
|
||||
else if (IS_SCANNING_DISABLED(rsp->data[1]))
|
||||
i += snprintf(sval, sizeof (sval), "disabled ");
|
||||
else
|
||||
i += snprintf(sval, sizeof (sval), "no reading ");
|
||||
@ -1256,7 +1108,7 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
|
||||
i += snprintf(sval, sizeof (sval), "%.*f %s",
|
||||
(val == (int) val) ? 0 : 2, val,
|
||||
do_unit ? unitstr : "");
|
||||
else if (rsp && IS_SCANNING_DISABLED(rsp->data[1]))
|
||||
else if (IS_SCANNING_DISABLED(rsp->data[1]))
|
||||
i += snprintf(sval, sizeof (sval), "Disabled");
|
||||
else
|
||||
i += snprintf(sval, sizeof (sval), "No Reading");
|
||||
@ -1282,7 +1134,7 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
|
||||
printf(" Sensor Reading : ");
|
||||
if (validread)
|
||||
printf("%xh\n", (uint32_t) val);
|
||||
else if (rsp && IS_SCANNING_DISABLED(rsp->data[1]))
|
||||
else if (IS_SCANNING_DISABLED(rsp->data[1]))
|
||||
printf("Disabled\n");
|
||||
else
|
||||
printf("Not Reading\n");
|
||||
@ -1305,9 +1157,8 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
|
||||
|
||||
ipmi_sdr_print_discrete_state("States Asserted",
|
||||
sensor->sensor.type,
|
||||
sensor->event_type,
|
||||
rsp ? rsp->data[2] : 0,
|
||||
rsp ? rsp->data[3] : 0);
|
||||
sensor->event_type, rsp->data[2],
|
||||
rsp->data[3]);
|
||||
ipmi_sdr_print_sensor_mask(&sensor->mask, sensor->sensor.type,
|
||||
sensor->event_type, DISCRETE_SENSOR);
|
||||
ipmi_sdr_print_sensor_event_status(intf,
|
||||
@ -1332,11 +1183,11 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
|
||||
printf(" Sensor Reading : ");
|
||||
if (validread) {
|
||||
uint16_t raw_tol = __TO_TOL(sensor->mtol);
|
||||
double tol = sdr_convert_sensor_tolerance(sensor, raw_tol);
|
||||
double tol = sdr_convert_sensor_reading(sensor, raw_tol * 2);
|
||||
printf("%.*f (+/- %.*f) %s\n",
|
||||
(val == (int) val) ? 0 : 3,
|
||||
val, (tol == (int) tol) ? 0 : 3, tol, unitstr);
|
||||
} else if (rsp && IS_SCANNING_DISABLED(rsp->data[1]))
|
||||
} else if (IS_SCANNING_DISABLED(rsp->data[1]))
|
||||
printf("Disabled\n");
|
||||
else
|
||||
printf("No Reading\n");
|
||||
@ -1357,7 +1208,7 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
|
||||
SENSOR_PRINT_THRESH("Lower non-critical", lower.non_critical, lnc);
|
||||
|
||||
creading =
|
||||
sdr_convert_sensor_hysterisis(sensor,
|
||||
sdr_convert_sensor_reading(sensor,
|
||||
sensor->threshold.hysteresis.positive);
|
||||
if (sensor->threshold.hysteresis.positive == 0x00
|
||||
|| sensor->threshold.hysteresis.positive == 0xff || creading == 0)
|
||||
@ -1366,7 +1217,7 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
|
||||
printf(" Positive Hysteresis : %.3f\n", creading);
|
||||
|
||||
creading =
|
||||
sdr_convert_sensor_hysterisis(sensor,
|
||||
sdr_convert_sensor_reading(sensor,
|
||||
sensor->threshold.hysteresis.negative);
|
||||
if (sensor->threshold.hysteresis.negative == 0x00
|
||||
|| sensor->threshold.hysteresis.negative == 0xff || creading == 0.0)
|
||||
@ -1599,27 +1450,13 @@ ipmi_sdr_print_discrete_state(const char *desc,
|
||||
}
|
||||
|
||||
if (evt->offset > 7) {
|
||||
if ((1 << (evt->offset - 8)) & state2) {
|
||||
if (evt->desc) {
|
||||
printf(" "
|
||||
"[%s]\n",
|
||||
evt->desc);
|
||||
} else {
|
||||
printf(" "
|
||||
"[no description]\n");
|
||||
}
|
||||
}
|
||||
if ((1 << (evt->offset - 8)) & state2)
|
||||
printf(" [%s]\n",
|
||||
evt->desc);
|
||||
} else {
|
||||
if ((1 << evt->offset) & state1) {
|
||||
if (evt->desc) {
|
||||
printf(" "
|
||||
"[%s]\n",
|
||||
evt->desc);
|
||||
} else {
|
||||
printf(" "
|
||||
"[no description]\n");
|
||||
}
|
||||
}
|
||||
if ((1 << evt->offset) & state1)
|
||||
printf(" [%s]\n",
|
||||
evt->desc);
|
||||
}
|
||||
c++;
|
||||
}
|
||||
@ -1654,30 +1491,21 @@ ipmi_sdr_print_sensor_compact(struct ipmi_intf *intf,
|
||||
desc, sensor->keys.sensor_num);
|
||||
validread = 0;
|
||||
}
|
||||
|
||||
else if (rsp->ccode > 0) {
|
||||
/* completion code 0xcd is special case */
|
||||
if (rsp->ccode == 0xcd) {
|
||||
/* sensor not found */
|
||||
validread = 0;
|
||||
} else {
|
||||
lprintf(LOG_DEBUG, "Error reading sensor %s (#%02x): %s",
|
||||
desc, sensor->keys.sensor_num,
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
validread = 0;
|
||||
}
|
||||
} else {
|
||||
if (IS_READING_UNAVAILABLE(rsp->data[1])) {
|
||||
/* sensor reading unavailable */
|
||||
validread = 0;
|
||||
} else if (IS_SCANNING_DISABLED(rsp->data[1])) {
|
||||
validread = 0;
|
||||
/* check for sensor scanning disabled bit */
|
||||
lprintf(LOG_DEBUG, "Sensor %s (#%02x) scanning disabled",
|
||||
desc, sensor->keys.sensor_num);
|
||||
}
|
||||
if (rsp->ccode > 0 && rsp->ccode != 0xcd) {
|
||||
/* completion code 0xcd is special case */
|
||||
lprintf(LOG_DEBUG, "Error reading sensor %s (#%02x): %s",
|
||||
desc, sensor->keys.sensor_num,
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
validread = 0;
|
||||
}
|
||||
|
||||
|
||||
/* check for sensor scanning disabled bit */
|
||||
if (IS_SCANNING_DISABLED(rsp->data[1])) {
|
||||
lprintf(LOG_DEBUG, "Sensor %s (#%02x) scanning disabled",
|
||||
desc, sensor->keys.sensor_num);
|
||||
validread = 0;
|
||||
}
|
||||
|
||||
if (verbose) {
|
||||
printf("Sensor ID : %s (0x%x)\n",
|
||||
(sensor->id_code) ? desc : "", sensor->keys.sensor_num);
|
||||
@ -2473,7 +2301,7 @@ ipmi_sdr_get_reservation(struct ipmi_intf *intf, uint16_t * reserve_id)
|
||||
return -1;
|
||||
|
||||
*reserve_id = ((struct sdr_reserve_repo_rs *) &(rsp->data))->reserve_id;
|
||||
lprintf(LOG_DEBUG, "SDR reservation ID %04x", *reserve_id);
|
||||
lprintf(LOG_DEBUG, "SDR reserveration ID %04x", *reserve_id);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -2515,8 +2343,6 @@ ipmi_sdr_start(struct ipmi_intf *intf)
|
||||
}
|
||||
devid = (struct ipm_devid_rsp *) rsp->data;
|
||||
|
||||
sdriana = (long)IPM_DEV_MANUFACTURER_ID(devid->manufacturer_id);
|
||||
|
||||
if (devid->device_revision & IPM_DEV_DEVICE_ID_SDR_MASK) {
|
||||
if ((devid->adtl_device_support & 0x02) == 0) {
|
||||
if ((devid->adtl_device_support & 0x01)) {
|
||||
@ -2558,8 +2384,7 @@ ipmi_sdr_start(struct ipmi_intf *intf)
|
||||
* IPMIv2.0 == 0x02
|
||||
*/
|
||||
if ((sdr_info.version != 0x51) &&
|
||||
(sdr_info.version != 0x01) &&
|
||||
(sdr_info.version != 0x02)) {
|
||||
(sdr_info.version != 0x01) && (sdr_info.version != 0x02)) {
|
||||
lprintf(LOG_WARN, "WARNING: Unknown SDR repository "
|
||||
"version 0x%02x", sdr_info.version);
|
||||
}
|
||||
@ -2668,7 +2493,7 @@ ipmi_sdr_get_record(struct ipmi_intf * intf, struct sdr_get_rs * header,
|
||||
continue;
|
||||
case 0xc5:
|
||||
/* lost reservation */
|
||||
lprintf(LOG_DEBUG, "SDR reservation cancelled. "
|
||||
lprintf(LOG_DEBUG, "SDR reserveration cancelled. "
|
||||
"Sleeping a bit and retrying...");
|
||||
|
||||
sleep(rand() & 3);
|
||||
@ -3370,39 +3195,39 @@ ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf, char *id)
|
||||
for (e = sdr_list_head; e != NULL; e = e->next) {
|
||||
switch (e->type) {
|
||||
case SDR_RECORD_TYPE_FULL_SENSOR:
|
||||
if (!strncmp((const char *)e->record.full->id_string,
|
||||
(const char *)id,
|
||||
__max(e->record.full->id_code & 0x1f, idlen)))
|
||||
if (!strncmp(e->record.full->id_string, id,
|
||||
__max(e->record.full->id_code & 0x1f,
|
||||
idlen)))
|
||||
return e;
|
||||
break;
|
||||
case SDR_RECORD_TYPE_COMPACT_SENSOR:
|
||||
if (!strncmp((const char *)e->record.compact->id_string,
|
||||
(const char *)id,
|
||||
__max(e->record.compact->id_code & 0x1f, idlen)))
|
||||
if (!strncmp(e->record.compact->id_string, id,
|
||||
__max(e->record.compact->id_code & 0x1f,
|
||||
idlen)))
|
||||
return e;
|
||||
break;
|
||||
case SDR_RECORD_TYPE_EVENTONLY_SENSOR:
|
||||
if (!strncmp((const char *)e->record.eventonly->id_string,
|
||||
(const char *)id,
|
||||
__max(e->record.eventonly->id_code & 0x1f, idlen)))
|
||||
if (!strncmp(e->record.eventonly->id_string, id,
|
||||
__max(e->record.eventonly->id_code & 0x1f,
|
||||
idlen)))
|
||||
return e;
|
||||
break;
|
||||
case SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR:
|
||||
if (!strncmp((const char *)e->record.genloc->id_string,
|
||||
(const char *)id,
|
||||
__max(e->record.genloc->id_code & 0x1f, idlen)))
|
||||
if (!strncmp(e->record.genloc->id_string, id,
|
||||
__max(e->record.genloc->id_code & 0x1f,
|
||||
idlen)))
|
||||
return e;
|
||||
break;
|
||||
case SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR:
|
||||
if (!strncmp((const char *)e->record.fruloc->id_string,
|
||||
(const char *)id,
|
||||
__max(e->record.fruloc->id_code & 0x1f, idlen)))
|
||||
if (!strncmp(e->record.fruloc->id_string, id,
|
||||
__max(e->record.fruloc->id_code & 0x1f,
|
||||
idlen)))
|
||||
return e;
|
||||
break;
|
||||
case SDR_RECORD_TYPE_MC_DEVICE_LOCATOR:
|
||||
if (!strncmp((const char *)e->record.mcloc->id_string,
|
||||
(const char *)id,
|
||||
__max(e->record.mcloc->id_code & 0x1f, idlen)))
|
||||
if (!strncmp(e->record.mcloc->id_string, id,
|
||||
__max(e->record.mcloc->id_code & 0x1f,
|
||||
idlen)))
|
||||
return e;
|
||||
break;
|
||||
}
|
||||
@ -3430,57 +3255,51 @@ ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf, char *id)
|
||||
case SDR_RECORD_TYPE_FULL_SENSOR:
|
||||
sdrr->record.full =
|
||||
(struct sdr_record_full_sensor *) rec;
|
||||
if (!strncmp(
|
||||
(const char *)sdrr->record.full->id_string,
|
||||
(const char *)id,
|
||||
__max(sdrr->record.full->id_code & 0x1f, idlen)))
|
||||
if (!strncmp
|
||||
(sdrr->record.full->id_string, id,
|
||||
__max(sdrr->record.full->id_code & 0x1f, idlen)))
|
||||
found = 1;
|
||||
break;
|
||||
case SDR_RECORD_TYPE_COMPACT_SENSOR:
|
||||
sdrr->record.compact =
|
||||
(struct sdr_record_compact_sensor *) rec;
|
||||
if (!strncmp(
|
||||
(const char *)sdrr->record.compact->id_string,
|
||||
(const char *)id,
|
||||
__max(sdrr->record.compact->id_code & 0x1f,
|
||||
if (!strncmp
|
||||
(sdrr->record.compact->id_string, id,
|
||||
__max(sdrr->record.compact->id_code & 0x1f,
|
||||
idlen)))
|
||||
found = 1;
|
||||
break;
|
||||
case SDR_RECORD_TYPE_EVENTONLY_SENSOR:
|
||||
sdrr->record.eventonly =
|
||||
(struct sdr_record_eventonly_sensor *) rec;
|
||||
if (!strncmp(
|
||||
(const char *)sdrr->record.eventonly->id_string,
|
||||
(const char *)id,
|
||||
__max(sdrr->record.eventonly->id_code & 0x1f,
|
||||
if (!strncmp
|
||||
(sdrr->record.eventonly->id_string, id,
|
||||
__max(sdrr->record.eventonly->id_code & 0x1f,
|
||||
idlen)))
|
||||
found = 1;
|
||||
break;
|
||||
case SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR:
|
||||
sdrr->record.genloc =
|
||||
(struct sdr_record_generic_locator *) rec;
|
||||
if (!strncmp(
|
||||
(const char *)sdrr->record.genloc->id_string,
|
||||
(const char *)id,
|
||||
__max(sdrr->record.genloc->id_code & 0x1f, idlen)))
|
||||
if (!strncmp
|
||||
(sdrr->record.genloc->id_string, id,
|
||||
__max(sdrr->record.genloc->id_code & 0x1f, idlen)))
|
||||
found = 1;
|
||||
break;
|
||||
case SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR:
|
||||
sdrr->record.fruloc =
|
||||
(struct sdr_record_fru_locator *) rec;
|
||||
if (!strncmp(
|
||||
(const char *)sdrr->record.fruloc->id_string,
|
||||
(const char *)id,
|
||||
__max(sdrr->record.fruloc->id_code & 0x1f, idlen)))
|
||||
if (!strncmp
|
||||
(sdrr->record.fruloc->id_string, id,
|
||||
__max(sdrr->record.fruloc->id_code & 0x1f, idlen)))
|
||||
found = 1;
|
||||
break;
|
||||
case SDR_RECORD_TYPE_MC_DEVICE_LOCATOR:
|
||||
sdrr->record.mcloc =
|
||||
(struct sdr_record_mc_locator *) rec;
|
||||
if (!strncmp(
|
||||
(const char *)sdrr->record.mcloc->id_string,
|
||||
(const char *)id,
|
||||
__max(sdrr->record.mcloc->id_code & 0x1f, idlen)))
|
||||
if (!strncmp
|
||||
(sdrr->record.mcloc->id_string, id,
|
||||
__max(sdrr->record.mcloc->id_code & 0x1f, idlen)))
|
||||
found = 1;
|
||||
break;
|
||||
case SDR_RECORD_TYPE_ENTITY_ASSOC:
|
||||
@ -3557,13 +3376,10 @@ ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile)
|
||||
if (header.length == 0)
|
||||
continue;
|
||||
|
||||
if (header.version != 0x51 &&
|
||||
header.version != 0x01 &&
|
||||
header.version != 0x02) {
|
||||
if (header.version != 0x51) {
|
||||
lprintf(LOG_WARN, "invalid sdr header version %02x",
|
||||
header.version);
|
||||
ret = -1;
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
sdrr = malloc(sizeof (struct sdr_record_list));
|
||||
@ -3913,62 +3729,42 @@ ipmi_sdr_dump_bin(struct ipmi_intf *intf, const char *ofile)
|
||||
{
|
||||
struct sdr_get_rs *header;
|
||||
struct ipmi_sdr_iterator *itr;
|
||||
struct sdr_record_list *sdrr;
|
||||
FILE *fp;
|
||||
int rc = 0;
|
||||
|
||||
fp = ipmi_open_file_write(ofile);
|
||||
if (fp == NULL)
|
||||
return -1;
|
||||
|
||||
/* open connection to SDR */
|
||||
itr = ipmi_sdr_start(intf);
|
||||
if (itr == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to open SDR for reading");
|
||||
fclose(fp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Dumping Sensor Data Repository to '%s'\n", ofile);
|
||||
|
||||
/* generate list of records */
|
||||
/* go through sdr records */
|
||||
while ((header = ipmi_sdr_get_next_header(intf, itr)) != NULL) {
|
||||
sdrr = malloc(sizeof(struct sdr_record_list));
|
||||
if (sdrr == NULL) {
|
||||
lprintf(LOG_ERR, "ipmitool: malloc failure");
|
||||
return -1;
|
||||
}
|
||||
memset(sdrr, 0, sizeof(struct sdr_record_list));
|
||||
int r;
|
||||
uint8_t h[5];
|
||||
uint8_t *rec;
|
||||
|
||||
lprintf(LOG_INFO, "Record ID %04x (%d bytes)",
|
||||
header->id, header->length);
|
||||
|
||||
sdrr->id = header->id;
|
||||
sdrr->version = header->version;
|
||||
sdrr->type = header->type;
|
||||
sdrr->length = header->length;
|
||||
sdrr->raw = ipmi_sdr_get_record(intf, header, itr);
|
||||
|
||||
if (sdr_list_head == NULL)
|
||||
sdr_list_head = sdrr;
|
||||
else
|
||||
sdr_list_tail->next = sdrr;
|
||||
|
||||
sdr_list_tail = sdrr;
|
||||
}
|
||||
|
||||
ipmi_sdr_end(intf, itr);
|
||||
|
||||
/* now write to file */
|
||||
fp = ipmi_open_file_write(ofile);
|
||||
if (fp == NULL)
|
||||
return -1;
|
||||
|
||||
for (sdrr = sdr_list_head; sdrr != NULL; sdrr = sdrr->next) {
|
||||
int r;
|
||||
uint8_t h[5];
|
||||
rec = ipmi_sdr_get_record(intf, header, itr);
|
||||
if (rec == NULL)
|
||||
continue;
|
||||
|
||||
/* build and write sdr header */
|
||||
h[0] = sdrr->id & 0xff;
|
||||
h[1] = (sdrr->id >> 8) & 0xff;
|
||||
h[2] = sdrr->version;
|
||||
h[3] = sdrr->type;
|
||||
h[4] = sdrr->length;
|
||||
h[0] = header->id & 0xff;
|
||||
h[1] = (header->id >> 8) & 0xff;
|
||||
h[2] = header->version;
|
||||
h[3] = header->type;
|
||||
h[4] = header->length;
|
||||
|
||||
r = fwrite(h, 1, 5, fp);
|
||||
if (r != 5) {
|
||||
@ -3979,16 +3775,18 @@ ipmi_sdr_dump_bin(struct ipmi_intf *intf, const char *ofile)
|
||||
}
|
||||
|
||||
/* write sdr entry */
|
||||
r = fwrite(sdrr->raw, 1, sdrr->length, fp);
|
||||
if (r != sdrr->length) {
|
||||
r = fwrite(rec, 1, header->length, fp);
|
||||
if (r != header->length) {
|
||||
lprintf(LOG_ERR, "Error writing %d record bytes "
|
||||
"to output file %s", sdrr->length, ofile);
|
||||
"to output file %s", header->length, ofile);
|
||||
rc = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
ipmi_sdr_end(intf, itr);
|
||||
|
||||
fclose(fp);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -4197,9 +3995,6 @@ ipmi_sdr_main(struct ipmi_intf *intf, int argc, char **argv)
|
||||
lprintf(LOG_ERR, " type [sensor type]");
|
||||
lprintf(LOG_ERR,
|
||||
" list Get a list of available sensor types");
|
||||
lprintf(LOG_ERR,
|
||||
" get Retrieve the state of a specified sensor");
|
||||
|
||||
lprintf(LOG_ERR, " info");
|
||||
lprintf(LOG_ERR,
|
||||
" Display information about the repository itself");
|
||||
|
@ -28,13 +28,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.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#define __USE_XOPEN /* glibc2 needs this for strptime */
|
||||
#include <time.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/log.h>
|
||||
@ -47,151 +50,8 @@
|
||||
#include <ipmitool/ipmi_sensor.h>
|
||||
|
||||
extern int verbose;
|
||||
|
||||
static int sel_extended = 0;
|
||||
static int sel_oem_nrecs = 0;
|
||||
|
||||
struct ipmi_sel_oem_msg_rec {
|
||||
int value[14];
|
||||
char *string[14];
|
||||
char *text;
|
||||
} *sel_oem_msg;
|
||||
|
||||
#define SEL_BYTE(n) (n-3) /* So we can refer to byte positions in log entries (byte 3 is at index 0, etc) */
|
||||
|
||||
/*
|
||||
* Reads values found in message translation file. XX is a wildcard, R means reserved.
|
||||
* Returns -1 for XX, -2 for R, -3 for non-hex (string), or positive integer from a hex value.
|
||||
*/
|
||||
static int ipmi_sel_oem_readval(char *str)
|
||||
{
|
||||
int ret;
|
||||
if (!strcmp(str, "XX")) {
|
||||
return -1;
|
||||
}
|
||||
if (!strcmp(str, "R")) {
|
||||
return -2;
|
||||
}
|
||||
if (sscanf(str, "0x%x", &ret) != 1) {
|
||||
return -3;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is where the magic happens. SEL_BYTE is a bit ugly, but it allows
|
||||
* reference to byte positions instead of array indexes which (hopefully)
|
||||
* helps make the code easier to read.
|
||||
*/
|
||||
static int ipmi_sel_oem_match(uint8_t *evt, struct ipmi_sel_oem_msg_rec rec)
|
||||
{
|
||||
if (evt[2] == rec.value[SEL_BYTE(3)] &&
|
||||
((rec.value[SEL_BYTE(4)] < 0) || (evt[3] == rec.value[SEL_BYTE(4)])) &&
|
||||
((rec.value[SEL_BYTE(5)] < 0) || (evt[4] == rec.value[SEL_BYTE(5)])) &&
|
||||
((rec.value[SEL_BYTE(6)] < 0) || (evt[5] == rec.value[SEL_BYTE(6)])) &&
|
||||
((rec.value[SEL_BYTE(7)] < 0) || (evt[6] == rec.value[SEL_BYTE(7)])) &&
|
||||
((rec.value[SEL_BYTE(11)] < 0) || (evt[10] == rec.value[SEL_BYTE(11)])) &&
|
||||
((rec.value[SEL_BYTE(12)] < 0) || (evt[11] == rec.value[SEL_BYTE(12)]))) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int ipmi_sel_oem_init(const char * filename)
|
||||
{
|
||||
FILE * fp;
|
||||
int i, j, k, n, byte;
|
||||
char buf[15][150];
|
||||
|
||||
if (filename == NULL) {
|
||||
lprintf(LOG_ERR, "No SEL OEM filename provided");
|
||||
return -1;
|
||||
}
|
||||
|
||||
fp = ipmi_open_file_read(filename);
|
||||
if (fp == NULL) {
|
||||
lprintf(LOG_ERR, "Could not open %s file", filename);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* count number of records (lines) in input file */
|
||||
sel_oem_nrecs = 0;
|
||||
while (fscanf(fp, "%*[^\n]\n") == 0) {
|
||||
sel_oem_nrecs++;
|
||||
}
|
||||
|
||||
printf("nrecs=%d\n", sel_oem_nrecs);
|
||||
|
||||
rewind(fp);
|
||||
sel_oem_msg = (struct ipmi_sel_oem_msg_rec *)calloc(sel_oem_nrecs,
|
||||
sizeof(struct ipmi_sel_oem_msg_rec));
|
||||
|
||||
for (i=0; i < sel_oem_nrecs; i++) {
|
||||
n=fscanf(fp, "\"%[^\"]\",\"%[^\"]\",\"%[^\"]\",\"%[^\"]\",\""
|
||||
"%[^\"]\",\"%[^\"]\",\"%[^\"]\",\"%[^\"]\",\""
|
||||
"%[^\"]\",\"%[^\"]\",\"%[^\"]\",\"%[^\"]\",\""
|
||||
"%[^\"]\",\"%[^\"]\",\"%[^\"]\"\n",
|
||||
buf[0], buf[1], buf[2], buf[3], buf[4], buf[5],
|
||||
buf[6], buf[7], buf[8], buf[9], buf[10], buf[11],
|
||||
buf[12], buf[13], buf[14]);
|
||||
|
||||
if (n != 15) {
|
||||
lprintf (LOG_ERR, "Encountered problems reading line %d of %s",
|
||||
i+1, filename);
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
sel_oem_nrecs = 0;
|
||||
/* free all the memory allocated so far */
|
||||
for (j=0; j<i ; j++) {
|
||||
for (k=3; k<17; k++) {
|
||||
if (sel_oem_msg[j].value[SEL_BYTE(k)] == -3) {
|
||||
free(sel_oem_msg[j].string[SEL_BYTE(k)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
free (sel_oem_msg);
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (byte = 3; byte < 17; byte++) {
|
||||
if ((sel_oem_msg[i].value[SEL_BYTE(byte)] =
|
||||
ipmi_sel_oem_readval(buf[SEL_BYTE(byte)])) == -3) {
|
||||
sel_oem_msg[i].string[SEL_BYTE(byte)] =
|
||||
(char *)malloc(strlen(buf[SEL_BYTE(byte)]) + 1);
|
||||
strcpy(sel_oem_msg[i].string[SEL_BYTE(byte)],
|
||||
buf[SEL_BYTE(byte)]);
|
||||
}
|
||||
}
|
||||
sel_oem_msg[i].text = (char *)malloc(strlen(buf[SEL_BYTE(17)]) + 1);
|
||||
strcpy(sel_oem_msg[i].text, buf[SEL_BYTE(17)]);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ipmi_sel_oem_message(struct sel_event_record * evt, int verbose)
|
||||
{
|
||||
/*
|
||||
* Note: although we have a verbose argument, currently the output
|
||||
* isn't affected by it.
|
||||
*/
|
||||
int i, j;
|
||||
|
||||
for (i=0; i < sel_oem_nrecs; i++) {
|
||||
if (ipmi_sel_oem_match((uint8_t *)evt, sel_oem_msg[i])) {
|
||||
printf (csv_output ? ",\"%s\"" : " | %s", sel_oem_msg[i].text);
|
||||
for (j=4; j<17; j++) {
|
||||
if (sel_oem_msg[i].value[SEL_BYTE(j)] == -3) {
|
||||
printf (csv_output ? ",%s=0x%x" : " %s = 0x%x",
|
||||
sel_oem_msg[i].string[SEL_BYTE(j)],
|
||||
((uint8_t *)evt)[SEL_BYTE(j)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const struct valstr event_dir_vals[] = {
|
||||
{ 0, "Assertion Event" },
|
||||
@ -218,7 +78,7 @@ ipmi_get_event_type(uint8_t code)
|
||||
static char *
|
||||
ipmi_sel_timestamp(uint32_t stamp)
|
||||
{
|
||||
static char tbuf[40];
|
||||
static uint8_t tbuf[40];
|
||||
time_t s = (time_t)stamp;
|
||||
memset(tbuf, 0, 40);
|
||||
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&s));
|
||||
@ -228,7 +88,7 @@ ipmi_sel_timestamp(uint32_t stamp)
|
||||
static char *
|
||||
ipmi_sel_timestamp_date(uint32_t stamp)
|
||||
{
|
||||
static char tbuf[11];
|
||||
static uint8_t tbuf[11];
|
||||
time_t s = (time_t)stamp;
|
||||
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y", localtime(&s));
|
||||
return tbuf;
|
||||
@ -237,7 +97,7 @@ ipmi_sel_timestamp_date(uint32_t stamp)
|
||||
static char *
|
||||
ipmi_sel_timestamp_time(uint32_t stamp)
|
||||
{
|
||||
static char tbuf[9];
|
||||
static uint8_t tbuf[9];
|
||||
time_t s = (time_t)stamp;
|
||||
strftime(tbuf, sizeof(tbuf), "%H:%M:%S", localtime(&s));
|
||||
return tbuf;
|
||||
@ -247,7 +107,7 @@ static char *
|
||||
hex2ascii (uint8_t * hexChars, uint8_t numBytes)
|
||||
{
|
||||
int count;
|
||||
static char hexString[SEL_OEM_NOTS_DATA_LEN+1]; /*Max Size*/
|
||||
static uint8_t hexString[SEL_OEM_NOTS_DATA_LEN+1]; /*Max Size*/
|
||||
|
||||
if(numBytes > SEL_OEM_NOTS_DATA_LEN)
|
||||
numBytes = SEL_OEM_NOTS_DATA_LEN;
|
||||
@ -270,6 +130,8 @@ ipmi_get_oem(struct ipmi_intf * intf)
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct ipm_devid_rsp *devid;
|
||||
uint32_t manufacturer_id;
|
||||
int i;
|
||||
|
||||
if (intf->fd == 0)
|
||||
return IPMI_OEM_UNKNOWN;
|
||||
@ -354,10 +216,10 @@ ipmi_sel_add_entries_fromfile(struct ipmi_intf * intf, const char * filename)
|
||||
|
||||
/* clip off trailing and leading whitespace */
|
||||
ptr--;
|
||||
while (isspace((int)*ptr) && ptr >= buf)
|
||||
while (isspace(*ptr) && ptr >= buf)
|
||||
*ptr-- = '\0';
|
||||
ptr = buf;
|
||||
while (isspace((int)*ptr))
|
||||
while (isspace(*ptr))
|
||||
ptr++;
|
||||
if (strlen(ptr) == 0)
|
||||
continue;
|
||||
@ -401,36 +263,7 @@ ipmi_sel_add_entries_fromfile(struct ipmi_intf * intf, const char * filename)
|
||||
return rc;
|
||||
}
|
||||
|
||||
static struct ipmi_event_sensor_types oem_kontron_event_reading_types[] __attribute__((unused)) = {
|
||||
{ 0x70 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info 1", "Reserved" },
|
||||
{ 0x71 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info 2", "Reserved" },
|
||||
};
|
||||
|
||||
char *
|
||||
get_kontron_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
|
||||
{
|
||||
char * description = NULL;
|
||||
/*
|
||||
* Kontron OEM events are described in the product's user manual, but are limited in favor of
|
||||
* sensor specific
|
||||
*/
|
||||
|
||||
/* Only standard records are defined so far */
|
||||
if( rec->record_type < 0xC0 ){
|
||||
struct ipmi_event_sensor_types *st=NULL;
|
||||
for ( st=oem_kontron_event_reading_types ; st->type != NULL; st++){
|
||||
if (st->code == rec->sel_type.standard_type.event_type ){
|
||||
size_t len =strlen(st->desc);
|
||||
description = (char*)malloc( len + 1 );
|
||||
memcpy(description, st->desc , len);
|
||||
description[len] = 0;;
|
||||
return description;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "Unsupported event";
|
||||
}
|
||||
|
||||
char *
|
||||
get_newisys_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
|
||||
@ -495,6 +328,7 @@ get_newisys_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
|
||||
return description;
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
ipmi_get_oem_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
|
||||
{
|
||||
@ -505,16 +339,6 @@ ipmi_get_oem_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
|
||||
case IPMI_OEM_NEWISYS:
|
||||
desc = get_newisys_evt_desc(intf, rec);
|
||||
break;
|
||||
case IPMI_OEM_SUN:
|
||||
case IPMI_OEM_INTEL:
|
||||
case IPMI_OEM_TYAN:
|
||||
case IPMI_OEM_SUPERMICRO:
|
||||
case IPMI_OEM_KONTRON:
|
||||
desc = get_kontron_evt_desc(intf, rec);
|
||||
break;
|
||||
case IPMI_OEM_UNKNOWN:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return desc;
|
||||
@ -525,7 +349,7 @@ void
|
||||
ipmi_get_event_desc(struct ipmi_intf * intf, struct sel_event_record * rec, char ** desc)
|
||||
{
|
||||
uint8_t code, offset;
|
||||
struct ipmi_event_sensor_types *evt = NULL;
|
||||
struct ipmi_event_sensor_types *evt;
|
||||
|
||||
if (desc == NULL)
|
||||
return;
|
||||
@ -535,29 +359,8 @@ ipmi_get_event_desc(struct ipmi_intf * intf, struct sel_event_record * rec, char
|
||||
*desc = ipmi_get_oem_desc(intf, rec);
|
||||
return;
|
||||
} else if (rec->sel_type.standard_type.event_type == 0x6f) {
|
||||
|
||||
if( rec->sel_type.standard_type.sensor_type >= 0xC0 && rec->sel_type.standard_type.sensor_type < 0xF0) {
|
||||
IPMI_OEM iana = ipmi_get_oem(intf);
|
||||
|
||||
switch(iana){
|
||||
case IPMI_OEM_KONTRON:
|
||||
lprintf(LOG_DEBUG, "oem sensor type %x %d using oem type supplied description",
|
||||
rec->sel_type.standard_type.sensor_type , iana);
|
||||
|
||||
evt = oem_kontron_event_types;
|
||||
code = rec->sel_type.standard_type.sensor_type;
|
||||
break;
|
||||
/* add your oem sensor assignation here */
|
||||
}
|
||||
if( evt == NULL ){
|
||||
lprintf(LOG_DEBUG, "oem sensor type %x using standard type supplied description",
|
||||
rec->sel_type.standard_type.sensor_type );
|
||||
}
|
||||
}
|
||||
if( evt == NULL ){
|
||||
evt = sensor_specific_types;
|
||||
code = rec->sel_type.standard_type.sensor_type;
|
||||
}
|
||||
evt = sensor_specific_types;
|
||||
code = rec->sel_type.standard_type.sensor_type;
|
||||
} else {
|
||||
evt = generic_event_types;
|
||||
code = rec->sel_type.standard_type.event_type;
|
||||
@ -579,54 +382,11 @@ ipmi_get_event_desc(struct ipmi_intf * intf, struct sel_event_record * rec, char
|
||||
memset(*desc, 0, strlen(evt->desc)+48);
|
||||
sprintf(*desc, "%s", evt->desc);
|
||||
return;
|
||||
}
|
||||
}
|
||||
evt++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
ipmi_sel_get_oem_sensor_type(IPMI_OEM iana, uint8_t code)
|
||||
{
|
||||
struct ipmi_event_sensor_types *st = NULL;
|
||||
|
||||
switch(iana){
|
||||
case IPMI_OEM_KONTRON:
|
||||
st = oem_kontron_event_types;
|
||||
break;
|
||||
/* add you oem sensor type lookup assignement here */
|
||||
}
|
||||
|
||||
if( st != NULL )
|
||||
for (; st->type != NULL; st++)
|
||||
if (st->code == code)
|
||||
return st->type;
|
||||
|
||||
return ipmi_sel_get_sensor_type(code);
|
||||
}
|
||||
|
||||
const char *
|
||||
ipmi_sel_get_oem_sensor_type_offset(IPMI_OEM iana, uint8_t code, uint8_t offset)
|
||||
{
|
||||
struct ipmi_event_sensor_types *st = NULL;
|
||||
|
||||
switch(iana){
|
||||
case IPMI_OEM_KONTRON:
|
||||
st = oem_kontron_event_types;
|
||||
break;
|
||||
/* add you oem sensor type lookup assignement here */
|
||||
}
|
||||
|
||||
if( st != NULL )
|
||||
for (; st->type != NULL; st++)
|
||||
{
|
||||
if (st->code == code && st->offset == (offset&0xf))
|
||||
return st->type;
|
||||
}
|
||||
|
||||
return ipmi_sel_get_oem_sensor_type(iana,code);
|
||||
}
|
||||
|
||||
const char *
|
||||
ipmi_sel_get_sensor_type(uint8_t code)
|
||||
{
|
||||
@ -644,7 +404,6 @@ ipmi_sel_get_sensor_type_offset(uint8_t code, uint8_t offset)
|
||||
for (st = sensor_specific_types; st->type != NULL; st++)
|
||||
if (st->code == code && st->offset == (offset&0xf))
|
||||
return st->type;
|
||||
|
||||
return ipmi_sel_get_sensor_type(code);
|
||||
}
|
||||
|
||||
@ -881,13 +640,7 @@ ipmi_sel_print_event_file(struct ipmi_intf * intf, struct sel_event_record * evt
|
||||
evt->sel_type.standard_type.event_data[0],
|
||||
evt->sel_type.standard_type.event_data[1],
|
||||
evt->sel_type.standard_type.event_data[2],
|
||||
(
|
||||
(evt->sel_type.standard_type.sensor_type >=0xC0 && evt->sel_type.standard_type.sensor_type < 0xF0)
|
||||
?
|
||||
ipmi_sel_get_oem_sensor_type_offset(ipmi_get_oem(intf),evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
|
||||
:
|
||||
ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
|
||||
),
|
||||
ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0]),
|
||||
evt->sel_type.standard_type.sensor_num,
|
||||
(description != NULL) ? description : "Unknown");
|
||||
|
||||
@ -991,22 +744,13 @@ ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt)
|
||||
for(data_count=0;data_count < SEL_OEM_NOTS_DATA_LEN;data_count++)
|
||||
printf("%02x", evt->sel_type.oem_nots_type.oem_defined[data_count]);
|
||||
}
|
||||
ipmi_sel_oem_message(evt, 0);
|
||||
printf ("\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* lookup SDR entry based on sensor number and type */
|
||||
if (sdr != NULL) {
|
||||
printf("%s ",
|
||||
(
|
||||
(evt->sel_type.standard_type.sensor_type >=0xC0 && evt->sel_type.standard_type.sensor_type < 0xF0)
|
||||
?
|
||||
ipmi_sel_get_oem_sensor_type_offset(ipmi_get_oem(intf),evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
|
||||
:
|
||||
ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
|
||||
)
|
||||
);
|
||||
printf("%s ", ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0]));
|
||||
switch (sdr->type) {
|
||||
case SDR_RECORD_TYPE_FULL_SENSOR:
|
||||
printf("%s", sdr->record.full->id_string);
|
||||
@ -1031,13 +775,7 @@ ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt)
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
printf("%s",(
|
||||
(evt->sel_type.standard_type.sensor_type >=0xC0 && evt->sel_type.standard_type.sensor_type < 0xF0)
|
||||
?
|
||||
ipmi_sel_get_oem_sensor_type_offset(ipmi_get_oem(intf),evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
|
||||
:
|
||||
ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
|
||||
));
|
||||
printf("%s", ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0]));
|
||||
if (evt->sel_type.standard_type.sensor_num != 0)
|
||||
printf(" #0x%02x", evt->sel_type.standard_type.sensor_num);
|
||||
}
|
||||
@ -1178,7 +916,6 @@ ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_recor
|
||||
for(data_count=0;data_count < SEL_OEM_NOTS_DATA_LEN;data_count++)
|
||||
printf("%02x", evt->sel_type.oem_nots_type.oem_defined[data_count]);
|
||||
printf(" [%s]\n\n",hex2ascii (evt->sel_type.oem_nots_type.oem_defined, SEL_OEM_NOTS_DATA_LEN));
|
||||
ipmi_sel_oem_message(evt, 1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -1188,14 +925,7 @@ ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_recor
|
||||
printf(" EvM Revision : %02x\n",
|
||||
evt->sel_type.standard_type.evm_rev);
|
||||
printf(" Sensor Type : %s\n",
|
||||
(
|
||||
(evt->sel_type.standard_type.sensor_type >=0xC0 && evt->sel_type.standard_type.sensor_type < 0xF0)
|
||||
?
|
||||
ipmi_sel_get_oem_sensor_type_offset(ipmi_get_oem(intf),evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
|
||||
:
|
||||
ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
|
||||
)
|
||||
);
|
||||
ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0]));
|
||||
printf(" Sensor Number : %02x\n",
|
||||
evt->sel_type.standard_type.sensor_num);
|
||||
printf(" Event Type : %s\n",
|
||||
@ -1218,13 +948,12 @@ ipmi_sel_print_extended_entry_verbose(struct ipmi_intf * intf, struct sel_event_
|
||||
{
|
||||
struct sdr_record_list * sdr;
|
||||
char * description;
|
||||
int data_count;
|
||||
|
||||
if (!evt)
|
||||
return;
|
||||
|
||||
sdr = ipmi_sdr_find_sdr_bynumtype(intf,
|
||||
evt->sel_type.standard_type.sensor_num,
|
||||
evt->sel_type.standard_type.sensor_type);
|
||||
sdr = ipmi_sdr_find_sdr_bynumtype(intf, evt->sel_type.standard_type.sensor_num, evt->sel_type.standard_type.sensor_type);
|
||||
if (sdr == NULL) {
|
||||
ipmi_sel_print_std_entry_verbose(intf, evt);
|
||||
return;
|
||||
@ -1365,11 +1094,6 @@ ipmi_sel_print_extended_entry_verbose(struct ipmi_intf * intf, struct sel_event_
|
||||
evt->sel_type.standard_type.event_data[2] & 0x0f,
|
||||
(evt->sel_type.standard_type.event_data[2] & 0xf0) >> 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* FIXME : Add sensor specific discrete types */
|
||||
printf(" Event Interpretation Missing\n");
|
||||
}
|
||||
} else if (evt->sel_type.standard_type.event_type >= 0x70 && evt->sel_type.standard_type.event_type <= 0x7f) {
|
||||
/* OEM */
|
||||
} else {
|
||||
@ -1415,7 +1139,7 @@ __ipmi_sel_savelist_entries(struct ipmi_intf * intf, int count, const char * sav
|
||||
|
||||
if (rsp->data[1] == 0 && rsp->data[2] == 0) {
|
||||
lprintf(LOG_ERR, "SEL has no entries");
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
@ -1466,7 +1190,7 @@ __ipmi_sel_savelist_entries(struct ipmi_intf * intf, int count, const char * sav
|
||||
|
||||
if (savefile != NULL) {
|
||||
fp = ipmi_open_file_write(savefile);
|
||||
}
|
||||
}
|
||||
|
||||
while (next_id != 0xffff) {
|
||||
curr_id = next_id;
|
||||
@ -1608,7 +1332,7 @@ ipmi_sel_get_time(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
static char tbuf[40];
|
||||
static uint8_t tbuf[40];
|
||||
uint32_t timei;
|
||||
time_t time;
|
||||
|
||||
@ -1632,13 +1356,12 @@ ipmi_sel_get_time(struct ipmi_intf * intf)
|
||||
"Invalid data length %d", rsp->data_len);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
memcpy(&timei, rsp->data, 4);
|
||||
#if WORDS_BIGENDIAN
|
||||
time = (time_t)(BSWAP_32(timei));
|
||||
#else
|
||||
time = (time_t)timei;
|
||||
timei = BSWAP_32(time);
|
||||
#endif
|
||||
time = (time_t)timei;
|
||||
|
||||
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&time));
|
||||
printf("%s\n", tbuf);
|
||||
@ -1686,7 +1409,7 @@ ipmi_sel_set_time(struct ipmi_intf * intf, const char * time_string)
|
||||
}
|
||||
|
||||
timei = (uint32_t)t;
|
||||
req.msg.data = (uint8_t *)&timei;
|
||||
req.msg.data = (uint8_t *)&timei;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
#if WORDS_BIGENDIAN
|
||||
@ -1774,7 +1497,7 @@ ipmi_sel_delete(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
msg_data[0] = id & 0xff;
|
||||
msg_data[1] = id >> 8;
|
||||
|
||||
for (; argc != 0; argc--)
|
||||
for (argc; argc != 0; argc--)
|
||||
{
|
||||
id = atoi(argv[argc-1]);
|
||||
msg_data[2] = id & 0xff;
|
||||
@ -2014,7 +1737,7 @@ int ipmi_sel_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
} else {
|
||||
lprintf(LOG_ERR, "sel time commands: get set");
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
lprintf(LOG_ERR, "Invalid SEL command: %s", argv[0]);
|
||||
rc = -1;
|
||||
@ -2022,3 +1745,4 @@ int ipmi_sel_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@ -43,7 +47,6 @@
|
||||
|
||||
extern int verbose;
|
||||
|
||||
#define SCANNING_DISABLED 0x40
|
||||
#define READING_UNAVAILABLE 0x20
|
||||
|
||||
static
|
||||
@ -103,16 +106,13 @@ ipmi_sensor_print_full_discrete(struct ipmi_intf *intf,
|
||||
*/
|
||||
rsp = ipmi_sdr_get_sensor_reading_ipmb(intf,
|
||||
sensor->keys.sensor_num,
|
||||
sensor->keys.owner_id,
|
||||
sensor->keys.lun);
|
||||
sensor->keys.owner_id);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error reading sensor %s (#%02x)",
|
||||
id, sensor->keys.sensor_num);
|
||||
return -1;
|
||||
} else if (rsp->ccode > 0 || (rsp->data[1] & READING_UNAVAILABLE)) {
|
||||
validread = 0;
|
||||
} else if (!(rsp->data[1] & SCANNING_DISABLED)) {
|
||||
validread = 0;
|
||||
} else {
|
||||
/* convert RAW reading into units */
|
||||
val = rsp->data[0];
|
||||
@ -146,19 +146,16 @@ ipmi_sensor_print_full_discrete(struct ipmi_intf *intf,
|
||||
printf(" Sensor Type (Discrete): %s\n",
|
||||
ipmi_sdr_get_sensor_type_desc(sensor->sensor.
|
||||
type));
|
||||
if( validread )
|
||||
{
|
||||
ipmi_sdr_print_discrete_state("States Asserted",
|
||||
sensor->sensor.type,
|
||||
sensor->event_type,
|
||||
rsp->data[2],
|
||||
rsp->data[3]);
|
||||
printf("\n");
|
||||
}
|
||||
ipmi_sdr_print_discrete_state("States Asserted",
|
||||
sensor->sensor.type,
|
||||
sensor->event_type,
|
||||
rsp->data[2],
|
||||
rsp->data[3]);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
return (validread ? 0 : -1 );
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -188,16 +185,13 @@ ipmi_sensor_print_full_analog(struct ipmi_intf *intf,
|
||||
*/
|
||||
rsp = ipmi_sdr_get_sensor_reading_ipmb(intf,
|
||||
sensor->keys.sensor_num,
|
||||
sensor->keys.owner_id,
|
||||
sensor->keys.lun);
|
||||
sensor->keys.owner_id);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error reading sensor %s (#%02x)",
|
||||
id, sensor->keys.sensor_num);
|
||||
return -1;
|
||||
} else if (rsp->ccode || (rsp->data[1] & READING_UNAVAILABLE)) {
|
||||
validread = 0;
|
||||
} else if (!(rsp->data[1] & SCANNING_DISABLED)) {
|
||||
validread = 0;
|
||||
} else {
|
||||
/* convert RAW reading into units */
|
||||
val = (rsp->data[0] > 0)
|
||||
@ -309,8 +303,8 @@ ipmi_sensor_print_full_analog(struct ipmi_intf *intf,
|
||||
if (validread) {
|
||||
uint16_t raw_tol = __TO_TOL(sensor->mtol);
|
||||
double tol =
|
||||
sdr_convert_sensor_tolerance(sensor,
|
||||
raw_tol);
|
||||
sdr_convert_sensor_reading(sensor,
|
||||
raw_tol * 2);
|
||||
printf("%.*f (+/- %.*f) %s\n",
|
||||
(val == (int) val) ? 0 : 3, val,
|
||||
(tol == (int) tol) ? 0 : 3, tol,
|
||||
@ -393,7 +387,7 @@ ipmi_sensor_print_full_analog(struct ipmi_intf *intf,
|
||||
}
|
||||
}
|
||||
|
||||
return (validread ? 0 : -1 );
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
@ -427,16 +421,13 @@ ipmi_sensor_print_compact(struct ipmi_intf *intf,
|
||||
*/
|
||||
rsp = ipmi_sdr_get_sensor_reading_ipmb(intf,
|
||||
sensor->keys.sensor_num,
|
||||
sensor->keys.owner_id,
|
||||
sensor->keys.lun);
|
||||
sensor->keys.owner_id);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error reading sensor %s (#%02x)",
|
||||
id, sensor->keys.sensor_num);
|
||||
return -1;
|
||||
} else if (rsp->ccode || (rsp->data[1] & READING_UNAVAILABLE)) {
|
||||
validread = 0;
|
||||
} else if (!(rsp->data[1] & SCANNING_DISABLED)) {
|
||||
validread = 0;
|
||||
} else {
|
||||
/* convert RAW reading into units */
|
||||
val = rsp->data[0];
|
||||
@ -471,20 +462,16 @@ ipmi_sensor_print_compact(struct ipmi_intf *intf,
|
||||
printf(" Sensor Type (Discrete): %s\n",
|
||||
ipmi_sdr_get_sensor_type_desc(sensor->sensor.
|
||||
type));
|
||||
|
||||
if(validread)
|
||||
{
|
||||
ipmi_sdr_print_discrete_state("States Asserted",
|
||||
sensor->sensor.type,
|
||||
sensor->event_type,
|
||||
rsp->data[2],
|
||||
rsp->data[3]);
|
||||
printf("\n");
|
||||
}
|
||||
ipmi_sdr_print_discrete_state("States Asserted",
|
||||
sensor->sensor.type,
|
||||
sensor->event_type,
|
||||
rsp->data[2],
|
||||
rsp->data[3]);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
return (validread ? 0 : -1 );
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -744,75 +731,6 @@ ipmi_sensor_set_threshold(struct ipmi_intf *intf, int argc, char **argv)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_sensor_get_reading(struct ipmi_intf *intf, int argc, char **argv)
|
||||
{
|
||||
struct sdr_record_list *sdr;
|
||||
struct ipmi_rs *rsp;
|
||||
int i, rc=0;
|
||||
double val = 0.0;
|
||||
|
||||
if (argc < 1 || strncmp(argv[0], "help", 4) == 0) {
|
||||
lprintf(LOG_NOTICE, "sensor reading <id> ... [id]");
|
||||
lprintf(LOG_NOTICE, " id : name of desired sensor");
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
sdr = ipmi_sdr_find_sdr_byid(intf, argv[i]);
|
||||
if (sdr == NULL) {
|
||||
lprintf(LOG_ERR, "Sensor \"%s\" not found!",
|
||||
argv[i]);
|
||||
rc = -1;
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (sdr->type) {
|
||||
case SDR_RECORD_TYPE_FULL_SENSOR:
|
||||
if (sdr->record.full->linearization >= SDR_SENSOR_L_NONLINEAR) {
|
||||
lprintf(LOG_ERR, "Sensor \"%s\" non-linear!", argv[i]);
|
||||
continue;
|
||||
}
|
||||
rsp = ipmi_sdr_get_sensor_reading_ipmb(intf,
|
||||
sdr->record.full->keys.sensor_num,
|
||||
sdr->record.full->keys.owner_id,
|
||||
sdr->record.full->keys.lun);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Error reading sensor \"%s\"", argv[i]);
|
||||
rc = -1;
|
||||
continue;
|
||||
} else if (rsp->ccode > 0) {
|
||||
continue;
|
||||
} else if (rsp->data[1] & READING_UNAVAILABLE) {
|
||||
continue;
|
||||
} else if (!(rsp->data[1] & SCANNING_DISABLED)) {
|
||||
continue;
|
||||
} else if (rsp->data[0] > 0) {
|
||||
/* convert RAW reading into units */
|
||||
val = sdr_convert_sensor_reading(sdr->record.full, rsp->data[0]);
|
||||
} else {
|
||||
val = 0.0;
|
||||
}
|
||||
|
||||
if (csv_output)
|
||||
printf("%s,%.*f\n", argv[i],
|
||||
(val == (int)val) ? 0 : 3, val);
|
||||
else
|
||||
printf("%-16s | %.*f\n", argv[i],
|
||||
(val == (int)val) ? 0 : 3, val);
|
||||
|
||||
break;
|
||||
|
||||
case SDR_RECORD_TYPE_COMPACT_SENSOR:
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_sensor_get(struct ipmi_intf *intf, int argc, char **argv)
|
||||
{
|
||||
@ -882,15 +800,13 @@ ipmi_sensor_main(struct ipmi_intf *intf, int argc, char **argv)
|
||||
if (argc == 0) {
|
||||
rc = ipmi_sensor_list(intf);
|
||||
} else if (strncmp(argv[0], "help", 4) == 0) {
|
||||
lprintf(LOG_NOTICE, "Sensor Commands: list thresh get reading");
|
||||
lprintf(LOG_NOTICE, "Sensor Commands: list thresh get");
|
||||
} else if (strncmp(argv[0], "list", 4) == 0) {
|
||||
rc = ipmi_sensor_list(intf);
|
||||
} else if (strncmp(argv[0], "thresh", 5) == 0) {
|
||||
rc = ipmi_sensor_set_threshold(intf, argc - 1, &argv[1]);
|
||||
} else if (strncmp(argv[0], "get", 3) == 0) {
|
||||
rc = ipmi_sensor_get(intf, argc - 1, &argv[1]);
|
||||
} else if (strncmp(argv[0], "reading", 7) == 0) {
|
||||
rc = ipmi_sensor_get_reading(intf, argc - 1, &argv[1]);
|
||||
} else {
|
||||
lprintf(LOG_ERR, "Invalid sensor command: %s", argv[0]);
|
||||
rc = -1;
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
@ -44,29 +48,10 @@ const struct valstr ipmi_oem_info[] = {
|
||||
{ IPMI_OEM_TYAN, "Tyan Computer Corporation" },
|
||||
{ IPMI_OEM_NEWISYS, "Newisys" },
|
||||
{ IPMI_OEM_SUPERMICRO, "Supermicro" },
|
||||
{ IPMI_OEM_GOOGLE, "Google" },
|
||||
{ IPMI_OEM_KONTRON, "Kontron" },
|
||||
{ IPMI_OEM_NOKIA, "Nokia" },
|
||||
{ 0xffff , NULL },
|
||||
};
|
||||
|
||||
const struct oemvalstr ipmi_oem_sdr_type_vals[] = {
|
||||
/* Keep OEM grouped together */
|
||||
{ IPMI_OEM_KONTRON , 0xC0 , "OEM Firmware Info" },
|
||||
{ IPMI_OEM_KONTRON , 0xC2 , "OEM Init Agent" },
|
||||
{ IPMI_OEM_KONTRON , 0xC3 , "OEM IPMBL Link State" },
|
||||
{ IPMI_OEM_KONTRON , 0xC4 , "OEM Board Reset" },
|
||||
{ IPMI_OEM_KONTRON , 0xC5 , "OEM FRU Information Agent" },
|
||||
{ IPMI_OEM_KONTRON , 0xC6 , "OEM POST Value Sensor" },
|
||||
{ IPMI_OEM_KONTRON , 0xC7 , "OEM FWUM Status" },
|
||||
{ IPMI_OEM_KONTRON , 0xC8 , "OEM Switch Mngt Software Status" },
|
||||
|
||||
{ IPMI_OEM_PICMG , 0xF0 , "PICMG FRU Hotswap" },
|
||||
{ IPMI_OEM_PICMG , 0xF1 , "PICMG IPMB0 Link State" },
|
||||
|
||||
{ 0xffff, 0x00, NULL }
|
||||
};
|
||||
|
||||
const struct valstr ipmi_netfn_vals[] = {
|
||||
{ IPMI_NETFN_CHASSIS, "Chassis" },
|
||||
{ IPMI_NETFN_BRIDGE, "Bridge" },
|
||||
@ -180,26 +165,18 @@ const struct valstr entity_id_vals[] = {
|
||||
{ 0x26, "Remote Management Device" },
|
||||
{ 0x27, "External Environment" },
|
||||
{ 0x28, "Battery" },
|
||||
{ 0x29, "Processing Blade" },
|
||||
{ 0x2A, "Connectivity Switch" },
|
||||
{ 0x2B, "Processor/Memory Module" },
|
||||
{ 0x2C, "I/O Module" },
|
||||
{ 0x2D, "Processor/IO Module" },
|
||||
{ 0x2E, "Management Controller Firmware" },
|
||||
{ 0x2F, "IPMI Channel" },
|
||||
{ 0x30, "PCI Bus" },
|
||||
{ 0x31, "PCI Express Bus" },
|
||||
{ 0x32, "SCSI Bus (parallel)" },
|
||||
{ 0x33, "SATA/SAS Bus" },
|
||||
{ 0x34, "Processor/Front-Side Bus" },
|
||||
/* PICMG */
|
||||
{ 0xA0, "PICMG Front Board" },
|
||||
{ 0xC0, "PICMG Rear Transition Module" },
|
||||
{ 0xC1, "PICMG AdvancedMC Module" },
|
||||
{ 0xF0, "PICMG Shelf Management Controller" },
|
||||
{ 0xF1, "PICMG Filtration Unit" },
|
||||
{ 0xF2, "PICMG Shelf FRU Information" },
|
||||
{ 0xF3, "PICMG Alarm Panel" },
|
||||
{ 0x29, "Processing Blade" },
|
||||
{ 0x2A, "Connectivity Switch" },
|
||||
{ 0x2B, "Processor/Memory Module" },
|
||||
{ 0x2C, "I/O Module" },
|
||||
{ 0x2D, "Processor/IO Module" },
|
||||
{ 0x2E, "Management Controller Firmware" },
|
||||
{ 0x2F, "IPMI Channel" },
|
||||
{ 0x30, "PCI Bus" },
|
||||
{ 0x31, "PCI Express Bus" },
|
||||
{ 0x32, "SCSI Bus (parallel)" },
|
||||
{ 0x33, "SATA/SAS Bus" },
|
||||
{ 0x34, "Processor/Front-Side Bus" },
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -58,7 +62,7 @@ static const struct valstr sunoem_led_type_vals[] = {
|
||||
{ 1, "SERVICE" },
|
||||
{ 2, "ACT" },
|
||||
{ 3, "LOCATE" },
|
||||
{ 0xFF, NULL },
|
||||
{ 0, NULL },
|
||||
};
|
||||
|
||||
static const struct valstr sunoem_led_mode_vals[] = {
|
||||
@ -78,8 +82,6 @@ static const struct valstr sunoem_led_mode_optvals[] = {
|
||||
{ 0xFF, NULL },
|
||||
};
|
||||
|
||||
int is_sbcmd = 0;
|
||||
|
||||
static void
|
||||
ipmi_sunoem_usage(void)
|
||||
{
|
||||
@ -102,14 +104,6 @@ ipmi_sunoem_usage(void)
|
||||
lprintf(LOG_NOTICE, " led set <sensorid> <ledmode> [ledtype]");
|
||||
lprintf(LOG_NOTICE, " Set mode of LED found in Generic Device Locator.");
|
||||
lprintf(LOG_NOTICE, "");
|
||||
lprintf(LOG_NOTICE, " sbled get <sensorid> [ledtype]");
|
||||
lprintf(LOG_NOTICE, " Read status of LED found in Generic Device Locator");
|
||||
lprintf(LOG_NOTICE, " for Sun Blade Modular Systems.");
|
||||
lprintf(LOG_NOTICE, "");
|
||||
lprintf(LOG_NOTICE, " sbled set <sensorid> <ledmode> [ledtype]");
|
||||
lprintf(LOG_NOTICE, " Set mode of LED found in Generic Device Locator");
|
||||
lprintf(LOG_NOTICE, " for Sun Blade Modular Systems.");
|
||||
lprintf(LOG_NOTICE, "");
|
||||
lprintf(LOG_NOTICE, " Use 'sdr list generic' command to get list of Generic");
|
||||
lprintf(LOG_NOTICE, " Devices that are controllable LEDs.");
|
||||
lprintf(LOG_NOTICE, "");
|
||||
@ -196,34 +190,21 @@ sunoem_led_get(struct ipmi_intf * intf,
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t rqdata[7];
|
||||
int rqdata_len = 5;
|
||||
uint8_t rqdata[5];
|
||||
|
||||
if (dev == NULL)
|
||||
return NULL;
|
||||
|
||||
rqdata[0] = dev->dev_slave_addr;
|
||||
if (ledtype == 0xFF)
|
||||
rqdata[1] = dev->oem;
|
||||
else
|
||||
rqdata[1] = ledtype;
|
||||
rqdata[1] = ledtype;
|
||||
rqdata[2] = dev->dev_access_addr;
|
||||
rqdata[3] = dev->oem;
|
||||
if (is_sbcmd) {
|
||||
rqdata[4] = dev->entity.id;
|
||||
rqdata[5] = dev->entity.instance;
|
||||
rqdata[6] = 0;
|
||||
rqdata_len = 7;
|
||||
}
|
||||
else {
|
||||
rqdata[4] = 0;
|
||||
}
|
||||
rqdata[4] = 0;
|
||||
|
||||
req.msg.netfn = IPMI_NETFN_SUNOEM;
|
||||
req.msg.cmd = IPMI_SUNOEM_LED_GET;
|
||||
req.msg.lun = dev->lun;
|
||||
req.msg.data = rqdata;
|
||||
req.msg.data_len = rqdata_len;
|
||||
req.msg.data_len = 5;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
@ -246,37 +227,23 @@ sunoem_led_set(struct ipmi_intf * intf,
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t rqdata[9];
|
||||
int rqdata_len = 7;
|
||||
uint8_t rqdata[7];
|
||||
|
||||
if (dev == NULL)
|
||||
return NULL;
|
||||
|
||||
rqdata[0] = dev->dev_slave_addr;
|
||||
if (ledtype == 0xFF)
|
||||
rqdata[1] = dev->oem;
|
||||
else
|
||||
rqdata[1] = ledtype;
|
||||
rqdata[1] = ledtype;
|
||||
rqdata[2] = dev->dev_access_addr;
|
||||
rqdata[3] = dev->oem;
|
||||
rqdata[4] = ledmode;
|
||||
if (is_sbcmd) {
|
||||
rqdata[5] = dev->entity.id;
|
||||
rqdata[6] = dev->entity.instance;
|
||||
rqdata[7] = 0;
|
||||
rqdata[8] = 0;
|
||||
rqdata_len = 9;
|
||||
}
|
||||
else {
|
||||
rqdata[5] = 0;
|
||||
rqdata[6] = 0;
|
||||
}
|
||||
rqdata[5] = 0;
|
||||
rqdata[6] = 0;
|
||||
|
||||
req.msg.netfn = IPMI_NETFN_SUNOEM;
|
||||
req.msg.cmd = IPMI_SUNOEM_LED_SET;
|
||||
req.msg.lun = dev->lun;
|
||||
req.msg.data = rqdata;
|
||||
req.msg.data_len = rqdata_len;
|
||||
req.msg.data_len = 7;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
@ -366,13 +333,6 @@ sunoem_led_set_byentity(struct ipmi_intf * intf, uint8_t entity_id,
|
||||
* [byte 4] force 1 = directly access the device
|
||||
* 0 = go thru its controller
|
||||
* Ignored if LED is local
|
||||
*
|
||||
* The format below is for Sun Blade Modular systems only
|
||||
* [byte 4] entityID The entityID field from the SDR record
|
||||
* [byte 5] entityIns The entityIns field from the SDR record
|
||||
* [byte 6] force 1 = directly access the device
|
||||
* 0 = go thru its controller
|
||||
* Ignored if LED is local
|
||||
*/
|
||||
static int
|
||||
ipmi_sunoem_led_get(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
@ -381,22 +341,20 @@ ipmi_sunoem_led_get(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
struct sdr_record_list *sdr;
|
||||
struct sdr_record_list *alist, *a;
|
||||
struct sdr_record_entity_assoc *assoc;
|
||||
int ledtype = 0xFF;
|
||||
int ledtype = 0;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* sunoem led/sbled get <id> [type]
|
||||
* sunoem led get <id> [type]
|
||||
*/
|
||||
|
||||
if (argc < 1 || strncmp(argv[0], "help", 4) == 0) {
|
||||
ipmi_sunoem_usage();
|
||||
lprintf(LOG_NOTICE, "usage: sunoem led get <id> [type]");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc > 1) {
|
||||
ledtype = str2val(argv[1], sunoem_led_type_vals);
|
||||
if (ledtype == 0xFF)
|
||||
lprintf(LOG_ERR, "Unknow ledtype, will use data from the SDR oem field");
|
||||
}
|
||||
|
||||
if (strncasecmp(argv[0], "all", 3) == 0) {
|
||||
@ -513,14 +471,6 @@ ipmi_sunoem_led_get(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
* Ignored if LED is local
|
||||
* [byte 6] role Used by BMC for authorization purposes
|
||||
*
|
||||
* The format below is for Sun Blade Modular systems only
|
||||
* [byte 5] entityID The entityID field from the SDR record
|
||||
* [byte 6] entityIns The entityIns field from the SDR record
|
||||
* [byte 7] force TRUE - directly access the device
|
||||
* FALSE - go thru its controller
|
||||
* Ignored if LED is local
|
||||
* [byte 8] role Used by BMC for authorization purposes
|
||||
*
|
||||
*
|
||||
* IPMI Response Data: 1 byte
|
||||
*
|
||||
@ -535,11 +485,11 @@ ipmi_sunoem_led_set(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
struct sdr_record_list *alist, *a;
|
||||
struct sdr_record_entity_assoc *assoc;
|
||||
int ledmode;
|
||||
int ledtype = 0xFF;
|
||||
int ledtype = 0;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* sunoem led/sbled set <id> <mode> [type]
|
||||
* sunoem led set <id> <mode> [type]
|
||||
*/
|
||||
|
||||
if (argc < 2 || strncmp(argv[0], "help", 4) == 0) {
|
||||
@ -558,8 +508,6 @@ ipmi_sunoem_led_set(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
|
||||
if (argc > 3) {
|
||||
ledtype = str2val(argv[2], sunoem_led_type_vals);
|
||||
if (ledtype == 0xFF)
|
||||
lprintf(LOG_ERR, "Unknow ledtype, will use data from the SDR oem field");
|
||||
}
|
||||
|
||||
if (strncasecmp(argv[0], "all", 3) == 0) {
|
||||
@ -791,14 +739,11 @@ ipmi_sunoem_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
}
|
||||
}
|
||||
|
||||
if ((strncmp(argv[0], "led", 3) == 0) || (strncmp(argv[0], "sbled", 5) == 0)) {
|
||||
if (strncmp(argv[0], "led", 3) == 0) {
|
||||
if (argc < 2) {
|
||||
ipmi_sunoem_usage();
|
||||
return -1;
|
||||
}
|
||||
if (strncmp(argv[0], "sbled", 5) == 0) {
|
||||
is_sbcmd = 1;
|
||||
}
|
||||
if (strncmp(argv[1], "get", 3) == 0) {
|
||||
if (argc < 3) {
|
||||
char * arg[] = { "all" };
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -47,15 +51,10 @@
|
||||
|
||||
#include <sys/select.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_TERMIOS_H)
|
||||
# include <termios.h>
|
||||
#elif defined (HAVE_SYS_TERMIOS_H)
|
||||
|
||||
#ifdef __linux__
|
||||
# include <linux/termios.h>
|
||||
#else
|
||||
# include <sys/termios.h>
|
||||
#endif
|
||||
|
||||
@ -67,14 +66,14 @@
|
||||
#include <ipmitool/ipmi_strings.h>
|
||||
#include <ipmitool/bswap.h>
|
||||
|
||||
#include <config.h>
|
||||
|
||||
static struct timeval _start_keepalive;
|
||||
static struct termios _saved_tio;
|
||||
static struct winsize _saved_winsize;
|
||||
static int _in_raw_mode = 0;
|
||||
static int _altterm = 0;
|
||||
|
||||
extern int verbose;
|
||||
|
||||
static int
|
||||
ipmi_tsol_command(struct ipmi_intf * intf, char *recvip, int port, unsigned char cmd)
|
||||
{
|
||||
@ -82,25 +81,31 @@ ipmi_tsol_command(struct ipmi_intf * intf, char *recvip, int port, unsigned char
|
||||
struct ipmi_rq req;
|
||||
unsigned char data[6];
|
||||
unsigned ip1, ip2, ip3, ip4;
|
||||
uint16_t portin;
|
||||
|
||||
#if WORDS_BIGENDIAN
|
||||
portin = BSWAP_16(port);
|
||||
#else
|
||||
portin = port;
|
||||
#endif
|
||||
|
||||
if (sscanf(recvip, "%d.%d.%d.%d", &ip1, &ip2, &ip3, &ip4) != 4) {
|
||||
lprintf(LOG_ERR, "Invalid IP address: %s", recvip);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&req, 0, sizeof(struct ipmi_rq));
|
||||
req.msg.netfn = IPMI_NETFN_TSOL;
|
||||
req.msg.cmd = cmd;
|
||||
req.msg.data_len = 6;
|
||||
req.msg.data = data;
|
||||
|
||||
memset(data, 0, sizeof(data));
|
||||
data[0] = ip1;
|
||||
data[1] = ip2;
|
||||
data[0] = ip1;
|
||||
data[1] = ip2;
|
||||
data[2] = ip3;
|
||||
data[3] = ip4;
|
||||
data[4] = (port & 0xff00) >> 8;
|
||||
data[5] = (port & 0xff);
|
||||
data[4] = (portin & 0xff00) >> 8;
|
||||
data[5] = (portin & 0xff);
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
@ -128,15 +133,14 @@ ipmi_tsol_stop(struct ipmi_intf * intf, char *recvip, int port)
|
||||
return ipmi_tsol_command(intf, recvip, port, IPMI_TSOL_CMD_STOP);
|
||||
}
|
||||
|
||||
static int
|
||||
static int
|
||||
ipmi_tsol_send_keystroke(struct ipmi_intf * intf, char *buff, int length)
|
||||
{
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
unsigned char data[16];
|
||||
static unsigned char keyseq = 0;
|
||||
|
||||
memset(&req, 0, sizeof(struct ipmi_rq));
|
||||
|
||||
req.msg.netfn = IPMI_NETFN_TSOL;
|
||||
req.msg.cmd = IPMI_TSOL_CMD_SENDKEY;
|
||||
req.msg.data_len = length + 2;
|
||||
@ -146,28 +150,26 @@ ipmi_tsol_send_keystroke(struct ipmi_intf * intf, char *buff, int length)
|
||||
data[0] = length + 1;
|
||||
memcpy(data + 1, buff, length);
|
||||
data[length + 1] = keyseq++;
|
||||
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (verbose) {
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to send keystroke");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Unable to send keystroke: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Unable to send keystroke");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Unable to send keystroke: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return length;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
tsol_keepalive(struct ipmi_intf * intf)
|
||||
{
|
||||
struct timeval end;
|
||||
|
||||
|
||||
gettimeofday(&end, 0);
|
||||
|
||||
if (end.tv_sec - _start_keepalive.tv_sec <= 30)
|
||||
@ -361,7 +363,7 @@ static void
|
||||
print_tsol_usage(void)
|
||||
{
|
||||
struct winsize winsize;
|
||||
|
||||
|
||||
lprintf(LOG_NOTICE, "Usage: tsol [recvip] [port=NUM] [ro|rw] [rows=NUM] [cols=NUM] [altterm]");
|
||||
lprintf(LOG_NOTICE, " recvip Receiver IP Address [default=local]");
|
||||
lprintf(LOG_NOTICE, " port=NUM Receiver UDP Port [default=%d]",
|
||||
@ -383,6 +385,7 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
struct pollfd fds_wait[3], fds_data_wait[3], *fds;
|
||||
struct sockaddr_in sin, myaddr;
|
||||
socklen_t mylen;
|
||||
char recvip_c[] = "0.0.0.0";
|
||||
char *recvip = NULL;
|
||||
char out_buff[IPMI_BUF_SIZE * 8], in_buff[IPMI_BUF_SIZE];
|
||||
char buff[IPMI_BUF_SIZE + 4];
|
||||
@ -422,7 +425,7 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
}
|
||||
}
|
||||
|
||||
/* create udp socket to receive the packet */
|
||||
/* create udp socket to receive the packet */
|
||||
memset(&sin, 0, sizeof(sin));
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_port = htons(port);
|
||||
@ -476,7 +479,7 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
enter_raw_mode();
|
||||
|
||||
/*
|
||||
* talk to smdc to start Console redirect - IP address and port as parameter
|
||||
* talk to smdc to start Console redirect - IP address and port as parameter
|
||||
* ipmitool -I lan -H 192.168.168.227 -U Administrator raw 0x30 0x06 0xC0 0xA8 0xA8 0x78 0x1A 0x0A
|
||||
*/
|
||||
result = ipmi_tsol_start(intf, recvip, port);
|
||||
@ -488,7 +491,7 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
printf("[SOL Session operational. Use %c? for help]\r\n",
|
||||
intf->session->sol_escape_char);
|
||||
|
||||
gettimeofday(&_start_keepalive, 0);
|
||||
gettimeofday(&_start_keepalive, 0);
|
||||
|
||||
fds_wait[0].fd = fd_socket;
|
||||
fds_wait[0].events = POLLIN;
|
||||
@ -499,7 +502,7 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
fds_wait[2].fd = -1;
|
||||
fds_wait[2].events = 0;
|
||||
fds_wait[2].revents = 0;
|
||||
|
||||
|
||||
fds_data_wait[0].fd = fd_socket;
|
||||
fds_data_wait[0].events = POLLIN | POLLOUT;
|
||||
fds_data_wait[0].revents = 0;
|
||||
@ -509,11 +512,11 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
fds_data_wait[2].fd = fileno(stdout);
|
||||
fds_data_wait[2].events = POLLOUT;
|
||||
fds_data_wait[2].revents = 0;
|
||||
|
||||
|
||||
out_buff_fill = 0;
|
||||
in_buff_fill = 0;
|
||||
fds = fds_wait;
|
||||
|
||||
|
||||
for (;;) {
|
||||
result = poll(fds, 3, 15*1000);
|
||||
if (result < 0)
|
||||
@ -552,7 +555,7 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
do_terminal_cleanup();
|
||||
return result;
|
||||
}
|
||||
if (read_only)
|
||||
if (read_only)
|
||||
bytes = 0;
|
||||
in_buff_fill += bytes;
|
||||
}
|
||||
@ -568,7 +571,7 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
}
|
||||
if ((fds[0].revents & POLLOUT) && in_buff_fill) {
|
||||
/*
|
||||
* translate key and send that to SMDC using IPMI
|
||||
* translate key and send that to SMDC using IPMI
|
||||
* ipmitool -I lan -H 192.168.168.227 -U Administrator raw 0x30 0x03 0x04 0x1B 0x5B 0x43
|
||||
*/
|
||||
result = ipmi_tsol_send_keystroke(intf, in_buff, __min(in_buff_fill,14));
|
||||
@ -580,9 +583,9 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
}
|
||||
}
|
||||
}
|
||||
fds = (in_buff_fill || out_buff_fill )?
|
||||
fds = (in_buff_fill || out_buff_fill )?
|
||||
fds_data_wait : fds_wait;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -72,10 +76,11 @@ extern int csv_output;
|
||||
*/
|
||||
static int
|
||||
ipmi_get_user_access(
|
||||
struct ipmi_intf *intf,
|
||||
uint8_t channel_number,
|
||||
uint8_t user_id,
|
||||
struct user_access_rsp *user_access)
|
||||
struct ipmi_intf * intf,
|
||||
uint8_t channel_number,
|
||||
uint8_t user_id,
|
||||
struct user_access_rsp * user_access)
|
||||
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
@ -91,7 +96,7 @@ ipmi_get_user_access(
|
||||
/* The channel number will remain constant throughout this function */
|
||||
msg_data[0] = channel_number;
|
||||
msg_data[1] = user_id;
|
||||
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
|
||||
if (rsp == NULL) {
|
||||
@ -128,9 +133,10 @@ ipmi_get_user_access(
|
||||
*/
|
||||
static int
|
||||
ipmi_get_user_name(
|
||||
struct ipmi_intf *intf,
|
||||
uint8_t user_id,
|
||||
char *user_name)
|
||||
struct ipmi_intf * intf,
|
||||
uint8_t user_id,
|
||||
char * user_name)
|
||||
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
@ -139,13 +145,13 @@ ipmi_get_user_name(
|
||||
memset(user_name, 0, 17);
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP; /* 0x06 */
|
||||
req.msg.cmd = IPMI_GET_USER_NAME; /* 0x45 */
|
||||
req.msg.netfn = IPMI_NETFN_APP; /* 0x06 */
|
||||
req.msg.cmd = IPMI_GET_USER_NAME; /* 0x45 */
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 1;
|
||||
|
||||
msg_data[0] = user_id;
|
||||
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
|
||||
if (rsp == NULL) {
|
||||
@ -183,6 +189,7 @@ dump_user_access(
|
||||
"Channel Priv Limit\n");
|
||||
printed_header = 1;
|
||||
}
|
||||
|
||||
|
||||
printf("%-4d%-17s%-8s%-11s%-11s%-s\n",
|
||||
user_id,
|
||||
@ -198,9 +205,9 @@ dump_user_access(
|
||||
|
||||
static void
|
||||
dump_user_access_csv(
|
||||
uint8_t user_id,
|
||||
const char *user_name,
|
||||
struct user_access_rsp *user_access)
|
||||
uint8_t user_id,
|
||||
const char * user_name,
|
||||
struct user_access_rsp * user_access)
|
||||
{
|
||||
printf("%d,%s,%s,%s,%s,%s\n",
|
||||
user_id,
|
||||
@ -216,8 +223,8 @@ dump_user_access_csv(
|
||||
|
||||
static int
|
||||
ipmi_print_user_list(
|
||||
struct ipmi_intf *intf,
|
||||
uint8_t channel_number)
|
||||
struct ipmi_intf * intf,
|
||||
uint8_t channel_number)
|
||||
{
|
||||
/* This is where you were! */
|
||||
char user_name[17];
|
||||
@ -238,7 +245,8 @@ ipmi_print_user_list(
|
||||
current_user_id,
|
||||
user_name))
|
||||
return -1;
|
||||
|
||||
|
||||
|
||||
if ((current_user_id == 0) ||
|
||||
user_access.link_auth_access ||
|
||||
user_access.ipmi_messaging_access ||
|
||||
@ -304,9 +312,9 @@ ipmi_print_user_summary(
|
||||
*/
|
||||
static int
|
||||
ipmi_user_set_username(
|
||||
struct ipmi_intf *intf,
|
||||
uint8_t user_id,
|
||||
const char *name)
|
||||
struct ipmi_intf * intf,
|
||||
uint8_t user_id,
|
||||
const char * name)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
@ -322,7 +330,7 @@ ipmi_user_set_username(
|
||||
/* The channel number will remain constant throughout this function */
|
||||
msg_data[0] = user_id;
|
||||
memset(msg_data + 1, 0, 16);
|
||||
strcpy((char *)(msg_data + 1), name);
|
||||
strcpy(msg_data + 1, name);
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
|
||||
@ -339,48 +347,49 @@ ipmi_user_set_username(
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
ipmi_user_set_userpriv(
|
||||
struct ipmi_intf *intf,
|
||||
uint8_t channel,
|
||||
uint8_t user_id,
|
||||
const unsigned char privLevel)
|
||||
{
|
||||
struct ipmi_rs *rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[4];
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP; /* 0x06 */
|
||||
req.msg.cmd = IPMI_SET_USER_ACCESS; /* 0x43 */
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 4;
|
||||
|
||||
/* The channel number will remain constant throughout this function */
|
||||
msg_data[0] = (channel & 0x0f);
|
||||
msg_data[0] |= 0x90; /* enable ipmi messaging */
|
||||
msg_data[1] = (user_id & 0x3f);
|
||||
msg_data[2] = (privLevel & 0x0f);
|
||||
msg_data[3] = 0;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
|
||||
if (rsp == NULL)
|
||||
{
|
||||
lprintf(LOG_ERR, "Set Privilege Level command failed (user %d)",
|
||||
user_id);
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0)
|
||||
{
|
||||
lprintf(LOG_ERR, "Set Privilege Level command failed (user %d): %s",
|
||||
user_id, val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
static int
|
||||
ipmi_user_set_userpriv(
|
||||
struct ipmi_intf * intf,
|
||||
uint8_t channel,
|
||||
uint8_t user_id,
|
||||
const unsigned char privLevel)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[17];
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP; /* 0x06 */
|
||||
req.msg.cmd = IPMI_SET_USER_ACCESS; /* 0x43 */
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = 3;
|
||||
|
||||
|
||||
/* The channel number will remain constant throughout this function */
|
||||
msg_data[0] = (channel & 0x0f); /* Do not change any bytes */
|
||||
msg_data[1] = (user_id & 0x3f);
|
||||
msg_data[2] = (privLevel & 0x0f);
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
|
||||
if (rsp == NULL)
|
||||
{
|
||||
lprintf(LOG_ERR, "Set Privilege Level command failed (user %d)",
|
||||
user_id);
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode > 0)
|
||||
{
|
||||
lprintf(LOG_ERR, "Set Privilege Level command failed (user %d)",
|
||||
user_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ipmi_user_set_password
|
||||
@ -391,19 +400,19 @@ ipmi_user_set_userpriv(
|
||||
*/
|
||||
static int
|
||||
ipmi_user_set_password(
|
||||
struct ipmi_intf * intf,
|
||||
uint8_t user_id,
|
||||
uint8_t operation,
|
||||
const char *password,
|
||||
int is_twenty_byte_password)
|
||||
struct ipmi_intf * intf,
|
||||
uint8_t user_id,
|
||||
uint8_t operation,
|
||||
const char * password,
|
||||
int is_twenty_byte_password)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t * msg_data;
|
||||
char * msg_data;
|
||||
|
||||
int password_length = (is_twenty_byte_password? 20 : 16);
|
||||
|
||||
msg_data = (uint8_t*)malloc(password_length + 2);
|
||||
msg_data = (char*)malloc(password_length + 2);
|
||||
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
@ -415,16 +424,16 @@ ipmi_user_set_password(
|
||||
|
||||
/* The channel number will remain constant throughout this function */
|
||||
msg_data[0] = user_id;
|
||||
|
||||
|
||||
if (is_twenty_byte_password)
|
||||
msg_data[0] |= 0x80;
|
||||
|
||||
|
||||
msg_data[1] = operation;
|
||||
|
||||
memset(msg_data + 2, 0, password_length);
|
||||
|
||||
if (password != NULL)
|
||||
strncpy((char *)(msg_data + 2), password, password_length);
|
||||
strncpy(msg_data + 2, password, password_length);
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
|
||||
@ -481,6 +490,7 @@ ipmi_user_test_password(
|
||||
return ((ret == 0) ? 0 : -1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* print_user_usage
|
||||
@ -494,7 +504,7 @@ print_user_usage(void)
|
||||
lprintf(LOG_NOTICE, " set password <user id> [<password>]");
|
||||
lprintf(LOG_NOTICE, " disable <user id>");
|
||||
lprintf(LOG_NOTICE, " enable <user id>");
|
||||
lprintf(LOG_NOTICE, " priv <user id> <privilege level> [<channel number>]");
|
||||
lprintf(LOG_NOTICE, " priv <user id> <privile level> [<channel number>]");
|
||||
lprintf(LOG_NOTICE, " test <user id> <16|20> [<password]>\n");
|
||||
}
|
||||
|
||||
@ -541,7 +551,7 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
channel = (uint8_t)strtol(argv[1], NULL, 0);
|
||||
else
|
||||
{
|
||||
print_user_usage();
|
||||
print_user_usage();
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -562,7 +572,7 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
channel = (uint8_t)strtol(argv[1], NULL, 0);
|
||||
else
|
||||
{
|
||||
print_user_usage();
|
||||
print_user_usage();
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -584,8 +594,8 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
char * password = NULL;
|
||||
int password_length = atoi(argv[2]);
|
||||
uint8_t user_id = (uint8_t)strtol(argv[1],
|
||||
NULL,
|
||||
0);
|
||||
NULL,
|
||||
0);
|
||||
if (user_id == 0)
|
||||
{
|
||||
lprintf(LOG_ERR, "Invalid user ID: %d", user_id);
|
||||
@ -600,6 +610,7 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
char * tmp;
|
||||
const char * password_prompt =
|
||||
ipmi_user_build_password_prompt(user_id);
|
||||
|
||||
#ifdef HAVE_GETPASSPHRASE
|
||||
tmp = getpassphrase (password_prompt);
|
||||
#else
|
||||
@ -630,6 +641,7 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set
|
||||
*/
|
||||
@ -639,12 +651,12 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
* Set Password
|
||||
*/
|
||||
if ((argc >= 3) &&
|
||||
(strncmp("password", argv[1], 8) == 0))
|
||||
(strncmp("password", argv[1], 8) == 0))
|
||||
{
|
||||
char * password = NULL;
|
||||
uint8_t user_id = (uint8_t)strtol(argv[2],
|
||||
NULL,
|
||||
0);
|
||||
NULL,
|
||||
0);
|
||||
if (user_id == 0)
|
||||
{
|
||||
lprintf(LOG_ERR, "Invalid user ID: %d", user_id);
|
||||
@ -701,6 +713,7 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
lprintf(LOG_ERR, "Password is too long (> 20 bytes)");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
retval = ipmi_user_set_password(intf,
|
||||
user_id,
|
||||
@ -708,6 +721,7 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
password,
|
||||
strlen(password) > 16);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set Name
|
||||
@ -723,8 +737,8 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
|
||||
retval = ipmi_user_set_username(intf,
|
||||
(uint8_t)strtol(argv[2],
|
||||
NULL,
|
||||
0),
|
||||
NULL,
|
||||
0),
|
||||
argv[3]);
|
||||
}
|
||||
else
|
||||
@ -732,38 +746,40 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
print_user_usage();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
else if (strncmp(argv[0], "priv", 4) == 0)
|
||||
{
|
||||
uint8_t user_id;
|
||||
uint8_t priv_level;
|
||||
uint8_t channel = 0x0e; /* Use channel running on */
|
||||
|
||||
if (argc != 3 && argc != 4)
|
||||
{
|
||||
print_user_usage();
|
||||
return -1;
|
||||
}
|
||||
if (argc == 4)
|
||||
{
|
||||
channel = (uint8_t)strtol(argv[3], NULL, 0);
|
||||
channel = (channel & 0x0f);
|
||||
}
|
||||
|
||||
user_id = (uint8_t)strtol(argv[1], NULL, 0);
|
||||
|
||||
priv_level = (uint8_t)strtol(argv[2], NULL, 0);
|
||||
priv_level = (priv_level & 0x0f);
|
||||
|
||||
if (user_id == 0)
|
||||
{
|
||||
lprintf(LOG_ERR, "Invalid user ID: %d", user_id);
|
||||
{
|
||||
uint8_t user_id;
|
||||
uint8_t priv_level;
|
||||
uint8_t channel = 0x0e; /* Use channel running on */
|
||||
|
||||
if (
|
||||
(argc != 3) &&
|
||||
(argc != 4)
|
||||
)
|
||||
|
||||
|
||||
if (argc == 4)
|
||||
{
|
||||
channel = (uint8_t)strtol(argv[3], NULL, 0);
|
||||
channel = (channel & 0x0f);
|
||||
}
|
||||
|
||||
user_id = (uint8_t)strtol(argv[1], NULL, 0);
|
||||
|
||||
priv_level = (uint8_t)strtol(argv[2], NULL, 0);
|
||||
priv_level = (priv_level & 0x0f);
|
||||
|
||||
if (user_id == 0)
|
||||
{
|
||||
lprintf(LOG_ERR, "Invalid user ID: %d", user_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
retval = ipmi_user_set_userpriv(intf,channel,user_id,priv_level);
|
||||
}
|
||||
retval = ipmi_user_set_userpriv(intf,channel,user_id,priv_level);
|
||||
}
|
||||
|
||||
/*
|
||||
* Disable / Enable
|
||||
@ -784,8 +800,8 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
}
|
||||
|
||||
user_id = (uint8_t)strtol(argv[1],
|
||||
NULL,
|
||||
0);
|
||||
NULL,
|
||||
0);
|
||||
if (user_id == 0)
|
||||
{
|
||||
lprintf(LOG_ERR, "Invalid user ID: %d", user_id);
|
||||
@ -802,10 +818,11 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
null_password,
|
||||
0); /* This field is ignored */
|
||||
}
|
||||
|
||||
|
||||
|
||||
else
|
||||
{
|
||||
retval = -1;
|
||||
lprintf(LOG_ERR, "Invalid user command: '%s'\n", argv[0]);
|
||||
print_user_usage();
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
|
@ -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.
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/include
|
||||
SUBDIRS = plugins
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@ -40,30 +44,23 @@
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <signal.h>
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PATHS_H
|
||||
#ifdef __FreeBSD__
|
||||
# include <signal.h>
|
||||
# include <paths.h>
|
||||
#else
|
||||
# define _PATH_VARRUN "/var/run/"
|
||||
#endif
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef IPMI_INTF_OPEN
|
||||
# if defined(HAVE_OPENIPMI_H)
|
||||
# if defined(HAVE_LINUX_COMPILER_H)
|
||||
# include <linux/compiler.h>
|
||||
# endif
|
||||
# ifdef HAVE_OPENIPMI_H
|
||||
# include <linux/compiler.h>
|
||||
# include <linux/ipmi.h>
|
||||
# elif defined(HAVE_FREEBSD_IPMI_H)
|
||||
# include <sys/ipmi.h>
|
||||
# else
|
||||
# include "plugins/open/open.h"
|
||||
# endif
|
||||
# include <sys/poll.h>
|
||||
# else /* HAVE_OPENIPMI_H */
|
||||
# include "plugins/open/open.h"
|
||||
# include <sys/poll.h>
|
||||
# endif /* HAVE_OPENIPMI_H */
|
||||
#endif /* IPMI_INTF_OPEN */
|
||||
|
||||
#include <ipmitool/helper.h>
|
||||
@ -75,9 +72,6 @@
|
||||
#include <ipmitool/ipmi_strings.h>
|
||||
#include <ipmitool/ipmi_main.h>
|
||||
|
||||
#define DEFAULT_PIDFILE _PATH_VARRUN "ipmievd.pid"
|
||||
char pidfile[64];
|
||||
|
||||
/* global variables */
|
||||
int verbose = 0;
|
||||
int csv_output = 0;
|
||||
@ -89,7 +83,6 @@ int selwatch_timeout = 10; /* default to 10 seconds */
|
||||
struct ipmi_event_intf {
|
||||
char name[16];
|
||||
char desc[128];
|
||||
char prefix[72];
|
||||
int (*setup)(struct ipmi_event_intf * eintf);
|
||||
int (*wait)(struct ipmi_event_intf * eintf);
|
||||
int (*read)(struct ipmi_event_intf * eintf);
|
||||
@ -108,7 +101,6 @@ static int openipmi_read(struct ipmi_event_intf * eintf);
|
||||
static struct ipmi_event_intf openipmi_event_intf = {
|
||||
name: "open",
|
||||
desc: "OpenIPMI asyncronous notification of events",
|
||||
prefix: "",
|
||||
setup: openipmi_setup,
|
||||
wait: openipmi_wait,
|
||||
read: openipmi_read,
|
||||
@ -197,34 +189,27 @@ log_event(struct ipmi_event_intf * eintf, struct sel_event_record * evt)
|
||||
return;
|
||||
|
||||
if (evt->record_type == 0xf0) {
|
||||
lprintf(LOG_ALERT, "%sLinux kernel panic: %.11s",
|
||||
eintf->prefix, (char *) evt + 5);
|
||||
lprintf(LOG_ALERT, "Linux kernel panic: %.11s", (char *) evt + 5);
|
||||
return;
|
||||
}
|
||||
else if (evt->record_type >= 0xc0) {
|
||||
lprintf(LOG_NOTICE, "%sIPMI Event OEM Record %02x",
|
||||
eintf->prefix, evt->record_type);
|
||||
lprintf(LOG_NOTICE, "IPMI Event OEM Record %02x", evt->record_type);
|
||||
return;
|
||||
}
|
||||
|
||||
type = ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type,
|
||||
evt->sel_type.standard_type.event_data[0]);
|
||||
|
||||
type = ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0]);
|
||||
ipmi_get_event_desc(intf, evt, &desc);
|
||||
|
||||
sdr = ipmi_sdr_find_sdr_bynumtype(intf, evt->sel_type.standard_type.sensor_num,
|
||||
evt->sel_type.standard_type.sensor_type);
|
||||
|
||||
sdr = ipmi_sdr_find_sdr_bynumtype(intf, evt->sel_type.standard_type.sensor_num, evt->sel_type.standard_type.sensor_type);
|
||||
if (sdr == NULL) {
|
||||
/* could not find matching SDR record */
|
||||
if (desc) {
|
||||
lprintf(LOG_NOTICE, "%s%s sensor - %s",
|
||||
eintf->prefix, type, desc);
|
||||
lprintf(LOG_NOTICE, "%s sensor - %s",
|
||||
type, desc);
|
||||
free(desc);
|
||||
} else {
|
||||
lprintf(LOG_NOTICE, "%s%s sensor %02x",
|
||||
eintf->prefix, type,
|
||||
evt->sel_type.standard_type.sensor_num);
|
||||
lprintf(LOG_NOTICE, "%s sensor %02x",
|
||||
type, evt->sel_type.standard_type.sensor_num);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -248,8 +233,7 @@ log_event(struct ipmi_event_intf * eintf, struct sel_event_record * evt)
|
||||
sdr->record.full, evt->sel_type.standard_type.event_data[2]);
|
||||
}
|
||||
|
||||
lprintf(LOG_NOTICE, "%s%s sensor %s %s (Reading %.*f %s Threshold %.*f %s)",
|
||||
eintf->prefix,
|
||||
lprintf(LOG_NOTICE, "%s sensor %s %s (Reading %.*f %s Threshold %.*f %s)",
|
||||
type,
|
||||
sdr->record.full->id_string,
|
||||
desc ? : "",
|
||||
@ -267,8 +251,8 @@ log_event(struct ipmi_event_intf * eintf, struct sel_event_record * evt)
|
||||
/*
|
||||
* Discrete Event
|
||||
*/
|
||||
lprintf(LOG_NOTICE, "%s%s sensor %s %s",
|
||||
eintf->prefix, type, sdr->record.full->id_string, desc ? : "");
|
||||
lprintf(LOG_NOTICE, "%s sensor %s %s",
|
||||
type, sdr->record.full->id_string, desc ? : "");
|
||||
if (((evt->sel_type.standard_type.event_data[0] >> 6) & 3) == 1) {
|
||||
/* previous state and/or severity in event data byte 2 */
|
||||
}
|
||||
@ -277,29 +261,26 @@ log_event(struct ipmi_event_intf * eintf, struct sel_event_record * evt)
|
||||
/*
|
||||
* OEM Event
|
||||
*/
|
||||
lprintf(LOG_NOTICE, "%s%s sensor %s %s",
|
||||
eintf->prefix, type, sdr->record.full->id_string, desc ? : "");
|
||||
lprintf(LOG_NOTICE, "%s sensor %s %s",
|
||||
type, sdr->record.full->id_string, desc ? : "");
|
||||
}
|
||||
break;
|
||||
|
||||
case SDR_RECORD_TYPE_COMPACT_SENSOR:
|
||||
if (evt->sel_type.standard_type.event_type == 0x6f) {
|
||||
lprintf(LOG_NOTICE, "%s%s sensor %s - %s %s",
|
||||
eintf->prefix,
|
||||
lprintf(LOG_NOTICE, "%s sensor %s - %s %s",
|
||||
type, sdr->record.compact->id_string,
|
||||
desc ? : "",
|
||||
evt->sel_type.standard_type.event_dir ? "Deasserted" : "Asserted");
|
||||
} else {
|
||||
lprintf(LOG_NOTICE, "%s%s sensor %s - %s",
|
||||
eintf->prefix, type,
|
||||
sdr->record.compact->id_string, desc ? : "");
|
||||
lprintf(LOG_NOTICE, "%s sensor %s - %s",
|
||||
type, sdr->record.compact->id_string, desc ? : "");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
lprintf(LOG_NOTICE, "%s%s sensor - %s",
|
||||
eintf->prefix, type,
|
||||
evt->sel_type.standard_type.sensor_num, desc ? : "");
|
||||
lprintf(LOG_NOTICE, "%s sensor - %s",
|
||||
type, evt->sel_type.standard_type.sensor_num, desc ? : "");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -390,7 +371,7 @@ openipmi_read(struct ipmi_event_intf * eintf)
|
||||
uint8_t data[80];
|
||||
int rv;
|
||||
|
||||
recv.addr = (unsigned char *) &addr;
|
||||
recv.addr = (char *) &addr;
|
||||
recv.addr_len = sizeof(addr);
|
||||
recv.msg.data = data;
|
||||
recv.msg.data_len = sizeof(data);
|
||||
@ -603,29 +584,11 @@ selwatch_wait(struct ipmi_event_intf * eintf)
|
||||
}
|
||||
/*************************************************************************/
|
||||
|
||||
static void
|
||||
ipmievd_cleanup(int signal)
|
||||
{
|
||||
struct stat st1;
|
||||
|
||||
if (lstat(pidfile, &st1) == 0) {
|
||||
/* cleanup daemon pidfile */
|
||||
(void)unlink(pidfile);
|
||||
}
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
int
|
||||
ipmievd_main(struct ipmi_event_intf * eintf, int argc, char ** argv)
|
||||
{
|
||||
int i, rc;
|
||||
int daemon = 1;
|
||||
struct sigaction act;
|
||||
|
||||
memset(pidfile, 0, 64);
|
||||
sprintf(pidfile, "%s%d", DEFAULT_PIDFILE, eintf->intf->devnum);
|
||||
lprintf(LOG_NOTICE, "ipmievd: using pidfile %s", pidfile);
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
if (strncasecmp(argv[i], "help", 4) == 0) {
|
||||
@ -649,50 +612,10 @@ ipmievd_main(struct ipmi_event_intf * eintf, int argc, char ** argv)
|
||||
else if (strncasecmp(argv[i], "timeout=", 8) == 0) {
|
||||
selwatch_timeout = strtoul(argv[i]+8, NULL, 0);
|
||||
}
|
||||
else if (strncasecmp(argv[i], "pidfile=", 8) == 0) {
|
||||
memset(pidfile, 0, 64);
|
||||
strncpy(pidfile, argv[i]+8,
|
||||
__min(strlen((const char *)(argv[i]+8)), 63));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* We need to open interface before forking daemon
|
||||
* so error messages are not lost to syslog and
|
||||
* return code is successfully returned to initscript
|
||||
*/
|
||||
if (eintf->intf->open(eintf->intf) < 0) {
|
||||
lprintf(LOG_ERR, "Unable to open interface");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (daemon) {
|
||||
FILE *fp;
|
||||
struct stat st1;
|
||||
|
||||
ipmi_start_daemon(eintf->intf);
|
||||
|
||||
if (lstat(pidfile, &st1) == 0) {
|
||||
/* already exists, erase first */
|
||||
if (unlink(pidfile) != 0) {
|
||||
lprintf(LOG_WARN, "Unable to erase pidfile");
|
||||
}
|
||||
}
|
||||
|
||||
fp = ipmi_open_file_write(pidfile);
|
||||
if (fp != NULL) {
|
||||
fprintf(fp, "%d\n", (int)getpid());
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
||||
/* register signal handler for cleanup */
|
||||
act.sa_handler = ipmievd_cleanup;
|
||||
act.sa_flags = 0;
|
||||
sigemptyset(&act.sa_mask);
|
||||
sigaction(SIGINT, &act, NULL);
|
||||
sigaction(SIGQUIT, &act, NULL);
|
||||
sigaction(SIGTERM, &act, NULL);
|
||||
if (daemon)
|
||||
ipmi_start_daemon();
|
||||
|
||||
log_halt();
|
||||
log_init("ipmievd", daemon, verbose);
|
||||
@ -703,7 +626,6 @@ ipmievd_main(struct ipmi_event_intf * eintf, int argc, char ** argv)
|
||||
lprintf(LOG_DEBUG, "Sensors cached");
|
||||
|
||||
/* call event handler setup routine */
|
||||
|
||||
if (eintf->setup != NULL) {
|
||||
rc = eintf->setup(eintf);
|
||||
if (rc < 0) {
|
||||
@ -739,12 +661,6 @@ ipmievd_sel_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
|
||||
eintf->intf = intf;
|
||||
|
||||
if (intf->session != NULL) {
|
||||
snprintf(eintf->prefix,
|
||||
strlen((const char *)intf->session->hostname) + 3,
|
||||
"%s: ", intf->session->hostname);
|
||||
}
|
||||
|
||||
return ipmievd_main(eintf, argc, argv);
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@ -48,19 +52,14 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define EXEC_BUF_SIZE 2048
|
||||
#define EXEC_ARG_SIZE 64
|
||||
#define EXEC_BUF_SIZE 1024
|
||||
#define EXEC_ARG_SIZE 32
|
||||
|
||||
extern const struct valstr ipmi_privlvl_vals[];
|
||||
extern const struct valstr ipmi_authtype_session_vals[];
|
||||
|
||||
#ifdef HAVE_READLINE
|
||||
|
||||
/* avoid warnings errors due to non-ANSI type declarations in readline.h */
|
||||
#define _FUNCTION_DEF
|
||||
#define USE_VARARGS
|
||||
#define PREFER_STDARG
|
||||
|
||||
#include <readline/readline.h>
|
||||
#include <readline/history.h>
|
||||
#define RL_PROMPT "ipmitool> "
|
||||
@ -97,7 +96,7 @@ static int rl_event_keepalive(void)
|
||||
|
||||
int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
char *ptr, *pbuf, **ap, *__argv[EXEC_ARG_SIZE];
|
||||
char *ptr, *pbuf, **ap, *__argv[20];
|
||||
int __argc, rc=0;
|
||||
|
||||
rl_readline_name = "ipmitool";
|
||||
@ -112,7 +111,7 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
shell_intf = intf;
|
||||
rl_event_hook = rl_event_keepalive;
|
||||
#if defined(RL_READLINE_VERSION) && RL_READLINE_VERSION >= 0x0402
|
||||
/* There is a bug in readline 4.2 and later (at least on FreeBSD and NetBSD):
|
||||
/* There is a bug in readline 4.2 and later (at least on FreeBSD):
|
||||
* timeout equal or greater than 1 second causes an infinite loop. */
|
||||
rl_set_keyboard_input_timeout(1000 * 1000 - 1);
|
||||
#endif
|
||||
@ -137,14 +136,14 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
|
||||
/* for the all-important up arrow :) */
|
||||
add_history(pbuf);
|
||||
|
||||
|
||||
/* change "" and '' with spaces in the middle to ~ */
|
||||
ptr = pbuf;
|
||||
while (*ptr != '\0') {
|
||||
if (*ptr == '"') {
|
||||
ptr++;
|
||||
while (*ptr != '"') {
|
||||
if (isspace((int)*ptr))
|
||||
if (isspace(*ptr))
|
||||
*ptr = '~';
|
||||
ptr++;
|
||||
}
|
||||
@ -152,7 +151,7 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
if (*ptr == '\'') {
|
||||
ptr++;
|
||||
while (*ptr != '\'') {
|
||||
if (isspace((int)*ptr))
|
||||
if (isspace(*ptr))
|
||||
*ptr = '~';
|
||||
ptr++;
|
||||
}
|
||||
@ -189,7 +188,7 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
}
|
||||
|
||||
if (**ap != '\0') {
|
||||
if (++ap >= &__argv[EXEC_ARG_SIZE])
|
||||
if (++ap >= &__argv[20])
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -201,8 +200,7 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
&(__argv[1]));
|
||||
|
||||
free(pbuf);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -225,8 +223,6 @@ int ipmi_echo_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
printf("%s ", argv[i]);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -363,7 +359,7 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
if (*ptr == '"') {
|
||||
ptr++;
|
||||
while (*ptr != '"') {
|
||||
if (isspace((int)*ptr))
|
||||
if (isspace(*ptr))
|
||||
*ptr = '~';
|
||||
ptr++;
|
||||
}
|
||||
@ -371,7 +367,7 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
if (*ptr == '\'') {
|
||||
ptr++;
|
||||
while (*ptr != '\'') {
|
||||
if (isspace((int)*ptr))
|
||||
if (isspace(*ptr))
|
||||
*ptr = '~';
|
||||
ptr++;
|
||||
}
|
||||
@ -381,10 +377,10 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
|
||||
/* clip off trailing and leading whitespace */
|
||||
ptr--;
|
||||
while (isspace((int)*ptr) && ptr >= buf)
|
||||
while (isspace(*ptr) && ptr >= buf)
|
||||
*ptr-- = '\0';
|
||||
ptr = buf;
|
||||
while (isspace((int)*ptr))
|
||||
while (isspace(*ptr))
|
||||
ptr++;
|
||||
if (strlen(ptr) == 0)
|
||||
continue;
|
||||
@ -437,3 +433,4 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
fclose(fp);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,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.
|
||||
*/
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
@ -57,9 +61,6 @@
|
||||
#include <ipmitool/ipmi_sunoem.h>
|
||||
#include <ipmitool/ipmi_fwum.h>
|
||||
#include <ipmitool/ipmi_picmg.h>
|
||||
#include <ipmitool/ipmi_kontronoem.h>
|
||||
#include <ipmitool/ipmi_firewall.h>
|
||||
#include <ipmitool/ipmi_hpmfwupg.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
@ -79,7 +80,6 @@ int verbose = 0;
|
||||
struct ipmi_cmd ipmitool_cmd_list[] = {
|
||||
{ ipmi_raw_main, "raw", "Send a RAW IPMI request and print response" },
|
||||
{ ipmi_rawi2c_main, "i2c", "Send an I2C Master Write-Read command and print response" },
|
||||
{ ipmi_rawspd_main, "spd", "Print SPD info from remote I2C device" },
|
||||
{ ipmi_lanp_main, "lan", "Configure LAN Channels" },
|
||||
{ ipmi_chassis_main, "chassis", "Get chassis status and set power state" },
|
||||
{ ipmi_power_main, "power", "Shortcut to chassis power commands" },
|
||||
@ -98,17 +98,14 @@ struct ipmi_cmd ipmitool_cmd_list[] = {
|
||||
{ ipmi_channel_main, "channel", "Configure Management Controller channels" },
|
||||
{ ipmi_session_main, "session", "Print session information" },
|
||||
{ ipmi_sunoem_main, "sunoem", "OEM Commands for Sun servers" },
|
||||
{ ipmi_kontronoem_main, "kontronoem", "OEM Commands for Kontron devices"},
|
||||
{ ipmi_picmg_main, "picmg", "Run a PICMG/ATCA extended cmd"},
|
||||
{ ipmi_fwum_main, "fwum", "Update IPMC using Kontron OEM Firmware Update Manager" },
|
||||
{ ipmi_firewall_main,"firewall","Configure Firmware Firewall" },
|
||||
#ifdef HAVE_READLINE
|
||||
{ ipmi_shell_main, "shell", "Launch interactive IPMI shell" },
|
||||
#endif
|
||||
{ ipmi_exec_main, "exec", "Run list of commands from file" },
|
||||
{ ipmi_set_main, "set", "Set runtime variable for shell and exec" },
|
||||
{ ipmi_echo_main, "echo", NULL }, /* for echoing lines to stdout in scripts */
|
||||
{ ipmi_hpmfwupg_main,"hpm", "Update HPM components using PICMG HPM.1 file"},
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
@ -27,13 +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.
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/include
|
||||
|
||||
SUBDIRS = @INTF_LAN@ @INTF_LANPLUS@ @INTF_OPEN@ @INTF_LIPMI@ @INTF_IMB@ @INTF_BMC@ @INTF_FREE@
|
||||
DIST_SUBDIRS = lan lanplus open lipmi imb bmc free
|
||||
SUBDIRS = @INTF_LAN@ @INTF_LANPLUS@ @INTF_OPEN@ @INTF_LIPMI@ @INTF_IMB@ @INTF_BMC@
|
||||
DIST_SUBDIRS = lan lanplus open lipmi imb bmc
|
||||
|
||||
noinst_LTLIBRARIES = libintf.la
|
||||
libintf_la_SOURCES = ipmi_intf.c
|
||||
|
@ -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
|
||||
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef _IPMI_BMC_H_
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#ifndef _BMC_INTF_H
|
||||
|
@ -1,9 +0,0 @@
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/include
|
||||
|
||||
EXTRA_LTLIBRARIES = libintf_free.la
|
||||
noinst_LTLIBRARIES = @INTF_FREE_LIB@
|
||||
libintf_free_la_LIBADD = $(top_builddir)/lib/libipmitool.la
|
||||
libintf_free_la_SOURCES = free.c
|
||||
libintf_free_la_LDFLAGS = -lfreeipmi
|
@ -1,157 +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.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
|
||||
#include <freeipmi/freeipmi.h>
|
||||
#include <freeipmi/udm/ipmi-udm.h>
|
||||
|
||||
#include <config.h>
|
||||
|
||||
ipmi_device_t dev = NULL;
|
||||
|
||||
extern int verbose;
|
||||
|
||||
static int ipmi_free_open(struct ipmi_intf * intf)
|
||||
{
|
||||
if (getuid() != 0) {
|
||||
fprintf(stderr, "Permission denied, must be root\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!(dev = ipmi_open_inband (IPMI_DEVICE_KCS,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
IPMI_FLAGS_DEFAULT))) {
|
||||
if (!(dev = ipmi_open_inband (IPMI_DEVICE_SSIF,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
IPMI_FLAGS_DEFAULT))) {
|
||||
perror("ipmi_open_inband()");
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
intf->opened = 1;
|
||||
return 0;
|
||||
cleanup:
|
||||
if (dev)
|
||||
ipmi_close_device(dev);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void ipmi_free_close(struct ipmi_intf * intf)
|
||||
{
|
||||
if (dev)
|
||||
ipmi_close_device(dev);
|
||||
intf->opened = 0;
|
||||
}
|
||||
|
||||
static struct ipmi_rs * ipmi_free_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
|
||||
{
|
||||
u_int8_t lun = 0;
|
||||
u_int8_t cmd = req->msg.cmd;
|
||||
u_int8_t netfn = req->msg.netfn;
|
||||
u_int8_t rq_buf[IPMI_BUF_SIZE];
|
||||
u_int8_t rs_buf[IPMI_BUF_SIZE];
|
||||
u_int32_t rs_buf_len = IPMI_BUF_SIZE;
|
||||
int32_t rs_len;
|
||||
|
||||
static struct ipmi_rs rsp;
|
||||
|
||||
/* achu: FreeIPMI requests have the cmd as the first byte of
|
||||
* the data. Responses have cmd as the first byte and
|
||||
* completion code as the second byte. This differs from some
|
||||
* other APIs, so it must be compensated for within the ipmitool
|
||||
* interface.
|
||||
*/
|
||||
|
||||
if (!intf || !req)
|
||||
return NULL;
|
||||
|
||||
if (!intf->opened && intf->open && intf->open(intf) < 0)
|
||||
return NULL;
|
||||
|
||||
if (req->msg.data_len > IPMI_BUF_SIZE)
|
||||
return NULL;
|
||||
|
||||
memset(rq_buf, '\0', IPMI_BUF_SIZE);
|
||||
memset(rs_buf, '\0', IPMI_BUF_SIZE);
|
||||
memcpy(rq_buf, &cmd, 1);
|
||||
|
||||
if (req->msg.data)
|
||||
memcpy(rq_buf + 1, req->msg.data, req->msg.data_len);
|
||||
|
||||
if ((rs_len = ipmi_cmd_raw(dev,
|
||||
lun,
|
||||
netfn,
|
||||
rq_buf,
|
||||
req->msg.data_len + 1,
|
||||
rs_buf,
|
||||
rs_buf_len)) < 0) {
|
||||
perror("ipmi_cmd_raw");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(&rsp, 0, sizeof(struct ipmi_rs));
|
||||
rsp.ccode = (unsigned char)rs_buf[1];
|
||||
rsp.data_len = (int)rs_len - 2;
|
||||
|
||||
if (!rsp.ccode && rsp.data_len)
|
||||
memcpy(rsp.data, rs_buf + 2, rsp.data_len);
|
||||
|
||||
return &rsp;
|
||||
}
|
||||
|
||||
struct ipmi_intf ipmi_free_intf = {
|
||||
name: "free",
|
||||
desc: "FreeIPMI IPMI Interface",
|
||||
open: ipmi_free_open,
|
||||
close: ipmi_free_close,
|
||||
sendrecv: ipmi_free_send_cmd,
|
||||
target_addr: IPMI_BMC_SLAVE_ADDR,
|
||||
};
|
||||
|
@ -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
|
||||
|
||||
|
@ -28,6 +28,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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -28,14 +28,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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <config.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_sdr.h>
|
||||
@ -59,9 +62,6 @@ extern struct ipmi_intf ipmi_lan_intf;
|
||||
#ifdef IPMI_INTF_LANPLUS
|
||||
extern struct ipmi_intf ipmi_lanplus_intf;
|
||||
#endif
|
||||
#ifdef IPMI_INTF_FREE
|
||||
extern struct ipmi_intf ipmi_free_intf;
|
||||
#endif
|
||||
|
||||
struct ipmi_intf * ipmi_intf_table[] = {
|
||||
#ifdef IPMI_INTF_OPEN
|
||||
@ -81,9 +81,6 @@ struct ipmi_intf * ipmi_intf_table[] = {
|
||||
#endif
|
||||
#ifdef IPMI_INTF_LANPLUS
|
||||
&ipmi_lanplus_intf,
|
||||
#endif
|
||||
#ifdef IPMI_INTF_FREE
|
||||
&ipmi_free_intf,
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
@ -218,15 +215,6 @@ ipmi_intf_session_set_privlvl(struct ipmi_intf * intf, uint8_t level)
|
||||
intf->session->privlvl = level;
|
||||
}
|
||||
|
||||
void
|
||||
ipmi_intf_session_set_lookupbit(struct ipmi_intf * intf, uint8_t lookupbit)
|
||||
{
|
||||
if (intf->session == NULL)
|
||||
return;
|
||||
|
||||
intf->session->v2_data.lookupbit = lookupbit;
|
||||
}
|
||||
|
||||
void
|
||||
ipmi_intf_session_set_cipher_suite_id(struct ipmi_intf * intf, uint8_t cipher_suite_id)
|
||||
{
|
||||
@ -275,12 +263,6 @@ ipmi_intf_session_set_authtype(struct ipmi_intf * intf, uint8_t authtype)
|
||||
if (intf->session == NULL)
|
||||
return;
|
||||
|
||||
/* clear password field if authtype NONE specified */
|
||||
if (authtype == IPMI_SESSION_AUTHTYPE_NONE) {
|
||||
memset(intf->session->authcode, 0, IPMI_AUTHCODE_BUFFER_SIZE);
|
||||
intf->session->password = 0;
|
||||
}
|
||||
|
||||
intf->session->authtype_set = authtype;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user