Compare commits

...

33 Commits

Author SHA1 Message Date
342f44b9f3 Update ChangeLog for 1.8.15 rleease 2014-11-24 06:40:17 -07:00
e1c7b532bd Release Version 1.8.15 2014-11-24 06:30:52 -07:00
3314024867 Remove debian from extra distribution rule for make dist 2014-10-23 14:27:06 -06:00
15499d014f Update ChangeLog for 1.8.15RC1 2014-10-23 14:02:38 -06:00
21fbd0e967 ID#340 - ipmitool sol session improperly closes on packet retry
Commit for Pat Donlin
2014-10-17 20:14:12 +02:00
deb9a4ed5d ID#277 - support for hostnames longer than 64 chars
ID#313 ipmitool doesn't support hostname long than 64 symbols
ID#277 Minor issue with ipmi_intf_session_set_hostname()

Commit adds support pretty much for FQDN not just up to the length of one label.
This is achieved by change in in struct ipmi_session; and strdup() of user
input. Of course, we have to free() this once we're done.
2014-10-17 19:33:37 +02:00
58837647c2 lib/ipmi_kontronoem.c - clean up formatting, code
Commit cleans up formatting in 'lib/ipmi_kontronoem.c'. Also, it adds some error
messages and fixes return codes.
2014-09-21 09:36:14 +02:00
5c85c7bc61 ID: 247 - 'sensor thresh' help output is wrong
Fix invalid help output by copy-pasting part of 'sensor thresh help'.
2014-09-20 18:21:23 +02:00
aa8bac2da2 Rename printf_sensor_get_usage() -> print_sensor_get_usage() 2014-09-20 18:07:23 +02:00
2b15969dcb Put 'sensor thresh help' into function
Move help text for 'sensor thresh help' into its own function.
2014-09-20 18:05:04 +02:00
7560d4f2f4 ID: 324 - conflicting declaration write_fru_area()
Commit fixes conflicting declarations of write_fru_area().

Author: Jörg Frings-Fürst
2014-09-20 15:43:30 +02:00
859e8a4576 ID: 337 - Add support for 13G Dell PowerEdge
Description: Add support for Dell 13G server.
 Add support for upcoming Dell PowerEdge 13G server
 and replace multiple if statments.
 Based on patch from  SriniG <srinivas_g_gowda@dell.com>

Author: Jörg Frings-Fürst <debian@jff-webhosting.net>
Origin: based on patch from SriniG <srinivas_g_gowda@dell.com>
Bug: http://sourceforge.net/p/ipmitool/patches/102/
Bug-debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=756555
Forwarded: http://sourceforge.net/p/ipmitool/patches/102/
Reviewed-by: 2014-08-07 SriniG <srinivas_g_gowda@dell.com>
2014-09-20 15:30:55 +02:00
f49c9eec53 print message header and data in verbose print
Change-Id: I613e35e180c815279d2a50f44956a5ed5bf5461b
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.xx.bhuvaragan@ericsson.com>
2014-09-03 10:01:07 +02:00
a6f34c9029 fix incorrect data validation
Change-Id: I6c277b4716445e8ae9a6851cca48e1ad95df49b4
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.xx.bhuvaragan@ericsson.com>
2014-09-03 09:53:56 +02:00
bee3fda656 update result ptr before return
Change-Id: If976f5c769d8ba83eefa1693e6969ef17f357ba8
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.xx.bhuvaragan@ericsson.com>
2014-09-03 09:44:57 +02:00
737b801768 delete duplicate macros
Change-Id: Ie219c955c4644b8ab9822fd1e5523d70038b5261
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.xx.bhuvaragan@ericsson.com>
2014-09-03 09:42:11 +02:00
96b19bb62d ID: 325 DDR4 DIMM Decoding Logic
Bug 325 was associated with identification of DDR4 SDRAM, but correct decoding
logic was necessary to actually support DDR4 decode.    This commit adds the
necessary logic to decode and display DDR4 DIMMS.
2014-08-13 07:12:42 -06:00
9372d2e34e ID: 328 HPM.2 fixes
Fix commited for Dmitry Bazhenov
2014-08-11 11:21:23 -06:00
9babab10f3 ID: 329 hpm.1 upgrade fixes
Fix commited for Dmitry Bazhenov
2014-08-11 11:17:41 -06:00
58d510f90f ID : 103 picmg discover messages should be DEBUG, not INFO
Changed picmg discover messages to LOG_DEBUG
2014-08-11 10:49:10 -06:00
ea49700ec1 ID: 331 Passwords provided in file (-f option) truncated on space
Code changed to remove truncation on space since space is valid in a password
2014-08-11 10:38:09 -06:00
732be1b968 ID: 325 - Can not identify DDR4 SDRAM 2014-08-11 08:34:58 -06:00
d79b0e05af ID: 318 - ipmi_tsol.c: fix buffer overflow
Commit fixes buffer over-flow in ipmi_tsol caused by mis-calculation in buffer
size, resp. using wrong variables completely.
2014-05-29 20:19:37 +02:00
3b15a7c0e2 ID: 306 - "fru print" command prints the FRU #0 twice
This patch make the command to spit FRU info #0 only once.

Commit for Dmitry Bazhenov
2014-05-25 08:52:07 +02:00
3f508629a5 ID: 305 - HPM.1 deferred activation support fixup
Currently, the HPM.1 agent in the IPMItool does not differ between Rollback
support and Deferred Activation Support. The patch fixes up this bug.

Commit for Dmitry Bazhenov
2014-05-25 08:48:50 +02:00
3473670051 lib/ipmi_tsol.c - remove dead code 2014-05-24 10:05:30 +02:00
aefd287222 lib/ipmi_tsol.c - make code formatting saner 2014-05-24 10:05:05 +02:00
6d25903a0b ID: 317 - ipmi_fwum.c: fix typo 2014-05-24 09:18:32 +02:00
26da519310 ID: 315 - buildsystem: configure.in is deprecated
As per https://lists.gnu.org/archive/html/automake/2013-05/msg00049.html,
renamed to configure.ac
2014-05-24 09:16:52 +02:00
edfee17f21 ID: 316 - Directory debian is outdated
Debian upstream will take care of packaging.
2014-05-24 09:14:47 +02:00
b37b914973 ID: 103 - 'lib/ipmi_ekanalyzer.c' needs a re-work
Most of the code is reformatted. I've removed some if blocks which didn't make
sense along the way. However, huge pile of work remains.
2014-05-19 05:35:16 +02:00
4e4a92100c ID: 103 - 'lib/ipmi_ekanalyzer.c' needs a re-work
Remove trailing empty lines.
2014-05-18 06:32:44 +02:00
8f7837364b ID: 46 - SEL OEM record corner case
According to 31.6.1 SEL Record Type Ranges, IPMIv2.0 specification, timestamped
OEM SEL records are in interval of <C0h,DFh> and not <C0h,DFh).
2014-05-17 11:39:42 +02:00
38 changed files with 2519 additions and 3075 deletions

View File

@ -1,3 +1,25 @@
version 1.8.15 2014-11-24
* ID: 340 - ipmitool sol session improperly closes on packet retry
* ID: 277 - support for hostnames longer than 64 chars
* ID: 313 - ipmitool doesn't support hostname long than 64 symbols
* ID: 277 - Minor issue with ipmi_intf_session_set_hostname()
* ID: 247 - 'sensor thresh' help output is wrong
* ID: 324 - conflicting declaration write_fru_area()
* ID: 337 - Add support for 13G Dell PowerEdge
* ID: 325 - DDR4 DIMM Decoding Logic
* ID: 328 - HPM.2 fixes
* ID: 329 - hpm.1 upgrade fixes
* ID: 103 - picmg discover messages should be DEBUG, not INFO
* ID: 331 - Passwords provided in file (-f option) truncated on space
* ID: 318 - ipmi_tsol.c: fix buffer overflow
* ID: 306 - "fru print" command prints the FRU #0 twice
* ID: 305 - HPM.1 deferred activation support fixup
* ID: 317 - ipmi_fwum.c: fix typo
* ID: 315 - buildsystem: configure.in is deprecated
* ID: 316 - Directory debian is outdated
* ID: 103 - 'lib/ipmi_ekanalyzer.c' needs a re-work
* ID: 46 - SEL OEM record corner case
version 1.8.14 2014-05-05
* ID: 299 - openipmi plugin writes zero to wrong byte
* ID: 301 - Add OS/Hypervisor installation status events

View File

@ -31,9 +31,7 @@
DOCDIR = $(datadir)/doc/$(PACKAGE)
DOCLIST = $(top_srcdir)/README $(top_srcdir)/COPYING $(top_srcdir)/AUTHORS $(top_srcdir)/ChangeLog
EXTRA_DIST = $(DOCLIST) \
debian/changelog debian/control debian/copyright \
debian/dirs debian/docs debian/rules
EXTRA_DIST = $(DOCLIST)
AUTOMAKE_OPTIONS = dist-bzip2

View File

@ -3,7 +3,7 @@ dnl autoconf for ipmitool
dnl
AC_INIT([src/ipmitool.c])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([ipmitool], [1.8.14-cvs])
AM_INIT_AUTOMAKE([ipmitool], [1.8.15-cvs])
AM_CONFIG_HEADER(config.h)
AC_CONFIG_SRCDIR([src/ipmitool.c])
AC_PREREQ(2.50)

View File

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

324
debian/changelog vendored
View File

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

28
debian/control vendored
View File

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

36
debian/copyright vendored
View File

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

4
debian/dirs vendored
View File

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

2
debian/docs vendored
View File

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

View File

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

118
debian/rules vendored
View File

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

6
debian/watch vendored
View File

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

View File

@ -39,6 +39,11 @@
#define HPM2_LAN_PARAMS_REV 0x01
#define HPM2_SOL_PARAMS_REV 0x01
#define HPM3_LAN_PARAMS_REV 0x01
/* IPMI defines parameter revision as
* MSN = present revision,
* LSN = oldest revision parameter is
* backward compatible with. */
#define LAN_PARAM_REV(x, y) ((x) << 4 | (y) & 0xF)
/* HPM.2 capabilities */
#define HPM2_CAPS_SOL_EXTENSION 0x01

View File

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

