mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-07-01 10:13:35 +00:00
Compare commits
30 Commits
bugfix/fix
...
IPMITOOL_1
Author | SHA1 | Date | |
---|---|---|---|
19d78782d7 | |||
46fd8d942c | |||
a1dc78c456 | |||
4d25a93f49 | |||
65ba015f5c | |||
4d4f29f0b6 | |||
5ac7f6a54e | |||
a24a512bdd | |||
39ca56bf33 | |||
08151adef3 | |||
86ef8fb091 | |||
66cda7e18f | |||
15418696ea | |||
7c47cf75f4 | |||
b7adc1dcaf | |||
11c7605c0d | |||
5cf436056f | |||
cdac4e07f7 | |||
cd57365fc4 | |||
351dad24a2 | |||
fb47ae8d7c | |||
50479484a2 | |||
9a1c0e68ba | |||
1f429f1ed7 | |||
59b7d6cf8f | |||
6b1ce6c1ac | |||
6a3ded7333 | |||
61bb233c5b | |||
fb176a1995 | |||
d88bbf3c41 |
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
@ -1,5 +1,5 @@
|
||||
# vi: set et ts=2 sw=2 :
|
||||
name: C/C++ CI
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -8,10 +8,10 @@ on:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
ubuntu:
|
||||
linux:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-16.04, ubuntu-18.04 ]
|
||||
os: [ ubuntu-18.04, ubuntu-20.04 ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: install dependencies
|
||||
@ -24,17 +24,12 @@ jobs:
|
||||
libtool \
|
||||
make \
|
||||
wget
|
||||
# TODO: Add ubuntu-20.04 to the matrix.os list and fix the build
|
||||
# - name: install extra dependencies
|
||||
# # In Ubuntu 20.04 some crucial development headers/libraries
|
||||
# # have been moved from libc6-dev to musl-dev
|
||||
# if: matrix.os == 'ubuntu-20.04'
|
||||
# run: sudo apt install musl-dev
|
||||
- name: install extra libraries
|
||||
# This build job tries to verify as much of ipmitool code
|
||||
# as possible, hence these libraries. They aren't usually
|
||||
# needed for normal user builds:
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install \
|
||||
libsystemd-dev \
|
||||
libreadline-dev \
|
||||
@ -50,7 +45,6 @@ jobs:
|
||||
./configure --enable-intf-dummy \
|
||||
--enable-intf-dbus \
|
||||
--enable-intf-usb \
|
||||
--enable-intf-bmc \
|
||||
--enable-intf-free
|
||||
- name: make
|
||||
run: make
|
||||
@ -60,8 +54,10 @@ jobs:
|
||||
run: make distcheck
|
||||
|
||||
macos-catalina:
|
||||
|
||||
runs-on: macos-10.15
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ macos-10.15, macos-11 ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: install dependencies
|
||||
|
269
ChangeLog
269
ChangeLog
@ -1,3 +1,238 @@
|
||||
version 1.8.19 2022-08-31
|
||||
* Cast type before the left shift
|
||||
* sel: Fix the deasserted thresholds inequality
|
||||
* man: Update the text for -C option
|
||||
* chassis restart_cause: Add new causes
|
||||
* sel: Remove redundant "Reserve SEL"
|
||||
* zero initialize the recv structure on the stack
|
||||
* zero initialize the recv structure on the stack
|
||||
* ci: Add support for MacOS-11
|
||||
* ci: Remove ubuntu-16.04 support
|
||||
* sdr: Fix modifier unit
|
||||
* Fix compile error
|
||||
* Refactor bridging level detection to dedicated function
|
||||
* Fix double bridge detection in get_max_(req|rsp)_data_size()
|
||||
* ipmi_mc: Fix the IPM_DEV_FWREV1_MAJOR_MASK
|
||||
* helper: Fix stderr file descriptor
|
||||
* Fix codefactor-io / CodeFactor warnings
|
||||
* Use /run instead of /var/run
|
||||
* oem: Update product IDs for YADRO
|
||||
* lan: Add processing of get/set specific CCs
|
||||
* lan: Refactor pointer style
|
||||
* doc: update lanplus doc to reflect default cipher suite change
|
||||
* ekanalyzer: Fix internal use area off-by-one bug
|
||||
* ekanalyzer frushow: Fix internal area size calc
|
||||
* sel: Fix "power supply inactive" flag offset
|
||||
* ci: Add support for Ubuntu 20.04
|
||||
* ci: Fix Ubuntu builds
|
||||
* Fix compiler warning
|
||||
* Fix compiler warning
|
||||
* Fix compiler warning
|
||||
* ci: Update for GitHub Actions v2.274.2
|
||||
* free: Fix implicit function declarations
|
||||
* Use "#pragma once" for headers
|
||||
* Remove unneeded execution bits from C source files and a header file
|
||||
* Convert line endings to LF
|
||||
* Fixed compiler warning.
|
||||
* RPM support: fixed broken build due to use of headers from kernel
|
||||
* imbapi: replace __FUNCTION__ to eleminate compiler warnings
|
||||
* lanplus: remove unused variable
|
||||
* hpmfwupg: Clean up / refactor
|
||||
* fru: Fix crashes on 6-bit ASCII strings
|
||||
* oem: Add product ID for YADRO VEGMAN
|
||||
* configure.ac: add '--location' for curl to follow location
|
||||
* configure.ac: replace '-#' by '--progress-bar' with curl
|
||||
* Add version info to debug output
|
||||
* doc, ci: Fix an error in package name for Windows
|
||||
* doc: Fix a small typo in INSTALL
|
||||
* RPM support: updated spec file changelog
|
||||
* RPM support: simplified build process
|
||||
* RPM support: fixed broken RPM build
|
||||
* doc: Update INSTALL with Windows info
|
||||
* ci: Add Windows/cygwin config
|
||||
* doc: Update INSTALL for new CI
|
||||
* ci: Add github workflow, drop travis
|
||||
* Fix compatibility with OpenBSD and macOS
|
||||
* dist: Fix dependencies and cleanup
|
||||
* dist: Add missing ipmi_time.h header to packaging
|
||||
* configure: Fix compatibility with non-bash systems
|
||||
* Finalize refactoring of string comparisons
|
||||
* channel: Refactor set_user_access option processing
|
||||
* Refactor string comparisons
|
||||
* sel: Fix OEM record definition example
|
||||
* sdr: harden against bad records
|
||||
* fru: fix memory leak in ipmi_spd_print_fru
|
||||
* ipmi_sel_set_time: fix strptime() return check
|
||||
* hpm: use portable __max() in hpmfwupg
|
||||
* hpmfwupg: move variable definition to .c file
|
||||
* sel: time: fix null pointer dereference in set
|
||||
* fru, sdr: Fix id_string buffer overflows
|
||||
* lanp: Fix buffer overflows in get_lan_param_select
|
||||
* channel: Fix buffer overflow
|
||||
* session: Fix buffer overflow in ipmi_get_session_info
|
||||
* fru: Fix buffer overflow in ipmi_spd_print_fru
|
||||
* fru: Fix buffer overflow vulnerabilities
|
||||
* configure: Drop requirement for curses et. al libs
|
||||
* configure: remove some duplicate code
|
||||
* doc: Update INSTALL to fix installation errors
|
||||
* ipmi_dcmi: fix typo in nm_policy_options initialization.
|
||||
* Docs: Add info on packages to install on Ubuntu 16.04
|
||||
* chassis: Refactor to get rid of strncmp()
|
||||
* chassis: Refactor main for centralized exiting
|
||||
* chassis: bootdev: Refactor more
|
||||
* chassis: bootdev: Refactor to reduce nesting
|
||||
* chassis: bootdev: Fix help message and its formatting
|
||||
* chassis: bootparam/bootdev: Refactor for less magic
|
||||
* oem: supermicro: Add product codes from IPMICFG
|
||||
* doc: Update man page regarding `user set password`
|
||||
* user: Cleanup/refactor ipmi_user_password()
|
||||
* user: Improve password length handling
|
||||
* user: Alter "set password" usage information
|
||||
* intf: Add missing function declarations
|
||||
* doc: fix URL in README
|
||||
* event: Clean up event sending from a file
|
||||
* event: Clean up the event sending code
|
||||
* event: Fix event submission via SSIF
|
||||
* make: Use DESTDIR to install IANA PEN database
|
||||
* lanplus: Fix embedded bridged responses handling
|
||||
* Update .gitignore
|
||||
* mc: Fix reporting of manufacturers > 64K
|
||||
* Add installation of enterprise-numbers database
|
||||
* Update documentation in regard to IANA PEN registry
|
||||
* Use configurable path to IANA PEN registry
|
||||
* Load IANA PEN registry from a file
|
||||
* dbus: Replace obsolete INCLUDES with AM_CPPFLAGS
|
||||
* oem: name change from Newisys to Viking Enterprise Solutions
|
||||
* Fix default interface to behave as it did before
|
||||
* man: Add documentation for chassis bootmbox
|
||||
* man: Update the chassis bootparam section
|
||||
* chassis: Add boot initiator mailbox support
|
||||
* chassis: Use command-specific completion code parser
|
||||
* Add support for command-specific completion codes
|
||||
* Add a helper htoipmi24() function
|
||||
* Add a helper args2buf() function
|
||||
* man: Cleanup the manpage formatting tags
|
||||
* create_pen_list: only print if values are set
|
||||
* chassis: Refactor to reduce code duplication
|
||||
* chassis: Refactor to reduce code duplication
|
||||
* sdr: Fix segfault on invalid unit types
|
||||
* vendor: Add YADRO TATLIN Storage Controller ID
|
||||
* exchange-bmc-os-info: Remove dependency on ipmi.service
|
||||
* Add mechanism to configure to set the default interface
|
||||
* ci: Update INSTALL to reflect recent changes
|
||||
* ci: Set up matrix builds with Travis CI
|
||||
* Enable Travis build of D-Bus interface
|
||||
* add OpenBMC D-Bus interface
|
||||
* Fix "ipmitool pef {status,info}" not printing final newline
|
||||
* Remove unused include
|
||||
* Fix IPMI DCMI message typo
|
||||
* open: swap free() calls for free_n()
|
||||
* open: checking received msg id against expectation
|
||||
* open: fix whitespace
|
||||
* Refactor free_n() function
|
||||
* fru: swap free() calls for free_n()
|
||||
* fru: Fix write chunk reduction code
|
||||
* fru: add macro FRU_AREA macros
|
||||
* fru: replace magic return codes with macros
|
||||
* fru header: add return error codes specific to fru
|
||||
* fru: fix ipmi_fru_picmg_ext_edit as bool
|
||||
* fru: use bool with ipmi_fru_oemkontron_edit
|
||||
* fru: change ipmi_fru_query_new_value to return bool
|
||||
* fru: mark ipmi_fru_query_new_value as static
|
||||
* fru: add fru_cc_rq2big helper method for code checks
|
||||
* fru: cleanup ipmi_fru_upg_ekeying
|
||||
* fru: use ipmi_cc defined maros for return codes
|
||||
* fru: drop extraneous parentheses on negative returns
|
||||
* fru: delete unused variable matchInstance
|
||||
* fru: cleanup ipmi_fru_oemkontron_get
|
||||
* fru: fixup array bounds checking
|
||||
* hpm: Adhere to centralized exiting
|
||||
* hpm: Minor refactoring
|
||||
* hpm: Fix resource leak
|
||||
* sol: Make interface timeout obey the -N option
|
||||
* helper: add free_n method to handle clearing pointers
|
||||
* cygwin: imb: Fix build error (wchar_t)
|
||||
* lanplus: Fix segfault for truncated dcmi response
|
||||
* Move led color static array to source file
|
||||
* drop unused static arrays
|
||||
* move static objects to source file
|
||||
* cleanup all unused-parameter warnings
|
||||
* use __UNUSED__ macro instead of gcc specific attribute
|
||||
* implement __UNUSED__ macro for marking unused
|
||||
* Add .dirstamp to .gitignore
|
||||
* fru: Fix processing of unspecified board mfg. date
|
||||
* [compiler-warnings-fixes] use correct fall through comment
|
||||
* [compiler-warnings-fixes] ipmi_start_daemon: check return values
|
||||
* [compiler-warnings-fixes] ipmi_sdr.c: remove unused function parameters
|
||||
* lan: Fix processing disabled VLAN
|
||||
* Make ipmitool respect system locale settings
|
||||
* Fix strftime() non-literal argument warning
|
||||
* Refactor timestamp handling
|
||||
* doc: Update manpage with new contact info
|
||||
* lanplus: Refactoring
|
||||
* lanplus: Fix -C option processing
|
||||
* lanplus: Auto-select 'best' cipher suite available
|
||||
* lanplus: Fix compile with deprecated APIs disabled.
|
||||
* doc: Update home page links
|
||||
* doc: Update formatting of ipmitool man page
|
||||
* sensor: Refactor ipmi_sensor_print_fc_threshold()
|
||||
* sensor: Add support for csv output
|
||||
* plugins: open: Properly enable event receiver (#35)
|
||||
* lan: Refactoring: Remove unused function
|
||||
* general: Get rid of some unused parameter warnings
|
||||
* mc: guid: Implement encoding autodetection
|
||||
* mc: guid: Fix timestamp decoding
|
||||
* mc: guid: Add support for non-standard encodings
|
||||
* mc: guid: Fix byte ordering to follow IPMI spec
|
||||
* Refactoring: optimize pointer checks
|
||||
* imb: Refactoring: remove duplicate code
|
||||
* Refactoring: get rid of superfluous comparisons
|
||||
* Refactoring. Improve code reuse ratio.
|
||||
* general: Fix several misspellings
|
||||
* mc: Fix compiler warnings
|
||||
* general: Add array_byteswap() to helper
|
||||
* lanplus: Make byteswapping generic
|
||||
* framework: Update .gitignore
|
||||
* framework: Switch to C11 standard with GNU extensions
|
||||
* framework: ci: Add support for Travis CI
|
||||
* oem: Add basic support for Quanta
|
||||
* intf: Refactoring. Remove unused sendrsp()
|
||||
* dummy: Add default dummy socket
|
||||
* mc: Fix manufacturer ID masking
|
||||
* Refactoring. Remove useless feature test macros.
|
||||
* general: Make byteswapping arch-independent
|
||||
* sel: Minor refactoring
|
||||
* sdr: Refactor/optimize code. No functional changes.
|
||||
* Add an option to display all dates in UTC
|
||||
* mc: Code refactor to reduce copy-paste ratio
|
||||
* mc: watchdog set: Refactor to reduce complexity
|
||||
* mc: watchdog set: Fix intr setting
|
||||
* mc: watchdog get: Update to match IPMI 2.0 spec
|
||||
* mc: watchdog: Add `set` command
|
||||
* framework: Make git ignore cscope.out
|
||||
* plugins/open: Fix for interrupted select
|
||||
* nm: Fix policy range (#12)
|
||||
* Replace user_id masks with a macro (#8)
|
||||
* fru: internaluse: Fix segmentation fault (#9)
|
||||
* dcmi: Refactor
|
||||
* ID:508 - Fix segfaults in dcmi command handlers
|
||||
* vendor: Add YADRO VESNIN identification
|
||||
* ID:491 - Fetch vendor IDs from IANA
|
||||
* ID:472 - Fix The Most recent Addition/Erase date
|
||||
* ID:480 - Call EVP_CIPHER_CTX_free() instead of EVP_CIPHER_CTX_cleanup()
|
||||
* ID:480 - ipmitool coredumps in EVP_CIPHER_CTX_init
|
||||
* Make git revision more descriptive
|
||||
* ID:477 - fru: Fix decoding of non-text data in get_fru_area_str()
|
||||
* ID:479 - ekanalyzer: fix processing of custom mfg. fields
|
||||
* ID:478 - ekanalyzer: Fixed decoding of FRU fields
|
||||
* Add some more configure/build/editor byproducts to .gitignore
|
||||
* Add git hash and dirty mark to ipmitool version
|
||||
* Prevent autoreconf from complaining about missing NEWS
|
||||
* Add bootstrap support for Mac
|
||||
* ID:474 - Compile fix on nonlinux systems
|
||||
* ID:461 - Make compiler happier about changes related to OpenSSL 1.1
|
||||
* ID:461 - OpenSSL 1.1 compatibility - "error: storage size of 'ctx' isn't known"
|
||||
|
||||
version 1.8.18 2016-10-08
|
||||
* Add mac2str() and str2mac() to print/parse MAC address
|
||||
* Change formatting, remove commented-out code in
|
||||
@ -647,7 +882,7 @@ version 1.8.11 released 2009-02-25
|
||||
* 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 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
|
||||
@ -663,14 +898,14 @@ version 1.8.11 released 2009-02-25
|
||||
* 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
|
||||
* 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
|
||||
|
||||
version 1.8.10 released 2008-08-08
|
||||
* Added support for BULL IANA number.
|
||||
* Fixed contrib build so the oem_ibm_sel_map file gets included in
|
||||
* Fixed contrib build so the oem_ibm_sel_map file gets included in
|
||||
rpm builds again.
|
||||
* Added support for Debian packages to be built from CVS
|
||||
* Fix for sdr and sel timestamp reporting issues
|
||||
@ -679,11 +914,11 @@ version 1.8.10 released 2008-08-08
|
||||
* Change ipmi_chassis_status() to non-static so it can be used
|
||||
externally
|
||||
* Added retries to SOL keepalive
|
||||
* Fix to stop sensor list command from reporting a failure due
|
||||
* Fix to stop sensor list command from reporting a failure due
|
||||
to missing sensor
|
||||
* Fix bug in sdr free space reporting
|
||||
* Add support for IANA number to vendor name conversion for many
|
||||
vendors
|
||||
vendors
|
||||
* Fix segfault bug in lan set command
|
||||
* Fix bug in population of raw i2c wdata buffer
|
||||
* Fix bug in ipmb sensor reading
|
||||
@ -697,7 +932,7 @@ version 1.8.10 released 2008-08-08
|
||||
* Add more JEDEC support info for DIMMs; decrease request size
|
||||
for DIMM FRU info to 16 bytes at a time to allow more
|
||||
DIMM FRUs to respond.
|
||||
* Fix to change hpmfwupg to version 1.02; fix to reduce hpmfwupg
|
||||
* Fix to change hpmfwupg to version 1.02; fix to reduce hpmfwupg
|
||||
buffer length more aggressively when no response from iol
|
||||
* Fix HPM firmware activation via IOL; fake a timeout after IOL
|
||||
session re-open to force get upgrade status retry;
|
||||
@ -706,11 +941,11 @@ version 1.8.10 released 2008-08-08
|
||||
* Fix for oemval2str size
|
||||
* Add support for product name resolution in mc info
|
||||
* Fix FRU display format
|
||||
* Added PICMG ekeying analyzer module support (ekanalyzer);
|
||||
display point to point physical connectivity and power
|
||||
supply information between carriers and AMC modules;
|
||||
display matched results of ekeying match between an
|
||||
on-carrier device and AMC module or between 2 AMC modules
|
||||
* Added PICMG ekeying analyzer module support (ekanalyzer);
|
||||
display point to point physical connectivity and power
|
||||
supply information between carriers and AMC modules;
|
||||
display matched results of ekeying match between an
|
||||
on-carrier device and AMC module or between 2 AMC modules
|
||||
* Fix AMC GUID display support
|
||||
* Improved amcportstate operations
|
||||
* Added resolution for new sensor types
|
||||
@ -723,8 +958,8 @@ version 1.8.10 released 2008-08-08
|
||||
* Added SPD support for parms: channel number, max read size
|
||||
* Add SDR support for adding SDR records from a dumped file,
|
||||
clearing SDR, adding partial SDR records
|
||||
* Add updates and fixes to hpmfwupg: upload block size to 32 bytes
|
||||
for KCS, handle long response option, implement rollback
|
||||
* Add updates and fixes to hpmfwupg: upload block size to 32 bytes
|
||||
for KCS, handle long response option, implement rollback
|
||||
override, garbage output fix
|
||||
* Add double bridge lan support , fix bridging issue
|
||||
* Add HPM support to pre-check which components need to be skipped
|
||||
@ -758,7 +993,7 @@ version 1.8.9 released 2007-03-06
|
||||
* Added edit support for AMC activation "Maximum Internal Current"
|
||||
* Fix bug generating garbage on the screen when handling GetDeviceId
|
||||
and sol traffic occurs
|
||||
* Added ability to map OEM sensor types to OEM description string using
|
||||
* Added ability to map OEM sensor types to OEM description string using
|
||||
IANA number; moved IANA number table
|
||||
* Fix lan set access command to use value already saved within
|
||||
parameters for PEF and authentication
|
||||
@ -776,13 +1011,13 @@ version 1.8.9 released 2007-03-06
|
||||
* Fix SOL set errors when commit-write not supported
|
||||
* Fix reset of session timeout for lanplus interface
|
||||
* Fixed lan interface accessibility timeout handling
|
||||
* Fix bug with Function Get Channel Cipher Suites command when
|
||||
* Fix bug with Function Get Channel Cipher Suites command when
|
||||
more than 1 page used.
|
||||
* Fix missing firmware firewall top-level command
|
||||
* Fix bug in SOL keepalive functionality
|
||||
* Fix SOLv2 NACK and retry handling for Intel ESB2 BMC
|
||||
* Added ipmi_sel_get_oem_sensor* APIs
|
||||
* Added HPM.1 support
|
||||
* Added HPM.1 support
|
||||
* Fix segfault when incorrect oem option supplied
|
||||
* Fix bus problem with spd command
|
||||
* Fix segfault in SOL when remote BMC does not return packet
|
||||
@ -796,7 +1031,7 @@ version 1.8.9 released 2007-03-06
|
||||
* Add freeipmi interface support
|
||||
* Add remote spd printing
|
||||
* Add better detection of linux/compiler.h to config
|
||||
* Makefile changes to fix makedistcheck, etc.
|
||||
* Makefile changes to fix makedistcheck, etc.
|
||||
|
||||
version 1.8.8
|
||||
* Fix segfaults in sensor data repository list
|
||||
|
@ -2,7 +2,7 @@ dnl
|
||||
dnl autoconf for ipmitool
|
||||
dnl
|
||||
m4_define([git_suffix], m4_esyscmd_s(./csv-revision))
|
||||
AC_INIT([ipmitool], [1.8.18git_suffix])
|
||||
AC_INIT([ipmitool], [1.8.19git_suffix])
|
||||
AC_CONFIG_SRCDIR([src/ipmitool.c])
|
||||
AC_CONFIG_COMMANDS_PRE([export prefix=$prefix])
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
@ -27,9 +27,9 @@ TRAPD_BMC_CONF="${SNMPD_BMC_CONF_DIR}/snmptrapd.local.conf"
|
||||
TRAPD_CONF="/etc/snmp/snmptrapd.conf"
|
||||
|
||||
LOCKFILE="/var/lock/subsys/bmc-snmp-proxy"
|
||||
BMC_INFO="/var/run/bmc-info"
|
||||
BMC_INFO="/run/bmc-info"
|
||||
|
||||
IPMITOOL=`which ipmitool`
|
||||
IPMITOOL=$(which ipmitool)
|
||||
|
||||
#Default config
|
||||
BMC_COMMUNITY="public"
|
||||
@ -158,7 +158,7 @@ pick_alert_dest()
|
||||
{
|
||||
test_ip="$1"
|
||||
# We have 4 IPv4 and 4 IPv6 alert dest. We will set IPv4 for now.
|
||||
for ALERT_DEST in `seq 1 4`
|
||||
for ALERT_DEST in $(seq 1 4)
|
||||
do
|
||||
temp_ip=$(${IPMITOOL} lan alert print ${CHANNEL} ${ALERT_DEST}\
|
||||
2>/dev/null| sed -n "s#^Alert IP Address.*: ##p")
|
||||
@ -178,7 +178,7 @@ config_bmc_alert_dest()
|
||||
{
|
||||
# call with enable|disable
|
||||
# Pick the first active LAN channel
|
||||
for CHANNEL in `seq 1 14`
|
||||
for CHANNEL in $(seq 1 14)
|
||||
do
|
||||
[ $(${IPMITOOL} -I open channel info ${CHANNEL} 2>/dev/null \
|
||||
| grep -q "802\.3") ] || break
|
||||
|
@ -5,7 +5,7 @@ After=exchange-bmc-os-info.service
|
||||
Requires=exchange-bmc-os-info.service
|
||||
PartOf=exchange-bmc-os-info.service
|
||||
|
||||
ConditionPathExists=/var/run/bmc-info
|
||||
ConditionPathExists=/run/bmc-info
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
@ -12,10 +12,10 @@
|
||||
# Description: Script to set OS information in the BMC; fetch BMC IP/URL
|
||||
# and set in the OS for use by other scripts/user.
|
||||
#
|
||||
# BMC IP and URL are made available in /var/run/bmc-info
|
||||
# BMC IP and URL are made available in /run/bmc-info
|
||||
#
|
||||
# Example to launch BMC web-interface:
|
||||
# # . /var/run/bmc-info
|
||||
# # . /run/bmc-info
|
||||
# # xdg-open $BMC_URL
|
||||
#
|
||||
# See here for details:
|
||||
@ -42,7 +42,7 @@
|
||||
#############################################################################
|
||||
CONFIGFILE=/etc/sysconfig/exchange-bmc-os-info
|
||||
IPMI_TOOL=/usr/bin/ipmitool
|
||||
BMC_INFO=/var/run/bmc-info
|
||||
BMC_INFO=/run/bmc-info
|
||||
|
||||
# BMC Manufacturer ID used in 'oem_set_os_version' and 'oem_get_bmc_url'
|
||||
DELL="674"
|
||||
|
@ -22,7 +22,7 @@ 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
|
||||
PIDFILE=/run/$NAME.pid
|
||||
SCRIPTNAME=/etc/init.d/$NAME
|
||||
|
||||
# Gracefully exit if the package has been removed.
|
||||
|
@ -174,7 +174,7 @@ Do NOT become a daemon, instead log all messages to stderr.
|
||||
.TP
|
||||
\fIpidfile\fP=<\fBfilename\fR>
|
||||
Save process ID to this file when in daemon mode. Defaults to
|
||||
/var/run/ipmievd.pid\fIN\fP (where \fIN\fP is the ipmi device
|
||||
/run/ipmievd.pid\fIN\fP (where \fIN\fP is the ipmi device
|
||||
number -- defaults to 0).
|
||||
.RE
|
||||
|
||||
@ -197,7 +197,7 @@ Do NOT become a daemon, instead log all messages to stderr.
|
||||
.TP
|
||||
\fIpidfile\fP=<\fBfilename\fR>
|
||||
Save process ID to this file when in daemon mode. Defaults to
|
||||
/var/run/ipmievd.pid\fIN\fP (where \fIN\fP is the ipmi device
|
||||
/run/ipmievd.pid\fIN\fP (where \fIN\fP is the ipmi device
|
||||
number -- defaults to 0).
|
||||
.TP
|
||||
\fItimeout\fP=<\fBseconds\fR>
|
||||
|
@ -97,9 +97,14 @@ This is not available with all commands.
|
||||
.TP
|
||||
\fB\-C\fR <\fIciphersuite\fP>
|
||||
The remote server authentication, integrity, and encryption algorithms
|
||||
to use for IPMIv2.0 \fIlanplus\fP connections. See table 22\-19 in the
|
||||
IPMIv2.0 specification. The default is 3 which specifies RAKP\-HMAC\-SHA1
|
||||
authentication, HMAC\-SHA1\-96 integrity, and AES\-CBC\-128 encryption algorithms.
|
||||
to use for IPMIv2.0 \fIlanplus\fP connections. See table 22\-20 in the
|
||||
IPMI v2.0 specification. The default is 17 which specifies RAKP\-HMAC\-SHA256
|
||||
authentication, HMAC\-SHA256\-128 integrity, and AES\-CBC\-128 encryption algorithms.
|
||||
|
||||
NOTE: In
|
||||
.BR ipmitool
|
||||
1.8.18 and earlier the default was 3, which was insecure and was not supported
|
||||
by some more recent BMC implementations.
|
||||
.TP
|
||||
\fB\-d \fIN\fP\fR
|
||||
Use device number N to specify the /dev/ipmiN (or
|
||||
@ -3742,9 +3747,9 @@ those available for the \fIlan\fP interface.
|
||||
The \fB\-C\fR option allows you specify the authentication, integrity,
|
||||
and encryption algorithms to use for for \fIlanplus\fP session based
|
||||
on the cipher suite ID found in the IPMIv2.0 specification in table
|
||||
22\-19. The default cipher suite is \fI3\fP which specifies
|
||||
RAKP\-HMAC\-SHA1 authentication, HMAC\-SHA1\-96 integrity, and AES\-CBC\-128
|
||||
encryption algorightms.
|
||||
22\-20. The default cipher suite is \fI17\fP which specifies
|
||||
RAKP\-HMAC\-SHA256 authentication, HMAC\-SHA256\-128 integrity, and
|
||||
AES\-CBC\-128 encryption algorightms.
|
||||
|
||||
.SH "FREE INTERFACE"
|
||||
.LP
|
||||
|
@ -152,7 +152,7 @@ static inline uint16_t ipmi16toh(void *ipmi16)
|
||||
uint8_t *ipmi = (uint8_t *)ipmi16;
|
||||
uint16_t h;
|
||||
|
||||
h = ipmi[1] << 8; /* MSB */
|
||||
h = (uint16_t)ipmi[1] << 8; /* MSB */
|
||||
h |= ipmi[0]; /* LSB */
|
||||
|
||||
return h;
|
||||
@ -169,7 +169,7 @@ static inline uint32_t ipmi24toh(void *ipmi24)
|
||||
uint8_t *ipmi = (uint8_t *)ipmi24;
|
||||
uint32_t h = 0;
|
||||
|
||||
h = ipmi[2] << 16; /* MSB */
|
||||
h = (uint32_t)ipmi[2] << 16; /* MSB */
|
||||
h |= ipmi[1] << 8;
|
||||
h |= ipmi[0]; /* LSB */
|
||||
|
||||
@ -188,7 +188,7 @@ static inline uint32_t ipmi32toh(void *ipmi32)
|
||||
uint8_t *ipmi = ipmi32;
|
||||
uint32_t h;
|
||||
|
||||
h = ipmi[3] << 24; /* MSB */
|
||||
h = (uint32_t)ipmi[3] << 24; /* MSB */
|
||||
h |= ipmi[2] << 16;
|
||||
h |= ipmi[1] << 8;
|
||||
h |= ipmi[0]; /* LSB */
|
||||
|
@ -242,6 +242,7 @@ struct ipmi_intf {
|
||||
|
||||
uint16_t ipmi_intf_get_max_request_data_size(struct ipmi_intf *intf);
|
||||
uint16_t ipmi_intf_get_max_response_data_size(struct ipmi_intf *intf);
|
||||
uint8_t ipmi_intf_get_bridging_level(const struct ipmi_intf *intf);
|
||||
|
||||
struct ipmi_intf * ipmi_intf_load(char * name);
|
||||
void ipmi_intf_print(struct ipmi_intf_support * intflist);
|
||||
|
@ -83,7 +83,7 @@ struct ipm_devid_rsp {
|
||||
#define IPM_DEV_DEVICE_ID_REV_MASK (0x0F) /* BCD-enoded */
|
||||
|
||||
#define IPM_DEV_FWREV1_AVAIL_MASK (0x80) /* 0 = normal operation */
|
||||
#define IPM_DEV_FWREV1_MAJOR_MASK (0x3f) /* Major rev, BCD-encoded */
|
||||
#define IPM_DEV_FWREV1_MAJOR_MASK (0x7f) /* Major rev, BCD-encoded */
|
||||
|
||||
#define IPM_DEV_IPMI_VER_MAJOR_MASK (0x0F) /* Major rev, BCD-encoded */
|
||||
#define IPM_DEV_IPMI_VER_MINOR_MASK (0xF0) /* Minor rev, BCD-encoded */
|
||||
|
@ -256,7 +256,7 @@ static const struct ipmi_event_sensor_types sensor_specific_event_types[] = {
|
||||
{ 0x08, 0x06, 0x03, "Config Error: Power Supply Rating Mismatch" },
|
||||
{ 0x08, 0x06, 0x04, "Config Error: Voltage Rating Mismatch" },
|
||||
{ 0x08, 0x06, 0xff, "Config Error" },
|
||||
{ 0x08, 0x06, 0xff, "Power Supply Inactive" },
|
||||
{ 0x08, 0x07, 0xff, "Power Supply Inactive" },
|
||||
/* Power Unit */
|
||||
{ 0x09, 0x00, 0xff, "Power off/down" },
|
||||
{ 0x09, 0x01, 0xff, "Power cycle" },
|
||||
|
@ -49,6 +49,7 @@ extern const struct valstr ipmi_authtype_vals[];
|
||||
extern const struct valstr ipmi_channel_protocol_vals[];
|
||||
extern const struct valstr ipmi_channel_medium_vals[];
|
||||
extern const struct valstr ipmi_chassis_power_control_vals[];
|
||||
extern const struct valstr ipmi_chassis_restart_cause_vals[];
|
||||
extern const struct valstr ipmi_auth_algorithms[];
|
||||
extern const struct valstr ipmi_integrity_algorithms[];
|
||||
extern const struct valstr ipmi_encryption_algorithms[];
|
||||
|
@ -54,7 +54,7 @@
|
||||
#ifdef HAVE_PATHS_H
|
||||
# include <paths.h>
|
||||
#else
|
||||
# define _PATH_VARRUN "/var/run/"
|
||||
# define _PATH_RUN "/run/"
|
||||
#endif
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
@ -935,7 +935,7 @@ ipmi_start_daemon(struct ipmi_intf *intf)
|
||||
exit(1);
|
||||
}
|
||||
ret = dup(fd);
|
||||
if (ret != STDOUT_FILENO) {
|
||||
if (ret != STDERR_FILENO) {
|
||||
lprintf(LOG_ERR, "failed to reset stderr: %s (%d)", strerror(errno), errno);
|
||||
exit(1);
|
||||
}
|
||||
|
@ -378,42 +378,8 @@ ipmi_chassis_restart_cause(struct ipmi_intf * intf)
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("System restart cause: ");
|
||||
|
||||
switch (rsp->data[0] & 0xf) {
|
||||
case 0:
|
||||
printf("unknown\n");
|
||||
break;
|
||||
case 1:
|
||||
printf("chassis power control command\n");
|
||||
break;
|
||||
case 2:
|
||||
printf("reset via pushbutton\n");
|
||||
break;
|
||||
case 3:
|
||||
printf("power-up via pushbutton\n");
|
||||
break;
|
||||
case 4:
|
||||
printf("watchdog expired\n");
|
||||
break;
|
||||
case 5:
|
||||
printf("OEM\n");
|
||||
break;
|
||||
case 6:
|
||||
printf("power-up due to always-restore power policy\n");
|
||||
break;
|
||||
case 7:
|
||||
printf("power-up due to restore-previous power policy\n");
|
||||
break;
|
||||
case 8:
|
||||
printf("reset via PEF\n");
|
||||
break;
|
||||
case 9:
|
||||
printf("power-cycle via PEF\n");
|
||||
break;
|
||||
default:
|
||||
printf("invalid\n");
|
||||
}
|
||||
printf("System restart cause: %s\n",
|
||||
val2str(rsp->data[0] & 0xf, ipmi_chassis_restart_cause_vals));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -43,6 +43,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#define NO_MORE_INFO_FIELD 0xc1
|
||||
#define TYPE_CODE 0xc0 /*Language code*/
|
||||
@ -2443,6 +2445,8 @@ ipmi_ek_display_fru_header_detail(char *filename)
|
||||
if (header.offset.internal != 0) {
|
||||
unsigned char format_version;
|
||||
unsigned long len = 0;
|
||||
uint8_t *area_offset;
|
||||
uint8_t next_offset = UINT8_MAX;
|
||||
|
||||
printf("%s\n", EQUAL_LINE_LIMITER);
|
||||
printf("FRU Internal Use Info\n");
|
||||
@ -2456,12 +2460,46 @@ ipmi_ek_display_fru_header_detail(char *filename)
|
||||
}
|
||||
printf("Format Version: %d\n", (format_version & 0x0f));
|
||||
|
||||
if (header.offset.chassis > 0) {
|
||||
len = (header.offset.chassis * FACTOR_OFFSET)
|
||||
- (header.offset.internal * FACTOR_OFFSET);
|
||||
} else {
|
||||
len = (header.offset.board * FACTOR_OFFSET)
|
||||
- (header.offset.internal * FACTOR_OFFSET);
|
||||
/* Internal use area doesn't contain the size byte.
|
||||
* We need to calculate its size by finding the area
|
||||
* that is next. Areas may not follow the same order
|
||||
* as their offsets listed in the header, so we need
|
||||
* to find the area that is physically next to the
|
||||
* internal use area.
|
||||
*/
|
||||
for (area_offset = &header.offset.internal + 1;
|
||||
area_offset <= &header.offset.multi;
|
||||
++area_offset)
|
||||
{
|
||||
/* If the area is closer to us than the previously
|
||||
* checked one, make it our best candidate
|
||||
*/
|
||||
if (*area_offset < next_offset
|
||||
&& *area_offset > header.offset.internal)
|
||||
{
|
||||
next_offset = *area_offset;
|
||||
}
|
||||
}
|
||||
|
||||
/* If there was at least one area after internal use one,
|
||||
* then we must have found it and can use it to calculate
|
||||
* length. Otherwise, everything till the end of file is
|
||||
* internal use area expect for the last (checksum) byte.
|
||||
*/
|
||||
if (next_offset < UINT8_MAX) {
|
||||
len = (next_offset - header.offset.internal) * FACTOR_OFFSET;
|
||||
--len; /* First byte of internal use area is version and we've
|
||||
already read it */
|
||||
}
|
||||
else {
|
||||
struct stat fs;
|
||||
long curpos = ftell(input_file);
|
||||
if (curpos < 0 || 0 > fstat(fileno(input_file), &fs)) {
|
||||
lprintf(LOG_ERR, "Failed to determine FRU file size");
|
||||
fclose(input_file);
|
||||
return -1;
|
||||
}
|
||||
len = fs.st_size - curpos - 1; /* Last byte is checksum */
|
||||
}
|
||||
printf("Length: %ld\n", len);
|
||||
printf("Data dump:\n");
|
||||
|
137
lib/ipmi_lanp.c
137
lib/ipmi_lanp.c
@ -61,7 +61,7 @@ static struct lan_param {
|
||||
int cmd;
|
||||
int size;
|
||||
char desc[24];
|
||||
uint8_t * data;
|
||||
uint8_t *data;
|
||||
int data_len;
|
||||
} ipmi_lan_params[] = {
|
||||
{ IPMI_LANP_SET_IN_PROGRESS, 1, "Set in Progress", NULL, 0 },
|
||||
@ -100,6 +100,19 @@ static struct lan_param {
|
||||
{ -1, -1, "", NULL, -1 }
|
||||
};
|
||||
|
||||
static const struct valstr set_lan_cc_vals[] = {
|
||||
{ 0x80, "Unsupported parameter" },
|
||||
{ 0x81, "Attempt to set 'in progress' while not in 'complete' state" },
|
||||
{ 0x82, "Parameter is read-only" },
|
||||
{ 0x83, "Parameter is wrote-only" },
|
||||
{ 0x00, NULL }
|
||||
};
|
||||
|
||||
static const struct valstr get_lan_cc_vals[] = {
|
||||
{ 0x80, "Unsupported parameter" },
|
||||
{ 0x00, NULL }
|
||||
};
|
||||
|
||||
static void print_lan_alert_print_usage(void);
|
||||
static void print_lan_alert_set_usage(void);
|
||||
static void print_lan_set_usage(void);
|
||||
@ -123,7 +136,7 @@ static void print_lan_usage(void);
|
||||
* @chan: channel number to check
|
||||
*/
|
||||
static int
|
||||
is_lan_channel(struct ipmi_intf * intf, uint8_t chan)
|
||||
is_lan_channel(struct ipmi_intf *intf, uint8_t chan)
|
||||
{
|
||||
uint8_t medium;
|
||||
|
||||
@ -148,7 +161,7 @@ is_lan_channel(struct ipmi_intf * intf, uint8_t chan)
|
||||
* @start: channel number to start searching from
|
||||
*/
|
||||
uint8_t
|
||||
find_lan_channel(struct ipmi_intf * intf, uint8_t start)
|
||||
find_lan_channel(struct ipmi_intf *intf, uint8_t start)
|
||||
{
|
||||
uint8_t chan = 0;
|
||||
|
||||
@ -174,10 +187,11 @@ find_lan_channel(struct ipmi_intf * intf, uint8_t start)
|
||||
* @select: lan parameter set selector
|
||||
*/
|
||||
static struct lan_param *
|
||||
get_lan_param_select(struct ipmi_intf * intf, uint8_t chan, int param, int select)
|
||||
get_lan_param_select(struct ipmi_intf *intf, uint8_t chan, int param, int select)
|
||||
{
|
||||
struct lan_param * p = NULL;
|
||||
struct ipmi_rs * rsp;
|
||||
struct lan_param *p = NULL;
|
||||
struct lan_param *rc = NULL;
|
||||
struct ipmi_rs *rsp;
|
||||
struct ipmi_rq req;
|
||||
int i = 0;
|
||||
uint8_t msg_data[4];
|
||||
@ -191,7 +205,7 @@ get_lan_param_select(struct ipmi_intf * intf, uint8_t chan, int param, int selec
|
||||
|
||||
if (!p) {
|
||||
lprintf(LOG_INFO, "Get LAN Parameter failed: Unknown parameter.");
|
||||
return NULL;
|
||||
return rc;
|
||||
}
|
||||
|
||||
msg_data[0] = chan;
|
||||
@ -208,7 +222,7 @@ get_lan_param_select(struct ipmi_intf * intf, uint8_t chan, int param, int selec
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp) {
|
||||
lprintf(LOG_INFO, "Get LAN Parameter '%s' command failed", p->desc);
|
||||
return NULL;
|
||||
return rc;
|
||||
}
|
||||
|
||||
switch (rsp->ccode)
|
||||
@ -219,19 +233,18 @@ get_lan_param_select(struct ipmi_intf * intf, uint8_t chan, int param, int selec
|
||||
case 0x80: /* parameter not supported */
|
||||
case 0xc9: /* parameter out of range */
|
||||
case 0xcc: /* invalid data field in request */
|
||||
|
||||
/* these completion codes usually mean parameter not supported */
|
||||
lprintf(LOG_INFO, "Get LAN Parameter '%s' command failed: %s",
|
||||
p->desc, val2str(rsp->ccode, completion_code_vals));
|
||||
/* We treat them as valid but empty response */
|
||||
p->data = NULL;
|
||||
p->data_len = 0;
|
||||
return p;
|
||||
|
||||
rc = p;
|
||||
/* fall through */
|
||||
default:
|
||||
|
||||
/* other completion codes are treated as error */
|
||||
lprintf(LOG_INFO, "Get LAN Parameter '%s' command failed: %s",
|
||||
p->desc, val2str(rsp->ccode, completion_code_vals));
|
||||
p->desc,
|
||||
specific_val2str(rsp->ccode,
|
||||
get_lan_cc_vals,
|
||||
completion_code_vals));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -254,7 +267,7 @@ get_lan_param_select(struct ipmi_intf * intf, uint8_t chan, int param, int selec
|
||||
* @param: lan parameter id
|
||||
*/
|
||||
static struct lan_param *
|
||||
get_lan_param(struct ipmi_intf * intf, uint8_t chan, int param)
|
||||
get_lan_param(struct ipmi_intf *intf, uint8_t chan, int param)
|
||||
{
|
||||
return get_lan_param_select(intf, chan, param, 0);
|
||||
}
|
||||
@ -275,10 +288,10 @@ get_lan_param(struct ipmi_intf * intf, uint8_t chan, int param)
|
||||
* @len: length of lan parameter data
|
||||
*/
|
||||
static int
|
||||
set_lan_param_wait(struct ipmi_intf * intf, uint8_t chan,
|
||||
int param, uint8_t * data, int len)
|
||||
set_lan_param_wait(struct ipmi_intf *intf, uint8_t chan,
|
||||
int param, uint8_t *data, int len)
|
||||
{
|
||||
struct lan_param * p;
|
||||
struct lan_param *p;
|
||||
int retry = 10; /* 10 retries */
|
||||
|
||||
lprintf(LOG_DEBUG, "Waiting for Set LAN Parameter to complete...");
|
||||
@ -334,10 +347,10 @@ set_lan_param_wait(struct ipmi_intf * intf, uint8_t chan,
|
||||
* @wait: whether to wait for write completion
|
||||
*/
|
||||
static int
|
||||
__set_lan_param(struct ipmi_intf * intf, uint8_t chan,
|
||||
int param, uint8_t * data, int len, int wait)
|
||||
__set_lan_param(struct ipmi_intf *intf, uint8_t chan,
|
||||
int param, uint8_t *data, int len, int wait)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rs *rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[32];
|
||||
|
||||
@ -361,7 +374,9 @@ __set_lan_param(struct ipmi_intf * intf, uint8_t chan,
|
||||
}
|
||||
if (rsp->ccode && wait) {
|
||||
lprintf(LOG_DEBUG, "Warning: Set LAN Parameter failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
specific_val2str(rsp->ccode,
|
||||
set_lan_cc_vals,
|
||||
completion_code_vals));
|
||||
if (rsp->ccode == 0xcc) {
|
||||
/* retry hack for invalid data field ccode */
|
||||
int retry = 10; /* 10 retries */
|
||||
@ -399,9 +414,9 @@ __set_lan_param(struct ipmi_intf * intf, uint8_t chan,
|
||||
* @chan: ipmi channel
|
||||
*/
|
||||
static int
|
||||
ipmi_lanp_lock_state(struct ipmi_intf * intf, uint8_t chan)
|
||||
ipmi_lanp_lock_state(struct ipmi_intf *intf, uint8_t chan)
|
||||
{
|
||||
struct lan_param * p;
|
||||
struct lan_param *p;
|
||||
p = get_lan_param(intf, chan, IPMI_LANP_SET_IN_PROGRESS);
|
||||
if (!p)
|
||||
return -1;
|
||||
@ -422,7 +437,7 @@ ipmi_lanp_lock_state(struct ipmi_intf * intf, uint8_t chan)
|
||||
* @chan: ipmi channel
|
||||
*/
|
||||
static void
|
||||
ipmi_lanp_lock(struct ipmi_intf * intf, uint8_t chan)
|
||||
ipmi_lanp_lock(struct ipmi_intf *intf, uint8_t chan)
|
||||
{
|
||||
uint8_t val = IPMI_LANP_WRITE_LOCK;
|
||||
int retry = 3;
|
||||
@ -452,7 +467,7 @@ ipmi_lanp_lock(struct ipmi_intf * intf, uint8_t chan)
|
||||
* @chan: ipmi channel
|
||||
*/
|
||||
static void
|
||||
ipmi_lanp_unlock(struct ipmi_intf * intf, uint8_t chan)
|
||||
ipmi_lanp_unlock(struct ipmi_intf *intf, uint8_t chan)
|
||||
{
|
||||
uint8_t val = IPMI_LANP_WRITE_COMMIT;
|
||||
int rc;
|
||||
@ -477,8 +492,8 @@ ipmi_lanp_unlock(struct ipmi_intf * intf, uint8_t chan)
|
||||
* @len: length of lan parameter data
|
||||
*/
|
||||
static int
|
||||
set_lan_param(struct ipmi_intf * intf, uint8_t chan,
|
||||
int param, uint8_t * data, int len)
|
||||
set_lan_param(struct ipmi_intf *intf, uint8_t chan,
|
||||
int param, uint8_t *data, int len)
|
||||
{
|
||||
int rc;
|
||||
ipmi_lanp_lock(intf, chan);
|
||||
@ -498,8 +513,8 @@ set_lan_param(struct ipmi_intf * intf, uint8_t chan,
|
||||
* @len: length of lan parameter data
|
||||
*/
|
||||
static int
|
||||
set_lan_param_nowait(struct ipmi_intf * intf, uint8_t chan,
|
||||
int param, uint8_t * data, int len)
|
||||
set_lan_param_nowait(struct ipmi_intf *intf, uint8_t chan,
|
||||
int param, uint8_t *data, int len)
|
||||
{
|
||||
int rc;
|
||||
ipmi_lanp_lock(intf, chan);
|
||||
@ -509,7 +524,7 @@ set_lan_param_nowait(struct ipmi_intf * intf, uint8_t chan,
|
||||
}
|
||||
|
||||
static int
|
||||
lan_set_arp_interval(struct ipmi_intf * intf, uint8_t chan, uint8_t ival)
|
||||
lan_set_arp_interval(struct ipmi_intf *intf, uint8_t chan, uint8_t ival)
|
||||
{
|
||||
struct lan_param *lp;
|
||||
uint8_t interval = 0;
|
||||
@ -539,7 +554,7 @@ lan_set_arp_interval(struct ipmi_intf * intf, uint8_t chan, uint8_t ival)
|
||||
}
|
||||
|
||||
static int
|
||||
lan_set_arp_generate(struct ipmi_intf * intf,
|
||||
lan_set_arp_generate(struct ipmi_intf *intf,
|
||||
uint8_t chan, uint8_t ctl)
|
||||
{
|
||||
struct lan_param *lp;
|
||||
@ -563,7 +578,7 @@ lan_set_arp_generate(struct ipmi_intf * intf,
|
||||
}
|
||||
|
||||
static int
|
||||
lan_set_arp_respond(struct ipmi_intf * intf,
|
||||
lan_set_arp_respond(struct ipmi_intf *intf,
|
||||
uint8_t chan, uint8_t ctl)
|
||||
{
|
||||
struct lan_param *lp;
|
||||
@ -615,9 +630,9 @@ static char priv_level_to_char(unsigned char priv_level)
|
||||
|
||||
|
||||
static int
|
||||
ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
|
||||
ipmi_lan_print(struct ipmi_intf *intf, uint8_t chan)
|
||||
{
|
||||
struct lan_param * p;
|
||||
struct lan_param *p;
|
||||
|
||||
if (chan < 1 || chan > IPMI_CHANNEL_NUMBER_MAX) {
|
||||
lprintf(LOG_ERR, "Invalid Channel %d", chan);
|
||||
@ -903,12 +918,12 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
|
||||
/* Configure Authentication Types */
|
||||
/* TODO - probably some code duplication going on ??? */
|
||||
static int
|
||||
ipmi_lan_set_auth(struct ipmi_intf * intf, uint8_t chan, char * level, char * types)
|
||||
ipmi_lan_set_auth(struct ipmi_intf *intf, uint8_t chan, char *level, char *types)
|
||||
{
|
||||
uint8_t data[5];
|
||||
uint8_t authtype = 0;
|
||||
char * p;
|
||||
struct lan_param * lp;
|
||||
char *p;
|
||||
struct lan_param *lp;
|
||||
|
||||
if (!level || !types)
|
||||
return -1;
|
||||
@ -1144,7 +1159,7 @@ ipmi_set_user_access(struct ipmi_intf *intf, uint8_t channel, uint8_t user_id)
|
||||
|
||||
|
||||
static int
|
||||
get_cmdline_cipher_suite_priv_data(char * arg, uint8_t * buf)
|
||||
get_cmdline_cipher_suite_priv_data(char *arg, uint8_t *buf)
|
||||
{
|
||||
int i, ret = 0;
|
||||
|
||||
@ -1221,7 +1236,7 @@ get_cmdline_cipher_suite_priv_data(char * arg, uint8_t * buf)
|
||||
|
||||
|
||||
static int
|
||||
get_cmdline_ipaddr(char * arg, uint8_t * buf)
|
||||
get_cmdline_ipaddr(char *arg, uint8_t *buf)
|
||||
{
|
||||
uint32_t ip1, ip2, ip3, ip4;
|
||||
if (sscanf(arg,
|
||||
@ -1373,7 +1388,7 @@ get_cmdline_bad_pass_thresh(char *argv[], uint8_t *buf)
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
ipmi_lan_set(struct ipmi_intf *intf, int argc, char **argv)
|
||||
{
|
||||
uint8_t data[32];
|
||||
uint8_t chan;
|
||||
@ -1729,9 +1744,9 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
|
||||
|
||||
static int
|
||||
is_alert_destination(struct ipmi_intf * intf, uint8_t channel, uint8_t alert)
|
||||
is_alert_destination(struct ipmi_intf *intf, uint8_t channel, uint8_t alert)
|
||||
{
|
||||
struct lan_param * p;
|
||||
struct lan_param *p;
|
||||
|
||||
p = get_lan_param(intf, channel, IPMI_LANP_NUM_DEST);
|
||||
if (!p)
|
||||
@ -1746,7 +1761,7 @@ is_alert_destination(struct ipmi_intf * intf, uint8_t channel, uint8_t alert)
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_lan_alert_print(struct ipmi_intf * intf, uint8_t channel, uint8_t alert)
|
||||
ipmi_lan_alert_print(struct ipmi_intf *intf, uint8_t channel, uint8_t alert)
|
||||
{
|
||||
# define PTYPE_LEN 4
|
||||
# define PADDR_LEN 13
|
||||
@ -1820,10 +1835,10 @@ ipmi_lan_alert_print(struct ipmi_intf * intf, uint8_t channel, uint8_t alert)
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_lan_alert_print_all(struct ipmi_intf * intf, uint8_t channel)
|
||||
ipmi_lan_alert_print_all(struct ipmi_intf *intf, uint8_t channel)
|
||||
{
|
||||
int j, ndest;
|
||||
struct lan_param * p;
|
||||
struct lan_param *p;
|
||||
|
||||
p = get_lan_param(intf, channel, IPMI_LANP_NUM_DEST);
|
||||
if (!p)
|
||||
@ -1840,10 +1855,10 @@ ipmi_lan_alert_print_all(struct ipmi_intf * intf, uint8_t channel)
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
|
||||
int argc, char ** argv)
|
||||
ipmi_lan_alert_set(struct ipmi_intf *intf, uint8_t chan, uint8_t alert,
|
||||
int argc, char **argv)
|
||||
{
|
||||
struct lan_param * p;
|
||||
struct lan_param *p;
|
||||
uint8_t data[32], temp[32];
|
||||
int rc = 0;
|
||||
|
||||
@ -2013,7 +2028,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert,
|
||||
}
|
||||
|
||||
static int
|
||||
ipmi_lan_alert(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
ipmi_lan_alert(struct ipmi_intf *intf, int argc, char **argv)
|
||||
{
|
||||
uint8_t alert;
|
||||
uint8_t channel = 1;
|
||||
@ -2105,10 +2120,10 @@ ipmi_lan_alert(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
|
||||
|
||||
static int
|
||||
ipmi_lan_stats_get(struct ipmi_intf * intf, uint8_t chan)
|
||||
ipmi_lan_stats_get(struct ipmi_intf *intf, uint8_t chan)
|
||||
{
|
||||
int rc = 0;
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rs *rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[2];
|
||||
uint16_t statsTemp;
|
||||
@ -2137,7 +2152,9 @@ ipmi_lan_stats_get(struct ipmi_intf * intf, uint8_t chan)
|
||||
|
||||
if (rsp->ccode) {
|
||||
lprintf(LOG_ERR, "Get LAN Stats command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
specific_val2str(rsp->ccode,
|
||||
get_lan_cc_vals,
|
||||
completion_code_vals));
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@ -2183,10 +2200,10 @@ ipmi_lan_stats_get(struct ipmi_intf * intf, uint8_t chan)
|
||||
|
||||
|
||||
static int
|
||||
ipmi_lan_stats_clear(struct ipmi_intf * intf, uint8_t chan)
|
||||
ipmi_lan_stats_clear(struct ipmi_intf *intf, uint8_t chan)
|
||||
{
|
||||
int rc = 0;
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rs *rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[2];
|
||||
|
||||
@ -2213,7 +2230,9 @@ ipmi_lan_stats_clear(struct ipmi_intf * intf, uint8_t chan)
|
||||
|
||||
if (rsp->ccode) {
|
||||
lprintf(LOG_INFO, "Get LAN Stats command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
specific_val2str(rsp->ccode,
|
||||
get_lan_cc_vals,
|
||||
completion_code_vals));
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@ -2473,7 +2492,7 @@ print_lan_usage(void)
|
||||
|
||||
|
||||
int
|
||||
ipmi_lanp_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
ipmi_lanp_main(struct ipmi_intf *intf, int argc, char **argv)
|
||||
{
|
||||
int rc = 0;
|
||||
uint8_t chan = 0;
|
||||
|
@ -258,7 +258,7 @@ ipmi_sdr_get_unit_string(bool pct, uint8_t relation,
|
||||
}
|
||||
|
||||
if (modifier <= UNIT_TYPE_MAX) {
|
||||
modstr = unit_desc[base];
|
||||
modstr = unit_desc[modifier];
|
||||
}
|
||||
else {
|
||||
modstr = "invalid";
|
||||
|
@ -1955,8 +1955,20 @@ ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt)
|
||||
(trigger_reading==(int)trigger_reading) ? 0 : 2,
|
||||
trigger_reading);
|
||||
if (threshold_reading_provided) {
|
||||
/* According to Table 29-6, Event Data byte 1 contains,
|
||||
* among other info, the offset from the Threshold type
|
||||
* code. According to Table 42-2, all even offsets
|
||||
* are 'going low', and all odd offsets are 'going high'
|
||||
*/
|
||||
bool going_high =
|
||||
(evt->sel_type.standard_type.event_data[0]
|
||||
& EVENT_OFFSET_MASK) % 2;
|
||||
if (evt->sel_type.standard_type.event_dir) {
|
||||
/* Event is de-asserted so the inequality is reversed */
|
||||
going_high = !going_high;
|
||||
}
|
||||
printf(" %s Threshold %.*f %s",
|
||||
((evt->sel_type.standard_type.event_data[0] & 0xf) % 2) ? ">" : "<",
|
||||
going_high ? ">" : "<",
|
||||
(threshold_reading==(int)threshold_reading) ? 0 : 2,
|
||||
threshold_reading,
|
||||
ipmi_sdr_get_unit_string(sdr->record.common->unit.pct,
|
||||
@ -2273,21 +2285,6 @@ __ipmi_sel_savelist_entries(struct ipmi_intf * intf, int count, const char * sav
|
||||
return 0;
|
||||
}
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = IPMI_CMD_RESERVE_SEL;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (!rsp) {
|
||||
lprintf(LOG_ERR, "Reserve SEL command failed");
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode) {
|
||||
lprintf(LOG_ERR, "Reserve SEL command failed: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (count < 0) {
|
||||
/** Show only the most recent 'count' records. */
|
||||
int i;
|
||||
@ -2923,11 +2920,6 @@ ipmi_sel_show_entry(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (ipmi_sel_reserve(intf) == 0) {
|
||||
lprintf(LOG_ERR, "Unable to reserve SEL");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
if (str2ushort(argv[i], &id) != 0) {
|
||||
lprintf(LOG_ERR, "Given SEL ID '%s' is invalid.",
|
||||
|
@ -928,8 +928,9 @@ const struct oemvalstr ipmi_oem_product_info[] = {
|
||||
{ IPMI_OEM_SUPERMICRO, 0xF580, "X8ST3" },
|
||||
/* YADRO */
|
||||
{ IPMI_OEM_YADRO, 0x0001, "VESNIN BMC" },
|
||||
{ IPMI_OEM_YADRO, 0x000A, "TATLIN Storage Controller BMC" },
|
||||
{ IPMI_OEM_YADRO, 0x0014, "VEGMAN BMC" },
|
||||
{ IPMI_OEM_YADRO, 0x000A, "TATLIN.UNIFIED Storage Controller BMC" },
|
||||
{ IPMI_OEM_YADRO, 0x0014, "VEGMAN Series BMC" },
|
||||
{ IPMI_OEM_YADRO, 0x0015, "TATLIN.ARCHIVE/xS BMC" },
|
||||
|
||||
{ 0xffffff , 0xffff , NULL },
|
||||
};
|
||||
@ -1264,6 +1265,25 @@ const struct valstr ipmi_chassis_power_control_vals[] = {
|
||||
{ 0x00, NULL },
|
||||
};
|
||||
|
||||
/*
|
||||
* See Table 28-11, Get System Restart Cause Command
|
||||
*/
|
||||
const struct valstr ipmi_chassis_restart_cause_vals[] = {
|
||||
{ 0x0, "unknown" },
|
||||
{ 0x1, "chassis power control command" },
|
||||
{ 0x2, "reset via pushbutton" },
|
||||
{ 0x3, "power-up via pushbutton" },
|
||||
{ 0x4, "watchdog expired" },
|
||||
{ 0x5, "OEM" },
|
||||
{ 0x6, "power-up due to always-restore power policy" },
|
||||
{ 0x7, "power-up due to restore-previous power policy" },
|
||||
{ 0x8, "reset via PEF" },
|
||||
{ 0x9, "power-cycle via PEF" },
|
||||
{ 0xa, "soft reset" },
|
||||
{ 0xb, "power-up via RTC wakeup" },
|
||||
{ 0xFF, NULL },
|
||||
};
|
||||
|
||||
const struct valstr ipmi_auth_algorithms[] = {
|
||||
{ IPMI_AUTH_RAKP_NONE, "none" },
|
||||
{ IPMI_AUTH_RAKP_HMAC_SHA1, "hmac_sha1" },
|
||||
|
@ -54,8 +54,8 @@
|
||||
# include <paths.h>
|
||||
#endif
|
||||
|
||||
#ifndef _PATH_VARRUN
|
||||
# define _PATH_VARRUN "/var/run/"
|
||||
#ifndef _PATH_RUN
|
||||
# define _PATH_RUN "/run/"
|
||||
#endif
|
||||
|
||||
#ifdef IPMI_INTF_OPEN
|
||||
@ -82,7 +82,7 @@
|
||||
#include <ipmitool/ipmi_main.h>
|
||||
|
||||
#define WARNING_THRESHOLD 80
|
||||
#define DEFAULT_PIDFILE _PATH_VARRUN "ipmievd.pid"
|
||||
#define DEFAULT_PIDFILE _PATH_RUN "ipmievd.pid"
|
||||
char pidfile[64];
|
||||
|
||||
/* global variables */
|
||||
@ -422,7 +422,7 @@ static int
|
||||
openipmi_read(struct ipmi_event_intf * eintf)
|
||||
{
|
||||
struct ipmi_addr addr;
|
||||
struct ipmi_recv recv;
|
||||
struct ipmi_recv recv = {};
|
||||
uint8_t data[80];
|
||||
int rv;
|
||||
|
||||
|
@ -68,11 +68,12 @@ static struct ipmi_rs *ipmi_bmc_send_cmd_putmsg(struct ipmi_intf *intf,
|
||||
#define MESSAGE_BUFSIZE 1024
|
||||
|
||||
struct ipmi_intf ipmi_bmc_intf = {
|
||||
name: "bmc",
|
||||
desc: "IPMI v2.0 BMC interface",
|
||||
open: ipmi_bmc_open,
|
||||
close: ipmi_bmc_close,
|
||||
sendrecv: ipmi_bmc_send_cmd};
|
||||
.name = "bmc",
|
||||
.desc = "IPMI v2.0 BMC interface",
|
||||
.open = ipmi_bmc_open,
|
||||
.close = ipmi_bmc_close,
|
||||
.sendrecv = ipmi_bmc_send_cmd
|
||||
};
|
||||
|
||||
void
|
||||
ipmi_bmc_close(struct ipmi_intf *intf)
|
||||
|
@ -63,8 +63,6 @@ extern int verbose;
|
||||
|
||||
static int ipmi_free_open(struct ipmi_intf * intf)
|
||||
{
|
||||
int kcs_ret = -1, ssif_ret = -1;
|
||||
|
||||
if (getuid() != 0) {
|
||||
fprintf(stderr, "Permission denied, must be root\n");
|
||||
return -1;
|
||||
@ -310,11 +308,11 @@ static struct ipmi_rs * ipmi_free_send_cmd(struct ipmi_intf * intf, struct ipmi_
|
||||
}
|
||||
|
||||
struct ipmi_intf ipmi_free_intf = {
|
||||
name: "free",
|
||||
desc: "FreeIPMI IPMI Interface",
|
||||
open: ipmi_free_open,
|
||||
close: ipmi_free_close,
|
||||
sendrecv: ipmi_free_send_cmd,
|
||||
target_addr: IPMI_BMC_SLAVE_ADDR,
|
||||
.name = "free",
|
||||
.desc = "FreeIPMI IPMI Interface",
|
||||
.open = ipmi_free_open,
|
||||
.close = ipmi_free_close,
|
||||
.sendrecv = ipmi_free_send_cmd,
|
||||
.target_addr = IPMI_BMC_SLAVE_ADDR,
|
||||
};
|
||||
|
||||
|
@ -502,13 +502,14 @@ uint16_t
|
||||
ipmi_intf_get_max_request_data_size(struct ipmi_intf * intf)
|
||||
{
|
||||
int16_t size;
|
||||
uint8_t bridging_level = ipmi_intf_get_bridging_level(intf);
|
||||
|
||||
size = intf->max_request_data_size;
|
||||
|
||||
/* check if request size is not specified */
|
||||
if (!size) {
|
||||
/*
|
||||
* The IPMB standard overall message length for <EFBFBD>non -bridging<EFBFBD>
|
||||
* The IPMB standard overall message length for non-bridging
|
||||
* messages is specified as 32 bytes, maximum, including slave
|
||||
* address. This sets the upper limit for typical IPMI messages.
|
||||
* With the exception of messages used for bridging messages to
|
||||
@ -521,14 +522,14 @@ ipmi_intf_get_max_request_data_size(struct ipmi_intf * intf)
|
||||
size = IPMI_DEFAULT_PAYLOAD_SIZE;
|
||||
|
||||
/* check if message is forwarded */
|
||||
if (intf->target_addr && intf->target_addr != intf->my_addr) {
|
||||
if (bridging_level) {
|
||||
/* add Send Message request size */
|
||||
size += 8;
|
||||
}
|
||||
}
|
||||
|
||||
/* check if message is forwarded */
|
||||
if (intf->target_addr && intf->target_addr != intf->my_addr) {
|
||||
if (bridging_level) {
|
||||
/* subtract send message request size */
|
||||
size -= 8;
|
||||
|
||||
@ -541,7 +542,7 @@ ipmi_intf_get_max_request_data_size(struct ipmi_intf * intf)
|
||||
}
|
||||
|
||||
/* check for double bridging */
|
||||
if (intf->transit_addr && intf->transit_addr != intf->target_addr) {
|
||||
if (bridging_level == 2) {
|
||||
/* subtract inner send message request size */
|
||||
size -= 8;
|
||||
}
|
||||
@ -559,13 +560,14 @@ uint16_t
|
||||
ipmi_intf_get_max_response_data_size(struct ipmi_intf * intf)
|
||||
{
|
||||
int16_t size;
|
||||
uint8_t bridging_level = ipmi_intf_get_bridging_level(intf);
|
||||
|
||||
size = intf->max_response_data_size;
|
||||
|
||||
/* check if response size is not specified */
|
||||
if (!size) {
|
||||
/*
|
||||
* The IPMB standard overall message length for <EFBFBD>non -bridging<EFBFBD>
|
||||
* The IPMB standard overall message length for non-bridging
|
||||
* messages is specified as 32 bytes, maximum, including slave
|
||||
* address. This sets the upper limit for typical IPMI messages.
|
||||
* With the exception of messages used for bridging messages to
|
||||
@ -578,14 +580,14 @@ ipmi_intf_get_max_response_data_size(struct ipmi_intf * intf)
|
||||
size = IPMI_DEFAULT_PAYLOAD_SIZE; /* response length with subtracted header and checksum byte */
|
||||
|
||||
/* check if message is forwarded */
|
||||
if (intf->target_addr && intf->target_addr != intf->my_addr) {
|
||||
if (bridging_level) {
|
||||
/* add Send Message header size */
|
||||
size += 7;
|
||||
}
|
||||
}
|
||||
|
||||
/* check if message is forwarded */
|
||||
if (intf->target_addr && intf->target_addr != intf->my_addr) {
|
||||
if (bridging_level) {
|
||||
/*
|
||||
* Some IPMI controllers like PICMG AMC Carriers embed responses
|
||||
* to the forwarded messages into the Send Message response.
|
||||
@ -603,7 +605,7 @@ ipmi_intf_get_max_response_data_size(struct ipmi_intf * intf)
|
||||
}
|
||||
|
||||
/* check for double bridging */
|
||||
if (intf->transit_addr && intf->transit_addr != intf->target_addr) {
|
||||
if (bridging_level == 2) {
|
||||
/* subtract inner send message header size */
|
||||
size -= 8;
|
||||
}
|
||||
@ -617,6 +619,25 @@ ipmi_intf_get_max_response_data_size(struct ipmi_intf * intf)
|
||||
return size;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
ipmi_intf_get_bridging_level(const struct ipmi_intf *intf)
|
||||
{
|
||||
uint8_t bridging_level;
|
||||
|
||||
if (intf->target_addr && (intf->target_addr != intf->my_addr)) {
|
||||
if (intf->transit_addr &&
|
||||
(intf->transit_addr != intf->target_addr || intf->transit_channel != intf->target_channel)) {
|
||||
bridging_level = 2;
|
||||
} else {
|
||||
bridging_level = 1;
|
||||
}
|
||||
} else {
|
||||
bridging_level = 0;
|
||||
}
|
||||
|
||||
return bridging_level;
|
||||
}
|
||||
|
||||
void
|
||||
ipmi_intf_set_max_request_data_size(struct ipmi_intf * intf, uint16_t size)
|
||||
{
|
||||
|
@ -741,8 +741,6 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
|
||||
return (struct ipmi_rs *)1;
|
||||
};
|
||||
|
||||
uint8_t target_cmd = entry->req.msg.target_cmd;
|
||||
|
||||
lprintf(LOG_DEBUG+2, "IPMI Request Match found");
|
||||
|
||||
if (entry->bridging_level) {
|
||||
|
@ -84,12 +84,16 @@ lanplus_rakp2_hmac_matches(const struct ipmi_session * session,
|
||||
return 1;
|
||||
|
||||
/* We don't yet support other algorithms */
|
||||
#ifdef HAVE_CRYPTO_SHA256 // assert() is a macro, must not put #ifdef inside it
|
||||
assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
|
||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
|
||||
#ifdef HAVE_CRYPTO_SHA256
|
||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA256)
|
||||
#endif /* HAVE_CRYPTO_SHA256 */
|
||||
);
|
||||
#else
|
||||
assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
|
||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
|
||||
);
|
||||
#endif /* HAVE_CRYPTO_SHA256 */
|
||||
|
||||
|
||||
bufferLength =
|
||||
@ -251,12 +255,16 @@ lanplus_rakp4_hmac_matches(const struct ipmi_session * session,
|
||||
return 1;
|
||||
|
||||
/* We don't yet support other algorithms */
|
||||
#ifdef HAVE_CRYPTO_SHA256 // assert() is a macro, must not put #ifdef inside it
|
||||
assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
|
||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
|
||||
#ifdef HAVE_CRYPTO_SHA256
|
||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA256)
|
||||
#endif /* HAVE_CRYPTO_SHA256 */
|
||||
);
|
||||
#else
|
||||
assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
|
||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
|
||||
);
|
||||
#endif /* HAVE_CRYPTO_SHA256 */
|
||||
}
|
||||
|
||||
bufferLength =
|
||||
@ -417,12 +425,16 @@ lanplus_generate_rakp3_authcode(uint8_t * output_buffer,
|
||||
}
|
||||
|
||||
/* We don't yet support other algorithms */
|
||||
#ifdef HAVE_CRYPTO_SHA256 // assert() is a macro, must not put #ifdef inside it
|
||||
assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
|
||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
|
||||
#ifdef HAVE_CRYPTO_SHA256
|
||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA256)
|
||||
#endif /* HAVE_CRYPTO_SHA256 */
|
||||
);
|
||||
#else
|
||||
assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
|
||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
|
||||
);
|
||||
#endif /* HAVE_CRYPTO_SHA256 */
|
||||
|
||||
input_buffer_length =
|
||||
16 + /* Rc */
|
||||
@ -539,12 +551,16 @@ lanplus_generate_sik(struct ipmi_session * session, struct ipmi_intf * intf)
|
||||
return 0;
|
||||
|
||||
/* We don't yet support other algorithms */
|
||||
#ifdef HAVE_CRYPTO_SHA256 // assert() is a macro, must not put #ifdef inside it
|
||||
assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
|
||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
|
||||
#ifdef HAVE_CRYPTO_SHA256
|
||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA256)
|
||||
#endif /* HAVE_CRYPTO_SHA256 */
|
||||
);
|
||||
#else
|
||||
assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
|
||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
|
||||
);
|
||||
#endif /* HAVE_CRYPTO_SHA256 */
|
||||
|
||||
input_buffer_length =
|
||||
16 + /* Rm */
|
||||
|
@ -119,11 +119,11 @@ static struct ipmi_rs * ipmi_lipmi_send_cmd(struct ipmi_intf * intf, struct ipmi
|
||||
}
|
||||
|
||||
struct ipmi_intf ipmi_lipmi_intf = {
|
||||
name: "lipmi",
|
||||
desc: "Solaris x86 LIPMI Interface",
|
||||
open: ipmi_lipmi_open,
|
||||
close: ipmi_lipmi_close,
|
||||
sendrecv: ipmi_lipmi_send_cmd,
|
||||
target_addr: IPMI_BMC_SLAVE_ADDR,
|
||||
.name = "lipmi",
|
||||
.desc = "Solaris x86 LIPMI Interface",
|
||||
.open = ipmi_lipmi_open,
|
||||
.close = ipmi_lipmi_close,
|
||||
.sendrecv = ipmi_lipmi_send_cmd,
|
||||
.target_addr = IPMI_BMC_SLAVE_ADDR,
|
||||
};
|
||||
|
||||
|
@ -170,7 +170,7 @@ static
|
||||
struct ipmi_rs *
|
||||
ipmi_openipmi_send_cmd(struct ipmi_intf *intf, struct ipmi_rq *req)
|
||||
{
|
||||
struct ipmi_recv recv;
|
||||
struct ipmi_recv recv = {};
|
||||
struct ipmi_addr addr;
|
||||
struct ipmi_system_interface_addr bmc_addr = {
|
||||
.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE,
|
||||
|
@ -612,18 +612,7 @@ serial_bm_build_msg(const struct ipmi_intf * intf,
|
||||
uint8_t * data = msg, seq;
|
||||
struct ipmb_msg_hdr * hdr = (struct ipmb_msg_hdr *) msg;
|
||||
struct ipmi_send_message_rq * inner_rq = NULL, * outer_rq = NULL;
|
||||
int bridging_level;
|
||||
|
||||
/* acquire bridging level */
|
||||
if (intf->target_addr && intf->target_addr != intf->my_addr) {
|
||||
if (intf->transit_addr != 0) {
|
||||
bridging_level = 2;
|
||||
} else {
|
||||
bridging_level = 1;
|
||||
}
|
||||
} else {
|
||||
bridging_level = 0;
|
||||
}
|
||||
int bridging_level = ipmi_intf_get_bridging_level(intf);
|
||||
|
||||
/* check overall packet length */
|
||||
if(req->msg.data_len + 7 + bridging_level * 8 > max_len) {
|
||||
|
@ -473,18 +473,7 @@ serial_term_build_msg(const struct ipmi_intf * intf,
|
||||
struct serial_term_hdr * term_hdr = (struct serial_term_hdr *) msg;
|
||||
struct ipmi_send_message_rq * outer_rq = NULL;
|
||||
struct ipmi_send_message_rq * inner_rq = NULL;
|
||||
int bridging_level;
|
||||
|
||||
/* acquire bridging level */
|
||||
if (intf->target_addr && intf->target_addr != intf->my_addr) {
|
||||
if (intf->transit_addr != 0) {
|
||||
bridging_level = 2;
|
||||
} else {
|
||||
bridging_level = 1;
|
||||
}
|
||||
} else {
|
||||
bridging_level = 0;
|
||||
}
|
||||
int bridging_level = ipmi_intf_get_bridging_level(intf);
|
||||
|
||||
/* check overall packet length */
|
||||
if(req->msg.data_len + 3 + bridging_level * 8 > max_len) {
|
||||
@ -635,7 +624,7 @@ serial_term_send_msg(struct ipmi_intf * intf, uint8_t * msg, int msg_len)
|
||||
|
||||
/* body */
|
||||
for (i = 0; i < msg_len; i++) {
|
||||
buf += sprintf( buf, "%02x", msg[i]);
|
||||
buf += sprintf((char*) buf, "%02x", msg[i]);
|
||||
}
|
||||
|
||||
/* stop character */
|
||||
|
Reference in New Issue
Block a user