From f85b8b834b7ff85c80503faa73f237040330087b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 3 Jan 2017 02:33:44 +0100 Subject: New upstream version 3.0.1 --- ChangeLog | 30 +++- TODO | 15 ++ configure | 36 ++-- configure.ac | 18 +- debpkg/changelog | 18 ++ doc/Makefile | 28 +-- doc/UserGuide | 18 +- doc/ilan.8 | 10 +- doc/ipmiutil.spec | 49 +++--- lib/Makefile | 28 +-- lib/lanplus/lanplus_crypt.c | 27 ++- lib/lanplus/lanplus_crypt_impl.c | 56 ++++-- lib/libipmiutil.pc | 2 +- scripts/Makefile | 28 +-- scripts/ipmi_port.service | 3 +- setver | 8 +- util/Makefile.am | 2 +- util/Makefile.in | 6 +- util/ialarms.c | 2 +- util/icmd.c | 2 +- util/iconfig.c | 3 +- util/idcmi.c | 2 +- util/ievents.c | 28 ++- util/ifirewall.c | 2 +- util/ifru.c | 2 +- util/ifruset.c | 2 +- util/igetevent.c | 2 +- util/ihealth.c | 11 +- util/ilan.c | 8 +- util/imbapi.c | 14 +- util/ipicmg.c | 2 +- util/ipmicmd.c | 1 - util/ipmicmd.h | 2 + util/ipmidir.c | 31 ++-- util/ipmilan.c | 6 +- util/ipmimv.c | 6 +- util/ipmiutil.c | 4 +- util/ipmiutil.mak | 11 +- util/ipmiutil64.mak | 11 +- util/ireset.c | 2 +- util/isel.c | 2 +- util/iseltime.c | 2 +- util/isensor.c | 169 +++++++++++++++--- util/iserial.c | 5 +- util/isol.c | 2 +- util/itsol.c | 2 +- util/iwdt.c | 2 +- util/oem_dell.c | 63 ++++--- util/oem_lenovo.c | 365 +++++++++++++++++++++++++++++++++++++++ util/oem_lenovo.h | 46 +++++ util/oem_newisys.c | 2 +- util/oem_sun.c | 2 +- util/oem_supermicro.c | 91 ++++++++-- util/subs.c | 4 +- 54 files changed, 1035 insertions(+), 258 deletions(-) create mode 100644 util/oem_lenovo.c create mode 100644 util/oem_lenovo.h diff --git a/ChangeLog b/ChangeLog index 705e67e..fe890cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4160,7 +4160,7 @@ wdt.8 iwdt.8 (ipmiutil wdt) util/idcmi.c - handle if mc_id is truncated util/iekanalyzer.c - stub out unless configure --enable-ekanalyzer configure.ac - add ekanalyzer option - util/oem_supermicro.c - fix Supermicro dimm decoding + util/oem_supermicro.c - fix Supermicro memory DIMM decoding scripts/ipmi.init.basic - do not start ipmi_watchdog if Supermicro lib/lanplus/lanplus.c - enable cipher 15,16 if HAVE_SHA256 util/*.c - changes to reduce compile warnings @@ -4178,8 +4178,8 @@ wdt.8 iwdt.8 (ipmiutil wdt) util/isel.c - add -i for RT_OEMIU 0xDB events util/ievents.c - interpret RT_OEMIU 0xDB events util/oem_supermicro.c - interpret SMC OEM 0xC8 events, - interpret SMC HDD sensors differently, - add factory defaults option + interpret SMC HDD sensors differently, + add factory defaults option doc/ipmiutil.spec - put so.1 in base, so in devel util/ipmiutil.mak - add LF_LANPLUS to DLL util/oem_intel.c/h - add support for Kontron CG2300/Grantley (gdicaire) @@ -4195,3 +4195,27 @@ wdt.8 iwdt.8 (ipmiutil wdt) ihpm (ipmiutil hpm) ver 1.09 idiscover (ipmiutil discover) ver 1.11 ipmi_port (ipmi_port) ver 1.4 + +12/29/2016 ARCress ipmiutil-3.0.1 changes + util/oem_dell.c - set Dell severities better, if empty desc fall through + util/ievents.c - for Battery 'Failed OK' -> 'Failed is OK now', + for Power Supply include decode_redund, + util/ihealth.c - set SuperMicro X10DRL to not try get_powerstate, + util/ipmidir.c - abort if no SMBIOS record for IPMI without trying, avoid IOerr sometimes + util/isensor.c - add decode_comp_generic for missing ev_type values + util/subs.c - add Lenovo vendor + util/oem_lenovo.c - new, custom Lenovo sensor readings, stub for sel + util/oem_lenovo.h - new + util/Makefile.am - add oem_lenovo.c + util/ipmiutil*.mak - add oem_lenovo.c + util/oem_supermicro.c - workaround for SuperMicro threshold firmware bug + scripts/ipmi_port.service - 0710-systemd.patch from Jorg Frings-Furst + configure.ac - detect openssl-1.1.0 for SSL11 + lib/lanplus/lanplus_crypt_impl.c - added openssl-1.1.0 support w SSL11 + ipmiutil-3.0.1 contains: + ipmiutil (ipmiutil) ver 3.01 + ...(various subcommands) ver 3.01 + ifwum (ipmiutil fwum) ver 1.3 + ihpm (ipmiutil hpm) ver 1.09 + idiscover (ipmiutil discover) ver 1.11 + ipmi_port (ipmi_port) ver 1.4 diff --git a/TODO b/TODO index 6f260c5..011bf6f 100644 --- a/TODO +++ b/TODO @@ -1,10 +1,25 @@ IPMIUTIL PROJECT TODO LIST: +Add subcommand to consolidate user functions + . enable, disable, list, set(priv/username/psw) + +Add support for openssl-1.1.0 for fedora + . detect new vs. old, handle both + IPV6 for IPMI LAN on Windows: Currently support IPV6 on Linux, but need to implement for Windows also . implement IPV6 for Windows (#ifdef WIN32 case) +Test SuperMicro DIMM event logic (pending bad DIMM) + PARTIAL in ipmiutil-2.9.9, revised code implemented + +Add OEM Lenovo sensor decoding + COMPLETE in ipmiutil-3.0.1 + +Add OEM Lenovo SEL decoding + PARTIAL in ipmiutil-3.0.1 + Thread-safe changes for IPMI LAN: Change ipmicmd.c/ipmilan.c to be thread-safe if accessing multiple nodes. Currently it is only conditionally safe, if threads access the same node. diff --git a/configure b/configure index 66aac63..bde6c5b 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for ipmiutil 3.0.0. +# Generated by GNU Autoconf 2.63 for ipmiutil 3.0.1. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. @@ -743,8 +743,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='ipmiutil' PACKAGE_TARNAME='ipmiutil' -PACKAGE_VERSION='3.0.0' -PACKAGE_STRING='ipmiutil 3.0.0' +PACKAGE_VERSION='3.0.1' +PACKAGE_STRING='ipmiutil 3.0.1' PACKAGE_BUGREPORT='' ac_unique_file="util/ipmiutil.c" @@ -1503,7 +1503,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ipmiutil 3.0.0 to adapt to many kinds of systems. +\`configure' configures ipmiutil 3.0.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1573,7 +1573,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ipmiutil 3.0.0:";; + short | recursive ) echo "Configuration of ipmiutil 3.0.1:";; esac cat <<\_ACEOF @@ -1683,7 +1683,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ipmiutil configure 3.0.0 +ipmiutil configure 3.0.1 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1697,7 +1697,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ipmiutil $as_me 3.0.0, which was +It was created by ipmiutil $as_me 3.0.1, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -2551,7 +2551,7 @@ fi # Define the identity of the package. PACKAGE='ipmiutil' - VERSION='3.0.0' + VERSION='3.0.1' cat >>confdefs.h <<_ACEOF @@ -13366,15 +13366,27 @@ else sed -i 's/# Default-Start:/# Default-Start: 3 4 5/' $init_scripts sed -i 's/# Default-Stop:/# Default-Stop: 0 1 2 6/' $init_scripts fi - if test -f "$LIB_DIR/libcrypto.so"; then + # The openssl rpm might not be installed + which rpm >/dev/null 2>&1 + if test $? -eq 0 ; then + sslver=`rpm -q openssl-devel |cut -f3 -d'-' |cut -f1-2 -d'.'` + else + sslver=`openssl version |awk '{ print $2 }'|cut -f1-2 -d'.'` + fi + if test "$sslver" = "1.1"; then + echo "Detected openssl-$sslver" + MD2_CFLAGS="-DSKIP_MD2 -DSSL11" + else + if test -f "$LIB_DIR/libcrypto.so"; then strings $LIB_DIR/libcrypto.so | grep EVP_md2 >/dev/null 2>&1 if test $? -ne 0; then echo "No MD2 detected in openssl libcrypto.so" MD2_CFLAGS="-DSKIP_MD2" fi - else + else echo "No openssl $LIB_DIR/libcrypto.so detected" MD2_CFLAGS="-DSKIP_MD2" + fi fi OS_CFLAGS="-DLINUX $MD2_CFLAGS -fPIC $cfwarn $cfgnu $cfhard" else @@ -13931,7 +13943,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ipmiutil $as_me 3.0.0, which was +This file was extended by ipmiutil $as_me 3.0.1, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13994,7 +14006,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -ipmiutil config.status 3.0.0 +ipmiutil config.status 3.0.1 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index f31123d..c16acb3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(ipmiutil,3.0.0) +AC_INIT(ipmiutil,3.0.1) AC_CONFIG_SRCDIR(util/ipmiutil.c) echo "ipmiutil version ${PACKAGE_VERSION}" AM_CONFIG_HEADER(config.h) @@ -404,15 +404,27 @@ else sed -i 's/# Default-Start:/# Default-Start: 3 4 5/' $init_scripts sed -i 's/# Default-Stop:/# Default-Stop: 0 1 2 6/' $init_scripts fi - if test -f "$LIB_DIR/libcrypto.so"; then + # The openssl rpm might not be installed + which rpm >/dev/null 2>&1 + if test $? -eq 0 ; then + sslver=`rpm -q openssl-devel |cut -f3 -d'-' |cut -f1-2 -d'.'` + else + sslver=`openssl version |awk '{ print $2 }'|cut -f1-2 -d'.'` + fi + if test "$sslver" = "1.1"; then + echo "Detected openssl-$sslver" + MD2_CFLAGS="-DSKIP_MD2 -DSSL11" + else + if test -f "$LIB_DIR/libcrypto.so"; then strings $LIB_DIR/libcrypto.so | grep EVP_md2 >/dev/null 2>&1 if test $? -ne 0; then echo "No MD2 detected in openssl libcrypto.so" MD2_CFLAGS="-DSKIP_MD2" fi - else + else echo "No openssl $LIB_DIR/libcrypto.so detected" MD2_CFLAGS="-DSKIP_MD2" + fi fi OS_CFLAGS="-DLINUX $MD2_CFLAGS -fPIC $cfwarn $cfgnu $cfhard" else diff --git a/debpkg/changelog b/debpkg/changelog index 7949f60..7a612ca 100644 --- a/debpkg/changelog +++ b/debpkg/changelog @@ -1,3 +1,21 @@ +ipmiutil (3.0.1-1) unstable; urgency=low + + * New upstream version. + + -- Andy Cress Mon, 26 Sep 2016 10:13:36 -0400 + +ipmiutil (3.0.1-1) unstable; urgency=low + + * New upstream version. + + -- Andy Cress Mon, 26 Sep 2016 10:12:58 -0400 + +ipmiutil (3.0.1-1) unstable; urgency=low + + * New upstream version. + + -- Andy Cress Mon, 26 Sep 2016 10:11:49 -0400 + ipmiutil (3.0.0-1) unstable; urgency=low * New upstream version. diff --git a/doc/Makefile b/doc/Makefile index 1c9e94e..f1c35d4 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -46,12 +46,12 @@ CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /usr/dev/ipmiutil-3.0.0/missing --run aclocal-1.11 -AMTAR = ${SHELL} /usr/dev/ipmiutil-3.0.0/missing --run tar +ACLOCAL = ${SHELL} /usr/dev/ipmiutil-3.0.1/missing --run aclocal-1.11 +AMTAR = ${SHELL} /usr/dev/ipmiutil-3.0.1/missing --run tar AR = ar -AUTOCONF = ${SHELL} /usr/dev/ipmiutil-3.0.0/missing --run autoconf -AUTOHEADER = ${SHELL} /usr/dev/ipmiutil-3.0.0/missing --run autoheader -AUTOMAKE = ${SHELL} /usr/dev/ipmiutil-3.0.0/missing --run automake-1.11 +AUTOCONF = ${SHELL} /usr/dev/ipmiutil-3.0.1/missing --run autoconf +AUTOHEADER = ${SHELL} /usr/dev/ipmiutil-3.0.1/missing --run autoheader +AUTOMAKE = ${SHELL} /usr/dev/ipmiutil-3.0.1/missing --run automake-1.11 AWK = gawk CC = gcc CCDEPMODE = depmode=gcc3 @@ -99,7 +99,7 @@ LIB_DIR = /usr/lib64 LIPO = LN_S = ln -s LTLIBOBJS = -MAKEINFO = ${SHELL} /usr/dev/ipmiutil-3.0.0/missing --run makeinfo +MAKEINFO = ${SHELL} /usr/dev/ipmiutil-3.0.1/missing --run makeinfo MKDIR_P = /bin/mkdir -p NM = /usr/bin/nm -B NMEDIT = @@ -113,9 +113,9 @@ OTOOL64 = PACKAGE = ipmiutil PACKAGE_BUGREPORT = PACKAGE_NAME = ipmiutil -PACKAGE_STRING = ipmiutil 3.0.0 +PACKAGE_STRING = ipmiutil 3.0.1 PACKAGE_TARNAME = ipmiutil -PACKAGE_VERSION = 3.0.0 +PACKAGE_VERSION = 3.0.1 PATH_SEPARATOR = : PKG_DIR = /root/rpmbuild RANLIB = ranlib @@ -127,11 +127,11 @@ SHR_LINK = libipmiutil.so.1 STRIP = strip SUBDIR_S = doc scripts lib util SYSTEMD_DIR = /usr/share/ipmiutil -VERSION = 3.0.0 -abs_builddir = /usr/dev/ipmiutil-3.0.0/doc -abs_srcdir = /usr/dev/ipmiutil-3.0.0/doc -abs_top_builddir = /usr/dev/ipmiutil-3.0.0 -abs_top_srcdir = /usr/dev/ipmiutil-3.0.0 +VERSION = 3.0.1 +abs_builddir = /usr/dev/ipmiutil-3.0.1/doc +abs_srcdir = /usr/dev/ipmiutil-3.0.1/doc +abs_top_builddir = /usr/dev/ipmiutil-3.0.1 +abs_top_srcdir = /usr/dev/ipmiutil-3.0.1 ac_ct_CC = gcc ac_ct_DUMPBIN = am__include = include @@ -159,7 +159,7 @@ host_vendor = redhat htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = ${SHELL} /usr/dev/ipmiutil-3.0.0/install-sh +install_sh = ${SHELL} /usr/dev/ipmiutil-3.0.1/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale diff --git a/doc/UserGuide b/doc/UserGuide index 8205c46..6f46cd7 100644 --- a/doc/UserGuide +++ b/doc/UserGuide @@ -1,6 +1,6 @@ IPMIUTIL USER GUIDE - VERSION 3.0.0 + VERSION 3.0.1 An easy-to-use IPMI server management utility @@ -191,14 +191,15 @@ Key Strengths = supports any IPMI server platforms, detection, portability, incorporates fixes and new features quickly Target Market = Administrators, Developers, and OEMs -OS Support = Linux, Windows, Solaris, and FreeBSD - (supports Windows natively for remote or local interface) +OS Support = Linux, Windows, Solaris, FreeBSD, and MacOSX + (supports Windows natively for local or remote interface) License = BSD Drivers = For Linux: openipmi, imb, valinux ipmikcs, lan, lanplus, - landesk, and driverless direct KCS & SSIF + landesk, and driverless direct KCS or SSIF For Windows: Intel IMB and Microsoft IPMI drivers For Solaris: bmc For FreeBSD: openipmi, driverless KCS or SSIF + For MacOSX: remote only LEDs = Show/set ATCA LEDs, set identify LED, Intel Telco Alarm LEDs health = show overall health and product information discovery = find all IPMI LAN servers on a given subnet @@ -4764,16 +4765,17 @@ ipmiutil lan, completed successfully ---------------------------------------------------------------- Suppose there are a number of IPMI servers that need to have their -BMC LAN interface configured. Shell access to the servers +IPMI LAN interface configured. Shell access to the servers (via ssh or similar) is assumed. -BMC LAN, Simple case, password is not changed: +IPMI LAN, Simple case, password is not changed, default user: [ssh connection] # ipmiutil lan -e [ssh exit] -BMC LAN, Complex case, assuming that a password needs to be set and +IPMI LAN, Complex case, assuming that a password needs to be set and that the session text (or script) must encrypt the password. +Assumes that we are setting a non-default user named 'admin' below. So, using the gnupg.org utilities with public/private keys would look something like this: [ Set up list (or db) of encrypted passwords & key by nodename. @@ -4784,7 +4786,7 @@ would look something like this: # gpg --import mykey.file # mynode=`uname -n` # my_enc_psw=`grep $mynode mylist.file |cut -f2` -# ipmiutil lan -e -p `gpg --decrypt $my_enc_psw` +# ipmiutil lan -e -u admin -p `gpg --decrypt $my_enc_psw` [ssh exit] ---------------------------------------------------------------- diff --git a/doc/ilan.8 b/doc/ilan.8 index 533f5cf..87784ef 100644 --- a/doc/ilan.8 +++ b/doc/ilan.8 @@ -1,7 +1,7 @@ .TH ILAN 8 "Version 1.8: 17 Feb 2010" .SH NAME -ipmiutil_lan \- show and configure BMC LAN parameters and -set up a PEF entry to send BMC LAN Alerts for OS Critical Stop log events +ipmiutil_lan \- show and configure IPMI LAN parameters, users, and +set up a PEF rule to send BMC LAN Alerts for OS Critical Stop log events .SH SYNOPSIS .B "ipmiutil lan [-abcdefghijklmnopq#rstuvwxyzBDQK -i eth1 ]" [\-I ipadr \-M macadr \-S subnet \-B baud_sol ] @@ -13,12 +13,12 @@ set up a PEF entry to send BMC LAN Alerts for OS Critical Stop log events .SH DESCRIPTION .I ipmiutil lan -shows or sets all of the IPMI LAN Parameters to enable +shows or sets all of the IPMI LAN Parameters and users to enable remote LAN sessions or BMC LAN Alerts. The IP address and MAC address of the local system, the default gateway, and the alert destination can be defaulted to those specified in Linux, or can be overridden -by user parameters. -It also creates a new Platform Event Filter table entry for an OS Critical +by specific parameters. +It also creates a new Platform Event Filter table rule for an OS Critical Stop (0x20) SEL firmware log event, so that it will be enabled to send a BMC LAN Alert. This utility will skip the PEF records if the system does not support IPMI 1.5 or greater. diff --git a/doc/ipmiutil.spec b/doc/ipmiutil.spec index 47d1e14..4f95a86 100644 --- a/doc/ipmiutil.spec +++ b/doc/ipmiutil.spec @@ -3,7 +3,7 @@ # Copyright (c) 2012 Andy Cress # Name: ipmiutil -Version: 3.0.0 +Version: 3.0.1 Release: 1%{?dist} Summary: Easy-to-use IPMI server management utilities License: BSD @@ -12,34 +12,36 @@ Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz URL: http://ipmiutil.sourceforge.net BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) # Suggests: cron or vixie-cron or cronie or similar -%if 0%{?fedora} >= 15 -BuildRequires: systemd autoconf automake systemd-units -Requires: systemd-units -%endif %if 0%{?sles_version} >= 10 -BuildRequires: libopenssl-devel +%define bldreq0 libopenssl-devel %else -BuildRequires: openssl-devel +%define bldreq0 openssl-devel +%endif +%if 0%{?fedora} >= 15 +%define bldreq_extra systemd autoconf automake systemd-units +Requires: systemd-units +Group: System Environment/Base +%endif +%if 0%{?rhel} >= 7 +%define bldreq_extra autoconf automake systemd-units %endif %if 0%{?suse_version} >= 1210 -BuildRequires: gcc gcc-c++ libtool systemd +%define bldreq_extra gcc gcc-c++ libtool systemd %define req_systemd 1 %define unit_dir %{_unitdir} %define systemd_fls %{unit_dir} # Requires: %{?systemd_requires} %else -BuildRequires: gcc gcc-c++ libtool +%define bldreq_extra gcc gcc-c++ libtool %define systemd_fls %{_datadir}/%{name} %if 0%{?fedora} == 16 %define unit_dir /lib/systemd/system %else -%if 0%{?rhel} >= 7 -BuildRequires: systemd-units -%endif %{!?_unitdir: %define _unitdir /usr/lib/systemd/system} %define unit_dir %{_unitdir} %endif %endif +BuildRequires: %{bldreq0} %{bldreq_extra} %define init_dir %{_initrddir} %description @@ -82,7 +84,11 @@ autoconf %else %configure %endif +%if 0%{?fedora} >= 15 +make %{?_smp_mflags} +%else make +%endif %install rm -rf %{buildroot} @@ -205,11 +211,11 @@ then %else if [ -x /bin/systemctl ] && [ -d %{unit_dir} ]; then echo "IINITDIR=%{init_dir}" >>%{_datadir}/%{name}/ipmiutil.env - cp -f ${scr_dir}/ipmiutil_evt.service %{unit_dir} - cp -f ${scr_dir}/ipmiutil_asy.service %{unit_dir} - cp -f ${scr_dir}/ipmiutil_wdt.service %{unit_dir} - cp -f ${scr_dir}/ipmi_port.service %{unit_dir} - # systemctl enable ipmi_port.service >/dev/null 2>&1 || : + cp -f ${scr_dir}/ipmiutil_evt.service %{unit_dir} + cp -f ${scr_dir}/ipmiutil_asy.service %{unit_dir} + cp -f ${scr_dir}/ipmiutil_wdt.service %{unit_dir} + cp -f ${scr_dir}/ipmi_port.service %{unit_dir} + # systemctl enable ipmi_port.service >/dev/null 2>&1 || : else cp -f ${scr_dir}/ipmiutil_wdt %{init_dir} cp -f ${scr_dir}/ipmiutil_asy %{init_dir} @@ -250,10 +256,10 @@ then sensorout=$vardir/sensor_out.txt if [ ! -f $sensorout ]; then %{_bindir}/ipmiutil sensor -q >$sensorout || : - if [ $? -ne 0 ]; then - # remove file if error, try again in ipmi_port on reboot. - rm -f $sensorout - fi + if [ $? -ne 0 ]; then + # remove file if error, try again in ipmi_port on reboot. + rm -f $sensorout + fi fi fi else @@ -319,6 +325,7 @@ then fi %postun +# after uninstall, $1 = 1 if update, $1 = 0 if rpm -e /sbin/ldconfig %if 0%{?req_systemd} %service_del_postun ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service diff --git a/lib/Makefile b/lib/Makefile index 1bf1b0d..e4b621d 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -47,12 +47,12 @@ CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /usr/dev/ipmiutil-3.0.0/missing --run aclocal-1.11 -AMTAR = ${SHELL} /usr/dev/ipmiutil-3.0.0/missing --run tar +ACLOCAL = ${SHELL} /usr/dev/ipmiutil-3.0.1/missing --run aclocal-1.11 +AMTAR = ${SHELL} /usr/dev/ipmiutil-3.0.1/missing --run tar AR = ar -AUTOCONF = ${SHELL} /usr/dev/ipmiutil-3.0.0/missing --run autoconf -AUTOHEADER = ${SHELL} /usr/dev/ipmiutil-3.0.0/missing --run autoheader -AUTOMAKE = ${SHELL} /usr/dev/ipmiutil-3.0.0/missing --run automake-1.11 +AUTOCONF = ${SHELL} /usr/dev/ipmiutil-3.0.1/missing --run autoconf +AUTOHEADER = ${SHELL} /usr/dev/ipmiutil-3.0.1/missing --run autoheader +AUTOMAKE = ${SHELL} /usr/dev/ipmiutil-3.0.1/missing --run automake-1.11 AWK = gawk CC = gcc CCDEPMODE = depmode=gcc3 @@ -101,7 +101,7 @@ LIB_DIR = /usr/lib64 LIPO = LN_S = ln -s LTLIBOBJS = -MAKEINFO = ${SHELL} /usr/dev/ipmiutil-3.0.0/missing --run makeinfo +MAKEINFO = ${SHELL} /usr/dev/ipmiutil-3.0.1/missing --run makeinfo MKDIR_P = /bin/mkdir -p NM = /usr/bin/nm -B NMEDIT = @@ -115,9 +115,9 @@ OTOOL64 = PACKAGE = ipmiutil PACKAGE_BUGREPORT = PACKAGE_NAME = ipmiutil -PACKAGE_STRING = ipmiutil 3.0.0 +PACKAGE_STRING = ipmiutil 3.0.1 PACKAGE_TARNAME = ipmiutil -PACKAGE_VERSION = 3.0.0 +PACKAGE_VERSION = 3.0.1 PATH_SEPARATOR = : PKG_DIR = /root/rpmbuild RANLIB = ranlib @@ -129,11 +129,11 @@ SHR_LINK = libipmiutil.so.1 STRIP = strip SUBDIR_S = doc scripts lib util SYSTEMD_DIR = /usr/share/ipmiutil -VERSION = 3.0.0 -abs_builddir = /usr/dev/ipmiutil-3.0.0/lib -abs_srcdir = /usr/dev/ipmiutil-3.0.0/lib -abs_top_builddir = /usr/dev/ipmiutil-3.0.0 -abs_top_srcdir = /usr/dev/ipmiutil-3.0.0 +VERSION = 3.0.1 +abs_builddir = /usr/dev/ipmiutil-3.0.1/lib +abs_srcdir = /usr/dev/ipmiutil-3.0.1/lib +abs_top_builddir = /usr/dev/ipmiutil-3.0.1 +abs_top_srcdir = /usr/dev/ipmiutil-3.0.1 ac_ct_CC = gcc ac_ct_DUMPBIN = am__include = include @@ -161,7 +161,7 @@ host_vendor = redhat htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = ${SHELL} /usr/dev/ipmiutil-3.0.0/install-sh +install_sh = ${SHELL} /usr/dev/ipmiutil-3.0.1/install-sh libdir = $(iprefix)/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale diff --git a/lib/lanplus/lanplus_crypt.c b/lib/lanplus/lanplus_crypt.c index 7f3095e..5554898 100644 --- a/lib/lanplus/lanplus_crypt.c +++ b/lib/lanplus/lanplus_crypt.c @@ -623,11 +623,14 @@ int lanplus_generate_sik(struct ipmi_session * session) switch(session->v2_data.auth_alg) { case IPMI_AUTH_RAKP_HMAC_SHA1 : - if (mac_length != SHA_DIGEST_LENGTH) unsupported = 1; break; + if (mac_length != SHA_DIGEST_LENGTH) unsupported = 1; + break; case IPMI_AUTH_RAKP_HMAC_MD5 : - if (mac_length != MD5_DIGEST_LENGTH) unsupported = 1; break; + if (mac_length != MD5_DIGEST_LENGTH) unsupported = 1; + break; case IPMI_AUTH_RAKP_HMAC_SHA256: - if (mac_length != SHA256_DIGEST_LENGTH) unsupported = 1; break; + if (mac_length != SHA256_DIGEST_LENGTH) unsupported = 1; + break; default : unsupported = 1; break; } if (unsupported) { /*was assert*/ @@ -685,11 +688,14 @@ int lanplus_generate_k1(struct ipmi_session * session) switch(session->v2_data.auth_alg) { case IPMI_AUTH_RAKP_HMAC_SHA1 : - if (mac_length != SHA_DIGEST_LENGTH) unsupported = 1; break; + if (mac_length != SHA_DIGEST_LENGTH) unsupported = 1; + break; case IPMI_AUTH_RAKP_HMAC_MD5 : - if (mac_length != MD5_DIGEST_LENGTH) unsupported = 1; break; + if (mac_length != MD5_DIGEST_LENGTH) unsupported = 1; + break; case IPMI_AUTH_RAKP_HMAC_SHA256: - if (mac_length != SHA256_DIGEST_LENGTH) unsupported = 1; break; + if (mac_length != SHA256_DIGEST_LENGTH) unsupported = 1; + break; default : unsupported = 1; break; } if (unsupported) { /*was assert*/ @@ -743,11 +749,14 @@ int lanplus_generate_k2(struct ipmi_session * session) switch(session->v2_data.auth_alg) { case IPMI_AUTH_RAKP_HMAC_SHA1 : - if (mac_length != SHA_DIGEST_LENGTH) unsupported = 1; break; + if (mac_length != SHA_DIGEST_LENGTH) unsupported = 1; + break; case IPMI_AUTH_RAKP_HMAC_MD5 : - if (mac_length != MD5_DIGEST_LENGTH) unsupported = 1; break; + if (mac_length != MD5_DIGEST_LENGTH) unsupported = 1; + break; case IPMI_AUTH_RAKP_HMAC_SHA256: - if (mac_length != SHA256_DIGEST_LENGTH) unsupported = 1; break; + if (mac_length != SHA256_DIGEST_LENGTH) unsupported = 1; + break; default : unsupported = 1; break; } if (unsupported) { /*was assert*/ diff --git a/lib/lanplus/lanplus_crypt_impl.c b/lib/lanplus/lanplus_crypt_impl.c index d12ad9c..1daf230 100644 --- a/lib/lanplus/lanplus_crypt_impl.c +++ b/lib/lanplus/lanplus_crypt_impl.c @@ -196,10 +196,17 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv, { int nwritten = 0; int inlen = 0; + EVP_CIPHER_CTX *pctx; +#ifdef SSL11 + EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); + pctx = ctx; +#else EVP_CIPHER_CTX ctx; - EVP_CIPHER_CTX_init(&ctx); - EVP_EncryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv); - EVP_CIPHER_CTX_set_padding(&ctx, 0); + pctx = &ctx; +#endif + EVP_CIPHER_CTX_init(pctx); + EVP_EncryptInit_ex(pctx, EVP_aes_128_cbc(), NULL, key, iv); + EVP_CIPHER_CTX_set_padding(pctx, 0); *bytes_written = 0; if (input_length == 0) return; @@ -219,28 +226,29 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv, assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0); inlen = input_length; - if(!EVP_EncryptUpdate(&ctx, output, &nwritten, input, inlen)) + if(!EVP_EncryptUpdate(pctx, output, &nwritten, input, inlen)) { - /* Error */ - *bytes_written = 0; - return; + *bytes_written = 0; /* Error */ } else { int tmplen; - if(!EVP_EncryptFinal_ex(&ctx, output + nwritten, &tmplen)) + if(!EVP_EncryptFinal_ex(pctx, output + nwritten, &tmplen)) { - *bytes_written = 0; - return; /* Error */ + *bytes_written = 0; /* Error */ } else { /* Success */ *bytes_written = nwritten + tmplen; - EVP_CIPHER_CTX_cleanup(&ctx); + EVP_CIPHER_CTX_cleanup(pctx); } } +#ifdef SSL11 + EVP_CIPHER_CTX_free(ctx); +#endif + return; } @@ -268,10 +276,17 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv, { int nwritten = 0; int inlen = 0; + EVP_CIPHER_CTX *pctx; +#ifdef SSL11 + EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); + pctx = ctx; +#else EVP_CIPHER_CTX ctx; - EVP_CIPHER_CTX_init(&ctx); - EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv); - EVP_CIPHER_CTX_set_padding(&ctx, 0); + pctx = &ctx; +#endif + EVP_CIPHER_CTX_init(pctx); + EVP_DecryptInit_ex(pctx, EVP_aes_128_cbc(), NULL, key, iv); + EVP_CIPHER_CTX_set_padding(pctx, 0); if (verbose >= 5) { @@ -291,7 +306,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv, assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0); inlen = input_length; - if (!EVP_DecryptUpdate(&ctx, output, &nwritten, input, inlen)) + if (!EVP_DecryptUpdate(pctx, output, &nwritten, input, inlen)) { /* Error */ lprintf(LOG_DEBUG, "ERROR: decrypt update failed"); @@ -302,20 +317,20 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv, { int tmplen; - if (!EVP_DecryptFinal_ex(&ctx, output + nwritten, &tmplen)) + if (!EVP_DecryptFinal_ex(pctx, output + nwritten, &tmplen)) { char buffer[1000]; ERR_error_string(ERR_get_error(), buffer); lprintf(LOG_DEBUG, "the ERR error %s", buffer); lprintf(LOG_DEBUG, "ERROR: decrypt final failed"); *bytes_written = 0; - return; /* Error */ + goto evpfin2; } else { /* Success */ *bytes_written = nwritten + tmplen; - EVP_CIPHER_CTX_cleanup(&ctx); + EVP_CIPHER_CTX_cleanup(pctx); } } @@ -324,4 +339,9 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv, lprintf(LOG_DEBUG, "Decrypted %d encrypted bytes",input_length); printbuf(output, *bytes_written, "Decrypted this data"); } +evpfin2: +#ifdef SSL11 + EVP_CIPHER_CTX_free(ctx); +#endif + return; } diff --git a/lib/libipmiutil.pc b/lib/libipmiutil.pc index 6e717f1..e88343c 100644 --- a/lib/libipmiutil.pc +++ b/lib/libipmiutil.pc @@ -8,6 +8,6 @@ nutuser=@RUN_AS_USER@ Name: libipmiutil Description: Library for ipmiutil -Version: 3.0.0 +Version: 3.0.1 Libs: -L${libdir} -lipmi_lanplus Cflags: -I${includedir} diff --git a/scripts/Makefile b/scripts/Makefile index dff2566..7ac10e6 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -46,12 +46,12 @@ CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /usr/dev/ipmiutil-3.0.0/missing --run aclocal-1.11 -AMTAR = ${SHELL} /usr/dev/ipmiutil-3.0.0/missing --run tar +ACLOCAL = ${SHELL} /usr/dev/ipmiutil-3.0.1/missing --run aclocal-1.11 +AMTAR = ${SHELL} /usr/dev/ipmiutil-3.0.1/missing --run tar AR = ar -AUTOCONF = ${SHELL} /usr/dev/ipmiutil-3.0.0/missing --run autoconf -AUTOHEADER = ${SHELL} /usr/dev/ipmiutil-3.0.0/missing --run autoheader -AUTOMAKE = ${SHELL} /usr/dev/ipmiutil-3.0.0/missing --run automake-1.11 +AUTOCONF = ${SHELL} /usr/dev/ipmiutil-3.0.1/missing --run autoconf +AUTOHEADER = ${SHELL} /usr/dev/ipmiutil-3.0.1/missing --run autoheader +AUTOMAKE = ${SHELL} /usr/dev/ipmiutil-3.0.1/missing --run automake-1.11 AWK = gawk CC = gcc CCDEPMODE = depmode=gcc3 @@ -99,7 +99,7 @@ LIB_DIR = /usr/lib64 LIPO = LN_S = ln -s LTLIBOBJS = -MAKEINFO = ${SHELL} /usr/dev/ipmiutil-3.0.0/missing --run makeinfo +MAKEINFO = ${SHELL} /usr/dev/ipmiutil-3.0.1/missing --run makeinfo MKDIR_P = /bin/mkdir -p NM = /usr/bin/nm -B NMEDIT = @@ -113,9 +113,9 @@ OTOOL64 = PACKAGE = ipmiutil PACKAGE_BUGREPORT = PACKAGE_NAME = ipmiutil -PACKAGE_STRING = ipmiutil 3.0.0 +PACKAGE_STRING = ipmiutil 3.0.1 PACKAGE_TARNAME = ipmiutil -PACKAGE_VERSION = 3.0.0 +PACKAGE_VERSION = 3.0.1 PATH_SEPARATOR = : PKG_DIR = /root/rpmbuild RANLIB = ranlib @@ -127,11 +127,11 @@ SHR_LINK = libipmiutil.so.1 STRIP = strip SUBDIR_S = doc scripts lib util SYSTEMD_DIR = /usr/share/ipmiutil -VERSION = 3.0.0 -abs_builddir = /usr/dev/ipmiutil-3.0.0/scripts -abs_srcdir = /usr/dev/ipmiutil-3.0.0/scripts -abs_top_builddir = /usr/dev/ipmiutil-3.0.0 -abs_top_srcdir = /usr/dev/ipmiutil-3.0.0 +VERSION = 3.0.1 +abs_builddir = /usr/dev/ipmiutil-3.0.1/scripts +abs_srcdir = /usr/dev/ipmiutil-3.0.1/scripts +abs_top_builddir = /usr/dev/ipmiutil-3.0.1 +abs_top_srcdir = /usr/dev/ipmiutil-3.0.1 ac_ct_CC = gcc ac_ct_DUMPBIN = am__include = include @@ -159,7 +159,7 @@ host_vendor = redhat htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = ${SHELL} /usr/dev/ipmiutil-3.0.0/install-sh +install_sh = ${SHELL} /usr/dev/ipmiutil-3.0.1/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale diff --git a/scripts/ipmi_port.service b/scripts/ipmi_port.service index 80ed31a..3fb8d70 100644 --- a/scripts/ipmi_port.service +++ b/scripts/ipmi_port.service @@ -6,7 +6,8 @@ After=network.target Type=forking PIDFile=/run/ipmi_port.pid EnvironmentFile=/usr/share/ipmiutil/ipmiutil.env -ExecStart=/usr/share/ipmiutil/ipmiutil.setup >/dev/null && /usr/sbin/ipmi_port -b || : +ExecStartPre=/usr/share/ipmiutil/ipmiutil.setup +ExecStart=-/usr/sbin/ipmi_port -b [Install] WantedBy=multi-user.target diff --git a/setver b/setver index 7f69a0a..470f206 100755 --- a/setver +++ b/setver @@ -6,16 +6,13 @@ # [doinc?] is 'n'. # if [doinc?] is 'r', reverse increment (decrement). # -ver=3.0.0 +ver=3.0.1 rel=1 tmped=/tmp/edver.tmp tmpspec=/tmp/edspec.tmp cmdf=/tmp/cmd.tmp skipinc=0 reverseinc=0 -v12=`echo $ver |cut -f1,2 -d'.'` -v3=`echo $ver |cut -f3 -d'.'` -vras=`echo $ver |sed -e 's/\.//g'` if [ $# -gt 0 ] then @@ -35,6 +32,9 @@ then fi fi fi +v12=`echo $ver |cut -f1,2 -d'.'` +v3=`echo $ver |cut -f3 -d'.'` +vras=`echo $ver |sed -e 's/\.//g'` distro=`echo $MACHTYPE |cut -d'-' -f2` if [ "$distro" = "suse" ] diff --git a/util/Makefile.am b/util/Makefile.am index c3312ac..583cbe5 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -23,7 +23,7 @@ CMDMOD += ipmilanplus.c # CMDMOD = ipmicmd.c mem_if.c @OS_DRIVERS@ # am: configure substitutions are not allowed in _SOURCES variables LIBOBJ = ipmicmd.o mem_if.o ipmidir.o imbapi.o ipmimv.o ipmild.o ipmibmc.o ipmilipmi.o subs.o md5.o md2.o $(tmpobj)/ipmilan.o $(tmpobj)/ipmilanplus.o @LIBSENSORS@ -OEMMOD = oem_kontron.c oem_fujitsu.c oem_intel.c oem_sun.c oem_supermicro.c oem_dell.c oem_quanta.c oem_hp.c oem_newisys.c iekanalyzer.c +OEMMOD = oem_kontron.c oem_fujitsu.c oem_intel.c oem_sun.c oem_supermicro.c oem_dell.c oem_quanta.c oem_hp.c oem_newisys.c oem_lenovo.c iekanalyzer.c L2OBJ = @SAM2OBJ@ AM_CPPFLAGS += -I. -I.. -DMETACOMMAND diff --git a/util/Makefile.in b/util/Makefile.in index a745663..bf37fdf 100644 --- a/util/Makefile.in +++ b/util/Makefile.in @@ -73,7 +73,8 @@ ipmi_sample_evt_DEPENDENCIES = $(am__DEPENDENCIES_1) am__objects_1 = oem_kontron.$(OBJEXT) oem_fujitsu.$(OBJEXT) \ oem_intel.$(OBJEXT) oem_sun.$(OBJEXT) oem_supermicro.$(OBJEXT) \ oem_dell.$(OBJEXT) oem_quanta.$(OBJEXT) oem_hp.$(OBJEXT) \ - oem_newisys.$(OBJEXT) iekanalyzer.$(OBJEXT) + oem_newisys.$(OBJEXT) oem_lenovo.$(OBJEXT) \ + iekanalyzer.$(OBJEXT) am__objects_2 = ipmicmd.$(OBJEXT) mem_if.$(OBJEXT) ipmidir.$(OBJEXT) \ imbapi.$(OBJEXT) ipmimv.$(OBJEXT) ipmild.$(OBJEXT) \ ipmibmc.$(OBJEXT) ipmilipmi.$(OBJEXT) subs.$(OBJEXT) \ @@ -294,7 +295,7 @@ CMDMOD = ipmicmd.c mem_if.c ipmidir.c imbapi.c ipmimv.c ipmild.c \ # CMDMOD = ipmicmd.c mem_if.c @OS_DRIVERS@ # am: configure substitutions are not allowed in _SOURCES variables LIBOBJ = ipmicmd.o mem_if.o ipmidir.o imbapi.o ipmimv.o ipmild.o ipmibmc.o ipmilipmi.o subs.o md5.o md2.o $(tmpobj)/ipmilan.o $(tmpobj)/ipmilanplus.o @LIBSENSORS@ -OEMMOD = oem_kontron.c oem_fujitsu.c oem_intel.c oem_sun.c oem_supermicro.c oem_dell.c oem_quanta.c oem_hp.c oem_newisys.c iekanalyzer.c +OEMMOD = oem_kontron.c oem_fujitsu.c oem_intel.c oem_sun.c oem_supermicro.c oem_dell.c oem_quanta.c oem_hp.c oem_newisys.c oem_lenovo.c iekanalyzer.c L2OBJ = @SAM2OBJ@ METASOURCE = ipmiutil.c ialarms.c ihealth.c ievents.c ifru.c ifru_picmg.c igetevent.c ireset.c icmd.c ilan.c isensor.c isel.c iserial.c iwdt.c isol.c idiscover.c iconfig.c ipicmg.c ifirewall.c ifwum.c ihpm.c itsol.c idcmi.c $(OEMMOD) $(CMDMOD) LANPLUS_OBJ = $(shell ar t @LANPLUS_LIB@ 2>/dev/null) @@ -484,6 +485,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oem_hp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oem_intel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oem_kontron.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oem_lenovo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oem_newisys.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oem_quanta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oem_sun.Po@am__quote@ diff --git a/util/ialarms.c b/util/ialarms.c index 460b3eb..afa8073 100644 --- a/util/ialarms.c +++ b/util/ialarms.c @@ -75,7 +75,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* * Global variables */ -static char * progver = "3.00"; +static char * progver = "3.01"; static char * progname = "ialarms"; static char fdebug = 0; static char fbmctam = 0; diff --git a/util/icmd.c b/util/icmd.c index 3d55642..04763ae 100644 --- a/util/icmd.c +++ b/util/icmd.c @@ -78,7 +78,7 @@ extern void ipmi_lan_set_timeout(int ipmito, int tries, int pingto); /* * Global variables */ -static char * progver = "3.00"; +static char * progver = "3.01"; static char * progname = "icmd"; static char fdebug = 0; static char fquiet = 0; diff --git a/util/iconfig.c b/util/iconfig.c index 240e530..ede54ff 100644 --- a/util/iconfig.c +++ b/util/iconfig.c @@ -90,6 +90,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endif #include "ipmicmd.h" #include "oem_intel.h" +#include "oem_supermicro.h" extern int find_ifname(char *ifname); /*see idiscover.c*/ /* atoip was moved to subs.c, defined in ipmicmd.h */ @@ -171,7 +172,7 @@ typedef struct /* * Global variables */ -static char * progver = "3.00"; +static char * progver = "3.01"; static char * progname = "iconfig"; static char fdebug = 0; static char fipmilan = 0; diff --git a/util/idcmi.c b/util/idcmi.c index 5731af5..65342d6 100644 --- a/util/idcmi.c +++ b/util/idcmi.c @@ -62,7 +62,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "idcmi.h" static char * progname = "idcmi"; -static char * progver = "3.00"; +static char * progver = "3.01"; extern char fdebug; /*from ipmicmd.c*/ static uchar g_bus = PUBLIC_BUS; static uchar g_sa = BMC_SA; diff --git a/util/ievents.c b/util/ievents.c index 7ff61e1..1e7f8e2 100644 --- a/util/ievents.c +++ b/util/ievents.c @@ -76,7 +76,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define SELprintf printf #define SMS_SA 0x41 #define SMI_SA 0x21 -static char *progver = "3.00"; +static char *progver = "3.01"; static char *progname = "ievents"; static char fsensdesc = 0; /* 1= get extended sensor descriptions*/ static char fcanonical = 0; /* 1= show canonical, delimited output*/ @@ -318,8 +318,8 @@ char * batt_str[NBATT] = { /* Battery assert descriptions */ /*01*/ "Failed", /*02*/ "Present" }; char * batt_clr[NBATT] = { /* Battery deassert descriptions */ - /*00*/ "Low OK", - /*01*/ "Failed OK", + /*00*/ "Low is OK now", + /*01*/ "Failed is OK now", /*02*/ "Absent" }; #define N_NMH 6 @@ -731,6 +731,7 @@ extern int decode_sel_kontron(uchar *evt, char *obuf,int sz,char fdesc,char fdbg extern int decode_sel_fujitsu(uchar *evt, char *obuf,int sz,char fdesc,char fdbg); /*oem_fujitsu.c*/ extern int decode_sel_intel(uchar *evt, char *obuf,int sz,char fdesc,char fdbg); /*oem_intel.c*/ extern int decode_sel_supermicro(uchar *evt, char *obuf,int sz,char fdesc,char fdbg); /*oem_supermicro.c*/ +extern int decode_sel_lenovo(uchar *evt, char *obuf,int sz,char fdesc,char fdbg); /*oem_lenovo.c*/ extern int decode_sel_quanta(uchar *evt, char *obuf,int sz,char fdesc,char fdbg); /*oem_quanta.c*/ extern int decode_sel_newisys(uchar *evt, char *obuf,int sz,char fdesc,char fdbg); /*oem_newisys.c*/ extern int decode_sel_dell(uchar *evt, char *obuf,int sz,char fdesc,char fdbg); /*oem_dell.c*/ @@ -1380,6 +1381,10 @@ int decode_sel_oem(int vend, uchar *pevt, char *outbuf,int szbuf, case VENDOR_SUPERMICROX: rv = decode_sel_supermicro(pevt,outbuf,szbuf,fdesc,fdbg); break; + case VENDOR_LENOVO: + case VENDOR_LENOVO2: + rv = decode_sel_lenovo(pevt,outbuf,szbuf,fdesc,fdbg); + break; case VENDOR_QUANTA: rv = decode_sel_quanta(pevt,outbuf,szbuf,fdesc,fdbg); break; @@ -1850,6 +1855,23 @@ int decode_sel_entry( uchar *pevt, char *outbuf, int szbuf) else { pstr = "ProcErr Asserted"; sev = SEV_CRIT; } } break; + case 0x08: /*Power Supply*/ + pstr = NULL; /*falls through to unknown*/ + if ((psel->event_trigger == 0x0b) || + (psel->event_trigger == 0x8b)) { + rv = decode_redund(psel->event_trigger, + psel->event_data1, mystr, &sev); + if (rv == 0) pstr = mystr; + } else { + pstr = get_misc_desc( psel->generator_id, + psel->sensor_type, + psel->sensor_number, + psel->event_trigger, + psel->event_data1, + psel->event_data2, + psel->event_data3, &sev); + } + break; case 0x09: /*Power Unit*/ if ((psel->event_trigger == 0x0b) || (psel->event_trigger == 0x8b)) { diff --git a/util/ifirewall.c b/util/ifirewall.c index 9048de0..7938cd9 100644 --- a/util/ifirewall.c +++ b/util/ifirewall.c @@ -64,7 +64,7 @@ /* global variables */ static char * progname = "ifirewall"; -static char * progver = "3.00"; +static char * progver = "3.01"; static char fdebug = 0; static uchar g_bus = PUBLIC_BUS; static uchar g_sa = BMC_SA; diff --git a/util/ifru.c b/util/ifru.c index 2390354..f9d35df 100644 --- a/util/ifru.c +++ b/util/ifru.c @@ -116,7 +116,7 @@ extern int ipmi_kontronoem_main(void * intf, int argc, char ** argv); #endif static char *progname = "ifru"; -static char *progver = "3.00"; +static char *progver = "3.01"; static int vend_id = 0; static int prod_id = 0; static char fdebug = 0; diff --git a/util/ifruset.c b/util/ifruset.c index 652167f..360b84b 100644 --- a/util/ifruset.c +++ b/util/ifruset.c @@ -106,7 +106,7 @@ extern void fmt_time(time_t etime, char *buf, int bufsz); /*see ievents.c*/ #define IPROD_OEM 7 static char *progname = "ifruset"; -static char *progver = "3.00"; +static char *progver = "3.01"; static char fdebug = 0; static char fpicmg = 0; static char fonlybase = 0; diff --git a/util/igetevent.c b/util/igetevent.c index f73c71f..4b0de05 100644 --- a/util/igetevent.c +++ b/util/igetevent.c @@ -169,7 +169,7 @@ extern void free_sdr_cache(uchar *pret); /*see isensor.c*/ * Global variables */ static char * progname = "igetevent"; -static char * progver = "3.00"; +static char * progver = "3.01"; static char fdebug = 0; static char fipmilan = 0; static char frunonce = 0; diff --git a/util/ihealth.c b/util/ihealth.c index 1389ba2..db228bf 100644 --- a/util/ihealth.c +++ b/util/ihealth.c @@ -82,7 +82,7 @@ extern int oem_supermicro_get_firmware_str(char *pstr, int sz); /*oem_supermicro * Global variables */ static char * progname = "ihealth"; -static char * progver = "3.00"; +static char * progver = "3.01"; static char fdebug = 0; static char fipmilan = 0; static char fcanonical = 0; @@ -634,6 +634,11 @@ void show_devid_all(int dtype, uchar *devrec, int sdevrec) if (prod >= 0x200) prodstr = "(iRMC S2)"; else prodstr = ""; break; + case VENDOR_LENOVO: + case VENDOR_LENOVO2: + if (prod == 0x143) prodstr = "(x3650 M4)"; + else prodstr = ""; + break; case VENDOR_CISCO: /*=0x00168b, 5771.*/ if (prod == 0x0005) prodstr = "(UCS C200)"; else prodstr = ""; @@ -763,6 +768,8 @@ void show_devid_all(int dtype, uchar *devrec, int sdevrec) case 1636: prodstr = "(X9DRH)"; break; /*0x0664*/ case 1643: prodstr = "(X9SRL)"; break; /*0x066b*/ case 1797: prodstr = "(X9DR7)"; break; /*0x0705*/ + case 2097: prodstr = "(X10DRL)"; /*0x0831*/ + do_powerstate = 0; break; case 2137: prodstr = "(X10DRH)"; break; /*0x0859*/ case 4520: prodstr = "(H8DGU)"; break; case 43025: prodstr = "(H8DGU-F)"; break; @@ -790,7 +797,7 @@ void show_devid_all(int dtype, uchar *devrec, int sdevrec) prodstr = ""; break; } /*end switch(prod)*/ - if (prodstr == "") prodstr = getdmiprod(); + if (prodstr[0] == '\0') prodstr = getdmiprod(); if (kcs_loops != 0) set_max_kcs_loops(kcs_loops); } /*end-else BMC*/ diff --git a/util/ilan.c b/util/ilan.c index 91dda48..0c47e4d 100644 --- a/util/ilan.c +++ b/util/ilan.c @@ -305,7 +305,7 @@ extern char *get_sensor_type_desc(uchar stype); /*from ievents.c*/ /* * Global variables */ -static char * progver = "3.00"; +static char * progver = "3.01"; static char * progname = "ilan"; static char fdebug = 0; static char fipmilan = 0; @@ -4745,12 +4745,12 @@ main(int argc, char **argv) if (ret != 0) { nerrs++; lasterr = ret; } else ngood++; } - if (lan_user != 0) { + if (lan_user != 0) { j = DisableUser(lan_user); /*disable this lan user*/ printf("DisableUser(%d), ret = %d\n",lan_user,j); if (j != 0) { nerrs++; lasterr = j; } - else ngood++; - } + else ngood++; + } LanRecord.data[0] = 0x01; /* static IP address source */ ret = SetLanEntry(4, &LanRecord, 1); printf("SetLanEntry(4), ret = %d\n",ret); diff --git a/util/imbapi.c b/util/imbapi.c index dd62e8b..3859e0d 100644 --- a/util/imbapi.c +++ b/util/imbapi.c @@ -441,7 +441,7 @@ SendTimedIpmbpRequest ( sizeof( responseData ), & respLength, NULL); - if (fdebug) printf("sendIpmb: send_message status=%d rlen=%d cc=%x\n", + if (fdebug) printf("sendIpmb: send_message status=%d rlen=%lu cc=%x\n", status,respLength,resp->cCode); if ( status != TRUE ) { DWORD error; @@ -478,7 +478,7 @@ SendTimedIpmbpRequest ( sizeof( responseData ), & respLength, NULL); - if (fdebug) printf("sendIpmb: get_message status=%d rlen=%d cc=%x\n", + if (fdebug) printf("sendIpmb: get_message status=%d rlen=%lu cc=%x\n", status,respLength,resp->cCode); if ( status != TRUE ) { DWORD error; @@ -1322,7 +1322,7 @@ SendTimedEmpMessageResponse_Ex ( #endif if (fdebug) { - printf("SendTimedEmp(%x,%x): status=%d cc=%x rlen=%d i=%d\n", + printf("SendTimedEmp(%x,%x): status=%d cc=%x rlen=%lu i=%d\n", sessionHandle, channelNumber, status,responseData[0],respLength,i); _dump_buf("requestData",requestData,sizeof(requestData),0); @@ -1428,7 +1428,7 @@ SendTimedLanMessageResponse( ); if (fdebug) { - printf("SendTimedLan(): status=%d cc=%x rlen=%d i=%d\n", + printf("SendTimedLan(): status=%d cc=%x rlen=%lu i=%d\n", status, responseData[0],respLength,i); _dump_buf("requestData",requestData,sizeof(requestData),0); } @@ -1579,7 +1579,7 @@ SendTimedLanMessageResponse_Ex( DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status); #endif if (fdebug) { - printf("SendTimedLan(%x,%x): status=%d cc=%x rlen=%d i=%d\n", + printf("SendTimedLan(%x,%x): status=%d cc=%x rlen=%lu i=%d\n", sessionHandle, channelNumber, status,responseData[0],respLength,i); if (responseData[0] != 0) /*0xcc == invalid request data*/ @@ -2020,7 +2020,7 @@ IsAsyncMessageAvailable (HandleType eventId ) if ( AsyncEventHandle != eventId) { #ifdef LINUX - printf("Invalid AsyncHandle %x!=%x\n",AsyncEventHandle,eventId); + printf("Invalid AsyncHandle %lx!=%lx\n",AsyncEventHandle,eventId); #endif return ACCESN_ERROR; } @@ -2239,7 +2239,7 @@ RegisterForImbAsyncMessageNotification (HandleType *handleId) if( (respLength != sizeof(int)) || (status != TRUE )) { if (fdebug) { - printf("RegisterForImbAsync error status=%d, len=%d sizeint=%d\n", status, respLength, sizeof(int)); + printf("RegisterForImbAsync error status=%d, len=%lu sizeint=%lu\n", status, respLength, sizeof(int)); if( respLength != sizeof(int)) printf("Async len err\n"); if( status != TRUE) printf("Async status err\n"); } diff --git a/util/ipicmg.c b/util/ipicmg.c index a85bde9..735ad87 100644 --- a/util/ipicmg.c +++ b/util/ipicmg.c @@ -81,7 +81,7 @@ /* Global data */ static char * progname = "ipicmg"; -static char * progver = "3.00"; +static char * progver = "3.01"; static char fdebug = 0; static char fset_mc = 0; static uint8_t g_bus = PUBLIC_BUS; diff --git a/util/ipmicmd.c b/util/ipmicmd.c index ffb59e2..45d6e8c 100644 --- a/util/ipmicmd.c +++ b/util/ipmicmd.c @@ -1050,7 +1050,6 @@ int ipmi_getpicmg(uchar *presp, int sresp, char fdebug) int ipmi_getdeviceid(uchar *presp, int sresp, char fdebug) { int rc, i; uchar cc; - char mbstr[80] = "unknown"; /* check that sresp is big enough (default is 15 bytes for Langley)*/ if (sresp < 15) return(ERR_BAD_LENGTH); diff --git a/util/ipmicmd.h b/util/ipmicmd.h index 02a0052..9e13d4e 100644 --- a/util/ipmicmd.h +++ b/util/ipmicmd.h @@ -312,6 +312,8 @@ struct oemvalstr { #define VENDOR_XYRATEX 1993 #define VENDOR_NEWISYS 9237 #define VENDOR_CISCO 5771 /*=0x168B*/ +#define VENDOR_LENOVO 0x004A66 +#define VENDOR_LENOVO2 0x004F4D #define PRODUCT_QUANTA_S99Q 21401 #define PRODUCT_QUANTA_QSSC_S4R 64 /*0x0040*/ diff --git a/util/ipmidir.c b/util/ipmidir.c index 2aeb6f3..12b379c 100644 --- a/util/ipmidir.c +++ b/util/ipmidir.c @@ -415,13 +415,13 @@ int ipmi_open_direct(int fdebugcmd) g_DriverType = DRV_SMB; mBMC_baseAddr = mybase; } else { /*0x01==KCS*/ - g_DriverType = DRV_KCS; + g_DriverType = DRV_KCS; + BMC_base = mybase; if (sa == 0x20 && mybase != 0) { /*valid*/ kcsBaseAddress = mybase; kcs_inc = inc; } } - BMC_base = mybase; DBGP("smbios: Driver=%d(%s), sa=%02x, Base=0x%04x, Spacing=%d\n", g_DriverType,BmcDesc(g_DriverType),sa,mybase,inc); } else { @@ -1207,7 +1207,7 @@ int ImbInit_dir(void) uchar iftype, iver, sa, inc; int mybase, status; char *ifstr; - status = get_IpmiStruct(&iftype,&iver,&sa,&mybase,&inc); + status = get_IpmiStruct(&iftype,&iver,&sa,&mybase,&inc); if (status == 0) { if (iftype == 0x04) { g_DriverType = DRV_SMB; @@ -1215,13 +1215,13 @@ int ImbInit_dir(void) mBMC_baseAddr = mybase; } else /*0x01==KCS*/ { g_DriverType = DRV_KCS; + BMC_base = mybase; ifstr = "KCS"; if (sa == BMC_SA && mybase != 0) { /*valid*/ kcsBaseAddress = mybase; kcs_inc = inc; } } - BMC_base = mybase; DBGP("SMBIOS IPMI Record found: type=%s sa=%02x base=0x%04x spacing=%d\n", ifstr, sa, mybase, inc); } @@ -1230,9 +1230,14 @@ int ImbInit_dir(void) /* Use KCS here. There are no known SMBus implementations on 64-bit */ if (BMC_base == 0) { DBGP("No IPMI Data Structure Found in SMBIOS Table,\n"); +#ifdef TRY_KCS g_DriverType = DRV_KCS; - BMC_base = kcsBaseAddress; + BMC_base = kcsBaseAddress; DBGP("Continuing with KCS on Default Port 0x%04x\n",kcsBaseAddress); +#else + printf("No IPMI interface detected...Exiting\n"); + return ERR_NO_DRV; +#endif } #if defined(BSD) || defined(MACOS) || defined(HPUX) iofd = open("/dev/io",O_RDWR); @@ -1242,14 +1247,14 @@ int ImbInit_dir(void) } #endif if (g_DriverType == DRV_SMB) { - /* Perhaps add controller type in ipmi_if.txt (?)*/ - /* Intel SSIF: 0x0540=SJR, 0x0400=STP */ - if (mBMC_baseAddr == 0x540 || mBMC_baseAddr == 0x400) - SMBChar.Controller = INTEL_SMBC; - else /*else try ServerWorks*/ - SMBChar.Controller = SW_SMBC; - SMBChar.baseAddr = mBMC_baseAddr; - DBGP("BMC SSIF/SMBus Interface at i2c=%02x base=0x%04x\n", + /* Perhaps add controller type in ipmi_if.txt (?)*/ + /* Intel SSIF: 0x0540=SJR, 0x0400=STP */ + if (mBMC_baseAddr == 0x540 || mBMC_baseAddr == 0x400) + SMBChar.Controller = INTEL_SMBC; + else /*else try ServerWorks*/ + SMBChar.Controller = SW_SMBC; + SMBChar.baseAddr = mBMC_baseAddr; + DBGP("BMC SSIF/SMBus Interface at i2c=%02x base=0x%04x\n", mBMCADDR,mBMC_baseAddr); } if (g_DriverType == DRV_KCS) { diff --git a/util/ipmilan.c b/util/ipmilan.c index acea438..fb5a477 100644 --- a/util/ipmilan.c +++ b/util/ipmilan.c @@ -680,8 +680,6 @@ sig_abort(int sig) { static int sig_aborting = 0; int rv; - // uchar buf_rs[4]; - // uchar *cmd_rs; if (sig_aborting == 0) { sig_aborting = 1; @@ -1057,7 +1055,7 @@ static int _send_lan_cmd(SockType s, uchar *pcmd, int scmd, uchar *presp, } clen = hlen + msglen; if (clen > sizeof(cbuf)) { - fprintf(fpdbg,"message size %d > buffer size %d\n",clen,sizeof(cbuf)); + fprintf(fpdbg,"message size %d > buffer size %lu\n",clen,sizeof(cbuf)); return(LAN_ERR_TOO_SHORT); } @@ -2242,7 +2240,6 @@ int lan_recv_sol( SOL_RSP_PKT *rsp ) uchar rdata[MAX_BUFFER_SIZE]; int rlen, hlen; IPMI_HDR *phdr; - int fdoauth = 1; uchar *pdata; int itry; int flags; @@ -2250,7 +2247,6 @@ int lan_recv_sol( SOL_RSP_PKT *rsp ) phdr = &ipmi_hdr; rsp->data = rsdata; - fdoauth = 0; hlen = SOL_HLEN; rlen = 0; if (fdebuglan) diff --git a/util/ipmimv.c b/util/ipmimv.c index 8962ef5..4cf995d 100644 --- a/util/ipmimv.c +++ b/util/ipmimv.c @@ -241,16 +241,16 @@ static void dbgmsg(char *pattn, ...) fflush( fpdbg ); } -int set_cloexec(fd,fdebugcmd) +int set_cloexec(int fd, int fdebugcmd) { int flags; - flags = fcntl(ipmi_fd, F_GETFD); + flags = fcntl(fd, F_GETFD); if (flags == -1) { if (fdebugcmd) printf("fcntl(get) errno = %d\n",errno); return -1; } flags |= FD_CLOEXEC; - if (fcntl(ipmi_fd, F_SETFD, flags) == -1) + if (fcntl(fd, F_SETFD, flags) == -1) { if (fdebugcmd) printf("fcntl(set) errno = %d\n",errno); return -1; diff --git a/util/ipmiutil.c b/util/ipmiutil.c index 167236d..43acf40 100644 --- a/util/ipmiutil.c +++ b/util/ipmiutil.c @@ -57,7 +57,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "ipmiutil.h" static char *progname = "ipmiutil"; -static char *progver = "3.00"; +static char *progver = "3.01"; // static char fdebug = 0; /*int ipmiutil(int argc, char **argv); */ @@ -83,7 +83,7 @@ static struct { { 11, "getevent", i_getevt, "get IPMI events and display them, event daemon" }, { 12, "health", i_health, "check and show the basic health of the IPMI BMC"}, { 13, "hpm", i_hpm, "HPM firmware update manager extensions" }, - { 14, "lan", i_lan, "show/set IPMI LAN parameters and PEF table"}, + { 14, "lan", i_lan, "show/set IPMI LAN parameters, users, PEF rules"}, { 15, "picmg", i_picmg, "show/set picmg extended functions" }, { 25, "power", i_reset, "issue IPMI reset or power control to the system"}, { 16, "reset", i_reset, "issue IPMI reset or power control to the system"}, diff --git a/util/ipmiutil.mak b/util/ipmiutil.mak index 9d63953..021851a 100644 --- a/util/ipmiutil.mak +++ b/util/ipmiutil.mak @@ -83,10 +83,10 @@ E_OBJ=$(TMP_D)\ipmiutil.obj \ $(TMP_D)\iconfig.obj $(TMP_D)\igetevent.obj $(TMP_D)\isensor.obj \ $(TMP_D)\isel.obj $(TMP_D)\ievents.obj \ $(TMP_D)\ipicmg.obj $(TMP_D)\ifirewall.obj \ - $(TMP_D)\iekanalyzer.obj $(TMP_D)\ifru_picmg.obj \ - $(TMP_D)\oem_kontron.obj $(TMP_D)\ihpm.obj $(TMP_D)\ifwum.obj \ - $(TMP_D)\oem_fujitsu.obj $(TMP_D)\oem_intel.obj \ - $(TMP_D)\oem_sun.obj $(TMP_D)\oem_dell.obj $(TMP_D)\oem_hp.obj \ + $(TMP_D)\iekanalyzer.obj $(TMP_D)\ifru_picmg.obj \ + $(TMP_D)\oem_kontron.obj $(TMP_D)\ihpm.obj $(TMP_D)\ifwum.obj \ + $(TMP_D)\oem_fujitsu.obj $(TMP_D)\oem_intel.obj $(TMP_D)\oem_lenovo.obj \ + $(TMP_D)\oem_sun.obj $(TMP_D)\oem_dell.obj $(TMP_D)\oem_hp.obj \ $(TMP_D)\oem_supermicro.obj $(TMP_D)\itsol.obj $(TMP_D)\idcmi.obj \ $(TMP_D)\oem_quanta.obj $(TMP_D)\oem_newisys.obj $(CMD_OBJ) mem_if.obj @@ -330,6 +330,9 @@ $(TMP_D)\oem_hp.obj: oem_hp.c $(TMP_D)\oem_supermicro.obj: oem_supermicro.c $(CC) /c $(CFLAGS_M) /Fo$(TMP_D)\oem_supermicro.obj oem_supermicro.c +$(TMP_D)\oem_lenovo.obj: oem_lenovo.c + $(CC) /c $(CFLAGS_M) /Fo$(TMP_D)\oem_lenovo.obj oem_lenovo.c + $(TMP_D)\oem_quanta.obj: oem_quanta.c $(CC) /c $(CFLAGS_M) /Fo$(TMP_D)\oem_quanta.obj oem_quanta.c diff --git a/util/ipmiutil64.mak b/util/ipmiutil64.mak index 45e1bec..27f0a50 100644 --- a/util/ipmiutil64.mak +++ b/util/ipmiutil64.mak @@ -83,10 +83,10 @@ E_OBJ=$(TMP_D)\ipmiutil.obj \ $(TMP_D)\iconfig.obj $(TMP_D)\igetevent.obj $(TMP_D)\isensor.obj \ $(TMP_D)\isel.obj $(TMP_D)\ievents.obj \ $(TMP_D)\ipicmg.obj $(TMP_D)\ifirewall.obj \ - $(TMP_D)\iekanalyzer.obj $(TMP_D)\ifru_picmg.obj \ - $(TMP_D)\oem_kontron.obj $(TMP_D)\ihpm.obj $(TMP_D)\ifwum.obj \ - $(TMP_D)\oem_fujitsu.obj $(TMP_D)\oem_intel.obj \ - $(TMP_D)\oem_sun.obj $(TMP_D)\oem_dell.obj $(TMP_D)\oem_hp.obj \ + $(TMP_D)\iekanalyzer.obj $(TMP_D)\ifru_picmg.obj \ + $(TMP_D)\oem_kontron.obj $(TMP_D)\ihpm.obj $(TMP_D)\ifwum.obj \ + $(TMP_D)\oem_fujitsu.obj $(TMP_D)\oem_intel.obj $(TMP_D)\oem_lenovo.obj \ + $(TMP_D)\oem_sun.obj $(TMP_D)\oem_dell.obj $(TMP_D)\oem_hp.obj \ $(TMP_D)\oem_supermicro.obj $(TMP_D)\itsol.obj $(TMP_D)\idcmi.obj \ $(TMP_D)\oem_quanta.obj $(TMP_D)\oem_newisys.obj $(CMD_OBJ) mem_if.obj @@ -330,6 +330,9 @@ $(TMP_D)\oem_hp.obj: oem_hp.c $(TMP_D)\oem_supermicro.obj: oem_supermicro.c $(CC) /c $(CFLAGS_M) /Fo$(TMP_D)\oem_supermicro.obj oem_supermicro.c +$(TMP_D)\oem_lenovo.obj: oem_lenovo.c + $(CC) /c $(CFLAGS_M) /Fo$(TMP_D)\oem_lenovo.obj oem_lenovo.c + $(TMP_D)\oem_quanta.obj: oem_quanta.c $(CC) /c $(CFLAGS_M) /Fo$(TMP_D)\oem_quanta.obj oem_quanta.c diff --git a/util/ireset.c b/util/ireset.c index 679ce97..d0d30de 100644 --- a/util/ireset.c +++ b/util/ireset.c @@ -108,7 +108,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* * Global variables */ -static char * progver = "3.00"; +static char * progver = "3.01"; static char * progname = "ireset"; static uchar ipmi_maj; static uchar ipmi_min; diff --git a/util/isel.c b/util/isel.c index a2b5703..909e28c 100644 --- a/util/isel.c +++ b/util/isel.c @@ -162,7 +162,7 @@ typedef struct #define RDATA_OFFSET 13 //byte offset to the record event data static char *progname = "isel"; -static char *progver = "3.00"; +static char *progver = "3.01"; #ifdef WIN32 #define IDXFILE "sel.idx" static char idxfile[80] = IDXFILE; diff --git a/util/iseltime.c b/util/iseltime.c index 1b2cc95..a61fd34 100644 --- a/util/iseltime.c +++ b/util/iseltime.c @@ -75,7 +75,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* * Global variables */ -static char * progver = "3.00"; +static char * progver = "3.01"; static char * progname = "iseltime"; static char fdebug = 0; static char fset = 0; diff --git a/util/isensor.c b/util/isensor.c index a59e18b..9456613 100644 --- a/util/isensor.c +++ b/util/isensor.c @@ -164,10 +164,12 @@ extern int decode_sensor_supermicro(uchar *sdr,uchar *reading,char *pstring, int slen); /*see oem_supermicro.c*/ extern int decode_sensor_quanta(uchar *sdr,uchar *reading,char *pstring, int slen); /*see oem_quanta.c*/ -extern int decode_sensor_hp(uchar *sdr,uchar *reading,char *pstring, - int slen); /*see oem_hp.c*/ extern int decode_sensor_dell(uchar *sdr,uchar *reading,char *pstring, int slen); /*see oem_dell.c*/ +extern int decode_sensor_lenovo(uchar *sdr,uchar *reading,char *pstring, + int slen); /*see oem_lenovo.c*/ +extern int decode_sensor_hp(uchar *sdr,uchar *reading,char *pstring, + int slen); /*see oem_hp.c*/ extern void show_oemsdr_hp(uchar *sdr); #else int is_romley(int vend, int prod) { @@ -252,7 +254,7 @@ char *decode_entity_id(int id) { * Global Data ************************/ static char *progname = "isensor"; -static char *progver = "3.00"; +static char *progver = "3.01"; #ifdef WIN32 static char savefile[] = "%ipmiutildir%\\thresholds.cmd"; #else @@ -314,7 +316,7 @@ static int prod_id; * This is used to decode the sensor reading types and meanings. * Use IPMI Table 36-1 and 36-2 for this. */ -#define N_DSTATUS 82 +#define N_DSTATUS 101 #define STR_CUSTOM 58 #define STR_OEM 71 #define STR_AC_LOST 76 @@ -351,10 +353,10 @@ static char *sensor_dstatus[N_DSTATUS] = { /*19 Avl */ "RedunLost", /*20 Avl */ "RedunDegr", /* ACPI Device Power States */ -/*21 ACPI*/ "Off ", -/*22 ACPI*/ "Working", +/*21 ACPI*/ "Off ", /*D3*/ +/*22 ACPI*/ "Working", /*D1*/ /*23 ACPI*/ "Sleeping", /*D2/S2*/ -/*24 ACPI*/ "On", +/*24 ACPI*/ "On", /*D0*/ /* Critical Interrupt event states */ /*25 CrI */ "FP_NMI ", /*26 CrI */ "Bus_TimOut", @@ -424,7 +426,26 @@ static char *sensor_dstatus[N_DSTATUS] = { /*78 PS */ "Config_Err", /*79 HSC */ "Offline", /*80 HSC */ "Rebuilding", -/*81 other*/ " _ " +/*81 other*/ " _ ", +/*82 Avl */ "NonRedund_Sufficient", +/*83 Avl */ "NonRedund_Insufficient", +/*84 Usage */ "Idle", +/*85 Usage */ "Active", +/*86 Usage */ "Busy", +/*87 Trans */ "Non-Critical", +/*88 Trans */ "Critical", +/*89 Trans */ "Non-Recoverable", +/*90 Trans */ "Monitor", +/*91 Trans */ "Informational", +/*92 State */ "Running", +/*93 State */ "In_Test", +/*94 State */ "Power_Off", +/*95 State */ "Online", +/*96 State */ "Offline", +/*97 State */ "Off_Duty", +/*98 State */ "Degraded", +/*99 State */ "PowerSave", +/*100 State */ "InstallError" }; static char *raid_states[9] = { /*for sensor type 0x0d drive status */ @@ -1941,6 +1962,10 @@ int decode_oem_sensor(uchar *sdr,uchar *reading,char *pstring,int slen) case VENDOR_DELL: rv = decode_sensor_dell(sdr, reading, pstring, slen); break; + case VENDOR_LENOVO: + case VENDOR_LENOVO2: + rv = decode_sensor_lenovo(sdr, reading, pstring, slen); + break; default: break; } /*end-switch vend_id*/ @@ -2109,6 +2134,97 @@ ShowThresh(int flg, uchar bits, uchar *vals, uchar *sdr) } /*endif full sdr*/ } +int decode_comp_generic(uchar type, uchar evtype, uchar num, ushort reading) +{ + int istr = 0; + uchar b; + /* decode via evtype */ + switch(evtype) + { + case 0x02: + if (reading & 0x01) istr = 85; /* Active */ + if (reading & 0x02) istr = 86; /* Busy */ + else istr = 84; /* Idle (OK)) */ + case 0x03: + if (reading & 0x01) istr = 13; /* Asserted */ + else istr = 0; /* "OK" Deasserted */ + break; + case 0x04: + if (reading & 0x01) istr = 15; /* Predictive Failure */ + else istr = 0; /* "OK" Deasserted */ + break; + case 0x05: + if (reading & 0x01) istr = 65; /* Limit Exceeded*/ + else istr = 0; /* "OK" LimitNotExceeded*/ + break; + case 0x07: /* transition */ + b = bitnum(reading); + switch(b) { + case 0: istr = 0; break; /*no bits set, OK*/ + case 1: istr = 87; break; /*transition up to Non-Critical*/ + case 2: istr = 88; break; /*transition up to Critical */ + case 3: istr = 89; break; /*transition up to Non-recoverable */ + case 4: istr = 87; break; /*transition down to Non-Critical */ + case 5: istr = 88; break; /*transition down to Critical */ + case 6: istr = 89; break; /*transition to Non-recoverable */ + case 7: istr = 90; break; /*Monitor*/ + case 8: istr = 91; break; /*Informational*/ + default: istr = 8; break; /*'OK*'*/ + } + break; + case 0x08: + if (reading & 0x01) istr = 9; /* Present */ + else istr = 10; /*Absent*/ + break; + case 0x09: /* Availability event states */ + if (reading & 0x01) istr = 17; /* Enabled */ + else istr = 16; /*Disabled*/ + break; + case 0x0A: /* */ + b = (reading & 0x7f); + switch(b) { + case 0x00: istr = 8; break; /* 00 'OK*'*/ + case 0x01: istr = 92; break; /* transition to Running */ + case 0x02: istr = 93; break; /* transition to In Test */ + case 0x04: istr = 94; break; /* transition to Power Off */ + case 0x08: istr = 95; break; /* transition to On Line */ + case 0x10: istr = 96; break; /* transition to Off Line */ + case 0x20: istr = 97; break; /* transition to Off Duty */ + case 0x40: istr = 98; break; /* transition to Degraded */ + case 0x80: istr = 99; break; /* transition to Power Save */ + default: istr = 100; break; /* Install Error */ + } + break; + case 0x0B: /* Redundancy */ + b = (reading & 0x7f); + switch(b) { + case 0x00: istr = 8; break; /* 00 'OK*'*/ + case 0x01: istr = 18; break; /* 01 Fully Redundant */ + case 0x02: istr = 19; break; /* 02 Redundancy Lost */ + case 0x04: istr = 20; break; /* 04 Redundancy Degraded */ + case 0x08: istr = 82; break; /* 08 Non-Redundant/Sufficient down */ + case 0x10: istr = 82; break; /* 10 Non-Redundant/Sufficient up*/ + case 0x20: istr = 83; break; /* 20 Non-Redundant/Insufficient */ + case 0x40: istr = 20; break; /* 40 Redundancy Degraded down */ + default: istr = 20; break; /* Redundancy Degraded up */ + } + break; + case 0x0C: /* ACPI Power States */ + if (reading & 0x04) istr = 21; /* D3, Off */ + else if (reading & 0x02) istr = 23; /* D2, Sleeping */ + else if (reading & 0x01) istr = 22; /* D1, Working */ + else istr = 24; /*D0, On*/ + break; + default: + if (fdebug) + printf("sensor[%x] et %02x type %02x not decoded, reading = %04x\n", + num,evtype,type,reading); + istr = STR_OTHER; /* other " - " */ + break; + } + return(istr); +} + /* * decode_comp_reading * @@ -2147,10 +2263,10 @@ decode_comp_reading(uchar type, uchar evtype, uchar num, } else if (evtype == 0x05) { /* see CPU1 VRD Temp on S5000, snum 0xc0 thru 0xcf */ if (reading & 0x01) istr = 65; /* Limit Exceeded*/ - else istr = 0; /* "OK" LimitNotExceeded*/ + else istr = 0; /* "OK" LimitNotExceeded*/ } else if (evtype == 0x03) { if (reading & 0x01) istr = 13; /* Asserted */ - else istr = 0; /* "OK" Deasserted */ + else istr = 0; /* "OK" Deasserted */ } else { /* evtype == other 0x05 */ if (reading & 0x01) istr = 0; /* 8="OK*", 0="OK" */ else istr = 5; /*state asserted, Crit-hi */ @@ -2351,8 +2467,8 @@ decode_comp_reading(uchar type, uchar evtype, uchar num, case 7: case 8: case 11: - case 13: istr = 21; break; /*Off*/ case 12: istr = 24; break; /*On*/ + case 13: istr = 21; break; /*Off*/ default: istr = 41; /*unknown*/ } break; @@ -2378,8 +2494,12 @@ decode_comp_reading(uchar type, uchar evtype, uchar num, else istr = 42; /* NotAvailable */ break; case 0x28: /* BMC FW Health */ - if (reading == 0) istr = 0; /*OK*/ - else istr = 12; /*Faulty*/ + if (evtype == 0x6F) { /*Sensor-specific*/ + if (reading == 0) istr = 0; /*OK*/ + else istr = 12; /*Faulty*/ + } else { /*use event/reading type*/ + istr = decode_comp_generic(type, evtype, num, reading); + } break; case 0x29: /* Battery */ switch(reading & 0x7f) { @@ -2395,8 +2515,8 @@ decode_comp_reading(uchar type, uchar evtype, uchar num, else istr = 46; /*Deactivated*/ break; case 0x2B: /* Version Change */ - b = bitnum(reading1); - switch(b) { + b = bitnum(reading1); + switch(b) { case 0: istr = 0; break; /*OK, no bits set*/ case 1: istr = 72; break; /*HW Changed, bit 0 set*/ case 2: istr = 73; break; /*SW Changed, bit 1 set*/ @@ -2404,9 +2524,7 @@ decode_comp_reading(uchar type, uchar evtype, uchar num, default: istr = 75; break; /*Change error*/ } break; - case 0x60: /* SCSI 1 Term Flt */ - case 0x61: /* SCSI 2 Term Flt */ - break; + /* sensor types 0xC0 - 0xFF are OEM RESERVED */ case 0xF1: /* ATCA IPMB-0 Sensor */ if ((reading & 0x7fff) == 0x0008) istr = 0; /*OK*/ @@ -2418,13 +2536,14 @@ decode_comp_reading(uchar type, uchar evtype, uchar num, case 0xF2: /* ATCA Module HotSwap, TODO: refine this */ case 0xF3: /* SMI Timeout, etc. */ if (reading & 0x01) istr = 13; /* Asserted */ - else istr = 0; /* "OK", Deasserted */ + else istr = 0; /* "OK", Deasserted */ break; + + case 0x60: /* SCSI 1 Term Flt */ + case 0x61: /* SCSI 2 Term Flt */ default: - if (fdebug) - printf("sensor[%x] type %02x not decoded, reading = %04x\n", - num,type,reading); - istr = STR_OTHER; /* other " - " */ + istr = decode_comp_generic(type, evtype, num, reading); + break; } return(istr); } /* end decode_comp_reading */ @@ -2553,7 +2672,7 @@ ShowSDR(char *tag, uchar *sdr) sens[0], sensor_dstatus[i],val,typestr); } sep[0] = 0; /*null string*/ - printf("%s", tag); + printf("%s", tag); if (fsimple) { sprintf(sep,"%c ",bdelim); printf("%04x %c Full %c %s %c %02x %c %s %c %s%c", @@ -3350,7 +3469,7 @@ int i_sensor(int argc, char **argv) fmBMC = 0; if (is_romley(vend_id,prod_id)) fRomley = 1; if (is_grantley(vend_id,prod_id)) fGrantley = 1; - if (prod_id == 0x003E || fRomley) /*Urbanna NSN2U,CG2100*/ + if (prod_id == 0x003E || fRomley || fGrantley) /*Urbanna,CG2100*/ set_max_kcs_loops(URNLOOPS); /*longer KCS timeout*/ } else if ((vend_id == VENDOR_SUPERMICRO) || (vend_id == VENDOR_SUPERMICROX)) { diff --git a/util/iserial.c b/util/iserial.c index 579d19d..e0cc7e9 100644 --- a/util/iserial.c +++ b/util/iserial.c @@ -155,7 +155,7 @@ typedef struct /* * Global variables */ -static char * progver = "3.00"; +static char * progver = "3.01"; static char * progname = "iserial"; static int vend_id = 0; static int prod_id = 0; @@ -965,10 +965,11 @@ main(int argc, char **argv) if ((ipmi_maj == 0) || (ipmi_maj == 1 && ipmi_min < 5)) { /* IPMI 0.9 and 1.0 dont support this. */ printf("This system does not support EMP Terminal Mode.\n"); - if (!fdoanyway) + if (!fdoanyway) { ret = LAN_ERR_NOTSUPPORT; goto do_exit; } + } if (ipmi_maj >= 2) fIPMI20 = 1; /* Determine if Basic or Terminal Mode is supported by product id */ if (vend_id == VENDOR_INTEL) { /*Intel*/ diff --git a/util/isol.c b/util/isol.c index 1fddc98..0dd7f22 100644 --- a/util/isol.c +++ b/util/isol.c @@ -165,7 +165,7 @@ void dbglog( char *pattn, ... ); /*local prototype*/ /* * Global variables */ -static char * progver = "3.00"; +static char * progver = "3.01"; static char * progname = "isol"; static char fdebug = 0; static char fpicmg = 0; diff --git a/util/itsol.c b/util/itsol.c index 20a0b8d..67ff688 100644 --- a/util/itsol.c +++ b/util/itsol.c @@ -98,7 +98,7 @@ int gettimeofday(struct timeval *tv, struct timezone *tz); extern int verbose; extern char fdebug; /*from ipmicmd.c*/ static char * progname = "itsol"; -static char * progver = "3.00"; +static char * progver = "3.01"; static uchar g_bus = PUBLIC_BUS; static uchar g_sa = BMC_SA; static uchar g_lun = BMC_LUN; diff --git a/util/iwdt.c b/util/iwdt.c index 324bcf6..121270a 100644 --- a/util/iwdt.c +++ b/util/iwdt.c @@ -100,7 +100,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* * Global variables */ -static char * progver = "3.00"; +static char * progver = "3.01"; static char * progname = "iwdt"; static char fdebug = 0; static char fdontlog = 0; diff --git a/util/oem_dell.c b/util/oem_dell.c index bd11446..0389355 100644 --- a/util/oem_dell.c +++ b/util/oem_dell.c @@ -132,7 +132,7 @@ char NIC_Selection_Mode_String_12g[] [50] = { "shared with failover all loms" }; -static char * progver = "3.00"; +static char * progver = "3.01"; static char * progname = "idelloem"; static int verbose = 0; static char fdebug = 0; @@ -1319,16 +1319,12 @@ ipmi_lcd_get_single_line_text (void * intf, char* lcdstring, uint8_t max_length) static int ipmi_lcd_get_info_wh(void * intf) - { uint8_t rsp[IPMI_RSPBUF_SIZE]; int rsp_len, rv; struct ipmi_rq req; uint8_t data[4]; - uint8_t command = 0; IPMI_DELL_LCD_CAPS* lcd_caps; char lcdstring[IPMI_DELL_LCD_STRING_LENGTH_MAX+1] = {0}; - int rc; - printf("LCD info\n"); @@ -1382,7 +1378,7 @@ ipmi_lcd_get_info_wh(void * intf) { memset(lcdstring, 0, IPMI_DELL_LCD_STRING_LENGTH_MAX+1); - rc = ipmi_lcd_get_single_line_text (intf, lcdstring, lcd_caps->max_chars[0]); + rv = ipmi_lcd_get_single_line_text (intf, lcdstring, lcd_caps->max_chars[0]); printf(" Text: %s\n", lcdstring); } else @@ -1454,7 +1450,6 @@ static int ipmi_lcd_get_info(void * intf) IPMI_DELL_LCD_CAPS * lcd_caps; uint8_t command = 0; char lcdstring[IPMI_DELL_LCD_STRING_LENGTH_MAX+1] = {0}; - int rc; printf("LCD info\n"); @@ -1504,7 +1499,7 @@ static int ipmi_lcd_get_info(void * intf) if (lcd_caps->number_lines > 0) { memset (lcdstring,0,IPMI_DELL_LCD_STRING_LENGTH_MAX+1); - rc = ipmi_lcd_get_single_line_text (intf, lcdstring, lcd_caps->max_chars[0]); + rv = ipmi_lcd_get_single_line_text (intf, lcdstring, lcd_caps->max_chars[0]); printf(" Text: %s\n", lcdstring); } else @@ -4141,7 +4136,7 @@ static int ipmi_get_peakpower_consmpt_history(void* intf,IPMI_POWER_CONSUMP_HIST if (verbose > 1) { - printf("Peak power consmhistory Data : %x %x %x %x %x %x %x %x %x %x\n %x %x %x %x %x %x %x %x %x %x %x %x %x\n\n", + printf("Peak power consmhistory Data : %x %x %x %x %x %x %x %x %x %x\n %x %x %x %x %x %x %x %x %x %x %x %x %x %x\n\n", rsp[0], rsp[1], rsp[2], rsp[3], rsp[4], rsp[5], rsp[6], rsp[7], rsp[8], rsp[9], rsp[10], rsp[11], @@ -5461,7 +5456,7 @@ int decode_sensor_dell(uchar *sdr,uchar *reading,char *pstring, int slen) #define BIT(x) (1 << x) #define SIZE_OF_DESC 128 -char * get_dell_evt_desc(uchar *sel_rec) +char * get_dell_evt_desc(uchar *sel_rec, int *psev) { struct sel_event_record * rec = (struct sel_event_record *)sel_rec; int data1, data2, data3; @@ -5505,6 +5500,7 @@ char * get_dell_evt_desc(uchar *sel_rec) case 0x07: if( ((data1 & DATA_BYTE2_SPECIFIED_MASK) == 0x80)) { + *psev = SEV_CRIT; if((data1 & 0x0f) == 0x00) snprintf(desc,SIZE_OF_DESC,"CPU Internal Err | "); if((data1 & 0x0f) == 0x06) @@ -5530,6 +5526,7 @@ char * get_dell_evt_desc(uchar *sel_rec) if ( (rec->sel_type.standard_type.event_type == 0x0B) && !(data1 & 0x03) ) { + *psev = SEV_INFO; if(data2 & 0x04) strcpy(desc,"Memory is in Spare Mode"); else if(data2 & 0x02) @@ -5538,12 +5535,13 @@ char * get_dell_evt_desc(uchar *sel_rec) strcpy(desc,"Memory is in Mirror Mode "); break; } - case 0x10: + case 0x10: get_devid_ver(NULL,NULL,&iver); // rv = ipmi_getdeviceid(devid,sizeof(devid),fdbg); // if (rv != 0) return NULL; version = iver; /* Memory DIMMS */ + *psev = SEV_MAJ; /*default severity for DIMM events*/ if( (data1 & 0x80) || (data1 & 0x20 ) ) { if( (code == 0x0c) && (rec->sel_type.standard_type.event_type == 0x0B) ) @@ -5551,10 +5549,12 @@ char * get_dell_evt_desc(uchar *sel_rec) if((data1 & 0x0f) == 0x00) { snprintf(desc,SIZE_OF_DESC," Redundancy Regained | "); + *psev = SEV_INFO; } else if((data1 & 0x0f) == 0x01) { snprintf(desc,SIZE_OF_DESC,"Redundancy Lost | "); + *psev = SEV_MAJ; } } else if(code == 0x0c) @@ -5610,29 +5610,37 @@ char * get_dell_evt_desc(uchar *sel_rec) break; } snprintf(desc,SIZE_OF_DESC,"Correctable ECC | "); + *psev = SEV_MAJ; } else if((data1 & 0x0f) == 0x01) { snprintf(desc,SIZE_OF_DESC,"UnCorrectable ECC | "); + *psev = SEV_CRIT; } } else if(code == 0x10) { - if((data1 & 0x0f) == 0x00) - snprintf(desc,SIZE_OF_DESC,"Corr Memory Log Dissabled | "); + if((data1 & 0x0f) == 0x00) { + snprintf(desc,SIZE_OF_DESC,"Corr Memory Log Disabled | "); + *psev = SEV_INFO; + } } } else { if(code == 0x12) { - if((data1 & 0x0f) == 0x02) + if((data1 & 0x0f) == 0x02) { snprintf(desc,SIZE_OF_DESC,"Unknown System Hardware Failure "); + *psev = SEV_MAJ; + } } if(code == 0x10) { - if((data1 & 0x0f) == 0x03) + if((data1 & 0x0f) == 0x03) { snprintf(desc,SIZE_OF_DESC,"All Even Logging Dissabled"); + *psev = SEV_INFO; + } } } if(data1 & 0x80 ) @@ -5731,6 +5739,7 @@ char * get_dell_evt_desc(uchar *sel_rec) case 0x20: if(((data1 & 0x0f)== 0x00)&&((data1 & 0x80) && (data1 & 0x20))) { + *psev = SEV_MAJ; if((data2 > 0x00)&&(data2<0xFF)) { //Add the code to display 194 entries.This sensor present only in ORCA @@ -5764,6 +5773,7 @@ char * get_dell_evt_desc(uchar *sel_rec) { if(data2 == 0x04) { + *psev = SEV_CRIT; snprintf(desc,SIZE_OF_DESC,"Hard Reset|Interrupt type None,SMS/OS Timer used at expiration"); } } @@ -5774,6 +5784,7 @@ char * get_dell_evt_desc(uchar *sel_rec) { if(data2 == 0x02) { + *psev = SEV_MAJ; if(data3 == 0x00) { snprintf(desc, SIZE_OF_DESC, "between BMC/iDRAC Firmware and other hardware"); @@ -5789,6 +5800,7 @@ char * get_dell_evt_desc(uchar *sel_rec) case 0xC1: if(rec->sel_type.standard_type.sensor_num == 0x25) { + *psev = SEV_MAJ; if((data1 & 0x0f) == 0x01) { snprintf(desc, SIZE_OF_DESC, "Failed to program Virtual Mac Address"); @@ -5819,6 +5831,7 @@ char * get_dell_evt_desc(uchar *sel_rec) case 0xC3: if(rec->sel_type.standard_type.sensor_num == 0x29) { + *psev = SEV_MAJ; if(((data1 & 0x0f)== 0x02)&&((data1 & 0x80) && (data1 & 0x20))) { #if 1 /*This sensor is not implemented in iDRAC code*/ @@ -5850,11 +5863,12 @@ char * get_dell_evt_desc(uchar *sel_rec) } strcat(desc,tmpdesc); #endif + *psev = SEV_MAJ; } } else { - + *psev = SEV_MAJ; if((data1 & 0x0f) == 0x02) { sprintf(desc,"%s","IO channel Check NMI"); @@ -5889,11 +5903,13 @@ char * get_dell_evt_desc(uchar *sel_rec) data2 & 0x7); strcat(desc,tmpdesc); } + *psev = SEV_CRIT; } break; case 0x0F: if(((data1 & 0x0f)== 0x0F)&&(data1 & 0x80)) { + *psev = SEV_CRIT; switch(data2) { case 0x80: @@ -5944,6 +5960,11 @@ char * get_dell_evt_desc(uchar *sel_rec) default: break; } + if (desc[0] == 0) { /* if no description specified above */ + /* snprintf(desc,SIZE_OF_DESC,"%02x [%02x %02x %02x]", + code,data1,date2,data3); // show raw data */ + desc = NULL; /*if empty, handle with default logic*/ + } } else { @@ -5986,8 +6007,6 @@ int decode_sel_dell(uint8_t *evt, char *outbuf, int outsz, char fdesc, snum = evt[11]; gstr = "BMC "; if (genid == 0x0033) gstr = "Bios"; - type_str = ""; - if (rectype == 0x02) type_str = get_sensor_type_desc(stype); #ifdef OTHER /* evt[13] is data1/offset*/ @@ -5995,18 +6014,20 @@ int decode_sel_dell(uint8_t *evt, char *outbuf, int outsz, char fdesc, ((evt[13] & DATA_BYTE3_SPECIFIED_MASK) == 0x20) ) { // if (evt[13] & DATA_BYTE2_SPECIFIED_MASK) // evt->data = rec->sel_type.standard_type.event_data[1]; - pstr = get_dell_evt_desc(evt); + pstr = get_dell_evt_desc(evt,&sevid); } else if (evt[13] == 0xC1) { if (snum == 0x23) { // evt->data = rec->sel_type.standard_type.event_data[1]; - pstr = get_dell_evt_desc(evt); + pstr = get_dell_evt_desc(evt,&sevid); } } #endif - pstr = get_dell_evt_desc(evt); + pstr = get_dell_evt_desc(evt,&sevid); if (pstr != NULL) rv = 0; if (rv == 0) { + type_str = ""; + if (rectype == 0x02) type_str = get_sensor_type_desc(stype); format_event(id,timestamp, sevid, genid, type_str, snum,NULL,pstr,NULL,outbuf,outsz); } diff --git a/util/oem_lenovo.c b/util/oem_lenovo.c new file mode 100644 index 0000000..9c5079f --- /dev/null +++ b/util/oem_lenovo.c @@ -0,0 +1,365 @@ +/* + * oem_lenovo.c + * Handle Lenovo OEM command functions + * + * Author: Andy Cress arcress at users.sourceforge.net + * Change history: + * 11/21/2016 ARCress - created + * + *--------------------------------------------------------------------- + */ +/*M* +Copyright (c) 2016 Andy Cress +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + a.. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + b.. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + c.. Neither the name of the copyright holder nor the names of contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *M*/ +#ifdef WIN32 +#include +#include "getopt.h" +#else +#if defined(HPUX) +/* getopt is defined in stdio.h */ +#elif defined(MACOS) +/* getopt is defined in unistd.h */ +#include +#include +#else +#include +#endif +#endif +#include +#include +#include +#include +#include "ipmicmd.h" +#include "ievents.h" +#include "oem_lenovo.h" + +void set_loglevel(int level); /*prototype */ + +static char * progver = "3.01"; +static char * progname = "ioemlenovo"; +static int verbose = 0; +static char fdebug = 0; +static uchar g_bus = PUBLIC_BUS; +static uchar g_sa = BMC_SA; +static uchar g_lun = BMC_LUN; +static uchar g_addrtype = ADDR_SMI; +static int vend_id = 0; +static int prod_id = 0; + +extern uchar bitnum(ushort value); /*isensor.c*/ + +/* + * decode_sensor_lenovo + * inputs: + * sdr = the SDR buffer + * reading = the 3 or 4 bytes of data from GetSensorReading + * pstring = points to the output string buffer + * slen = size of the output buffer + * outputs: + * rv = 0 if this sensor was successfully interpreted here, + * non-zero otherwise, to use default interpretations. + * pstring = contains the sensor reading interpretation string (if rv==0) + */ +int decode_sensor_lenovo(uchar *sdr,uchar *reading,char *pstring, int slen) +{ + int rv = -1; + uchar stype, etype, entity; + uchar bval; + ushort rval; + char *pstr = NULL; + int b; + + if (sdr == NULL || reading == NULL) return(rv); + if (pstring == NULL || slen == 0) return(rv); + /* sdr[3] is 0x01 for Full, 0x02 for Compact */ + bval = reading[2]; + if (sdr[3] == 0x01) return(rv); /*skip if full sensor*/ + entity = sdr[8]; + stype = sdr[12]; + etype = sdr[13]; + rval = reading[2] | ((reading[3] & 0x7f) << 8); + b = bitnum(rval); + if (fdebug) printf("oem_lenovo: sensor type=%x evt=%x entity=%x rval=%04x\n", + stype,etype,entity,rval); + switch(stype) { + case 0x07: /* All CPUs */ + if (etype == 0x6F) { + switch(b) { + case 0x00: pstr = "OK"; break; + case 0x02: pstr = "BIST_Fail"; break; + case 0x05: pstr = "Config_Error"; break; + case 0x06: pstr = "Uncorr_Error"; break; + case 0x08: pstr = "Disabled"; break; + default: pstr = "OK*"; break; + } + snprintf(pstring,slen,"%04x %s",bval,pstr); + rv = 0; + } + break; + case 0x0F: /* ABR Status, Firmware Error, Sys Boot Status, etc. */ + if (etype == 0x6F) { /* should be entity 0x22 */ + if (bval == 0x00) pstr = "OK"; + else if (bval & 0x01) pstr = "FirmwareError"; /*bit 0*/ + else if ((bval & 0x02) != 0) pstr = "FirmwareHang"; /*bit 1*/ + else pstr = "OK*"; + snprintf(pstring,slen,"%04x %s",bval,pstr); + rv = 0; + } + break; + case 0x1B: /* Front USB, nvDIMM Cable, etc. */ + if (etype == 0x6F) { + /* 0x01 = connected/OK, 0x02 = cable connect error */ + switch(bval) { + case 0x01: pstr = "OK"; break; + case 0x02: pstr = "CableError"; break; + default: pstr = "OK*"; break; + } + snprintf(pstring,slen,"%04x %s",rval,pstr); + rv = 0; + } + break; + case 0x1E: /* No Boot Device */ + if (etype == 0x6F) { + switch(b) { + case 0x00: pstr = "OK"; break; /*No Media*/ + default: pstr = "Asserted"; break; + } + snprintf(pstring,slen,"%04x %s",rval,pstr); + rv = 0; + } + case 0x21: /*All PCI Error, PCI 1, Internal RAID, No Op ROM, etc.*/ + if (etype == 0x6F) { + if (bval == 0x00) pstr = "OK"; + else pstr = "Fault"; + snprintf(pstring,slen,"%04x %s",bval,pstr); + rv = 0; + } + break; + case 0x25: /* DASD Backplane*/ + /*spec says 00 = Present, 01 = Absent, but not match results*/ + /* +0066 SDR Comp 02 6f 20 a 25 snum 20 DASD Backplane 1 = 0001 OK* +0067 SDR Comp 02 6f 20 a 25 snum 21 DASD Backplane 2 = 0000 Absent +0068 SDR Comp 02 6f 20 a 25 snum 22 DASD Backplane 3 = 0000 Absent +0069 SDR Comp 02 6f 20 a 25 snum 23 DASD Backplane 4 = 0000 Absent +006a SDR Comp 02 6f 20 a 25 snum 24 DASD Backplane 5 = 0000 Absent +006b SDR Comp 02 6f 20 a 25 snum 25 DASD Backplane 6 = 0000 Absent + */ + rv = -1; + break; + case 0x2B: /* ROM Recovery, Bkup Auto Update, IMM*/ + if (etype == 0x6F) { + switch(bval) { + case 0x00: pstr = "OK"; break; + case 0x01: pstr = "Changed"; break; /*entity 0x22*/ + case 0x05: pstr = "Invalid"; break; /*entity 0x21*/ + case 0x07: pstr = "ChangedOK"; break; /*entity 21,22*/ + default: pstr = "_"; break; + } + snprintf(pstring,slen,"%04x %s",rval,pstr); + rv = 0; + } + break; + case 0x02: /* SysBrd Vol Fault: et 07 8004=error */ + if (etype == 0x07) { + if ((bval & 0x04) != 0) pstr = "Faulty"; + else pstr = "OK"; + snprintf(pstring,slen,"%04x %s",bval,pstr); + rv = 0; + } + break; + case 0x28: /* Low Security Jmp et 08 8002=error*/ + if (etype == 0x08) { + if ((bval & 0x02) != 0) pstr = "Faulty"; + else pstr = "OK"; + snprintf(pstring,slen,"%04x %s",bval,pstr); + rv = 0; + } + break; + default: break; + } + // if (rv == 0) strncpy(pstring, pstr, slen); + return(rv); +} + +/* + * decode_sel_lenovo + * inputs: + * evt = the 16-byte IPMI SEL event + * outbuf = points to the output string buffer + * outsz = size of the output buffer + * outputs: + * rv = 0 if this event was successfully interpreted here, + * non-zero otherwise, to use default interpretations. + * outbuf = will contain the interpreted event text string (if rv==0) + */ +int decode_sel_lenovo(uchar *evt, char *outbuf, int outsz, char fdesc, + char fdbg) +{ + int rv = -1; + ushort id; + uchar rectype; + ulong timestamp; + char mybuf[64]; + char *type_str = ""; + char *pstr = NULL; + int sevid; + ushort genid; + uchar snum; + uchar data1, data2, data3; + + fdebug = fdbg; + sevid = SEV_INFO; + id = evt[0] + (evt[1] << 8); + rectype = evt[2]; + snum = evt[11]; + timestamp = evt[3] + (evt[4] << 8) + (evt[5] << 16) + (evt[6] << 24); + genid = evt[7] | (evt[8] << 8); + data1 = evt[13]; + data2 = evt[14]; + data3 = evt[15]; + if (rectype == 0x02) + { + sprintf(mybuf,"%02x [%02x %02x %02x]", evt[12],data1,data2,data3); + switch(evt[10]) { /*sensor type*/ + case 0xC0: /* OEM type */ + type_str = "OEM_type"; + pstr = "OEM Sensor "; + sevid = SEV_MAJ; + rv = -1; + break; + default: /*other sensor types*/ + break; + } + } + if (rv == 0) { + format_event(id,timestamp, sevid, genid, type_str, + snum,NULL,pstr,mybuf,outbuf,outsz); + } + return(rv); +} + +static void usage(void) +{ + printf("Usage: %s [arg]\n",progname); + printf("These commands may not work on all Lenovo systems\n"); +} + +static int ipmi_oemlenovo_main(int argc, char **argv) +{ + int rv = 0; + + if (strncmp(argv[0],"other",9) == 0) { + usage(); + rv = ERR_USAGE; + } else { + usage(); + rv = ERR_USAGE; + } + return(rv); +} + +#ifdef METACOMMAND +int i_oemlenovo(int argc, char **argv) +#else +#ifdef WIN32 +int __cdecl +#else +int +#endif +main(int argc, char **argv) +#endif +{ + int rv = 0; + uchar devrec[16]; + int c, i; + char *s1; + + printf("%s ver %s\n", progname,progver); + set_loglevel(LOG_NOTICE); + parse_lan_options('V',"4",0); /*default to admin priv*/ + + while ( (c = getopt( argc, argv,"m:xzEF:J:N:P:R:T:U:V:YZ:?")) != EOF ) + switch(c) { + case 'm': /* specific IPMB MC, 3-byte address, e.g. "409600" */ + g_bus = htoi(&optarg[0]); /*bus/channel*/ + g_sa = htoi(&optarg[2]); /*device slave address*/ + g_lun = htoi(&optarg[4]); /*LUN*/ + g_addrtype = ADDR_IPMB; + if (optarg[6] == 's') { + g_addrtype = ADDR_SMI; s1 = "SMI"; + } else { g_addrtype = ADDR_IPMB; s1 = "IPMB"; } + ipmi_set_mc(g_bus,g_sa,g_lun,g_addrtype); + printf("Use MC at %s bus=%x sa=%x lun=%x\n", + s1,g_bus,g_sa,g_lun); + break; + case 'x': fdebug = 2; /* normal (dbglog if isol) */ + verbose = 1; + break; + case 'z': fdebug = 3; /*full debug (for isol)*/ + verbose = 1; + break; + case 'N': /* nodename */ + case 'U': /* remote username */ + case 'P': /* remote password */ + case 'R': /* remote password */ + case 'E': /* get password from IPMI_PASSWORD environment var */ + case 'F': /* force driver type */ + case 'T': /* auth type */ + case 'J': /* cipher suite */ + case 'V': /* priv level */ + case 'Y': /* prompt for remote password */ + case 'Z': /* set local MC address */ + parse_lan_options(c,optarg,fdebug); + break; + default: + usage(); + return(ERR_USAGE); + break; + } + for (i = 0; i < optind; i++) { argv++; argc--; } + if (argc == 0) { + usage(); + return(ERR_USAGE); + } + + rv = ipmi_getdeviceid(devrec,16,fdebug); + if (rv == 0) { + char ipmi_maj, ipmi_min; + ipmi_maj = devrec[4] & 0x0f; + ipmi_min = devrec[4] >> 4; + vend_id = devrec[6] + (devrec[7] << 8) + (devrec[8] << 16); + prod_id = devrec[9] + (devrec[10] << 8); + show_devid( devrec[2], devrec[3], ipmi_maj, ipmi_min); + } + + rv = ipmi_oemlenovo_main(argc, argv); + + ipmi_close_(); + return(rv); +} +/* end oem_lenovo.c */ diff --git a/util/oem_lenovo.h b/util/oem_lenovo.h new file mode 100644 index 0000000..41d8955 --- /dev/null +++ b/util/oem_lenovo.h @@ -0,0 +1,46 @@ +/* + * oem_lenovo.h + * Handle Lenovo OEM command functions + * + * Author: Andy Cress arcress at users.sourceforge.net + * Change history: + * 11/21/2016 ARCress - created + * + *--------------------------------------------------------------------- + */ +/*M* +Copyright (c) 2016 Andy Cress +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + a.. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + b.. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + c.. Neither the name of the copyright holder nor the names of contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *M*/ + +#ifndef IPMI_OEMLENOVO_H +#define IPMI_OEMLENOVO_H + +int ipmi_oem_lenovo_main(void *, int, char **); +int decode_sensor_lenovo(uchar *sdr,uchar *reading,char *pstring, int slen); + +#endif /*IPMI_OEMLENOVO_H*/ + diff --git a/util/oem_newisys.c b/util/oem_newisys.c index 7b78532..dd4d759 100644 --- a/util/oem_newisys.c +++ b/util/oem_newisys.c @@ -47,7 +47,7 @@ static char fdebug = 0; static uchar g_bus = PUBLIC_BUS; static uchar g_sa = BMC_SA; static uchar g_lun = BMC_LUN; -static uchar g_addrtype = ADDR_SMI; +//static uchar g_addrtype = ADDR_SMI; #define DESC_MAX 200 /* diff --git a/util/oem_sun.c b/util/oem_sun.c index 5cbf82c..85b761f 100644 --- a/util/oem_sun.c +++ b/util/oem_sun.c @@ -109,7 +109,7 @@ static const struct valstr sunoem_led_mode_optvals[] = { /* global variables */ static char * progname = "isunoem"; -static char * progver = "3.00"; +static char * progver = "3.01"; static char fdebug = 0; static uchar g_bus = PUBLIC_BUS; static uchar g_sa = BMC_SA; diff --git a/util/oem_supermicro.c b/util/oem_supermicro.c index 3937f0d..f3e42dd 100644 --- a/util/oem_supermicro.c +++ b/util/oem_supermicro.c @@ -54,6 +54,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include "ipmicmd.h" #include "ievents.h" +#include "isensor.h" #include "oem_supermicro.h" #ifdef MOVED /*moved to oem_supermicro.h*/ @@ -67,7 +68,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. void set_loglevel(int level); /*prototype */ extern char fsm_debug; /*mem_if.c*/ -static char * progver = "3.00"; +static char * progver = "3.01"; static char * progname = "ismcoem"; static int verbose = 0; static char fdebug = 0; @@ -372,6 +373,35 @@ int oem_supermicro_reset_intrusion(void) return(rv); } +/* decode_threshold_supermicro() assumes Fans, not Temp + * Temp thresholds are different order. */ +int decode_threshold_supermicro(uchar rval, uchar *thresh) +{ + int idx = 0; + uchar bits; + + bits = thresh[0]; + if (bits & 0x20) { /*hi-unrec*/ + if (rval >= thresh[6]) { idx = 6; return(idx); } + } + if (bits & 0x10) { /*hi-crit*/ + if (rval >= thresh[5]) { idx = 5; return(idx); } + } + if (bits & 0x08) { /*hi-noncr*/ + if (rval >= thresh[4]) { idx = 4; return(idx); } + } + if (bits & 0x01) { /*lo-noncr*/ + if (rval <= thresh[1]) { idx = 1; } + } + if (bits & 0x02) { /*lo-crit*/ + if (rval <= thresh[2]) { idx = 2; } + } + if (bits & 0x04) { /*lo-unrec*/ + if (rval <= thresh[3]) { idx = 3; } + } + return(idx); +} + /* * decode_sensor_supermicro * inputs: @@ -386,16 +416,48 @@ int oem_supermicro_reset_intrusion(void) */ int decode_sensor_supermicro(uchar *sdr,uchar *reading,char *pstring, int slen) { - int rv = -1; - uchar stype; + int i, rv = -1; + uchar stype, etype, snum; uchar bval; char *pstr = NULL; + uchar thresh[7]; + SDR01REC *sdr01; + char *typestr = NULL; + double val; if (sdr == NULL || reading == NULL) return(rv); if (pstring == NULL || slen == 0) return(rv); - /* sdr[3] is 0x01 for Full, 0x02 for Compact */ - bval = reading[2]; - stype = sdr[12]; + bval = (reading[2] & 0x3f); + snum = sdr[7]; /*sdr01->sens_num*/ + stype = sdr[12]; /*sensor_type*/ + etype = sdr[13]; /*sdr01->ev_type*/ + /* sdr[3] rec_type is 0x01 for Full, 0x02 for Compact */ + if ((sdr[3] == 0x01) && (etype == 0x01)) { /* full threshold sensor */ + if (bval == 0) return(-1); /* OK, treat it normally */ + /*cannot rely upon the sensor reading[2], so get thresholds and compare*/ + rv = GetSensorThresholds(snum,&thresh[0]); + if (rv != 0) return(rv); + i = decode_threshold_supermicro(reading[0],thresh); + if (fdebug) + printf("decode_sensor_supermicro: snum=%x rdg=%x:%x thresh=%x:%x:%x:%x:%x:%x:%x i=%d rv=%d\n", + snum,reading[0],reading[2], thresh[0], thresh[1], thresh[2], thresh[3], + thresh[4], thresh[5], thresh[6], i,rv); + switch(i) { + case 0: pstr = "OK*"; break; + case 1: pstr = "Warn-lo"; break; + case 2: pstr = "Crit-lo"; break; + case 3: pstr = "BelowCrit"; break; + case 4: pstr = "Warn-hi"; break; + case 5: pstr = "Crit-hi"; break; + case 6: pstr = "AboveCrit"; break; + default: pstr = "OK*"; break; + } + sdr01 = (SDR01REC *)sdr; + val = RawToFloat(reading[0],sdr); + typestr = get_unit_type(sdr01->sens_units,sdr01->sens_base,sdr01->sens_mod, 0); + snprintf(pstring, slen, "%s %.2f %s",pstr,val,typestr); + return(rv); + } switch(stype) { case 0xC0: /* CPU Temp Sensor, EvTyp=0x70 (Full) */ //if (dbg) printf("supermicro %x sensor reading %x\n",stype,reading); @@ -456,14 +518,6 @@ int decode_mem_supermicro(int prod, uchar b2, uchar b3, char *desc, int *psz) /* bdata = 0x10 (16.) means CPU 1, DIMM 6 */ cpu = bdata / 10; dimm = bdata % 10; -#endif -#ifdef DMIOK - /* Use DMI if we get confirmation about cpu/dimm indices. */ - if (! is_remote()) { - fsm_debug = fdebug; - rv = get_MemDesc(cpu,dimm,desc,psz); - /* if (rv != 0) desc has "DIMM[%d}" */ - } #endif /* ver 0 previous SuperMicro firmware returned all zeros here. * ver 1 returns data3 with some info (X9) @@ -496,6 +550,14 @@ int decode_mem_supermicro(int prod, uchar b2, uchar b3, char *desc, int *psz) dimm = (bdata & 0x0F) - 9; /*0x0A=dimmX1, 0x0B=dimmX2*/ n = sprintf(desc,"P%d_DIMM%c%d",cpu,rgpair[pair],dimm); } +#ifdef DMIOK + /* Use DMI if we get confirmation about cpu/dimm indices. */ + if (! is_remote()) { + fsm_debug = fdebug; + rv = get_MemDesc(cpu,dimm,desc,psz); + /* if (rv != 0) desc has "DIMM[%d}" */ + } +#endif if (fdebug) printf("decode_mem_supermicro: v%d bdata=%02x(%d) cpu=%d dimm=%d pair=%d\n",ver,bdata,bdata,cpu,dimm,pair); @@ -514,6 +576,7 @@ int decode_mem_supermicro(int prod, uchar b2, uchar b3, char *desc, int *psz) * rv = 0 if this event was successfully interpreted here, * non-zero otherwise, to use default interpretations. * outbuf = will contain the interpreted event text string (if rv==0) + * See also decode_mem_supermicro above */ int decode_sel_supermicro(uchar *evt, char *outbuf, int outsz, char fdesc, char fdbg) diff --git a/util/subs.c b/util/subs.c index 135fcd9..f2af5da 100644 --- a/util/subs.c +++ b/util/subs.c @@ -403,7 +403,7 @@ int get_errno(void) /* For a list of all IANA enterprise mfg vendor numbers, * see http://www.iana.org/assignments/enterprise-numbers * Product numbers are different for each mfg vendor. */ -#define N_MFG 44 +#define N_MFG 46 static struct { int val; char *pstr; } mfgs[N_MFG] = { {0, " "}, {0x0000BA, "Toshiba"}, @@ -448,6 +448,8 @@ static struct { int val; char *pstr; } mfgs[N_MFG] = { {VENDOR_LMC, "LMC"}, /*=0x000878 with SuperMicro*/ {VENDOR_TYAN, "Tyan"}, /*=0x0019FD*/ {VENDOR_SUN, "Sun"}, /*=0x00002A*/ + {VENDOR_LENOVO, "Lenovo"}, /*=0x004A66*/ + {VENDOR_LENOVO2, "Lenovo"}, /*=0x004F4D*/ {VENDOR_INTEL, "Intel"} /*=0x000157*/ }; -- cgit v1.2.3