View File

@ -796,6 +796,7 @@ typedef struct _VERSIONINFO {
unsigned char imageAux[4];
unsigned char coldResetRequired;
unsigned char rollbackSupported;
unsigned char deferredActivationSupported;
char descString[HPMFWUPG_DESC_STRING_LENGTH + 1];
}VERSIONINFO, *PVERSIONINFO;

View File

@ -63,7 +63,7 @@ enum LANPLUS_SESSION_STATE {
#define IPMI_KG_BUFFER_SIZE 21 /* key plus null byte */
struct ipmi_session {
uint8_t hostname[64];
char *hostname; /* Numeric IP adress or DNS name - see RFC 1034/RFC 1035 */
uint8_t username[17];
uint8_t authcode[IPMI_AUTHCODE_BUFFER_SIZE + 1];
uint8_t challenge[16];
@ -213,6 +213,7 @@ void ipmi_intf_session_set_port(struct ipmi_intf * intf, int port);
void ipmi_intf_session_set_authtype(struct ipmi_intf * intf, uint8_t authtype);
void ipmi_intf_session_set_timeout(struct ipmi_intf * intf, uint32_t timeout);
void ipmi_intf_session_set_retry(struct ipmi_intf * intf, int retry);
void ipmi_intf_session_cleanup(struct ipmi_intf *intf);
void ipmi_cleanup(struct ipmi_intf * intf);
#if defined(IPMI_INTF_LAN) || defined (IPMI_INTF_LANPLUS)

View File

@ -102,8 +102,6 @@ enum {
#define GET_SENSOR_EVENT_STATUS 0x2b
#define GET_SENSOR_READING 0x2d
#define GET_SENSOR_TYPE 0x2f
#define GET_SENSOR_READING 0x2d
#define GET_SENSOR_TYPE 0x2f
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)

View File

@ -63,10 +63,11 @@ const struct valstr spd_memtype_vals[] = {
{ 0x09, "DDR2 SDRAM FB-DIMM" },
{ 0x0A, "DDR2 SDRAM FB-DIMM Probe" },
{ 0x0B, "DDR3 SDRAM" },
{ 0x0C, "DDR4 SDRAM" },
{ 0x00, NULL },
};
const struct valstr ddr3_density_vals[] =
const struct valstr ddr3_density_vals[] =
{
{ 0, "256 Mb" },
{ 1, "512 Mb" },
@ -87,6 +88,8 @@ const struct valstr ddr3_banks_vals[] =
{ 0x00, NULL },
};
#define ddr4_ecc_vals ddr3_ecc_vals
const struct valstr ddr3_ecc_vals[] =
{
{ 0, "0 bits" },
@ -94,6 +97,62 @@ const struct valstr ddr3_ecc_vals[] =
{ 0x00, NULL },
};
const struct valstr ddr4_density_vals[] =
{
{ 0, "256 Mb" },
{ 1, "512 Mb" },
{ 2, "1 Gb" },
{ 3, "2 Gb" },
{ 4, "4 Gb" },
{ 5, "8 Gb" },
{ 6, "16 Gb" },
{ 7, "32 Gb" },
{ 0x00, NULL },
};
const struct valstr ddr4_banks_vals[] =
{
{ 0, "2 (4 Banks)" },
{ 1, "3 (8 Banks)" },
{ 0x00, NULL },
};
const struct valstr ddr4_bank_groups[] =
{
{ 0, "0 (no Bank Groups)" },
{ 1, "1 (2 Bank Groups)" },
{ 2, "2 (4 Bank Groups)" },
{ 0x00, NULL },
};
const struct valstr ddr4_package_type[] =
{
{ 0, "Monolithic DRAM Device" },
{ 1, "Non-Monolithic Device" },
{ 0x00, NULL },
};
const struct valstr ddr4_technology_type[] =
{
{ 0, "Extended module type, see byte 15" },
{ 1, "RDIMM" },
{ 2, "UDIMM" },
{ 3, "SO-DIMM" },
{ 4, "LRDIMM" },
{ 5, "Mini-RDIMM" },
{ 6, "Mini-UDIMM" },
{ 7, "7 - Reserved" },
{ 8, "72b-SO-RDIMM" },
{ 9, "72b-SO-UDIMM" },
{ 10, "10 - Reserved" },
{ 11, "11 - Reserved" },
{ 12, "16b-SO-DIMM" },
{ 13, "32b-SO-DIMM" },
{ 14, "14 - Reserved" },
{ 15, "No base memory present" },
{ 0x00, NULL },
};
const struct valstr spd_config_vals[] = {
{ 0x00, "None" },
{ 0x01, "Parity" },
@ -800,6 +859,92 @@ ipmi_spd_print(uint8_t *spd_data, int len)
printf( "%c", *pchPN++ );
}
printf("\n");
} else if (spd_data[2] == 0x0C) /* DDR4 SDRAM */
{
int i;
int sdram_cap = 0;
int pri_bus_width = 0;
int sdram_width = 0;
int mem_size = 0;
int lrank_dimm;
if (len < 148)
return -1; /* we need first 91 bytes to do our thing */
/* "Logical rank" referes to the individually addressable die
* in a 3DS stack and has no meaning for monolithic or
* multi-load stacked SDRAMs; however, for the purposes of
* calculating the capacity of the module, one should treat
* monolithic and multi-load stack SDRAMs as having one logical
* rank per package rank.
*/
lrank_dimm = (spd_data[12]>>3&0x3) + 1; /* Number of Package Ranks per DIMM */
if ((spd_data[6] & 0x3) == 0x10) { /* 3DS package Type */
lrank_dimm *= ((spd_data[6]>>4)&0x3) + 1; /* Die Count */
}
sdram_cap = ldexp(256,(spd_data[4]&15));
pri_bus_width = ldexp(8,(spd_data[13]&7));
sdram_width = ldexp(4,(spd_data[12]&7));
mem_size = (sdram_cap/8) * (pri_bus_width/sdram_width) * lrank_dimm;
printf(" SDRAM Package Type : %s\n", val2str((spd_data[6]>>7), ddr4_package_type));
printf(" Technology : %s\n", val2str((spd_data[3]&15), ddr4_technology_type));
printf(" SDRAM Die Count : %d\n", ((spd_data[6]>>4) & 3)+1);
printf(" SDRAM Capacity : %d Mb\n", sdram_cap );
printf(" Memory Bank Group : %s\n", val2str((spd_data[4]>>6 & 0x3), ddr4_bank_groups));
printf(" Memory Banks : %s\n", val2str((spd_data[4]>>4 & 0x3), ddr4_banks_vals));
printf(" Primary Bus Width : %d bits\n", pri_bus_width );
printf(" SDRAM Device Width : %d bits\n", sdram_width );
printf(" Logical Rank per DIMM : %d\n", lrank_dimm );
printf(" Memory size : %d MB\n", mem_size );
printf(" Memory Density : %s\n", val2str(spd_data[4]&15, ddr4_density_vals));
printf(" 1.2 V Nominal Op : %s\n", (((spd_data[11]&3) != 3) ? "No":"Yes" ) );
printf(" TBD1 V Nominal Op : %s\n", (((spd_data[11]>>2&3) != 3) ? "No":"Yes" ) );
printf(" TBD2 V Nominal Op : %s\n", (((spd_data[11]>>4&3) != 3) ? "No":"Yes" ) );
printf(" Error Detect/Cor : %s\n", val2str(spd_data[13]>>3, ddr4_ecc_vals));
printf(" Manufacturer : ");
switch (spd_data[320]&127)
{
case 0:
printf("%s\n", val2str(spd_data[321], jedec_id1_vals));
break;
case 1:
printf("%s\n", val2str(spd_data[321], jedec_id2_vals));
break;
case 2:
printf("%s\n", val2str(spd_data[321], jedec_id3_vals));
break;
case 3:
printf("%s\n", val2str(spd_data[321], jedec_id4_vals));
break;
case 4:
printf("%s\n", val2str(spd_data[321], jedec_id5_vals));
break;
default:
printf("%s\n", "JEDEC JEP106 update required");
}
u_int year = (spd_data[323]>>4)*10 + spd_data[323]&15;
u_int week = (spd_data[324]>>4)*10 + spd_data[324]&15;
printf(" Manufacture Date : year %4d week %2d\n",
2000 + year, week);
printf(" Serial Number : %02x%02x%02x%02x\n",
spd_data[325], spd_data[326], spd_data[327], spd_data[328]);
printf(" Part Number : ");
for (i=329; i <= 348; i++)
{
printf( "%c", spd_data[i]);
}
printf("\n");
}
else
{
@ -868,7 +1013,7 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id)
struct ipmi_rs * rsp;
struct ipmi_rq req;
struct fru_info fru;
uint8_t spd_data[256], msg_data[4];
uint8_t *spd_data, msg_data[4];
int len, offset;
msg_data[0] = id;
@ -896,11 +1041,20 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id)
lprintf(LOG_DEBUG, "fru.size = %d bytes (accessed by %s)",
fru.size, fru.access ? "words" : "bytes");
if (fru.size < 1) {
lprintf(LOG_ERR, " Invalid FRU size %d", fru.size);
return -1;
}
spd_data = malloc(fru.size);
if (spd_data == NULL) {
printf(" Unable to malloc memory for spd array of size=%d\n",
fru.size);
return -1;
}
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_STORAGE;
req.msg.cmd = GET_FRU_DATA;
@ -908,22 +1062,27 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id)
req.msg.data_len = 4;
offset = 0;
memset(spd_data, 0, 256);
memset(spd_data, 0, fru.size);
do {
int i;
msg_data[0] = id;
msg_data[1] = offset;
msg_data[2] = 0;
msg_data[1] = offset & 0xFF;
msg_data[2] = offset >> 8;
msg_data[3] = FRU_DATA_RQST_SIZE;
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
printf(" Device not present (No Response)\n");
free(spd_data);
spd_data = NULL;
return -1;
}
if (rsp->ccode > 0) {
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
free(spd_data);
spd_data = NULL;
/* Timeouts are acceptable. No DIMM in the socket */
if (rsp->ccode == 0xc3)
return 1;
@ -938,6 +1097,8 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id)
/* now print spd info */
ipmi_spd_print(spd_data, offset);
free(spd_data);
spd_data = NULL;
return 0;
}

View File

@ -357,6 +357,7 @@ int str2char(const char *str, int8_t * chr_ptr)
if (arg_long < INT8_MIN || arg_long > INT8_MAX) {
return (-3);
}
*chr_ptr = (uint8_t)arg_long;
return 0;
} /* str2char(...) */

View File

@ -30,6 +30,7 @@
* EVEN IF PPS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#include <ipmitool/bswap.h>
#include <ipmitool/hpm2.h>
#include <ipmitool/ipmi_intf.h>
#include <ipmitool/log.h>
@ -233,7 +234,8 @@ int hpm2_get_lan_channel_capabilities(struct ipmi_intf * intf,
}
/* check parameter revision */
if (rsp->data[0] != HPM2_LAN_PARAMS_REV) {
if (rsp->data[0] !=
LAN_PARAM_REV(HPM2_LAN_PARAMS_REV, HPM2_LAN_PARAMS_REV)) {
lprintf(LOG_NOTICE, "Bad HPM.2 LAN parameter revision, rev=%d",
rsp->data[0]);
return -1;

View File

@ -123,6 +123,16 @@ const struct vFlashstr vFlash_completion_code_vals[] = {
static int current_arg =0;
uint8_t iDRAC_FLAG=0;
/*
* new flags for
* 11G || 12G || 13G -> _ALL
* 12G || 13G -> _12_13
*
*/
uint8_t iDRAC_FLAG_ALL=0;
uint8_t iDRAC_FLAG_12_13=0;
LCD_MODE lcd_mode;
static uint8_t LcdSupported=0;
static uint8_t SetLEDSupported=0;
@ -358,7 +368,7 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_ERR, "lcd is not supported on this system.");
return -1;
} else if (strncmp(argv[current_arg], "info\0", 5) == 0) {
if ((iDRAC_FLAG==IDRAC_11G) || (iDRAC_FLAG==IDRAC_12G)) {
if (iDRAC_FLAG_ALL) {
rc = ipmi_lcd_get_info_wh(intf);
} else {
rc = ipmi_lcd_get_info(intf);
@ -392,7 +402,7 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
}
}
if ((strncmp(argv[current_arg], "mode\0", 5) == 0)
&& ((iDRAC_FLAG==IDRAC_11G) || (iDRAC_FLAG==IDRAC_12G))) {
&& (iDRAC_FLAG_ALL)) {
current_arg++;
if (argc <= current_arg) {
ipmi_lcd_usage();
@ -446,7 +456,7 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
ipmi_lcd_usage();
}
} else if ((strncmp(argv[current_arg], "lcdqualifier\0", 13) == 0)
&& ((iDRAC_FLAG==IDRAC_11G) || (iDRAC_FLAG==IDRAC_12G))) {
&& (iDRAC_FLAG_ALL)) {
current_arg++;
if (argc <= current_arg) {
ipmi_lcd_usage();
@ -470,7 +480,7 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
ipmi_lcd_usage();
}
} else if ((strncmp(argv[current_arg], "errordisplay\0", 13) == 0)
&& ((iDRAC_FLAG==IDRAC_11G) || (iDRAC_FLAG==IDRAC_12G))) {
&& (iDRAC_FLAG_ALL)) {
current_arg++;
if (argc <= current_arg) {
ipmi_lcd_usage();
@ -635,17 +645,33 @@ ipmi_idracvalidator_command(struct ipmi_intf * intf)
val2str(rsp->ccode, completion_code_vals)); */
return -1;
}
/*
* Set the new flags to 0
*/
iDRAC_FLAG_ALL = 0;
iDRAC_FLAG_12_13 = 0;
/* Support the 11G Monolithic, modular, Maisy and Coaster */
if ((IMC_IDRAC_11G_MONOLITHIC == data[10])
|| (IMC_IDRAC_11G_MODULAR == data[10])
|| (IMC_MASER_LITE_BMC == data[10])
|| (IMC_MASER_LITE_NU == data[10])) {
iDRAC_FLAG=IDRAC_11G;
iDRAC_FLAG_ALL = 1;
} else if((IMC_IDRAC_12G_MONOLITHIC == data[10])
|| (IMC_IDRAC_12G_MODULAR == data[10])) {
iDRAC_FLAG = IDRAC_12G;
iDRAC_FLAG_ALL = 1;
iDRAC_FLAG_12_13 = 1;
} else if ((IMC_IDRAC_13G_MONOLITHIC == data[10])
|| (IMC_IDRAC_13G_MODULAR == data[10])
|| (IMC_IDRAC_13G_DCS == data[10])) {
iDRAC_FLAG=IDRAC_13G;
iDRAC_FLAG_ALL = 1;
iDRAC_FLAG_12_13 = 1;
} else {
iDRAC_FLAG = 0;
iDRAC_FLAG_ALL = 0;
iDRAC_FLAG_12_13 = 0;
}
IMC_Type = data[10];
return 0;
@ -1394,7 +1420,7 @@ ipmi_lcd_usage(void)
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
"iDRAC 11g or iDRAC 12g:");
"iDRAC 11g or iDRAC 12g or iDRAC 13g :");
lprintf(LOG_NOTICE,
" lcd set {mode}|{lcdqualifier}|{errordisplay}");
lprintf(LOG_NOTICE,
@ -1561,7 +1587,9 @@ ipmi_macinfo_drac_idrac_virtual_mac(struct ipmi_intf* intf,uint8_t NicNum)
return -1;
}
if ((IMC_IDRAC_12G_MODULAR == IMC_Type)
|| (IMC_IDRAC_12G_MONOLITHIC== IMC_Type)) {
|| (IMC_IDRAC_12G_MONOLITHIC== IMC_Type)
|| (IMC_IDRAC_13G_MODULAR == IMC_Type)
|| (IMC_IDRAC_13G_MONOLITHIC== IMC_Type)) {
/* Get the Chasiss Assigned MAC Addresss for 12g Only */
memcpy(VirtualMacAddress, ((rsp->data) + 1), MACADDRESSLENGH);
for (i = 0; i < MACADDRESSLENGH; i++) {
@ -1599,6 +1627,9 @@ ipmi_macinfo_drac_idrac_virtual_mac(struct ipmi_intf* intf,uint8_t NicNum)
} else if ((IMC_IDRAC_12G_MODULAR == IMC_Type)
|| (IMC_IDRAC_12G_MONOLITHIC== IMC_Type)) {
printf("\niDRAC7 MAC Address ");
} else if ((IMC_IDRAC_13G_MODULAR == IMC_Type)
|| (IMC_IDRAC_13G_MONOLITHIC== IMC_Type)) {
printf ("\niDRAC8 MAC Address ");
} else if ((IMC_MASER_LITE_BMC== IMC_Type)
|| (IMC_MASER_LITE_NU== IMC_Type)) {
printf("\nBMC MAC Address ");
@ -1668,6 +1699,9 @@ ipmi_macinfo_drac_idrac_mac(struct ipmi_intf* intf,uint8_t NicNum)
} else if ((IMC_IDRAC_12G_MODULAR == IMC_Type)
|| (IMC_IDRAC_12G_MONOLITHIC== IMC_Type)) {
printf("\niDRAC7 MAC Address ");
} else if ((IMC_IDRAC_13G_MODULAR == IMC_Type)
|| (IMC_IDRAC_13G_MONOLITHIC== IMC_Type)) {
printf ("\niDRAC8 MAC Address ");
} else if ((IMC_MASER_LITE_BMC== IMC_Type)
|| (IMC_MASER_LITE_NU== IMC_Type)) {
printf("\n\rBMC MAC Address ");
@ -1879,6 +1913,8 @@ ipmi_macinfo(struct ipmi_intf* intf, uint8_t NicNum)
|| IMC_IDRAC_11G_MONOLITHIC == IMC_Type)
|| (IMC_IDRAC_12G_MODULAR == IMC_Type
|| IMC_IDRAC_12G_MONOLITHIC == IMC_Type)
|| (IMC_IDRAC_13G_MODULAR == IMC_Type
|| IMC_IDRAC_13G_MONOLITHIC == IMC_Type)
|| (IMC_MASER_LITE_NU == IMC_Type || IMC_MASER_LITE_BMC== IMC_Type)) {
return ipmi_macinfo_11g(intf,NicNum);
} else {
@ -1946,7 +1982,7 @@ ipmi_delloem_lan_main(struct ipmi_intf * intf, int argc, char ** argv)
ipmi_lan_usage();
return -1;
}
if (iDRAC_FLAG == IDRAC_12G) {
if (iDRAC_FLAG_12_13) {
nic_selection = get_nic_selection_mode_12g(intf, current_arg, argv,
nic_set);
if (INVALID == nic_selection) {
@ -2063,7 +2099,7 @@ get_nic_selection_mode_12g(struct ipmi_intf* intf,int current_arg,
}
if (argv[current_arg] != NULL
&& strncmp(argv[current_arg], "lom1\0", 5) == 0) {
if (IMC_IDRAC_12G_MODULAR == IMC_Type) {
if ((IMC_IDRAC_12G_MODULAR == IMC_Type) || (IMC_IDRAC_13G_MODULAR == IMC_Type)) {
return INVAILD_SHARED_MODE;
}
if (failover) {
@ -2082,7 +2118,7 @@ get_nic_selection_mode_12g(struct ipmi_intf* intf,int current_arg,
return 0;
} else if (argv[current_arg] != NULL
&& strncmp(argv[current_arg], "lom2\0", 5) == 0) {
if (IMC_IDRAC_12G_MODULAR == IMC_Type) {
if ((IMC_IDRAC_12G_MODULAR == IMC_Type) || (IMC_IDRAC_13G_MODULAR == IMC_Type)) {
return INVAILD_SHARED_MODE;
}
if (failover) {
@ -2101,7 +2137,7 @@ get_nic_selection_mode_12g(struct ipmi_intf* intf,int current_arg,
return 0;
} else if (argv[current_arg] != NULL
&& strncmp(argv[current_arg], "lom3\0", 5) == 0) {
if (IMC_IDRAC_12G_MODULAR == IMC_Type) {
if ((IMC_IDRAC_12G_MODULAR == IMC_Type) || (IMC_IDRAC_13G_MODULAR == IMC_Type)) {
return INVAILD_SHARED_MODE;
}
if (failover) {
@ -2120,7 +2156,7 @@ get_nic_selection_mode_12g(struct ipmi_intf* intf,int current_arg,
return 0;
} else if (argv[current_arg] != NULL
&& strncmp(argv[current_arg], "lom4\0", 5) == 0) {
if (IMC_IDRAC_12G_MODULAR == IMC_Type) {
if ((IMC_IDRAC_12G_MODULAR == IMC_Type) || (IMC_IDRAC_13G_MODULAR == IMC_Type)) {
return INVAILD_SHARED_MODE;
}
if (failover) {
@ -2139,7 +2175,7 @@ get_nic_selection_mode_12g(struct ipmi_intf* intf,int current_arg,
return 0;
} else if (failover && argv[current_arg] != NULL
&& strncmp(argv[current_arg], "none\0", 5) == 0) {
if (IMC_IDRAC_12G_MODULAR == IMC_Type) {
if ((IMC_IDRAC_12G_MODULAR == IMC_Type) || (IMC_IDRAC_13G_MODULAR == IMC_Type) ) {
return INVAILD_SHARED_MODE;
}
if (failover) {
@ -2159,7 +2195,7 @@ get_nic_selection_mode_12g(struct ipmi_intf* intf,int current_arg,
current_arg++;
if (failover && argv[current_arg] != NULL
&& strncmp(argv[current_arg], "loms\0", 5) == 0) {
if (IMC_IDRAC_12G_MODULAR == IMC_Type) {
if ((IMC_IDRAC_12G_MODULAR == IMC_Type) || (IMC_IDRAC_13G_MODULAR == IMC_Type)) {
return INVAILD_SHARED_MODE;
}
if (nic_set[0] == 1) {
@ -2242,7 +2278,8 @@ ipmi_lan_set_nic_selection_12g(struct ipmi_intf * intf, uint8_t * nic_selection)
lprintf(LOG_ERR, "Error in setting nic selection");
return -1;
} else if( (nic_selection[0] == 1)
&& ((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED))) {
&& (( iDRAC_FLAG_12_13 )
&& (rsp->ccode == LICENSE_NOT_SUPPORTED))) {
/* Check license only for setting the dedicated nic. */
lprintf(LOG_ERR,
"FM001 : A required license is missing or expired");
@ -2297,7 +2334,7 @@ ipmi_lan_get_nic_selection(struct ipmi_intf * intf)
input_length = 0;
req.msg.netfn = DELL_OEM_NETFN;
req.msg.lun = 0;
if (iDRAC_FLAG == IDRAC_12G) {
if( iDRAC_FLAG_12_13 ) {
req.msg.cmd = GET_NIC_SELECTION_12G_CMD;
} else {
req.msg.cmd = GET_NIC_SELECTION_CMD;
@ -2314,7 +2351,7 @@ ipmi_lan_get_nic_selection(struct ipmi_intf * intf)
return -1;
}
nic_selection = rsp->data[0];
if (iDRAC_FLAG == IDRAC_12G) {
if( iDRAC_FLAG_12_13 ) {
nic_selection_failover = rsp->data[1];
if ((nic_selection < 6) && (nic_selection > 0)
&& (nic_selection_failover < 7)) {
@ -2413,7 +2450,7 @@ ipmi_lan_usage(void)
lprintf(LOG_NOTICE,
" sets the NIC Selection Mode :");
lprintf(LOG_NOTICE,
" on iDRAC12g :");
" on iDRAC12g OR iDRAC13g :");
lprintf(LOG_NOTICE,
" dedicated, shared with lom1, shared with lom2,shared with lom3,shared");
lprintf(LOG_NOTICE,
@ -2433,7 +2470,7 @@ ipmi_lan_usage(void)
lprintf(LOG_NOTICE,
" lan get ");
lprintf(LOG_NOTICE,
" on iDRAC12g :");
" on iDRAC12g or iDRAC13g :");
lprintf(LOG_NOTICE,
" returns the current NIC Selection Mode (dedicated, shared with lom1, shared");
lprintf(LOG_NOTICE,
@ -2662,7 +2699,7 @@ ipmi_get_power_capstatus_command(struct ipmi_intf * intf)
if (rsp == NULL) {
lprintf(LOG_ERR, "Error getting powercap status");
return -1;
} else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
} else if (( iDRAC_FLAG_12_13 ) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
lprintf(LOG_ERR,
"FM001 : A required license is missing or expired");
return -1; /* Return Error as unlicensed */
@ -2713,7 +2750,7 @@ ipmi_set_power_capstatus_command(struct ipmi_intf * intf, uint8_t val)
if (rsp == NULL) {
lprintf(LOG_ERR, "Error setting powercap status");
return -1;
} else if ((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
} else if ((iDRAC_FLAG_12_13) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
lprintf(LOG_ERR,
"FM001 : A required license is missing or expired");
return -1; /* return unlicensed Error code */
@ -2807,7 +2844,7 @@ ipmi_powermgmt(struct ipmi_intf * intf)
return -1;
}
if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
if ((iDRAC_FLAG_12_13) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
lprintf(LOG_ERR,
"FM001 : A required license is missing or expired");
return -1;
@ -2910,7 +2947,7 @@ ipmi_powermgmt_clear(struct ipmi_intf * intf, uint8_t clearValue)
if (rsp == NULL) {
lprintf(LOG_ERR, "Error clearing power values.");
return -1;
} else if ((iDRAC_FLAG == IDRAC_12G)
} else if ((iDRAC_FLAG_12_13)
&& (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
lprintf(LOG_ERR,
"FM001 : A required license is missing or expired");
@ -2988,7 +3025,7 @@ ipmi_get_power_headroom_command(struct ipmi_intf * intf,uint8_t unit)
if (rsp == NULL) {
lprintf(LOG_ERR, "Error getting power headroom status");
return -1;
} else if ((iDRAC_FLAG == IDRAC_12G)
} else if ((iDRAC_FLAG_12_13)
&& (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
lprintf(LOG_ERR,
"FM001 : A required license is missing or expired");
@ -3122,7 +3159,7 @@ ipmi_get_instan_power_consmpt_data(struct ipmi_intf * intf,
if (rsp == NULL) {
lprintf(LOG_ERR, "Error getting instantaneous power consumption data .");
return -1;
} else if ((iDRAC_FLAG == IDRAC_12G)
} else if ((iDRAC_FLAG_12_13)
&& (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
lprintf(LOG_ERR,
"FM001 : A required license is missing or expired");
@ -3215,7 +3252,7 @@ ipmi_get_avgpower_consmpt_history(struct ipmi_intf * intf,
lprintf(LOG_ERR,
"Error getting average power consumption history data.");
return -1;
} else if ((iDRAC_FLAG == IDRAC_12G) && (rc == LICENSE_NOT_SUPPORTED)) {
} else if ((iDRAC_FLAG_12_13) && (rc == LICENSE_NOT_SUPPORTED)) {
lprintf(LOG_ERR,
"FM001 : A required license is missing or expired");
return -1;
@ -3264,7 +3301,7 @@ ipmi_get_peakpower_consmpt_history(struct ipmi_intf * intf,
if (rc < 0) {
lprintf(LOG_ERR, "Error getting peak power consumption history data.");
return -1;
} else if ((iDRAC_FLAG == IDRAC_12G) && (rc == LICENSE_NOT_SUPPORTED)) {
} else if ((iDRAC_FLAG_12_13) && (rc == LICENSE_NOT_SUPPORTED)) {
lprintf(LOG_ERR,
"FM001 : A required license is missing or expired");
return -1;
@ -3321,7 +3358,7 @@ ipmi_get_minpower_consmpt_history(struct ipmi_intf * intf,
if (rc < 0) {
lprintf(LOG_ERR, "Error getting peak power consumption history data .");
return -1;
} else if ((iDRAC_FLAG == IDRAC_12G) && (rc == LICENSE_NOT_SUPPORTED)) {
} else if ((iDRAC_FLAG_12_13) && (rc == LICENSE_NOT_SUPPORTED)) {
lprintf(LOG_ERR,
"FM001 : A required license is missing or expired");
return -1;
@ -3518,7 +3555,7 @@ ipmi_get_power_cap(struct ipmi_intf * intf, IPMI_POWER_CAP * ipmipowercap)
if (rc < 0) {
lprintf(LOG_ERR, "Error getting power cap.");
return -1;
} else if ((iDRAC_FLAG == IDRAC_12G) && (rc == LICENSE_NOT_SUPPORTED)) {
} else if ((iDRAC_FLAG_12_13) && (rc == LICENSE_NOT_SUPPORTED)) {
lprintf(LOG_ERR,
"FM001 : A required license is missing or expired");
return -1;
@ -3618,7 +3655,7 @@ ipmi_set_power_cap(struct ipmi_intf * intf, int unit, int val)
if (rc < 0) {
lprintf(LOG_ERR, "Error getting power cap.");
return -1;
} else if ((iDRAC_FLAG == IDRAC_12G) && (rc == LICENSE_NOT_SUPPORTED)) {
} else if ((iDRAC_FLAG_12_13) && (rc == LICENSE_NOT_SUPPORTED)) {
lprintf(LOG_ERR,
"FM001 : A required license is missing or expired");
return -1;
@ -3698,7 +3735,7 @@ ipmi_set_power_cap(struct ipmi_intf * intf, int unit, int val)
if (rc < 0) {
lprintf(LOG_ERR, "Error setting power cap");
return -1;
} else if ((iDRAC_FLAG == IDRAC_12G) && (rc == LICENSE_NOT_SUPPORTED)) {
} else if ((iDRAC_FLAG_12_13) && (rc == LICENSE_NOT_SUPPORTED)) {
lprintf(LOG_ERR,
"FM001 : A required license is missing or expired");
return -1;
@ -3860,7 +3897,7 @@ ipmi_get_sd_card_info(struct ipmi_intf * intf) {
sdcardinfoblock = (IPMI_DELL_SDCARD_INFO *) (void *) rsp->data;
if ((iDRAC_FLAG == IDRAC_12G)
if ((iDRAC_FLAG_12_13)
&& (sdcardinfoblock->vflashcompcode == VFL_NOT_LICENSED)) {
lprintf(LOG_ERR,
"FM001 : A required license is missing or expired");

File diff suppressed because it is too large Load Diff

View File

@ -3111,7 +3111,8 @@ ipmi_fru_print_all(struct ipmi_intf * intf)
mc = (struct sdr_record_mc_locator *)
ipmi_sdr_get_record(intf, header, itr);
/* Does this MC device support FRU inventory device? */
if (mc && (mc->dev_support & 0x08)) { /* FRU inventory device? */
if (mc && (mc->dev_support & 0x08) && /* FRU inventory device? */
intf->target_addr != mc->dev_slave_addr) {
/* Yes. Prepare to issue FRU commands to FRU device #0 LUN 0 */
/* using the slave address specified in the MC record. */

View File

@ -892,14 +892,14 @@ KfwumUploadFirmware(struct ipmi_intf *intf, unsigned char *pBuffer,
}
if (rc == 0) {
if ((address % 1024) == 0) {
KfwumShowProgress("Writting Firmware in Flash",
KfwumShowProgress("Writing Firmware in Flash",
address, totalSize);
}
sequenceNumber++;
}
} while ((rc == 0) && (address < totalSize));
if (rc == 0) {
KfwumShowProgress("Writting Firmware in Flash",
KfwumShowProgress("Writing Firmware in Flash",
100, 100);
}
return rc;

View File

@ -344,6 +344,8 @@ HpmfwupgTargetCheck(struct ipmi_intf *intf, int option)
generalPropResp.GeneralCompProperties.bitfield.rollbackBackup;
gVersionInfo[componentId].coldResetRequired = getCompProp.resp.Response.
generalPropResp.GeneralCompProperties.bitfield.payloadColdReset;
gVersionInfo[componentId].deferredActivationSupported = getCompProp.resp.Response.
generalPropResp.GeneralCompProperties.bitfield.deferredActivation;
getCompProp.req.selector = HPMFWUPG_COMP_DESCRIPTION_STRING;
rc = HpmfwupgGetComponentProperties(intf, &getCompProp);
if (rc != HPMFWUPG_SUCCESS) {
@ -395,6 +397,16 @@ HpmfwupgTargetCheck(struct ipmi_intf *intf, int option)
gVersionInfo[componentId].rollbackAux[2] = getCompProp.resp.Response.rollbackFwVersionResp.rollbackFwVersion[4];
gVersionInfo[componentId].rollbackAux[3] = getCompProp.resp.Response.rollbackFwVersionResp.rollbackFwVersion[5];
}
mode |= ROLLBACK_VER;
} else {
gVersionInfo[componentId].rollbackMajor = 0xff;
gVersionInfo[componentId].rollbackMinor = 0xff;
gVersionInfo[componentId].rollbackAux[0] = 0xff;
gVersionInfo[componentId].rollbackAux[1] = 0xff;
gVersionInfo[componentId].rollbackAux[2] = 0xff;
gVersionInfo[componentId].rollbackAux[3] = 0xff;
}
if (gVersionInfo[componentId].deferredActivationSupported) {
getCompProp.req.selector = HPMFWUPG_COMP_DEFERRED_FIRMWARE_VERSION;
rc = HpmfwupgGetComponentProperties(intf, &getCompProp);
if (rc != HPMFWUPG_SUCCESS) {
@ -411,14 +423,7 @@ HpmfwupgTargetCheck(struct ipmi_intf *intf, int option)
gVersionInfo[componentId].deferredAux[2] = getCompProp.resp.Response.deferredFwVersionResp.deferredFwVersion[4];
gVersionInfo[componentId].deferredAux[3] = getCompProp.resp.Response.deferredFwVersionResp.deferredFwVersion[5];
}
mode |= ROLLBACK_VER;
} else {
gVersionInfo[componentId].rollbackMajor = 0xff;
gVersionInfo[componentId].rollbackMinor = 0xff;
gVersionInfo[componentId].rollbackAux[0] = 0xff;
gVersionInfo[componentId].rollbackAux[1] = 0xff;
gVersionInfo[componentId].rollbackAux[2] = 0xff;
gVersionInfo[componentId].rollbackAux[3] = 0xff;
gVersionInfo[componentId].deferredMajor = 0xff;
gVersionInfo[componentId].deferredMinor = 0xff;
gVersionInfo[componentId].deferredAux[0] = 0xff;
@ -1235,10 +1240,12 @@ HpmFwupgActionUploadFirmware(struct HpmfwupgComponentBitMask components,
} else {
/* success, buf length is valid */
bufLengthIsSet = 1;
if (blockLength > firmwareLength) {
if (imageOffset + blockLength > firmwareLength ||
imageOffset + blockLength < blockLength) {
/*
* blockLength is the remaining length of the firmware to upload so
* if its greater than the firmware length then its kind of error
* if imageOffset and blockLength sum is greater than the firmware
* length then its kind of error
*/
lprintf(LOG_NOTICE,
"\n Error in Upload FIRMWARE command [rc=%d]\n",
@ -1247,6 +1254,7 @@ HpmFwupgActionUploadFirmware(struct HpmfwupgComponentBitMask components,
"\n TotalSent:0x%x Img offset:0x%x Blk length:0x%x Fwlen:0x%x\n",
totalSent,imageOffset,blockLength,firmwareLength);
rc = HPMFWUPG_ERROR;
continue;
}
totalSent += count;
if (imageOffset != 0x00) {
@ -2296,7 +2304,8 @@ HpmfwupgWaitLongDurationCmd(struct ipmi_intf *intf,
* receive d5 (on the first get status) from
* the ipmi driver.
*/
(upgStatusCmd.resp.lastCmdCompCode != 0x00 )
(upgStatusCmd.resp.lastCmdCompCode == 0x80 ||
upgStatusCmd.resp.lastCmdCompCode == 0xD5)
&& ((timeoutSec2 - timeoutSec1) < upgradeTimeout )
&& (rc == HPMFWUPG_SUCCESS)) {
/* Must wait at least 1000 ms between status requests */

File diff suppressed because it is too large Load Diff

View File

@ -125,8 +125,8 @@ ipmi_password_file_read(char * filename)
return NULL;
}
/* remove trailing whitespace */
l = strcspn(pass, " \r\n\t");
/* remove traling <cr><nl><tab> */
l = strcspn(pass, "\r\n\t");
if (l > 0) {
pass[l] = '\0';
}

View File

@ -2345,7 +2345,7 @@ picmg_discover(struct ipmi_intf *intf) {
req.msg.data_len = 1;
msg_data = 0;
lprintf(LOG_INFO, "Running Get PICMG Properties my_addr %#x, transit %#x, target %#x",
lprintf(LOG_DEBUG, "Running Get PICMG Properties my_addr %#x, transit %#x, target %#x",
intf->my_addr, intf->transit_addr, intf->target_addr);
rsp = intf->sendrecv(intf, &req);
if (rsp && !rsp->ccode) {
@ -2353,19 +2353,19 @@ picmg_discover(struct ipmi_intf *intf) {
((rsp->data[1] & 0x0F) == PICMG_ATCA_MAJOR_VERSION
|| (rsp->data[1] & 0x0F) == PICMG_AMC_MAJOR_VERSION) ) {
intf->picmg_avail = 1;
lprintf(LOG_INFO, "Discovered PICMG Extension %d.%d",
lprintf(LOG_DEBUG, "Discovered PICMG Extension %d.%d",
(rsp->data[1] & 0x0f), (rsp->data[1] >> 4));
}
}
} else {
if (rsp == NULL) {
lprintf(LOG_INFO,"No Response from Get PICMG Properties");
lprintf(LOG_DEBUG,"No Response from Get PICMG Properties");
} else {
lprintf(LOG_INFO,"Error Response %#x from Get PICMG Properities", rsp->ccode);
lprintf(LOG_DEBUG,"Error Response %#x from Get PICMG Properities", rsp->ccode);
}
}
}
if (intf->picmg_avail == 0) {
lprintf(LOG_INFO, "No PICMG Extenstion discovered");
lprintf(LOG_DEBUG, "No PICMG Extenstion discovered");
}
return intf->picmg_avail;
}

View File

@ -1778,7 +1778,7 @@ ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt)
else
printf(" | ");
if(evt->record_type < 0xdf)
if(evt->record_type <= 0xdf)
{
printf ("%02x%02x%02x", evt->sel_type.oem_ts_type.manf_id[0], evt->sel_type.oem_ts_type.manf_id[1], evt->sel_type.oem_ts_type.manf_id[2]);
if (csv_output)
@ -1979,7 +1979,7 @@ ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_recor
if (evt->record_type >= 0xc0)
{
if(evt->record_type < 0xdf)
if(evt->record_type <= 0xdf)
{
printf (" Manufactacturer ID : %02x%02x%02x\n", evt->sel_type.oem_ts_type.manf_id[0],
evt->sel_type.oem_ts_type.manf_id[1], evt->sel_type.oem_ts_type.manf_id[2]);

View File

@ -42,7 +42,8 @@
#include <ipmitool/ipmi_sensor.h>
extern int verbose;
void printf_sensor_get_usage();
void print_sensor_get_usage();
void print_sensor_thresh_usage();
// Macro's for Reading the current sensor Data.
#define SCANNING_DISABLED 0x40
@ -515,7 +516,6 @@ __ipmi_sensor_threshold_value_to_raw(struct sdr_record_full_sensor *full, double
}
}
static int
ipmi_sensor_set_threshold(struct ipmi_intf *intf, int argc, char **argv)
{
@ -531,33 +531,7 @@ ipmi_sensor_set_threshold(struct ipmi_intf *intf, int argc, char **argv)
struct sdr_record_list *sdr;
if (argc < 3 || strncmp(argv[0], "help", 4) == 0) {
lprintf(LOG_NOTICE, "sensor thresh <id> <threshold> <setting>");
lprintf(LOG_NOTICE,
" id : name of the sensor for which threshold is to be set");
lprintf(LOG_NOTICE, " threshold : which threshold to set");
lprintf(LOG_NOTICE,
" unr = upper non-recoverable");
lprintf(LOG_NOTICE, " ucr = upper critical");
lprintf(LOG_NOTICE,
" unc = upper non-critical");
lprintf(LOG_NOTICE,
" lnc = lower non-critical");
lprintf(LOG_NOTICE, " lcr = lower critical");
lprintf(LOG_NOTICE,
" lnr = lower non-recoverable");
lprintf(LOG_NOTICE,
" setting : the value to set the threshold to");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE,
"sensor thresh <id> lower <lnr> <lcr> <lnc>");
lprintf(LOG_NOTICE,
" Set all lower thresholds at the same time");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE,
"sensor thresh <id> upper <unc> <ucr> <unr>");
lprintf(LOG_NOTICE,
" Set all upper thresholds at the same time");
lprintf(LOG_NOTICE, "");
print_sensor_thresh_usage();
return 0;
}
@ -589,7 +563,7 @@ ipmi_sensor_set_threshold(struct ipmi_intf *intf, int argc, char **argv)
} else if (strncmp(thresh, "lower", 5) == 0) {
if (argc < 5) {
lprintf(LOG_ERR,
"usage: sensor thresh <id> lower <unc> <ucr> <unr>");
"usage: sensor thresh <id> lower <lnr> <lcr> <lnc>");
return -1;
}
allLower = 1;
@ -899,10 +873,10 @@ ipmi_sensor_get(struct ipmi_intf *intf, int argc, char **argv)
if (argc < 1) {
lprintf(LOG_ERR, "Not enough parameters given.");
printf_sensor_get_usage();
print_sensor_get_usage();
return (-1);
} else if (strcmp(argv[0], "help") == 0) {
printf_sensor_get_usage();
print_sensor_get_usage();
return 0;
}
printf("Locating sensor record...\n");
@ -952,13 +926,55 @@ ipmi_sensor_main(struct ipmi_intf *intf, int argc, char **argv)
return rc;
}
/* printf_sensor_get_usage - print usage for # ipmitool sensor get NAC;
/* print_sensor_get_usage - print usage for # ipmitool sensor get NAC;
*
* @returns: void
*/
void
printf_sensor_get_usage()
print_sensor_get_usage()
{
lprintf(LOG_NOTICE, "sensor get <id> ... [id]");
lprintf(LOG_NOTICE, " id : name of desired sensor");
}
/* print_sensor_thresh_set_usage - print usage for # ipmitool sensor thresh;
*
* @returns: void
*/
void
print_sensor_thresh_usage()
{
lprintf(LOG_NOTICE,
"sensor thresh <id> <threshold> <setting>");
lprintf(LOG_NOTICE,
" id : name of the sensor for which threshold is to be set");
lprintf(LOG_NOTICE,
" threshold : which threshold to set");
lprintf(LOG_NOTICE,
" unr = upper non-recoverable");
lprintf(LOG_NOTICE,
" ucr = upper critical");
lprintf(LOG_NOTICE,
" unc = upper non-critical");
lprintf(LOG_NOTICE,
" lnc = lower non-critical");
lprintf(LOG_NOTICE,
" lcr = lower critical");
lprintf(LOG_NOTICE,
" lnr = lower non-recoverable");
lprintf(LOG_NOTICE,
" setting : the value to set the threshold to");
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
"sensor thresh <id> lower <lnr> <lcr> <lnc>");
lprintf(LOG_NOTICE,
" Set all lower thresholds at the same time");
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
"sensor thresh <id> upper <unc> <ucr> <unr>");
lprintf(LOG_NOTICE,
" Set all upper thresholds at the same time");
lprintf(LOG_NOTICE, "");
}

View File

@ -1477,33 +1477,28 @@ static int
ipmi_sol_keepalive_using_sol(struct ipmi_intf * intf)
{
struct ipmi_v2_payload v2_payload;
struct ipmi_rs * rsp = NULL;
struct timeval end;
int ret = 0;
if (_disable_keepalive)
return 0;
gettimeofday(&end, 0);
if (end.tv_sec - _start_keepalive.tv_sec > SOL_KEEPALIVE_TIMEOUT) {
memset(&v2_payload, 0, sizeof(v2_payload));
v2_payload.payload.sol_packet.character_count = 0;
rsp = intf->send_sol(intf, &v2_payload);
memset(&v2_payload, 0, sizeof(v2_payload));
v2_payload.payload.sol_packet.character_count = 0;
if (intf->send_sol(intf, &v2_payload) == NULL)
return -1;
/* good return, reset start time */
gettimeofday(&_start_keepalive, 0);
}
return ret;
}
return 0;
}
static int
ipmi_sol_keepalive_using_getdeviceid(struct ipmi_intf * intf)
{
struct timeval end;
static int ret = 0;
if (_disable_keepalive)
return 0;
@ -1511,16 +1506,12 @@ ipmi_sol_keepalive_using_getdeviceid(struct ipmi_intf * intf)
gettimeofday(&end, 0);
if (end.tv_sec - _start_keepalive.tv_sec > SOL_KEEPALIVE_TIMEOUT) {
ret = intf->keepalive(intf);
if ( (ret!=0) && (_keepalive_retries < SOL_KEEPALIVE_RETRIES) ) {
ret = 0;
_keepalive_retries++;
}
else if ((ret==0) && (_keepalive_retries > 0))
_keepalive_retries = 0;
if (intf->keepalive(intf) != 0)
return -1;
/* good return, reset start time */
gettimeofday(&_start_keepalive, 0);
}
return ret;
}
return 0;
}
@ -1653,14 +1644,15 @@ ipmi_sol_red_pill(struct ipmi_intf * intf, int instance)
else if (FD_ISSET(intf->fd, &read_fds))
{
struct ipmi_rs * rs =intf->recv_sol(intf);
if (! rs)
{
bShouldExit = bBmcClosedSession = 1;
}
else
if ( rs)
{
output(rs);
}
/*
* Should recv_sol come back null, the incoming packet was not ours.
* Just fall through, the keepalive logic will determine if
* the BMC has dropped the session.
*/
}

View File

@ -76,78 +76,77 @@ static int _altterm = 0;
extern int verbose;
static int
ipmi_tsol_command(struct ipmi_intf * intf, char *recvip, int port, unsigned char cmd)
ipmi_tsol_command(struct ipmi_intf *intf, char *recvip, int port,
unsigned char cmd)
{
struct ipmi_rs *rsp;
struct ipmi_rq req;
unsigned char data[6];
unsigned ip1, ip2, ip3, ip4;
if (sscanf(recvip, "%d.%d.%d.%d", &ip1, &ip2, &ip3, &ip4) != 4) {
lprintf(LOG_ERR, "Invalid IP address: %s", recvip);
return -1;
}
struct ipmi_rs *rsp;
struct ipmi_rq req;
unsigned char data[6];
unsigned ip1, ip2, ip3, ip4;
if (sscanf(recvip, "%d.%d.%d.%d", &ip1, &ip2, &ip3, &ip4) != 4) {
lprintf(LOG_ERR, "Invalid IP address: %s", recvip);
return (-1);
}
memset(&req, 0, sizeof(struct ipmi_rq));
req.msg.netfn = IPMI_NETFN_TSOL;
req.msg.cmd = cmd;
req.msg.data_len = 6;
req.msg.data = data;
req.msg.netfn = IPMI_NETFN_TSOL;
req.msg.cmd = cmd;
req.msg.data_len = 6;
req.msg.data = data;
memset(data, 0, sizeof(data));
data[0] = ip1;
data[1] = ip2;
data[2] = ip3;
data[3] = ip4;
data[4] = (port & 0xff00) >> 8;
data[5] = (port & 0xff);
data[0] = ip1;
data[1] = ip2;
data[2] = ip3;
data[3] = ip4;
data[4] = (port & 0xff00) >> 8;
data[5] = (port & 0xff);
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
lprintf(LOG_ERR, "Unable to perform TSOL command");
return -1;
return (-1);
}
if (rsp->ccode > 0) {
lprintf(LOG_ERR, "Unable to perform TSOL command: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
}
return 0;
val2str(rsp->ccode, completion_code_vals));
return (-1);
}
return 0;
}
static int
ipmi_tsol_start(struct ipmi_intf * intf, char *recvip, int port)
ipmi_tsol_start(struct ipmi_intf *intf, char *recvip, int port)
{
return ipmi_tsol_command(intf, recvip, port, IPMI_TSOL_CMD_START);
}
static int
ipmi_tsol_stop(struct ipmi_intf * intf, char *recvip, int port)
ipmi_tsol_stop(struct ipmi_intf *intf, char *recvip, int port)
{
return ipmi_tsol_command(intf, recvip, port, IPMI_TSOL_CMD_STOP);
return ipmi_tsol_command(intf, recvip, port, IPMI_TSOL_CMD_STOP);
}
static int
ipmi_tsol_send_keystroke(struct ipmi_intf * intf, char *buff, int length)
ipmi_tsol_send_keystroke(struct ipmi_intf *intf, char *buff, int length)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
unsigned char data[16];
struct ipmi_rs *rsp;
struct ipmi_rq req;
unsigned char data[16];
static unsigned char keyseq = 0;
memset(&req, 0, sizeof(struct ipmi_rq));
req.msg.netfn = IPMI_NETFN_TSOL;
req.msg.cmd = IPMI_TSOL_CMD_SENDKEY;
req.msg.data_len = length + 2;
req.msg.data = data;
req.msg.netfn = IPMI_NETFN_TSOL;
req.msg.cmd = IPMI_TSOL_CMD_SENDKEY;
req.msg.data_len = length + 2;
req.msg.data = data;
memset(data, 0, sizeof(data));
data[0] = length + 1;
data[0] = length + 1;
memcpy(data + 1, buff, length);
data[length + 1] = keyseq++;
rsp = intf->sendrecv(intf, &req);
rsp = intf->sendrecv(intf, &req);
if (verbose) {
if (rsp == NULL) {
lprintf(LOG_ERR, "Unable to send keystroke");
@ -155,61 +154,56 @@ ipmi_tsol_send_keystroke(struct ipmi_intf * intf, char *buff, int length)
}
if (rsp->ccode > 0) {
lprintf(LOG_ERR, "Unable to send keystroke: %s",
val2str(rsp->ccode, completion_code_vals));
val2str(rsp->ccode, completion_code_vals));
return -1;
}
}
return length;
return length;
}
static int
tsol_keepalive(struct ipmi_intf * intf)
tsol_keepalive(struct ipmi_intf *intf)
{
struct timeval end;
gettimeofday(&end, 0);
if (end.tv_sec - _start_keepalive.tv_sec <= 30)
return 0;
intf->keepalive(intf);
struct timeval end;
gettimeofday(&end, 0);
if (end.tv_sec - _start_keepalive.tv_sec <= 30) {
return 0;
}
intf->keepalive(intf);
gettimeofday(&_start_keepalive, 0);
return 0;
return 0;
}
static void
print_escape_seq(struct ipmi_intf *intf)
{
lprintf(LOG_NOTICE,
" %c. - terminate connection\n"
" %c^Z - suspend ipmitool\n"
" %c^X - suspend ipmitool, but don't restore tty on restart\n"
" %c? - this message\n"
" %c%c - send the escape character by typing it twice\n"
" (Note that escapes are only recognized immediately after newline.)",
intf->session->sol_escape_char,
intf->session->sol_escape_char,
intf->session->sol_escape_char,
intf->session->sol_escape_char,
intf->session->sol_escape_char,
intf->session->sol_escape_char);
" %c. - terminate connection\n"
" %c^Z - suspend ipmitool\n"
" %c^X - suspend ipmitool, but don't restore tty on restart\n"
" %c? - this message\n"
" %c%c - send the escape character by typing it twice\n"
" (Note that escapes are only recognized immediately after newline.)",
intf->session->sol_escape_char,
intf->session->sol_escape_char,
intf->session->sol_escape_char,
intf->session->sol_escape_char,
intf->session->sol_escape_char,
intf->session->sol_escape_char);
}
static int
leave_raw_mode(void)
{
if (!_in_raw_mode)
if (!_in_raw_mode) {
return -1;
else if (tcsetattr(fileno(stdin), TCSADRAIN, &_saved_tio) == -1)
} else if (tcsetattr(fileno(stdin), TCSADRAIN, &_saved_tio) == -1) {
lperror(LOG_ERR, "tcsetattr(stdin)");
else if (tcsetattr(fileno(stdout), TCSADRAIN, &_saved_tio) == -1)
} else if (tcsetattr(fileno(stdout), TCSADRAIN, &_saved_tio) == -1) {
lperror(LOG_ERR, "tcsetattr(stdout)");
else
} else {
_in_raw_mode = 0;
}
return 0;
}
@ -217,16 +211,14 @@ static int
enter_raw_mode(void)
{
struct termios tio;
if (tcgetattr(fileno(stdout), &_saved_tio) < 0) {
lperror(LOG_ERR, "tcgetattr failed");
return -1;
}
tio = _saved_tio;
if (_altterm) {
tio.c_iflag &= (ISTRIP | IGNBRK );
tio.c_iflag &= (ISTRIP | IGNBRK);
tio.c_cflag &= ~(CSIZE | PARENB | IXON | IXOFF | IXANY);
tio.c_cflag |= (CS8 |CREAD) | (IXON|IXOFF|IXANY);
tio.c_lflag &= 0;
@ -241,13 +233,13 @@ enter_raw_mode(void)
tio.c_cc[VTIME] = 0;
}
if (tcsetattr(fileno(stdin), TCSADRAIN, &tio) < 0)
if (tcsetattr(fileno(stdin), TCSADRAIN, &tio) < 0) {
lperror(LOG_ERR, "tcsetattr(stdin)");
else if (tcsetattr(fileno(stdout), TCSADRAIN, &tio) < 0)
} else if (tcsetattr(fileno(stdout), TCSADRAIN, &tio) < 0) {
lperror(LOG_ERR, "tcsetattr(stdout)");
else
} else {
_in_raw_mode = 1;
}
return 0;
}
@ -255,11 +247,10 @@ static void
suspend_self(int restore_tty)
{
leave_raw_mode();
kill(getpid(), SIGTSTP);
if (restore_tty)
if (restore_tty) {
enter_raw_mode();
}
}
static int
@ -272,7 +263,7 @@ do_inbuf_actions(struct ipmi_intf *intf, char *in_buff, int len)
for(i = 0; i < len ;) {
if (!in_esc) {
if (last_was_cr &&
(in_buff[i] == intf->session->sol_escape_char)) {
(in_buff[i] == intf->session->sol_escape_char)) {
in_esc = 1;
memmove(in_buff, in_buff + 1, len - i - 1);
len--;
@ -289,40 +280,35 @@ do_inbuf_actions(struct ipmi_intf *intf, char *in_buff, int len)
switch (in_buff[i]) {
case '.':
printf("%c. [terminated ipmitool]\n",
intf->session->sol_escape_char);
intf->session->sol_escape_char);
return -1;
case 'Z' - 64:
printf("%c^Z [suspend ipmitool]\n",
intf->session->sol_escape_char);
suspend_self(1); /* Restore tty back to raw */
intf->session->sol_escape_char);
/* Restore tty back to raw */
suspend_self(1);
break;
case 'X' - 64:
printf("%c^X [suspend ipmitool]\n",
intf->session->sol_escape_char);
suspend_self(0); /* Don't restore to raw mode */
intf->session->sol_escape_char);
/* Don't restore to raw mode */
suspend_self(0);
break;
case '?':
printf("%c? [ipmitool help]\n",
intf->session->sol_escape_char);
intf->session->sol_escape_char);
print_escape_seq(intf);
break;
}
memmove(in_buff, in_buff + 1, len - i - 1);
memmove(in_buff, (in_buff + 1), (len - i - 1));
len--;
in_esc = 0;
continue;
}
last_was_cr = (in_buff[i] == '\r' || in_buff[i] == '\n');
i++;
}
return len;
}
@ -330,27 +316,25 @@ do_inbuf_actions(struct ipmi_intf *intf, char *in_buff, int len)
static void
do_terminal_cleanup(void)
{
if (_saved_winsize.ws_row > 0 && _saved_winsize.ws_col > 0)
if (_saved_winsize.ws_row > 0 && _saved_winsize.ws_col > 0) {
ioctl(fileno(stdout), TIOCSWINSZ, &_saved_winsize);
}
leave_raw_mode();
if (errno)
if (errno) {
lprintf(LOG_ERR, "Exiting due to error %d -> %s",
errno, strerror(errno));
}
}
static void
set_terminal_size(int rows, int cols)
{
struct winsize winsize;
if (rows <= 0 || cols <= 0)
if (rows <= 0 || cols <= 0) {
return;
}
/* save initial winsize */
ioctl(fileno(stdout), TIOCGWINSZ, &_saved_winsize);
/* set new winsize */
winsize.ws_row = rows;
winsize.ws_col = cols;
@ -361,30 +345,35 @@ static void
print_tsol_usage(void)
{
struct winsize winsize;
lprintf(LOG_NOTICE, "Usage: tsol [recvip] [port=NUM] [ro|rw] [rows=NUM] [cols=NUM] [altterm]");
lprintf(LOG_NOTICE, " recvip Receiver IP Address [default=local]");
lprintf(LOG_NOTICE, " port=NUM Receiver UDP Port [default=%d]",
IPMI_TSOL_DEF_PORT);
lprintf(LOG_NOTICE, " ro|rw Set Read-Only or Read-Write [default=rw]");
ioctl(fileno(stdout), TIOCGWINSZ, &winsize);
lprintf(LOG_NOTICE, " rows=NUM Set terminal rows [default=%d]",
winsize.ws_row);
lprintf(LOG_NOTICE, " cols=NUM Set terminal columns [default=%d]",
winsize.ws_col);
lprintf(LOG_NOTICE, " altterm Alternate terminal setup [default=off]");
lprintf(LOG_NOTICE,
"Usage: tsol [recvip] [port=NUM] [ro|rw] [rows=NUM] [cols=NUM] [altterm]");
lprintf(LOG_NOTICE,
" recvip Receiver IP Address [default=local]");
lprintf(LOG_NOTICE,
" port=NUM Receiver UDP Port [default=%d]",
IPMI_TSOL_DEF_PORT);
lprintf(LOG_NOTICE,
" ro|rw Set Read-Only or Read-Write [default=rw]");
ioctl(fileno(stdout), TIOCGWINSZ, &winsize);
lprintf(LOG_NOTICE,
" rows=NUM Set terminal rows [default=%d]",
winsize.ws_row);
lprintf(LOG_NOTICE,
" cols=NUM Set terminal columns [default=%d]",
winsize.ws_col);
lprintf(LOG_NOTICE,
" altterm Alternate terminal setup [default=off]");
}
int
ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
ipmi_tsol_main(struct ipmi_intf *intf, int argc, char **argv)
{
struct pollfd fds_wait[3], fds_data_wait[3], *fds;
struct sockaddr_in sin, myaddr, *sa_in;
socklen_t mylen;
char *recvip = NULL;
char out_buff[IPMI_BUF_SIZE * 8], in_buff[IPMI_BUF_SIZE];
char in_buff[IPMI_BUF_SIZE];
char out_buff[IPMI_BUF_SIZE * 8];
char buff[IPMI_BUF_SIZE + 4];
int fd_socket, result, i;
int out_buff_fill, in_buff_fill;
@ -394,7 +383,7 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
if (strlen(intf->name) < 3 || strncmp(intf->name, "lan", 3) != 0) {
lprintf(LOG_ERR, "Error: Tyan SOL is only available over lan interface");
return -1;
return (-1);
}
for (i = 0; i<argc; i++) {
@ -402,24 +391,26 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
/* not free'd ...*/
/* recvip = strdup(argv[i]); */
recvip = argv[i];
}
else if (sscanf(argv[i], "port=%d", &ip1) == 1)
} else if (sscanf(argv[i], "port=%d", &ip1) == 1) {
port = ip1;
else if (sscanf(argv[i], "rows=%d", &ip1) == 1)
} else if (sscanf(argv[i], "rows=%d", &ip1) == 1) {
rows = ip1;
else if (sscanf(argv[i], "cols=%d", &ip1) == 1)
} else if (sscanf(argv[i], "cols=%d", &ip1) == 1) {
cols = ip1;
else if (strlen(argv[i]) == 2 && strncmp(argv[i], "ro", 2) == 0)
} else if (strlen(argv[i]) == 2
&& strncmp(argv[i], "ro", 2) == 0) {
read_only = 1;
else if (strlen(argv[i]) == 2 && strncmp(argv[i], "rw", 2) == 0)
} else if (strlen(argv[i]) == 2
&& strncmp(argv[i], "rw", 2) == 0) {
read_only = 0;
else if (strlen(argv[i]) == 7 && strncmp(argv[i], "altterm", 7) == 0)
} else if (strlen(argv[i]) == 7
&& strncmp(argv[i], "altterm", 7) == 0) {
_altterm = 1;
else if (strlen(argv[i]) == 4 && strncmp(argv[i], "help", 4) == 0) {
} else if (strlen(argv[i]) == 4
&& strncmp(argv[i], "help", 4) == 0) {
print_tsol_usage();
return 0;
}
else {
} else {
print_tsol_usage();
return 0;
}
@ -432,7 +423,7 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
sa_in = (struct sockaddr_in *)&intf->session->addr;
result = inet_pton(AF_INET, (const char *)intf->session->hostname,
&sa_in->sin_addr);
&sa_in->sin_addr);
if (result <= 0) {
struct hostent *host = gethostbyname((const char *)intf->session->hostname);
@ -457,7 +448,7 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_ERR, "Can't open port %d", port);
return -1;
}
if (-1 == bind(fd_socket, (struct sockaddr *)&sin, sizeof(sin))) {
if (bind(fd_socket, (struct sockaddr *)&sin, sizeof(sin)) == (-1)) {
lprintf(LOG_ERR, "Failed to bind socket.");
close(fd_socket);
return -1;
@ -467,7 +458,8 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
* retrieve local IP address if not supplied on command line
*/
if (recvip == NULL) {
result = intf->open(intf); /* must connect first */
/* must connect first */
result = intf->open(intf);
if (result < 0) {
close(fd_socket);
return -1;
@ -489,7 +481,7 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
}
printf("[Starting %sSOL with receiving address %s:%d]\n",
read_only ? "Read-only " : "", recvip, port);
read_only ? "Read-only " : "", recvip, port);
set_terminal_size(rows, cols);
enter_raw_mode();
@ -499,14 +491,14 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
* ipmitool -I lan -H 192.168.168.227 -U Administrator raw 0x30 0x06 0xC0 0xA8 0xA8 0x78 0x1A 0x0A
*/
result = ipmi_tsol_start(intf, recvip, port);
if (result < 0) {
if (result < 0) {
lprintf(LOG_ERR, "Error starting SOL");
close(fd_socket);
return -1;
}
return (-1);
}
printf("[SOL Session operational. Use %c? for help]\n",
intf->session->sol_escape_char);
intf->session->sol_escape_char);
gettimeofday(&_start_keepalive, 0);
@ -533,52 +525,58 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
out_buff_fill = 0;
in_buff_fill = 0;
fds = fds_wait;
for (;;) {
result = poll(fds, 3, 15*1000);
if (result < 0)
result = poll(fds, 3, 15 * 1000);
if (result < 0) {
break;
}
/* send keepalive packet */
tsol_keepalive(intf);
if ((fds[0].revents & POLLIN) && (sizeof(out_buff) > out_buff_fill)){
if ((fds[0].revents & POLLIN) && (sizeof(out_buff) > out_buff_fill)) {
socklen_t sin_len = sizeof(sin);
result = recvfrom(fd_socket, buff, sizeof(out_buff) - out_buff_fill + 4, 0,
(struct sockaddr *)&sin, &sin_len);
/* read the data from udp socket, skip some bytes in the head */
if((result - 4) > 0 ){
int buff_size = sizeof(buff);
if ((sizeof(out_buff) - out_buff_fill + 4) < buff_size) {
buff_size = (sizeof(out_buff) - out_buff_fill) + 4;
if ((buff_size - 4) <= 0) {
buff_size = 0;
}
}
result = recvfrom(fd_socket, buff,
buff_size, 0,
(struct sockaddr *)&sin, &sin_len);
/* read the data from udp socket,
* skip some bytes in the head
*/
if ((result - 4) > 0) {
int length = result - 4;
#if 1
length = (unsigned char)buff[2] & 0xff;
length *= 256;
length += ((unsigned char)buff[3] & 0xff);
if ((length <= 0) || (length > (result - 4)))
length = result - 4;
#endif
memcpy(out_buff + out_buff_fill, buff + 4, length);
out_buff_fill += length;
}
}
if ((fds[1].revents & POLLIN) && (sizeof(in_buff) > in_buff_fill)) {
/* Read from keyboard */
result = read(fileno(stdin), in_buff + in_buff_fill,
sizeof(in_buff) - in_buff_fill); // read from keyboard
sizeof(in_buff) - in_buff_fill);
if (result > 0) {
int bytes;
bytes = do_inbuf_actions(intf, in_buff + in_buff_fill, result);
if(bytes < 0) {
bytes = do_inbuf_actions(intf,
in_buff + in_buff_fill, result);
if (bytes < 0) {
result = ipmi_tsol_stop(intf, recvip, port);
do_terminal_cleanup();
return result;
}
if (read_only)
if (read_only) {
bytes = 0;
}
in_buff_fill += bytes;
}
}
if ((fds[2].revents & POLLOUT) && out_buff_fill) {
result = write(fileno(stdout), out_buff, out_buff_fill); // to screen
/* To screen */
result = write(fileno(stdout), out_buff, out_buff_fill);
if (result > 0) {
out_buff_fill -= result;
if (out_buff_fill) {
@ -591,7 +589,8 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
* translate key and send that to SMDC using IPMI
* ipmitool -I lan -H 192.168.168.227 -U Administrator raw 0x30 0x03 0x04 0x1B 0x5B 0x43
*/
result = ipmi_tsol_send_keystroke(intf, in_buff, __min(in_buff_fill,14));
result = ipmi_tsol_send_keystroke(intf,
in_buff, __min(in_buff_fill, 14));
if (result > 0) {
gettimeofday(&_start_keepalive, 0);
in_buff_fill -= result;
@ -603,6 +602,5 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
fds = (in_buff_fill || out_buff_fill )?
fds_data_wait : fds_wait;
}
return 0;
}

View File

@ -194,15 +194,14 @@ struct ipmi_intf * ipmi_intf_load(char * name)
void
ipmi_intf_session_set_hostname(struct ipmi_intf * intf, char * hostname)
{
if (intf->session == NULL)
if (intf->session == NULL || hostname == NULL) {
return;
memset(intf->session->hostname, 0, 16);
if (hostname != NULL) {
memcpy(intf->session->hostname, hostname,
__min(strlen(hostname), 64));
}
if (intf->session->hostname != NULL) {
free(intf->session->hostname);
intf->session->hostname = NULL;
}
intf->session->hostname = strdup(hostname);
}
void
@ -330,6 +329,20 @@ ipmi_intf_session_set_retry(struct ipmi_intf * intf, int retry)
intf->session->retry = retry;
}
void
ipmi_intf_session_cleanup(struct ipmi_intf *intf)
{
if (intf->session == NULL) {
return;
}
if (intf->session->hostname != NULL) {
free(intf->session->hostname);
intf->session->hostname = NULL;
}
free(intf->session);
intf->session = NULL;
}
void
ipmi_cleanup(struct ipmi_intf * intf)
{

View File

@ -2005,12 +2005,7 @@ ipmi_lan_close(struct ipmi_intf * intf)
close(intf->fd);
ipmi_req_clear_entries();
if (intf->session != NULL) {
free(intf->session);
intf->session = NULL;
}
ipmi_intf_session_cleanup(intf);
intf->opened = 0;
intf->manufacturer_id = IPMI_OEM_UNKNOWN;
intf = NULL;

View File

@ -3291,12 +3291,7 @@ ipmi_lanplus_close(struct ipmi_intf * intf)
close(intf->fd);
ipmi_req_clear_entries();
if (intf->session) {
free(intf->session);
intf->session = NULL;
}
ipmi_intf_session_cleanup(intf);
intf->session = NULL;
intf->opened = 0;
intf->manufacturer_id = IPMI_OEM_UNKNOWN;
@ -3367,7 +3362,6 @@ ipmi_lanplus_open(struct ipmi_intf * intf)
return -1;
session = intf->session;
if (!session->port)
session->port = IPMI_LANPLUS_PORT;
if (!session->privlvl)

View File

@ -188,9 +188,14 @@ ipmi_openipmi_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
if (intf->open(intf) < 0)
return NULL;
if (verbose > 2)
printbuf(req->msg.data, req->msg.data_len,
"OpenIPMI Request Message");
if (verbose > 2) {
fprintf(stderr, "OpenIPMI Request Message Header:\n");
fprintf(stderr, " netfn = 0x%x\n", req->msg.netfn );
fprintf(stderr, " cmd = 0x%x\n", req->msg.cmd);
printbuf(req->msg.data, req->msg.data_len, "OpenIPMI Request Message Data");
}
/*
* setup and send message
@ -227,7 +232,7 @@ ipmi_openipmi_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
fprintf(stderr, "Converting message:\n");
fprintf(stderr, " netfn = 0x%x\n", req->msg.netfn );
fprintf(stderr, " cmd = 0x%x\n", req->msg.cmd);
if (recv.msg.data && recv.msg.data_len) {
if (req->msg.data && req->msg.data_len) {
fprintf(stderr, " data_len = %d\n", req->msg.data_len);
fprintf(stderr, " data = %s\n",
buf2str(req->msg.data,req->msg.data_len));

View File

@ -305,12 +305,7 @@ serial_bm_close(struct ipmi_intf * intf)
close(intf->fd);
intf->fd = -1;
}
if (intf->session) {
free(intf->session);
intf->session = NULL;
}
ipmi_intf_session_cleanup(intf);
intf->opened = 0;
}

View File

@ -242,12 +242,7 @@ ipmi_serial_term_close(struct ipmi_intf * intf)
close(intf->fd);
intf->fd = -1;
}
if (intf->session) {
free(intf->session);
intf->session = NULL;
}
ipmi_intf_session_cleanup(intf);
intf->opened = 0;
}