Compare commits

..

161 Commits

Author SHA1 Message Date
d0f52c7a6b This commit was manufactured by cvs2svn to create tag 'IPMITOOL_1_8_9'. 2007-03-06 22:31:08 +00:00
2e7571daf2 Prepare for release. 2007-03-06 22:31:07 +00:00
c13966f04b fix byteswapping problem on sparc (and other big endian architectures) 2007-03-05 05:16:02 +00:00
56b892cea1 Benoit Guillon fix for get fru activation policy args 2007-02-23 19:13:48 +00:00
bec24b9019 - Fix a bug in sol when no retry-count is set. Was causing a line to be duplicate. 2007-02-23 15:12:20 +00:00
45185b23ec Fix configuring with FreeIPMI interface on FreeBSD 2007-02-23 08:21:07 +00:00
ecca25ed2b Add Arkadiusz Miskiewicz's Makefile, spec, config changes; update changelog for v1.8.9 2007-02-23 06:02:08 +00:00
eccd10200f Update ChangeLog to prepare for v1.8.9 2007-02-23 04:43:48 +00:00
0bad3feabd Benoit Guillon patch for bug in Get FRU Activation Policy result 2007-02-22 23:38:04 +00:00
edb0ba9c6d Allow ipmitool/ipmievd to target specific device nodes on multi-BMC systems 2007-02-22 22:32:06 +00:00
c4a368edfb Fixing a few misspellings 2007-02-22 22:03:32 +00:00
b136863199 Fix for new prefix code causing segfault with ipmievd sel cmd 2007-02-22 21:48:26 +00:00
628c3ca854 freeipmi interface files 2007-02-22 18:17:46 +00:00
0a682dbedd add freeipmi interface support 2007-02-22 18:16:10 +00:00
b3dde472ce Fix breakage on FreeBSD caused by configure.in rev 1.64 2007-02-22 02:35:39 +00:00
22f0fc7c00 removed endianness check 2007-02-08 20:22:54 +00:00
6eaa2e8305 Added
ipmi_sel_get_oem_sensor_type
and
 ipmi_sel_get_oem_sensor_type_offset APIs

as well as get_kontron_evt_desc.
Added lookups in ipmi_get_event_desc for OEM defined sensor types.
Added oem_kontron_event_types definition
2007-02-07 21:14:54 +00:00
992b36bc0f fixed for big endian (PPC) architecture 2007-02-01 14:28:44 +00:00
6a68dc2e65 - Incremented to version 0.4
- Fixed lan iface inaccesiblity timeout handling. Waiting for firmware
    activation completion (fixed sleep) before re-opening a session and
    get the final firmware upgrade status.
  - Fixed some user interface stuff.
2007-01-17 19:38:18 +00:00
66958d8c52 fix ipmi_fru_edit_multirec return code 2007-01-17 16:05:28 +00:00
333dc5bedc added initial interactive edition support for multirec
added IANA verification before interpreting PICMG records
added edit support for AMC activation "Maximum Internal Current"
2007-01-17 16:04:12 +00:00
a62287c589 undefined ENABLE_OPENIPMI_V39_PATCH 2007-01-11 21:36:25 +00:00
43a529bff0 added new header dependancies 2007-01-11 21:28:55 +00:00
cf96efd47d added missing () for operator precedence bug 2007-01-11 21:17:46 +00:00
9cbe0938f1 Added initial AMC ekey query operation support 2007-01-11 21:15:12 +00:00
7acd1310ec avoid lprintf to control \n generation 2007-01-11 19:35:29 +00:00
77b47d3751 improvements to ekeying support (PICMG 3.x only)
- added getall/getgranted/getdenied support
 - changed cli arg parsing (avoid segfaults)
 - changet set portstate interface vs channel ordering
2007-01-11 18:47:53 +00:00
9a4979ac62 - Fix bug with bad handling of GetDeviceId answer when sol traffic occurs
(generating garbage on the screen)
---** Thanks to Jarrod B Johnson [jbj@vnet.ibm.com] for the patch **---
2007-01-11 18:40:10 +00:00
9e4bbc2e65 - Re-Enable Keep Alive function using GetDeviceId
(I re-enable this function since the bug in the keep alive has been addressed)
- Keep the usage of sol for keep alive when usesolforkeepalive is added after
the activate.
2007-01-11 18:36:25 +00:00
8fc8e1a69a added ENABLE_OPENIPMI_V39_PATCH (not enable by default)
updated to 0.3
2007-01-11 16:23:59 +00:00
18b6d4cc08 added TRUE and FALSE definitions 2007-01-11 15:33:31 +00:00
a74e7d396a changed hpmxxx keyword to hpm in main to access HPM.1 functionnality 2007-01-11 15:29:04 +00:00
88af9d3652 Added lan packet size reduction mechanism to workaround fact
that lan iface will not return C7 on excessive length
2007-01-11 15:25:53 +00:00
968e97d905 Adjusted packet length for AMC.0 specification retricting IPMB packets to
32 bytes
 Added lan packet size reduction mechanism to workaround fact
    that lan iface will not return C7 on excessive length
2007-01-11 15:01:39 +00:00
459770d58c now includes ipmi_cc.h for generic completion codes 2007-01-11 14:43:22 +00:00
c28da79cab Added generic completion codes to be used instead of hardcoded values 2007-01-11 14:42:51 +00:00
b548d3573b - Still in development
- Implementation now aligned with specification HPM.1 draft 0.9
- Tested with Kontron implementation
2006-12-01 16:36:54 +00:00
68afc1b001 Handle timeout completion code C3h in SaveFirmwareImage 2006-12-01 16:34:48 +00:00
c78911c730 -Add HPM.1 support
Based on specification (non-official) release version 0.74
Implemented and tested on Kontron ATCA blade
2006-11-17 20:27:16 +00:00
6ac87eed90 - Add HPM.1 support module 2006-11-17 20:24:15 +00:00
9f66ac2cd3 - Fix a bug with the keepalive functionallity. When keepAlive GetDeviceId is sent and SOL traffic is received in between the answer, the SOL packet is ignore or use as an answer.
- Change the keepalive function to send empty SOL packet instead of sending the getdeviceid command.
2006-11-14 16:08:55 +00:00
3bd95062ba Avoids printing invalid sensor reading when the reading actually fails 2006-11-06 20:45:00 +00:00
86a32205be Added ability to map OEM sensor types to OEM description string using
IANA number.
Moved IANA number table
2006-11-03 21:10:59 +00:00
583a5e7cd0 Added sensor type strings for IPMI v2.0 2006-11-03 19:44:51 +00:00
381783786a Added PICMG specific IDs in entity_id_vals 2006-11-03 19:35:07 +00:00
cea777a51d Added sdr_convert_sensor_hysterisis to avoid taking "B" into consideration 2006-11-03 19:04:15 +00:00
e3c97ddd3d Do not use readings for sensors with Sensor Scanning bit cleared 2006-10-25 03:21:57 +00:00
e7f7209c32 - Auto adjust packet size for SaveFirmwareImage
- Fix bug with sendMessage of bad length with different target (IOL, IPMB-0, IPMB-L, etc..)
2006-10-13 15:03:13 +00:00
5d21a9d8a8 - Fix bug with Function Get Channel Cipher Suites command when more than 1 page used. 2006-10-06 20:33:42 +00:00
74e028690b - Fix a bug with command ipmitool lan stats get 1.
Stats on channel 1 is always rejected while channel 1 can be lan.
command printconf and print is OK.
2006-10-06 17:47:10 +00:00
fda2c028fe fix formatting loss 2006-09-21 19:53:33 +00:00
19f9d13807 - Fix a bug with FWUM Get Info
- Output of DEBUG build was erronous.
- Mode byte change to a bitfield
2006-09-21 15:29:09 +00:00
9fcde40c97 - Fix lan set access command to use value already save within parameters for PEF and authentication
- This was causing problem to implementation where PEF alerting is not supported.
- Enable PEF was hard coded.
2006-09-21 14:03:42 +00:00
34b21d2d57 better detection of linux/compiler.h 2006-09-14 16:20:59 +00:00
9e14d37835 add nokeepalive option to sol activate 2006-09-13 00:01:55 +00:00
981a24365f add support for name+privilege lookup for lanplus sessions 2006-09-12 23:23:28 +00:00
729bf0e7c3 new chassis bootdev options 2006-09-11 17:07:00 +00:00
db4a2e5951 fix compile error 2006-09-11 16:20:56 +00:00
ef20239926 update comment regarding sol packet handling 2006-09-11 16:19:29 +00:00
e672819a9d fix unlock behavior to always do set-complete 2006-09-11 16:14:01 +00:00
f61c3acbaf fix sequence number incrementing on retry 2006-09-01 17:48:15 +00:00
eab4dfe679 fix display of auth enables 2006-09-01 17:47:50 +00:00
89199b49f3 fix ipmievd fd closing bug 2006-08-31 22:14:29 +00:00
96dec6ddc7 add set-in-progress flag support to chassis bootdev 2006-08-23 17:25:37 +00:00
153965aca2 missing header fix 2006-08-23 16:47:00 +00:00
4e79265a7c prefix hostname on sel ipmievd sessions 2006-08-18 22:31:19 +00:00
1c60cbf500 add sol payload enable/disable command 2006-08-18 20:09:33 +00:00
b82cfdf945 - fix SOL set errors when commit-write not supported
- fix reset of session timeout for lanplus interface
2006-08-11 17:57:15 +00:00
09a6e0e917 add firewall top-level command 2006-08-04 17:28:00 +00:00
760de11c71 debug output 2006-08-03 16:41:18 +00:00
50f36dd841 fix user priv bugs 2006-07-28 22:37:49 +00:00
0d6fecc737 There is a bug in ipmi_sdr.h which prevents ipmitool from correctly displaying
thresholds and threshold mask. The "Discrete reading mask/Settable threshold
mask, Readable threshold mask" field in SDR has two bytes (16 bits). The 16 bits
should be treated as one uint16_t instead of two bytes. Otherwise, if someone
sets the fields to 0x3f, it will be mistakenly interpreted as 0x3f00 instead of
0x003f.
2006-07-28 20:43:50 +00:00
ab58809b3b update version to 1.8.9 2006-07-28 20:18:58 +00:00
d572add750 fix SOLv2 NACK and retry handling for Intel ESB2 BMC 2006-07-28 20:17:25 +00:00
fa21266ec2 fix segfault when incorrect oem option supplied 2006-07-28 16:39:18 +00:00
f63189780f Don't display physical FRU devices; FRU API only works for logical devices 2006-07-24 17:12:32 +00:00
7849cc978f add 'get' to the help information 2006-07-22 03:23:40 +00:00
6013cec710 minor fixes 2006-07-14 22:36:50 +00:00
9f6133936d fix bus problem with spd command 2006-07-12 19:31:31 +00:00
580f416693 compile error 2006-07-12 19:25:43 +00:00
c99e8595e4 fix segfault in SOL when remote BMC does not return packet 2006-07-06 21:38:21 +00:00
a92765fbc9 fixes from netbsd 2006-06-28 22:16:32 +00:00
cc63758d53 patch from netbsd 2006-06-28 22:04:30 +00:00
388b9e058d misc cleanups 2006-06-28 21:21:34 +00:00
520aa05c07 fix segfault and channel problem with user priv command 2006-06-28 21:06:16 +00:00
533582e9e3 add remote spd printing 2006-06-28 20:58:08 +00:00
c3289bb6f4 Initial checkin. This file will describe SOL in ipmitool at a high level. 2006-06-20 21:33:53 +00:00
b3d2bb937d Cleaned up return codes for invalid arguments passed to sub-commands. 2006-06-20 19:48:53 +00:00
070f36d1ae __ipmi_sel_savelist_entries should return 0 instead of -1 if the SEL is
empty.  An empty SEL shouldn't be an error condition when listing the SEL.
2006-06-20 19:20:25 +00:00
882d9ce81c why does every version of gcc behave different? 2006-05-26 04:41:11 +00:00
d0e5434790 add support for bus/chan on i2c raw command 2006-05-26 04:35:16 +00:00
4ab522ab29 Fixed time_t conversion bug for 64-bit OS
.
2006-05-23 20:41:08 +00:00
ce3636894d use select() instead of alarm signal for receive timeout 2006-05-17 23:57:44 +00:00
83a924d7ed fix gcc4 compile warnings (again...) 2006-05-16 23:43:37 +00:00
28a7f2c14b fix compile warning 2006-05-16 23:09:34 +00:00
10154ba9ce fix compile warnings 2006-05-16 23:09:06 +00:00
12a6554416 fix formatting and compile warnings 2006-05-16 23:06:38 +00:00
78f8f0793f fix segfault that was reverted... 2006-05-16 22:28:19 +00:00
4433696ae4 fix tsol on big-endian 2006-05-12 15:37:45 +00:00
c9b2eb04f6 Implemented sdr_convert_sensor_tolerance
- uses y = L[Mx/2 * 10K2 ] formula as per IPMI spec
This function is now used instead of sdr_convert_sensor_reading when it
 comes to tolerance.
2006-05-12 14:07:31 +00:00
be79973194 remove fclose that happened before fopen 2006-05-03 22:05:24 +00:00
8e12bc0299 - Fix flag in StartFirmwareImage 2006-05-03 13:34:59 +00:00
b253fd5da3 - Remove write number of bytes in function SaveFirwwareImage
- Use this extra byte for payload transfer
2006-05-02 19:05:39 +00:00
811c894d78 added "--with-rpm-release" configure option to set the RPM release number
the distro tag, if supplied, is still part of the release value
2006-05-02 16:26:13 +00:00
65d1b0a623 ipmi_sdr.c: Fix ipmi_sdr_get_sensor_reading_ipmb() to keep track of device lun.
ipmi_sdr.c: Better error handling to avoid coredump when sensor description is missing.
ipmi_sensor.c: use new ipmi_sdr_get_sensor_reading_ipmb() interface
ipmi_sunoem.c: keep track of device lun
ipmi_sel.h: add "OEM Specific" device description
ipmi_sdr.h: modify ipmi_sdr_get_sensor_reading_ipmb() prototype
2006-05-01 23:57:01 +00:00
e667785bd3 update changelogs, prepare for 1.8.8 2006-05-01 23:33:33 +00:00
cf74129ba8 grr last time 2006-05-01 23:22:44 +00:00
3a30f4d0b8 intf -> eintf 2006-05-01 23:20:49 +00:00
ac40435a4a connect before fork to return error to initscript if needed 2006-05-01 23:15:38 +00:00
b800400c41 clear password if authtype NONE specified on command line 2006-05-01 22:33:21 +00:00
9132b30b6c fix cipher suite display bug 2006-05-01 22:28:45 +00:00
dd29a141ed add kontronoem header to package build 2006-05-01 22:23:53 +00:00
9f86c0601a fix typo in sol output when sending break 2006-04-27 18:08:30 +00:00
f7cfe44ce7 add missing MD2 authtype 2006-04-27 18:05:57 +00:00
1ad5d3d0b2 remove a few straggling nuclear clauses 2006-04-27 18:04:09 +00:00
9b4766a767 - Add lun consideration in ipmi_openipmi_send_cmd 2006-04-21 19:57:25 +00:00
a43c37e6ce - Add kontron oem file 2006-04-21 19:28:01 +00:00
ee044f0169 Remove static keyword to read_fru_area, write_fru_area, get_fru_area_str to be used in other files 2006-04-21 19:15:12 +00:00
a089b441f9 Upgrade to new protocol version
Faster Upgrade
2006-04-21 16:36:51 +00:00
adef82354e Fix compiling error 2006-04-21 16:34:30 +00:00
ee59c4d0f1 fix segfaults 2006-04-11 01:43:59 +00:00
9fd9b29cb5 clear ipmi_rq before using to remove garbage data like LUN. throttle keystroke errors unless verbose 2006-04-11 00:47:49 +00:00
35a7fad915 use find_lan_channel() for printing when no channel specified on command line 2006-04-11 00:47:10 +00:00
905892b5a7 ipmi_user.c: only allocated needed 3 bytes in ipmi_user_set_userpriv() 2006-03-28 17:01:16 +00:00
8fd02275a0 conditionally include config.h only if it is present 2006-03-28 16:56:56 +00:00
133cf86058 fix paths.h handling for solaris 2006-03-19 23:33:53 +00:00
7467b928c1 add missing header to dist, add default freebsd configure options 2006-03-19 23:22:25 +00:00
cfd5783232 update manpage 2006-03-19 23:10:40 +00:00
c44a3a85f6 update changelog 2006-03-19 23:08:23 +00:00
7e029dbb87 add initscripts for ipmievd 2006-03-19 23:06:56 +00:00
e3be943843 update debian files from maintainer 2006-03-19 23:01:48 +00:00
4b1ccbfdc3 cleanup sdr cache generation 2006-03-19 22:53:15 +00:00
e37e785449 make ipmievd write pidfile 2006-03-19 22:35:12 +00:00
66ffa994e9 better handling of termios header file 2006-03-19 21:20:42 +00:00
21fb127ce2 fix gcc4 + buildcheck compile problems 2006-03-19 21:15:06 +00:00
c65b206144 fix gcc4 compile warnings 2006-03-19 20:54:44 +00:00
a3d206523d make OEM SEL file a generic command line option 2006-03-19 20:04:20 +00:00
06ad21054f Add support for IPMIv2 Firmware Firewall 2006-03-19 19:08:50 +00:00
e2cc94d96b Add support for FreeBSD OpenIPMI-compatible driver 2006-03-19 18:40:48 +00:00
56c495455c Add support for setting VLAN id and priority 2006-03-19 18:37:16 +00:00
64af2f2bdb Display message and exit if keepalive fails during SOL 2006-03-19 18:29:07 +00:00
d80fa31411 Support IPMIv2 SOL on older Intel boxes 2006-03-19 18:24:37 +00:00
271c681609 disable file paranoia checks on read files by default 2006-03-19 18:22:39 +00:00
fa8c8116e1 Add support for IBM OEM SEL messages 2006-03-19 18:05:20 +00:00
5532b6856e Add IPMIv2 SOL loopback test 2006-03-19 18:01:56 +00:00
58ea8803f9 remove nuclear clause from license 2006-03-19 17:59:39 +00:00
99070e730e increase argument size for shell/exec for raw commands 2006-03-19 17:44:40 +00:00
115df86f23 implement sbled command for sun blades 2006-03-10 19:30:44 +00:00
a94f0e612c check that intf->open(intf) is successful before proceeding
add additional debug messages
2006-03-01 21:25:24 +00:00
e21475c78d attempt to fix bridged commands over lan interfaces 2006-01-26 21:38:11 +00:00
6f3e247274 add 'sensor reading' command 2006-01-26 21:37:23 +00:00
b8d9ada302 fix retry handling for SOL 2006-01-17 18:13:41 +00:00
29dbaf6882 update to version 1.8.6 2006-01-17 17:51:21 +00:00
f367905bef fix Unknown display for val2str() 2006-01-17 17:30:29 +00:00
66cb3143dc send periodic keepalive packet when SOL is active to keep session open 2006-01-17 17:25:23 +00:00
79befbb112 set payload length for outbound sol packets to prevent memory corruption in openssl during SOL 2006-01-17 17:24:42 +00:00
185b762fa9 use \r\n for log output during raw mode 2006-01-17 17:24:06 +00:00
5d7197d467 update changelog 2006-01-15 21:56:48 +00:00
b0498d93cf fix date in changelog 2006-01-15 21:33:14 +00:00
9f49913c2f change copyright tag to license 2006-01-15 21:32:28 +00:00
73d088de1f remove CYGWIN defines for older cygwin support 2006-01-15 21:21:49 +00:00
124 changed files with 12628 additions and 4639 deletions

View File

@ -28,6 +28,3 @@ PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
You acknowledge that this software is not designed or intended for use
in the design, construction, operation or maintenance of any nuclear
facility.

View File

@ -1,3 +1,93 @@
version 1.8.9 released 2007-03-06
* Added initial AMC ekey query operation support
* Improvements to ekeying support (PICMG 3.x only)
* Added initial interactive edition support for multirec; added IANA
verification before interpreting PICMG records.
* Added edit support for AMC activation "Maximum Internal Current"
* Fix bug generating garbage on the screen when handling GetDeviceId
and sol traffic occurs
* Added ability to map OEM sensor types to OEM description string using
IANA number; moved IANA number table
* Fix lan set access command to use value already saved within
parameters for PEF and authentication
* Fix bug in cmd ipmitool lan stats get 1
* Add support to allow ipmitool/ipmievd to target specific device
nodes on multi-BMC systems
* Add support for name+privilege lookup for lanplus sessions
* Fix time_t conversion bug for 64-bit OS
* Added prefix of hostname on sel ipmievd sessions
* Fixed FWUM Get Info
* Fix ipmievd fd closing bug
* Add set-in-progress flag support to chassis bootdev
* Added new chassis bootdev options
* Add sol payload enable/disable comman
* Fix SOL set errors when commit-write not supported
* Fix reset of session timeout for lanplus interface
* Fixed lan interface accessibility timeout handling
* Fix bug with Function Get Channel Cipher Suites command when
more than 1 page used.
* Fix missing firmware firewall top-level command
* Fix bug in SOL keepalive functionality
* Fix SOLv2 NACK and retry handling for Intel ESB2 BMC
* Added ipmi_sel_get_oem_sensor* APIs
* Added HPM.1 support
* Fix segfault when incorrect oem option supplied
* Fix bus problem with spd command
* Fix segfault in SOL when remote BMC does not return packet
* Adjust packet length for AMC.0 retricting IPMB packets to 32 bytes
* Added lan packet size reduction mechanism
* Fix bug with sendMessage of bad length with different target
* Fix for big endian (PPC) architecture
* NetBSD fixes
* Fix segfault and channel problem with user priv command
* Add support for bus/chan on i2c raw command
* Add freeipmi interface support
* Add remote spd printing
* Add better detection of linux/compiler.h to config
* Makefile changes to fix makedistcheck, etc.
version 1.8.8
* Fix segfaults in sensor data repository list
* Fix ipmievd to open interface before daemonizing
* Fix IPMIv1.5 authtype NONE to ignore supplied password
* Fix cipher suite display bug in lan print
* Fix typo in IPMIv2 SOL output when sending break
* Fix improper LUN handling with Tyan SOL
* Add LUN support to OpenIPMI interface
* Add support for Kontron OEM commands
* Update to Kontron Firmware Update command
version 1.8.7
* Remove nuclear clause from license
* Add Sun OEM command for blades
* Increase argument size for raw commands in shell/exec
* Fix handling of LUNs for LAN interfaces
* Add IPMIv2 SOL loopback test
* Add support for IBM OEM SEL messages
* Disable file paranoia checks on read files by default
* Support IPMIv2 SOL on older Intel boxes
* Display message and exit if keepalive fails during SOL
* Add support for setting VLAN id and priority
* Add support for FreeBSD OpenIPMI-compatible driver
* Add support for IPMIv2 Firmware Firewall
* Fix gcc4 compile warnings
* Make ipmievd generate pidfile
* Add initscripts for ipmievd
version 1.8.6
* Fix memory corruption when sending encrypted SOL traffic
* Add keepalive timer to IPMIv2 SOL sessions
version 1.8.5
* Add support for settable SOL escape character with -e option
* Add support for Kg BMC key for IPMIv2 authentication with -k option
* Add support for Tyan IPMIv1.5 SOL with tsol command
* Add support for PICMG devices
* Add support for OEM SEL event parsing
* Add support for command bridging over lan and lanplus interfaces
* New 'chassis selftest' command
* Many bufxies and patches from contributors
version 1.8.3
* Add support for 'sel readraw' and 'sel writeraw' commands.
* Add support for entering NetFn as a string for RAW commands.

View File

@ -27,13 +27,9 @@
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# You acknowledge that this software is not designed or intended for use
# in the design, construction, operation or maintenance of any nuclear
# facility.
DOCDIR = $(DESTDIR)/$(datadir)/doc/$(PACKAGE)
DOCLIST = README COPYING AUTHORS ChangeLog
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 \
@ -52,8 +48,11 @@ dist-hook:
cp control/ipmitool.spec $(distdir)
install-data-local:
mkdir -p $(DOCDIR)
install -m 644 $(DOCLIST) $(DOCDIR)
mkdir -p $(DESTDIR)$(DOCDIR)
$(INSTALL_DATA) $(DOCLIST) $(DESTDIR)$(DOCDIR)
uninstall-local:
-rm -rf $(DESTDIR)$(DOCDIR)
.PHONY: pkg
pkg: PKG := ipmitool-@VERSION@-@OS@-@ARCH@
@ -80,4 +79,3 @@ rpm: control/ipmitool.spec dist
.PHONY: clean-rpm
clean-rpm:
-rm -rf $(RPMDIR)

View File

@ -29,10 +29,6 @@
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# You acknowledge that this software is not designed or intended for use
# in the design, construction, operation or maintenance of any nuclear
# facility.
aclocal
libtoolize --automake --copy

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.5])
AM_INIT_AUTOMAKE([ipmitool], [1.8.9])
AM_CONFIG_HEADER(config.h)
AC_CONFIG_SRCDIR([src/ipmitool.c])
AC_PREREQ(2.50)
@ -18,7 +18,7 @@ AC_CHECK_PROG([RPMBUILD], [rpmbuild], [rpmbuild], [rpm])
AC_CHECK_PROG([SED], [sed], [sed])
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h paths.h termios.h])
AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h paths.h])
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/socket.h])
AC_CHECK_HEADERS([sys/byteorder.h byteswap.h])
@ -91,6 +91,17 @@ solaris*)
enable_intf_bmc=no
enable_ipmishell=no
;;
*freebsd*)
enable_intf_imb=no
enable_intf_lipmi=no
enable_intf_bmc=no
;;
*netbsd*)
enable_intf_imb=no
enable_intf_lipmi=no
enable_intf_bmc=no
enable_intf_open=no
;;
esac
AC_SUBST(ARCH, $host_cpu)
@ -172,6 +183,8 @@ else
enable_intf_lanplus=no
fi
ORIG_CPPFLAGS=$CPPFLAGS
dnl look for OpenIPMI header files
AC_ARG_WITH([kerneldir],
[AC_HELP_STRING([--with-kerneldir=DIR],
@ -181,6 +194,8 @@ AC_ARG_WITH([kerneldir],
fi
CFLAGS="$CFLAGS -I ${with_kerneldir}/include"
AC_SUBST(CFLAGS)
CPPFLAGS="$CPPFLAGS -I ${with_kerneldir}/include"
AC_SUBST(CPPFLAGS)
if test -s ${with_kerneldir}/include/linux/version.h ; then
kernelver=`grep UTS_RELEASE ${with_kerneldir}/include/linux/version.h | \
sed 's/^\#define UTS_RELEASE \"\(2\.[0-9]\)\..*/\1/'`
@ -189,10 +204,73 @@ AC_ARG_WITH([kerneldir],
AC_SUBST(CPPFLAGS)
fi
fi])
AH_TEMPLATE([HAVE_LINUX_COMPILER_H], [])
AC_MSG_CHECKING([for linux/compiler.h])
AC_PREPROC_IFELSE([#include <linux/compiler.h>],
[AC_DEFINE(HAVE_LINUX_COMPILER_H, [1],
[Define to 1 if you have the <linux/compiler.h> header file.])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
CPPFLAGS=$ORIG_CPPFLAGS
AC_SUBST(CPPFLAGS)
AC_CHECK_HEADER([linux/ipmi.h],
[AC_DEFINE(HAVE_OPENIPMI_H, [1],
[Define to 1 if you have the <linux/ipmi.h> header file.])],
[echo "** Unable to find OpenIPMI header files. Using internal version."])
[AC_CHECK_HEADER([sys/ipmi.h],
[AC_DEFINE(HAVE_FREEBSD_IPMI_H, [1],
[Define to 1 if you have the <sys/ipmi.h> header file.])],
[echo "** Unable to find OpenIPMI header files. Using internal version."])])
dnl look for FreeIPMI files
AC_CHECK_LIB(freeipmi, ipmi_open_inband, [have_free=yes], [have_free=no])
AC_ARG_ENABLE([intf-free],
[AC_HELP_STRING([--enable-intf-free],
[enable FreeIPMI IPMI interface [default=auto]])],
[if test "x$enable_intf_free" != "xno" && test "x$have_free" != "xyes"; then
echo "** Unable to build FreeIPMI interface support!"
enable_intf_free=no
fi],
[enable_intf_free=$have_free])
if test "x$enable_intf_free" = "xstatic" || test "x$enable_intf_free" = "xplugin"; then
enable_intf_free=yes
fi
if test "x$enable_intf_free" = "xyes"; then
dnl Determine if you got the right FreeIPMI version
AC_MSG_CHECKING([for good libfreeipmi version])
AC_TRY_COMPILE([
#include <sys/types.h> /* For size_t */
#include <stdio.h> /* For NULL */
#include <freeipmi/freeipmi.h>
#include <freeipmi/udm/ipmi-udm.h>
], [
ipmi_device_t dev;
dev = ipmi_open_inband(IPMI_DEVICE_KCS,
0,
0,
0,
NULL,
0);
], ac_free_version_good=yes,ac_free_version_good=no)
AC_MSG_RESULT($ac_free_version_good)
if test "x$ac_free_version_good" = "xyes"; then
AC_DEFINE(IPMI_INTF_FREE, [1], [Define to 1 to enable FreeIPMI interface.])
AC_SUBST(INTF_FREE, [free])
AC_SUBST(INTF_FREE_LIB, [libintf_free.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB free/libintf_free.la"
else
enable_intf_free=no
fi
fi
dnl look for termios header file
AC_CHECK_HEADER([termios.h],
[AC_DEFINE(HAVE_TERMIOS_H, [1], [Define to 1 if you have <termios.h>.])],
[AC_CHECK_HEADER([sys/termios.h],
[AC_DEFINE(HAVE_SYS_TERMIOS_H, [1], [Define to 1 if you have <sys/termios.h>.])],
[echo "** Unable to find termios header file."])])
dnl set RPM distro tag for use in RPM name
AC_ARG_WITH([rpm-distro],
@ -200,6 +278,13 @@ AC_ARG_WITH([rpm-distro],
[set Linux distribution tag for use in RPM version string])],
[AC_SUBST(DISTRO, $with_rpm_distro)])
dnl set RPM release tag
AC_ARG_WITH([rpm-release],
[AC_HELP_STRING([--with-rpm-release=RELEASE],
[set release number for RPM release field])],
[], [with_rpm_release=1])
AC_SUBST(RPM_RELEASE, $with_rpm_release)
dnl enable Linux OpenIPMI interface
AC_ARG_ENABLE([intf-open],
[AC_HELP_STRING([--enable-intf-open],
@ -273,8 +358,8 @@ AC_ARG_ENABLE([ipmishell],
[enable IPMI shell interface [default=yes]])],
[], [enable_ipmishell=yes])
if test "x$enable_ipmishell" = "xyes"; then
AC_SEARCH_LIBS([tgetent], [readline ncurses curses termcap])
AC_SEARCH_LIBS([initscr], [curses ncurses], [have_curses=yes])
AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses readline termcap])
AC_SEARCH_LIBS([initscr], [ncurses curses], [have_curses=yes])
AC_SEARCH_LIBS([readline], [readline edit], [have_readline=yes])
if test "x$have_curses" = "xyes" && test "x$have_readline" = "xyes"; then
AC_DEFINE(HAVE_READLINE, [1], [Define to 1 if readline present.])
@ -291,6 +376,14 @@ AC_ARG_ENABLE([buildcheck],
AC_SUBST(CFLAGS)
dnl Enable extra file security paranoia
AC_ARG_ENABLE([file-security],
[AC_HELP_STRING([--enable-file-security],
[enable extra security checks on files opened for read [default=no]])],
[if test "x$enable_file_security" != "xno"; then
AC_DEFINE(ENABLE_FILE_SECURITY, [1], [Define to 1 for extra file security.])
fi], [])
dnl Generate files for build
AC_CONFIG_FILES([Makefile
doc/Makefile
@ -308,6 +401,7 @@ AC_CONFIG_FILES([Makefile
src/plugins/lan/Makefile
src/plugins/lanplus/Makefile
src/plugins/open/Makefile
src/plugins/free/Makefile
src/plugins/imb/Makefile
src/plugins/bmc/Makefile
src/plugins/lipmi/Makefile])
@ -321,6 +415,7 @@ AC_MSG_RESULT([Interfaces])
AC_MSG_RESULT([ lan : $enable_intf_lan])
AC_MSG_RESULT([ lanplus : $enable_intf_lanplus])
AC_MSG_RESULT([ open : $enable_intf_open])
AC_MSG_RESULT([ free : $enable_intf_free])
AC_MSG_RESULT([ imb : $enable_intf_imb])
AC_MSG_RESULT([ bmc : $enable_intf_bmc])
AC_MSG_RESULT([ lipmi : $enable_intf_lipmi])

View File

@ -27,15 +27,11 @@
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# You acknowledge that this software is not designed or intended for use
# in the design, construction, operation or maintenance of any nuclear
# facility.
MAINTAINERCLEANFILES = Makefile.in
dist_pkgdata_DATA = README
dist_pkgdata_SCRIPTS = bmclanconf ipmi.init.basic ipmi.init.redhat \
EXTRA_DIST = README oem_ibm_sel_map \
bmclanconf ipmi.init.basic ipmi.init.redhat \
ipmievd.init.redhat ipmievd.init.suse ipmievd.init.debian \
collect_data.sh create_rrds.sh create_webpage_compact.sh create_webpage.sh

View File

@ -29,11 +29,6 @@
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# You acknowledge that this software is not designed or intended for use
# in the design, construction, operation or maintenance of any nuclear
# facility.
#
# This script is designed for Sun Fire LX50, V60x and V65x systems.

View File

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

View File

@ -0,0 +1,87 @@
#!/bin/bash
#
# /etc/rc.d/init.d/ipmievd
#
# Based on example sysvinitfiles script
# Copyright (c) 2000 Red Hat Software, Inc.
#
# chkconfig: 345 99 00
# description: ipmievd daemon to send events to syslog
# processname: ipmievd
# config: /etc/sysconfig/ipmievd
#
### BEGIN INIT INFO
# Provides: ipmievd
# Required-Start: $syslog ipmi
# Should-Start: $time
# Required-Stop: $syslog ipmi
# Should-Stop: $time
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: ipmievd daemon to send events to syslog
# Description: Start ipmievd to read events from BMC and
# log them to syslog. Events correspond to hardware faults,
# state transitions such as power on and off, and sensor
# readings such as temperature, voltage and fan speed that
# are abnormal.
### END INIT INFO
IPMIEVD_BIN=/usr/sbin/ipmievd
test -x $IPMIEVD_BIN || { echo "$IPMIEVD_BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
# Check for existence of needed config file
IPMIEVD_CONFIG=/etc/sysconfig/ipmievd
test -r $IPMIEVD_CONFIG || { echo "$IPMIEVD_CONFIG does not exist";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
# Read config file
. $IPMIEVD_CONFIG
# Source function library.
. /etc/init.d/functions
start() {
echo "Starting ipmievd:"
if [ -f /var/lock/subsys/ipmievd ]; then
return 0
fi
daemon $IPMIEVD_BIN $IPMIEVD_OPTIONS
ret=$?
[ $ret -eq 0 ] && touch /var/lock/subsys/ipmievd
return $ret
}
stop() {
echo "Shutting down ipmievd:"
killproc $IPMIEVD_BIN
ret=$?
[ $ret -eq 0 ] && rm -f /var/lock/subsys/ipmievd
return $ret
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $IPMIEVD_BIN
;;
restart|reload)
stop
start
;;
condrestart)
[ -f /var/lock/subsys/ipmievd ] && restart || :
;;
*)
echo "Usage: ipmievd {start|stop|status|reload|restart|condrestart}"
exit 1
;;
esac
exit $?

View File

@ -0,0 +1,212 @@
#!/bin/bash
#
# System startup script for ipmievd
# Based on skeleton.compat example script
# Copyright (C) 1995--2005 Kurt Garloff, SUSE / Novell Inc.
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or (at
# your option) any later version.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
# USA.
#
# Note: This template uses functions rc_XXX defined in /etc/rc.status on
# UnitedLinux/SUSE/Novell based Linux distributions. However, it will work
# on other distributions as well, by using the LSB (Linux Standard Base)
# or RH functions or by open coding the needed functions.
# Read http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/ if you prefer not
# to use this template.
#
# chkconfig: 345 99 00
# description: ipmievd daemon
#
### BEGIN INIT INFO
# Provides: ipmievd
# Required-Start: $syslog ipmi
# Should-Start: $time
# Required-Stop: $syslog ipmi
# Should-Stop: $time
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: ipmievd daemon to send events to syslog
# Description: Start ipmievd to read events from BMC and
# log them to syslog. Events correspond to hardware faults,
# state transitions such as power on and off, and sensor
# readings such as temperature, voltage and fan speed that
# are abnormal.
### END INIT INFO
#
# Check for missing binaries (stale symlinks should not happen)
# Note: Special treatment of stop for LSB conformance
IPMIEVD_BIN=/usr/sbin/ipmievd
test -x $IPMIEVD_BIN || { echo "$IPMIEVD_BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
# Check for existence of needed config file and read it
IPMIEVD_CONFIG=/etc/sysconfig/ipmievd
test -r $IPMIEVD_CONFIG || { echo "$IPMIEVD_CONFIG does not exist";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
# Read config
. $IPMIEVD_CONFIG
if test -e /etc/rc.status; then
# SUSE rc script library
. /etc/rc.status
else
export LC_ALL=POSIX
_cmd=$1
declare -a _SMSG
if test "${_cmd}" = "status"; then
_SMSG=(running dead dead unused unknown reserved)
_RC_UNUSED=3
else
_SMSG=(done failed failed missed failed skipped unused failed failed reserved)
_RC_UNUSED=6
fi
if test -e /lib/lsb/init-functions; then
# LSB
. /lib/lsb/init-functions
echo_rc()
{
if test ${_RC_RV} = 0; then
log_success_msg " [${_SMSG[${_RC_RV}]}] "
else
log_failure_msg " [${_SMSG[${_RC_RV}]}] "
fi
}
# TODO: Add checking for lockfiles
checkproc() { return pidofproc ${1+"$@"} >/dev/null 2>&1; }
elif test -e /etc/init.d/functions; then
# RHAT
. /etc/init.d/functions
echo_rc()
{
#echo -n " [${_SMSG[${_RC_RV}]}] "
if test ${_RC_RV} = 0; then
success " [${_SMSG[${_RC_RV}]}] "
else
failure " [${_SMSG[${_RC_RV}]}] "
fi
}
checkproc() { return status ${1+"$@"}; }
start_daemon() { return daemon ${1+"$@"}; }
else
# emulate it
echo_rc() { echo " [${_SMSG[${_RC_RV}]}] "; }
fi
rc_reset() { _RC_RV=0; }
rc_failed()
{
if test -z "$1"; then
_RC_RV=1;
elif test "$1" != "0"; then
_RC_RV=$1;
fi
return ${_RC_RV}
}
rc_check()
{
return rc_failed $?
}
rc_status()
{
rc_failed $?
if test "$1" = "-r"; then _RC_RV=0; shift; fi
if test "$1" = "-s"; then rc_failed 5; echo_rc; rc_failed 3; shift; fi
if test "$1" = "-u"; then rc_failed ${_RC_UNUSED}; echo_rc; rc_failed 3; shift; fi
if test "$1" = "-v"; then echo_rc; shift; fi
if test "$1" = "-r"; then _RC_RV=0; shift; fi
return ${_RC_RV}
}
rc_exit() { exit ${_RC_RV}; }
rc_active()
{
if test -z "$RUNLEVEL"; then read RUNLEVEL REST < <(/sbin/runlevel); fi
if test -e /etc/init.d/S[0-9][0-9]${1}; then return 0; fi
return 1
}
fi
# Reset status of this service
rc_reset
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - user had insufficient privileges
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
# 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signaling is not supported) are
# considered a success.
case "$1" in
start)
echo -n "Starting ipmievd "
start_daemon $IPMIEVD_BIN $IPMIEVD_OPTIONS
rc_status -v
;;
stop)
echo -n "Shutting down ipmievd "
killproc -TERM $IPMIEVD_BIN
rc_status -v
;;
try-restart|condrestart)
## Do a restart only if the service was active before.
## Note: try-restart is now part of LSB (as of 1.9).
## RH has a similar command named condrestart.
if test "$1" = "condrestart"; then
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
fi
$0 status
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure.
fi
rc_status
;;
restart)
$0 stop
$0 start
rc_status
;;
force-reload)
echo -n "Reload service ipmievd "
$0 try-restart
rc_status
;;
reload)
rc_failed 3
rc_status -v
;;
status)
echo -n "Checking for service ipmievd "
checkproc $IPMIEVD_BIN
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload| reload}"
exit 1
;;
esac
rc_exit

View File

@ -0,0 +1,202 @@
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x02","0x04","Chassis Number","Memory Card","Completion Code (0x00=Success)","0x00","Memory hot replace event"
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x02","0x05","Chassis Number","Memory Card","Memory Size (in 512MB units)","0x00","Memory hot add event"
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x00","Chassis Number","Scalability Port Number","R","0x00","Scalability link down"
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","Chassis Number","Scalability Port Number","R","0x00","Scalability link up"
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x02","Chassis Number","Scalability Port Number","R","0x00","Scalability link double wide down"
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x03","Chassis Number","Scalability Port Number","R","0x00","Scalability link double wide up"
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x80","Chassis Number","Scalability Port Number","R","0x00","Scalability link PFA"
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x81","Chassis Number","Scalability Port Number","R","0x00","Scalability link invalid port"
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x82","Chassis Number","Scalability Port Number","R","0x00","Scalability link invalid node"
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x03","0x83","Chassis Number","Scalability Port Number","R","0x00","Scalability link kill"
"0xE0","0x00","0x00","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Device OK"
"0xE0","0x00","0x01","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required ROM space not available"
"0xE0","0x00","0x02","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required I/O Space not available"
"0xE0","0x00","0x03","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required memory not available"
"0xE0","0x00","0x04","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required memory below 1MB not available"
"0xE0","0x00","0x05","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","ROM checksum failed"
"0xE0","0x00","0x06","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","BIST failed"
"0xE0","0x00","0x07","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Planar device missing or disabled by user"
"0xE0","0x00","0x08","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","PCI device has an invalid PCI configuration space header"
"0xE0","0x00","0x09","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","FRU information for added PCI device"
"0xE0","0x00","0x0A","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","FRU information for removed PCI device"
"0xE0","0x00","0x0B","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","A PCI device was added, PCI FRU information is stored in next log entry"
"0xE0","0x00","0x0C","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","A PCI device was removed, PCI FRU information is stored in next log entry"
"0xE0","0x00","0x0D","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Requested resources not available"
"0xE0","0x00","0x0E","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required I/O Space Not Available"
"0xE0","0x00","0x0F","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required I/O Space Not Available"
"0xE0","0x00","0x10","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required I/O Space Not Available"
"0xE0","0x00","0x11","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required I/O Space Not Available"
"0xE0","0x00","0x12","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Required I/O Space Not Available"
"0xE0","0x00","0x13","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Planar video disabled due to add in video card"
"0xE0","0x00","0x14","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","FRU information for PCI device partially disabled "
"0xE0","0x00","0x15","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","A PCI device was partially disabled, PCI FRU information is stored in next log entry"
"0xE0","0x00","0x16","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","A 33Mhz device is installed on a 66Mhz bus, PCI device information is stored in next log entry"
"0xE0","0x00","0x17","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","FRU information, 33Mhz device installed on 66Mhz bus"
"0xE0","0x00","0x18","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Merge cable missing"
"0xE0","0x00","0x19","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Node 1 to Node 2 cable missing"
"0xE0","0x00","0x1A","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Node 1 to Node 3 cable missing"
"0xE0","0x00","0x1B","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Node 2 to Node 3 cable missing"
"0xE0","0x00","0x1C","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Nodes could not merge"
"0xE0","0x00","0x1D","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","No 8 way SMP cable"
"0xE0","0x00","0x1E","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Primary North Bridge to PCI Host Bridge IB Link has failed"
"0xE0","0x00","0x1F","Chassis Number","Slot Number","Bus Number","Device ID (MSB)","Device ID (LSB)","Vendor ID (MSB)","Vendor ID (LSB)","R","R","R","0x00","Redundant PCI Host Bridge IB Link has failed"
"0xE0","0x00","0x00","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Device OK"
"0xE0","0x00","0x01","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required ROM space not available"
"0xE0","0x00","0x02","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required I/O Space not available"
"0xE0","0x00","0x03","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required memory not available"
"0xE0","0x00","0x04","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required memory below 1MB not available"
"0xE0","0x00","0x05","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","ROM checksum failed"
"0xE0","0x00","0x06","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","BIST failed"
"0xE0","0x00","0x07","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Planar device missing or disabled by user"
"0xE0","0x00","0x08","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","PCI device has an invalid PCI configuration space header"
"0xE0","0x00","0x09","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","FRU information for added PCI device"
"0xE0","0x00","0x0A","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","FRU information for removed PCI device"
"0xE0","0x00","0x0B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","A PCI device was added, PCI FRU information is stored in next log entry"
"0xE0","0x00","0x0C","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","A PCI device was removed, PCI FRU information is stored in next log entry"
"0xE0","0x00","0x0D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Requested resources not available"
"0xE0","0x00","0x0E","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required I/O Space Not Available"
"0xE0","0x00","0x0F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required I/O Space Not Available"
"0xE0","0x00","0x10","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required I/O Space Not Available"
"0xE0","0x00","0x11","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required I/O Space Not Available"
"0xE0","0x00","0x12","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Required I/O Space Not Available"
"0xE0","0x00","0x13","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Planar video disabled due to add in video card"
"0xE0","0x00","0x14","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","FRU information for PCI device partially disabled "
"0xE0","0x00","0x15","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","A PCI device was partially disabled, PCI FRU information is stored in next log entry"
"0xE0","0x00","0x16","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","A 33Mhz device is installed on a 66Mhz bus, PCI device information is stored in next log entry"
"0xE0","0x00","0x17","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","FRU information, 33Mhz device installed on 66Mhz bus"
"0xE0","0x00","0x18","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Merge cable missing"
"0xE0","0x00","0x19","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Node 1 to Node 2 cable missing"
"0xE0","0x00","0x1A","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Node 1 to Node 3 cable missing"
"0xE0","0x00","0x1B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Node 2 to Node 3 cable missing"
"0xE0","0x00","0x1C","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Nodes could not merge"
"0xE0","0x00","0x1D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","No 8 way SMP cable"
"0xE0","0x00","0x1E","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Primary North Bridge to PCI Host Bridge IB Link has failed"
"0xE0","0x00","0x1F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","R","R","R","0x01","Redundant PCI Host Bridge IB Link has failed"
"0xE0","0x01","0x00","Chassis Number","Processor Number","R","R","R","R","R","R","R","R","0x00","Processor has failed BIST"
"0xE0","0x01","0x01","Chassis Number","Processor Number","R","R","R","R","R","R","R","R","0x00","Unable to apply processor microcode update"
"0xE0","0x01","0x02","Chassis Number","Processor Number","R","R","R","R","R","R","R","R","0x00","POST does not support current stepping level of processor"
"0xE0","0x01","0x03","Chassis Number","Processor Number","R","R","R","R","R","R","R","R","0x00","CPU mismatch detected"
"0xE0","0x02","0x00","Chassis Number","Memory Card","Memory DIMM","R","R","R","R","R","R","R","0x00","Uncorrectable memory error occurred"
"0xE0","0x02","0x01","Chassis Number","Memory Card","Memory DIMM","Failing Symbol","R","R","R","R","R","R","0x00","Correctable memory threshold occurred"
"0xE0","0x02","0x02","0x00","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM enabled"
"0xE0","0x02","0x02 ","0x01","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM disabled, failed ECC test"
"0xE0","0x02","0x02 ","0x02","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM disabled, failed POST/BIOS memory test"
"0xE0","0x02","0x02 ","0x03","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM disabled, non-supported memory device"
"0xE0","0x02","0x02 ","0x04","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x00","DIMM disabled, non-matching or missing DIMM(s)"
"0xE0","0x03","0x00","Chassis Number","Memory Card","R","R","R","R","R","R","R","R","0x00","Memory card enabled"
"0xE0","0x03","0x00","Chassis Number","Memory Card","R","R","R","R","R","R","R","R","0x00","Memory card disabled"
"0xE0","0x02","0x00","0x00","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM enabled"
"0xE0","0x02","0x00","0x01","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, failed ECC test"
"0xE0","0x02","0x00","0x02","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, failed POST/BIOS memory test"
"0xE0","0x02","0x00","0x03","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, non-supported memory device"
"0xE0","0x02","0x00","0x04","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, non-matching or missing DIMM(s)"
"0xE1","0x00","0x00","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","Unknown SERR/PERR detected on PCI bus"
"0xE1","0x00","0x01","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Address of special cycle DPE"
"0xE1","0x00","0x02","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Master read parity error"
"0xE1","0x00","0x03","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Received target parity error"
"0xE1","0x00","0x04","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Master write parity error"
"0xE1","0x00","0x05","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Device signaled SERR"
"0xE1","0x00","0x06","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Slave signaled parity error"
"0xE1","0x00","0x07","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Signaled Target Abort"
"0xE1","0x00","0x08","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Additional Correctable ECC Error"
"0xE1","0x00","0x09","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Received Master Abort"
"0xE1","0x00","0x0A","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Additional Uncorrectable ECC Error"
"0xE1","0x00","0x0B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Split Completion Discarded"
"0xE1","0x00","0x0C","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Correctable ECC Error"
"0xE1","0x00","0x0D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Unexpected Split Completion"
"0xE1","0x00","0x0E","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: Uncorrectable ECC Error"
"0xE1","0x00","0x0F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Received split completion error"
"0xE1","0x00","0x11","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Address of special cycle DPE"
"0xE1","0x00","0x12","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Master read parity error"
"0xE1","0x00","0x13","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Received target parity error"
"0xE1","0x00","0x14","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Master write parity error"
"0xE1","0x00","0x15","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Device Signaled SERR"
"0xE1","0x00","0x16","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Slave Signaled Parity Error"
"0xE1","0x00","0x17","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Signaled Target Abort"
"0xE1","0x00","0x18","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Additional Correctable ECC Error"
"0xE1","0x00","0x19","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Received Master Abort"
"0xE1","0x00","0x1A","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Additional Uncorrectable ECC Error"
"0xE1","0x00","0x1B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Split Completion Discarded"
"0xE1","0x00","0x1C","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Correctable ECC Error"
"0xE1","0x00","0x1D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Unexpected Split Completion"
"0xE1","0x00","0x1E","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI-PCI bridge secondary error: Uncorrectable ECC Error"
"0xE1","0x00","0x1F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI-PCI bridge secondary error: Received split completion error"
"0xE1","0x00","0x20","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI ECC Error (Corrected)"
"0xE1","0x00","0x21","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI Bus Address Parity Error"
"0xE1","0x00","0x22","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI Bus Data Parity Error"
"0xE1","0x00","0x23","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: SERR# Asserted"
"0xE1","0x00","0x24","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PERR Received by Calgary on a PCIX Split Completion"
"0xE1","0x00","0x25","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Address"
"0xE1","0x00","0x27","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: TCE Extent Error"
"0xE1","0x00","0x29","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Page Fault"
"0xE1","0x00","0x2B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Unauthorized Access"
"0xE1","0x00","0x2D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Parity Error in DMA Read Data Buffer"
"0xE1","0x00","0x2F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI Bus Time Out"
"0xE1","0x00","0x31","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: DMA Delayed Read Timeout"
"0xE1","0x00","0x33","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Internal Error on PCIX Split Completion"
"0xE1","0x00","0x35","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: DMA Read Reply (RIO) Timeout"
"0xE1","0x00","0x37","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Internal RAM Error on DMA Write"
"0xE1","0x00","0x39","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: MVE Valid Bit Off"
"0xE1","0x00","0x3B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: MVE Index Invalid"
"0xE1","0x00","0x40","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: ECC Error (Corrected)"
"0xE1","0x00","0x41","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: SERR# Detected"
"0xE1","0x00","0x42","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI Bus Data Parity Error"
"0xE1","0x00","0x43","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: No DEVSEL#"
"0xE1","0x00","0x45","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Bus Time Out"
"0xE1","0x00","0x47","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Retry Count Expired"
"0xE1","0x00","0x49","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Target-Abort"
"0xE1","0x00","0x4B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Size"
"0xE1","0x00","0x4D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Access Not Enabled"
"0xE1","0x00","0x4F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Internal RAM Error on MMIO Store"
"0xE1","0x00","0x51","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Split Response Received"
"0xE1","0x00","0x53","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCIX Split Completion Error Status Received"
"0xE1","0x00","0x55","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Unexpected PCIX Split Completion Received"
"0xE1","0x00","0x57","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCIX Split Completion Timeout"
"0xE1","0x00","0x59","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Recoverable Error Summary Bit"
"0xE1","0x00","0x5B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: CSR Error Summary Bit"
"0xE1","0x00","0x5D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Internal RAM Error on MMIO Load"
"0xE1","0x00","0x61","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Bad Command"
"0xE1","0x00","0x63","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Length Field Invalid"
"0xE1","0x00","0x65","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Load Greater Than 8 & No Write Buffer Enabled"
"0xE1","0x00","0x67","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCIX Discontiguous Byte Enable Error"
"0xE1","0x00","0x69","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: 4K Address Boundary Crossing Error"
"0xE1","0x00","0x6B","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Store Wrap State Machine Check"
"0xE1","0x00","0x6D","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Target State Machine Check"
"0xE1","0x00","0x6F","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Transaction PM/DW"
"0xE1","0x00","0x71","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Transaction PM/DR"
"0xE1","0x00","0x73","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: Invalid Transaction PS/DW"
"0xE1","0x00","0x75","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: DMA Write Command FIFO Parity Error"
"0xE1","0x00","0x76","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PERR: PCI Secondary Status Register Dump"
"0xE1","0x00","0x77","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","SERR: PCI Secondary Status Register Dump"
"0xE1","0x00","0x81","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x00","PCI-to-PCI Bridge Discard Timer Error"
"0xE1","0x00","0x01","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x01","SERR detected on PCI bus"
"0xE1","0x00","0x02","Chassis Number","Slot Number","Bus Number","Device ID (LSB)","Device ID (MSB)","Vendor ID (LSB)","Vendor ID (MSB)","Status Register (LSB)","Status Register (MSB)","DevFun Number","0x01","PERR detected on PCI bus"
"0xE1","0x01","0x00","R","R","Bank (LSB)","Bank (MSB)","Apic ID (LSB)","Apic ID (MSB)","CK4(LSB)","CK4","CK4","CK4(MSB)","0x00","Processor Error Information Data A"
"0xE1","0x01","0x01","R","R","Address high (LSB)","Address high","Address high","Address high (MSB)","Address low (LSB)","Address low ","Address low ","Address low (MSB)","0x00","Processor Error Information Data B1"
"0xE1","0x01","0x02","R","R","Timestamp high (LSB)","Timestamp high","Timestamp high","Timestamp high (MSB)","Timestamp Low (LSB)","Timestamp low","Timestamp low","Timestamp low (MSB)","0x00","Processor Error Information Data B2"
"0xE1","0x01","0x03","R","R","MCA status register high (LSB)","MCA status register high","MCA status register high","MCA status register high (MSB)","MCA status register low (LSB)","MCA status register low","MCA status register low","MCA status register low (MSB)","0x00","Processor Error Information Data C"
"0xE1","0x01","0x04","Chassis","0x00","Processor ID","R","R","R","R","R","R","R","0x00","Processor recoverable error"
"0xE1","0x01","0x04","Chassis","0x01","Processor ID","R","R","R","R","R","R","R","0x00","Processor unrecoverable error"
"0xE1","0x02","0x00","0x00","Failed Row","Spare Row","R","R","R","R","R","R","R","0x00","Memory sparing event, start 1"
"0xE1","0x02","0x00","0x02","Failed Row","Spare Row","R","R","R","R","R","R","R","0x00","Memory sparing event, done 1"
"0xE1","0x02","0x00","0x01","Failed Row 1","Failed Row 2","Spare Row 1","Spare Row 2","R","R","R","R","R","0x00","Memory sparing event, start 2"
"0xE1","0x02","0x00","0x03","Failed Row 1","Failed Row 2","Spare Row 1","Spare Row 2","R","R","R","R","R","0x00","Memory sparing event, done 2"
"0xE1","0x02","0x01","Failed Port","Spare Port","R","R","R","R","R","R","R","R","0x00","Memory mirroring failover occurred"
"0xE1","0x04","0x00","0x00","FSB FERR/NERR Register","FSB FERR/NERR Register","Chassis Number","R","R","R","R","R","R","0x00","FSB A Fatal"
"0xE1","0x04","0x00","0x01","FSB FERR/NERR Register","FSB FERR/NERR Register","Chassis Number","R","R","R","R","R","R","0x00","FSB A Nonfatal"
"0xE1","0x04","0x00","0x02","FSB FERR/NERR Register","FSB FERR/NERR Register","Chassis Number","R","R","R","R","R","R","0x00","FSB B Fatal"
"0xE1","0x04","0x00","0x03","FSB FERR/NERR Register","FSB FERR/NERR Register","Chassis Number","R","R","R","R","R","R","0x00","FSB B Nonfatal"
"0xE1","0x05","0x00","0x02","Hi FERR or NERR Register","R","R","R","R","R","R","R","R","0x00","Lindenhurst Chipset Event: Hi Fatal"
"0xE1","0x05","0x00","0x03","Hi FERR or NERR Register","R","R","R","R","R","R","R","R","0x00","Lindenhurst Chipset Event: Hi Nonfatal"
"0xE1","0x05","0x01","0x02","Status Register Contents","R","R","R","R","R","R","R","R","0x00","Fatal internal north bridge error"
"0xE1","0x05","0x01","0x03","Status Register Contents","R","R","R","R","R","R","R","R","0x00","Nonfatal internal north bridge error"
"0xE2","0x00","Register ID","R","First Fire Bit","Register Data (LSB)","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data (MSB)","0x00","PCI Industry Standard Register Dump"
"0xE2","0x01","Register ID","R","First Fire Bit (0xFF if N/A)","Register Data (LSB)","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data (MSB)","0x00","PCI-X Industry Standard Register Dump"
"0xE2","0x02","Register ID","R","First Fire Bit (0xFF if N/A)","Register Data (LSB)","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data","Register Data (MSB)","0x00","PCI Express Industry Standard Register Dump"
"0xE3","Platform ID","Register ID","R","R","R","R","R","R","Register Data (LSB)","Register Data","Register Data","Register Data (MSB)","0x00","RAW Hex Dump"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x00","0x00","R","R","R","0x00","PCI Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x01","0x00","R","R","R","0x00","Processor Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x02","0x00","R","R","R","0x00","Memory Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x00","R","R","R","0x00"," Scalability Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x04","0x00","R","R","R","0x00","Bus PCI Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x05","0x00","R","R","R","0x00","Chipset Event/Error Occurred. Next non-timestamped OEM SEL entry will contain details of the specific PCI event/error"

View File

@ -27,10 +27,6 @@
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# You acknowledge that this software is not designed or intended for use
# in the design, construction, operation or maintenance of any nuclear
# facility.
MAINTAINERCLEANFILES = Makefile.in

View File

@ -1,11 +1,11 @@
Name: ipmitool
Summary: ipmitool - Utility for IPMI control
Version: @VERSION@
Release: 1%{?_distro:.%{_distro}}
Copyright: BSD
Release: @RPM_RELEASE@%{?_distro:.%{_distro}}
License: BSD
Group: Utilities
Packager: Duncan Laurie <duncan@iceblink.org>
Source: ipmitool-@VERSION@.tar.gz
Source: %{name}-%{version}.tar.gz
Buildroot: /var/tmp/ipmitool-root
%description
@ -50,19 +50,96 @@ make DESTDIR=$RPM_BUILD_ROOT install-strip
if [ "$RPM_BUILD_ROOT" ] && [ "$RPM_BUILD_ROOT" != "/" ]; then
rm -rf $RPM_BUILD_ROOT
fi
rm -rf $RPM_BUILD_DIR/ipmitool-@VERSION@
%files
%defattr(-,root,root)
%{_bindir}/*
%{_sbindir}/*
%{_datadir}/ipmitool/*
%doc %{_mandir}/man1/*
%doc %{_mandir}/man8/*
%doc %{_datadir}/doc/ipmitool/*
%defattr(755,root,root)
%attr(755,root,root) %{_bindir}/*
%attr(755,root,root) %{_sbindir}/*
%{_mandir}/man*/*
%doc %{_datadir}/doc/ipmitool
%changelog
* Sat Jan 14, 2006 <duncan@iceblink.org> 1.8.5-1
* Tue Mar 6 2007 <pere@hungry.com> 1.8.9-1
- Added initial AMC ekey query operation support
- Improvements to ekeying support (PICMG 3.x only)
- Added initial interactive edition support for multirec; added IANA
verification before interpreting PICMG records.
- Added edit support for AMC activation "Maximum Internal Current"
- Fix bug generating garbage on the screen when handling GetDeviceId
and sol traffic occurs
- Added ability to map OEM sensor types to OEM description string using
IANA number; moved IANA number table
- Fix lan set access command to use value already saved within parameters
for PEF and authentication
- Fix bug in cmd ipmitool lan stats get 1
- Add support to allow ipmitool/ipmievd to target specific device nodes
on multi-BMC systems
- Add support for name+privilege lookup for lanplus sessions
- Fix time_t conversion bug for 64-bit OS
- Added prefix of hostname on sel ipmievd sessions
- Fixed FWUM Get Info
- Fix ipmievd fd closing bug
- Add set-in-progress flag support to chassis bootdev
- Added new chassis bootdev options
- Add sol payload enable/disable comman
- Fix SOL set errors when commit-write not supported
- Fix reset of session timeout for lanplus interface
- Fixed lan interface accessibility timeout handling
- Fix bug with Function Get Channel Cipher Suites command when more
than 1 page used.
- Fix missing firmware firewall top-level command
- Fix bug in SOL keepalive functionality
- Fix SOLv2 NACK and retry handling for Intel ESB2 BMC
- Added ipmi_sel_get_oem_sensor* APIs
- Added HPM.1 support
- Fix segfault when incorrect oem option supplied
- Fix bus problem with spd command
- Fix segfault in SOL when remote BMC does not return packet
- Adjust packet length for AMC.0 retricting IPMB packets to 32 bytes
- Added lan packet size reduction mechanism
- Fix bug with sendMessage of bad length with different target
- Fix for big endian (PPC) architecture
- NetBSD fixes
- Fix segfault and channel problem with user priv command
- Add support for bus/chan on i2c raw command
- Add freeipmi interface support
- Add remote spd printing
- Add better detection of linux/compiler.h to config
- Makefile changes to fix makedistcheck, etc.
* Tue May 02 2006 <duncan@iceblink.org> 1.8.8-1
- Fix segfaults in sensor data repository list
- Fix ipmievd to open interface before daemonizing
- Fix IPMIv1.5 authtype NONE to ignore supplied password
- Fix cipher suite display bug in lan print
- Fix typo in IPMIv2 SOL output when sending break
- Fix improper LUN handling with Tyan SOL
- Add LUN support to OpenIPMI interface
- Add support for Kontron OEM commands
- Update to Kontron Firmware Update command
* Sun Mar 19 2006 <duncan@iceblink.org> 1.8.7-1
- Add Sun OEM command for blades
- Increase argument size for raw commands in shell/exec
- Fix handling of LUNs for LAN interfaces
- Add IPMIv2 SOL loopback test
- Add support for IBM OEM SEL messages
- Disable file paranoia checks on read files by default
- Support IPMIv2 SOL on older Intel boxes
- Display message and exit if keepalive fails during SOL
- Add support for setting VLAN id and priority
- Add support for FreeBSD OpenIPMI-compatible driver
- Add support for IPMIv2 Firmware Firewall
- Fix gcc4 compile warnings
- Make ipmievd generate pidfile
- Add initscripts for ipmievd
* Mon Jan 17 2006 <duncan@iceblink.org> 1.8.6-1
- Fix memory corruption when sending encrypted SOL traffic
- Add keepalive timer to IPMIv2 SOL sessions
* Sat Jan 14 2006 <duncan@iceblink.org> 1.8.5-1
- Raise privilege level after creating IPMIv2 session
- Add support for settable SOL escape character with -e option
- Add support for Kg BMC key for IPMIv2 authentication with -k option

View File

@ -1,3 +1,53 @@
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.

View File

@ -3,13 +3,13 @@ Section: utils
Priority: optional
Maintainer: Petter Reinholdtsen <pere@debian.org>
Uploaders: Duncan Laurie <duncan@iceblink.org>
Build-Depends: debhelper (>> 4.0.0),
Standards-Version: 3.6.1
Build-Depends: debhelper (>> 4.0.0), libreadline5-dev | libreadline-dev, libssl-dev
Standards-Version: 3.6.2.1
Package: ipmitool
Architecture: i386 amd64
Depends: ${shlibs:Depends}
Suggest: openipmi
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

View File

@ -34,7 +34,3 @@ OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
You acknowledge that this software is not designed or intended for use
in the design, construction, operation or maintenance of any nuclear
facility.

View File

@ -0,0 +1,99 @@
#! /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

View File

@ -91,6 +91,7 @@ binary-common:
dh_testroot
dh_installdocs
dh_installchangelogs
dh_installinit --name ipmievd
dh_link
dh_strip
dh_compress

View File

@ -27,10 +27,6 @@
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# You acknowledge that this software is not designed or intended for use
# in the design, construction, operation or maintenance of any nuclear
# facility.
MAINTAINERCLEANFILES = Makefile.in

View File

@ -2,7 +2,7 @@
.SH "NAME"
ipmievd \- IPMI event daemon for sending events to syslog
.SH "SYNOPSIS"
ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-d \fIN\fP\fR|\fB\-v\fR|\fB\-V\fR]
\fB\-I\fR \fIopen\fP <\fIopen\fR | \fIsel\fR> [<\fIoption\fP>]
ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
@ -13,6 +13,7 @@ ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
[\fB\-L\fR <\fIprivlvl\fP>]
[\fB\-a\fR|\fB\-E\fR|\fB\-P\fR|\fB\-f\fR <\fIpassword\fP>]
[\fB\-o\fR <\fIoemtype\fP>]
[\fB\-O\fR <\fIsel oem\fP>]
\fIsel\fP [<\fIoption\fP>]
ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
@ -22,6 +23,7 @@ ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
[\fB\-L\fR <\fIprivlvl\fP>]
[\fB\-a\fR|\fB\-E\fR|\fB\-P\fR|\fB\-f\fR <\fIpassword\fP>]
[\fB\-o\fR <\fIoemtype\fP>]
[\fB\-O\fR <\fIsel oem\fP>]
[\fB\-C\fR <\fIciphersuite\fP>]
\fIsel\fR [<\fIoption\fP>]
.SH "DESCRIPTION"
@ -44,7 +46,7 @@ Prompt for the remote server password.
.TP
\fB\-A\fR <\fIauthtype\fP>
Specify an authentication type to use during IPMIv1.5 \fIlan\fP
session activation. Supported types are NONE, PASSWORD, MD5, or OEM.
session activation. Supported types are NONE, PASSWORD, MD2, MD5, or OEM.
.TP
\fB\-c\fR
Present output in CSV (comma separated variable) format.
@ -90,6 +92,10 @@ in place in the code to work around quirks in various BMCs from
various manufacturers. Use \fI\-o list\fP to see a list of
current supported OEM types.
.TP
\fB\-O\fR <\fIsel oem\fP>
Open selected file and read OEM SEL event descriptions to be used
during SEL listings. See examples in contrib dir for file format.
.TP
\fB\-p\fR <\fIport\fP>
Remote server UDP port to connect to. Default is 623.
.TP
@ -110,6 +116,13 @@ Bridge IPMI requests to the remote target address.
\fB\-U\fR <\fIusername\fP>
Remote server username, default is NULL user.
.TP
\fB\-d \fIN\fP\fR
Use device number N to specify the /dev/ipmiN (or
/dev/ipmi/N or /dev/ipmidev/N) device to use for in-band
BMC communication. Used to target a specific BMC on a
multi-node, multi-BMC system through the ipmi device
driver interface. Default is 0.
.TP
\fB\-v\fR
Increase verbose output level. This option may be specified
multiple times to increase the level of debug output. If given
@ -158,6 +171,11 @@ All messages will be sent to syslog. This is the default action.
.TP
\fInodaemon\fP
Do NOT become a daemon, instead log all messages to stderr.
.TP
\fIpidfile\fP=<\fBfilename\fR>
Save process ID to this file when in daemon mode. Defaults to
/var/run/ipmievd.pid\fIN\fP (where \fIN\fP is the ipmi device
number -- defaults to 0).
.RE
.TP
@ -176,6 +194,11 @@ All messages will be sent to syslog. This is the default action.
.TP
\fInodaemon\fP
Do NOT become a daemon, instead log all messages to stderr.
.TP
\fIpidfile\fP=<\fBfilename\fR>
Save process ID to this file when in daemon mode. Defaults to
/var/run/ipmievd.pid\fIN\fP (where \fIN\fP is the ipmi device
number -- defaults to 0).
.TP
\fItimeout\fP=<\fBseconds\fR>
Time between checks for SEL polling method. Default is 10 seconds.

View File

@ -2,7 +2,7 @@
.SH "NAME"
ipmitool \- utility for controlling IPMI\-enabled devices
.SH "SYNOPSIS"
ipmitool [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
ipmitool [\fB\-c\fR|\fB\-h\fR|\fB\-d \fIN\fP\fR|\fB\-v\fR|\fB\-V\fR]
\fB\-I\fR \fIopen\fP <\fIcommand\fP>
ipmitool [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
@ -13,6 +13,7 @@ ipmitool [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
[\fB\-L\fR <\fIprivlvl\fP>]
[\fB\-a\fR|\fB\-E\fR|\fB\-P\fR|\fB\-f\fR <\fIpassword\fP>]
[\fB\-o\fR <\fIoemtype\fP>]
[\fB\-O\fR <\fIsel oem\fP>]
[\fB\-e\fR <\fIesc_char\fP>]
<\fIcommand\fP>
@ -23,6 +24,7 @@ ipmitool [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
[\fB\-L\fR <\fIprivlvl\fP>]
[\fB\-a\fR|\fB\-E\fR|\fB\-P\fR|\fB\-f\fR <\fIpassword\fP>]
[\fB\-o\fR <\fIoemtype\fP>]
[\fB\-O\fR <\fIsel oem\fP>]
[\fB\-C\fR <\fIciphersuite\fP>]
[\fB\-k\fR <\fIkg_key\fP>]
[\fB\-e\fR <\fIesc_char\fP>]
@ -49,7 +51,7 @@ Prompt for the remote server password.
.TP
\fB\-A\fR <\fIauthtype\fP>
Specify an authentication type to use during IPMIv1.5 \fIlan\fP
session activation. Supported types are NONE, PASSWORD, MD5, or OEM.
session activation. Supported types are NONE, PASSWORD, MD2, MD5, or OEM.
.TP
\fB\-c\fR
Present output in CSV (comma separated variable) format.
@ -103,6 +105,10 @@ in place in the code to work around quirks in various BMCs from
various manufacturers. Use \fI\-o list\fP to see a list of
current supported OEM types.
.TP
\fB\-O\fR <\fIsel oem\fP>
Open selected file and read OEM SEL event descriptions to be used
during SEL listings. See examples in contrib dir for file format.
.TP
\fB\-p\fR <\fIport\fP>
Remote server UDP port to connect to. Default is 623.
.TP
@ -124,6 +130,13 @@ Bridge IPMI requests to the remote target address.
.TP
\fB\-U\fR <\fIusername\fP>
Remote server username, default is NULL user.
.TP
\fB\-d \fIN\fP\fR
Use device number N to specify the /dev/ipmiN (or
/dev/ipmi/N or /dev/ipmidev/N) device to use for in-band
BMC communication. Used to target a specific BMC on a
multi-node, multi-BMC system through the ipmi device
driver interface. Default is 0.
.TP
\fB\-v\fR
Increase verbose output level. This option may be specified
@ -750,6 +763,20 @@ Set BMC generated gratuitous ARPs.
Set BMC generated gratuitous ARP interval.
.TP
\fIvlan id\fP <\fBoff\fR|\fBid\fR>
.br
Disable VLAN operation or enable VLAN and set the ID.
.br
ID: value of the virtual lan identifier between 1 and 4094 inclusive.
.TP
\fIvlan priority\fP <\fBpriority\fR>
.br
Set the priority associated with VLAN frames.
.br
ID: priority of the virtual lan frames between 0 and 7 inclusive.
.TP
\fIauth\fP <\fBlevel\fR,\fB...\fR> <\fBtype\fR,\fB...\fR>
.br
@ -1501,6 +1528,16 @@ on the cipher suite ID found in the IPMIv2.0 specification in table
22\-19. The default cipher suite is \fI3\fP which specifies
RAKP\-HMAC\-SHA1 authentication, HMAC\-SHA1\-96 integrity, and AES\-CBC\-128
encryption algorightms.
.SH "FREE INTERFACE"
.LP
The ipmitool \fIfree\fP interface utilizes the FreeIPMI libfreeipmi
drivers.
.LP
You can tell ipmitool to use the FreeIPMI interface with the -I option:
.PP
ipmitool \fB\-I\fR \fIfree\fP <\fIcommand\fP>
.SH "EXAMPLES"
.TP
\fIExample 1\fP: Listing remote sensors
@ -1563,4 +1600,6 @@ http://www.intel.com/design/servers/ipmi
.TP
OpenIPMI Homepage
http://openipmi.sourceforge.net
.TP
FreeIPMI Homepage
http://www.gnu.org/software/freeipmi/

View File

@ -27,10 +27,6 @@
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# You acknowledge that this software is not designed or intended for use
# in the design, construction, operation or maintenance of any nuclear
# facility.
MAINTAINERCLEANFILES = Makefile.in

View File

@ -27,18 +27,15 @@
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# You acknowledge that this software is not designed or intended for use
# in the design, construction, operation or maintenance of any nuclear
# facility.
MAINTAINERCLEANFILES = Makefile.in
noinst_HEADERS = log.h bswap.h helper.h ipmi.h ipmi_intf.h \
ipmi_chassis.h ipmi_entity.h ipmi_fru.h ipmi_lanp.h \
noinst_HEADERS = log.h bswap.h helper.h ipmi.h ipmi_cc.h ipmi_intf.h \
ipmi_chassis.h ipmi_entity.h ipmi_fru.h ipmi_hpmfwupg.h ipmi_lanp.h \
ipmi_sdr.h ipmi_sel.h ipmi_sol.h ipmi_mc.h ipmi_raw.h \
ipmi_channel.h ipmi_sensor.h ipmi_event.h ipmi_session.h \
ipmi_strings.h ipmi_constants.h ipmi_user.h ipmi_pef.h \
ipmi_oem.h ipmi_isol.h ipmi_sunoem.h ipmi_picmg.h \
ipmi_fwum.h ipmi_main.h ipmi_tsol.h
ipmi_fwum.h ipmi_main.h ipmi_tsol.h ipmi_firewall.h \
ipmi_kontronoem.h

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_BSWAP_H

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_HELPER_H
@ -42,11 +38,29 @@
#include <stdio.h>
#include <string.h>
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
struct ipmi_intf;
struct valstr {
uint16_t val;
const char * str;
};
struct oemvalstr {
uint16_t oem;
uint16_t val;
const char * str;
};
const char * val2str(uint16_t val, const struct valstr * vs);
const char * oemval2str(uint16_t oem,uint16_t val, const struct oemvalstr * vs);
uint16_t str2val(const char * str, const struct valstr * vs);
void print_valstr(const struct valstr * vs, const char * title, int loglevel);
void print_valstr_2col(const struct valstr * vs, const char * title, int loglevel);
@ -58,7 +72,7 @@ const char * buf2str(uint8_t * buf, int len);
void printbuf(const uint8_t * buf, int len, const char * desc);
uint8_t ipmi_csum(uint8_t * d, int s);
FILE * ipmi_open_file(const char * file, int rw);
void ipmi_start_daemon(void);
void ipmi_start_daemon(struct ipmi_intf *intf);
#define ipmi_open_file_read(file) ipmi_open_file(file, 0)
#define ipmi_open_file_write(file) ipmi_open_file(file, 1)

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_H
@ -43,6 +39,8 @@
#include <sys/types.h>
#include <netinet/in.h>
#include <ipmitool/helper.h>
#include <ipmitool/ipmi_cc.h>
#define IPMI_BUF_SIZE 1024
@ -238,6 +236,21 @@ struct ipmi_rs {
#define IPMI_BMC_SLAVE_ADDR 0x20
#define IPMI_REMOTE_SWID 0x81
/* These values are IANA numbers */
typedef enum IPMI_OEM {
IPMI_OEM_UNKNOWN = 0,
IPMI_OEM_SUN = 42,
IPMI_OEM_NOKIA = 94,
IPMI_OEM_INTEL = 343,
IPMI_OEM_TYAN = 6653,
IPMI_OEM_NEWISYS = 9237,
IPMI_OEM_SUPERMICRO = 10876,
IPMI_OEM_GOOGLE = 11129,
IPMI_OEM_PICMG = 12634,
IPMI_OEM_KONTRON = 15000,
} IPMI_OEM;
extern const struct valstr completion_code_vals[];
#endif /* IPMI_H */

View File

@ -0,0 +1,76 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef IPMI_CC_H
#define IPMI_CC_H
/*
Thu Jan 11 09:32:41 2007
francois.isabelle@ca.kontron.com
I just noticed that most modules refer to IPMI completion codes using
hard coded values ...
*/
/*
* CC
* See IPMI specification table 5-2 Generic Completion Codes
*/
#define IPMI_CC_OK 0x00
#define IPMI_CC_NODE_BUSY 0xc0
#define IPMI_CC_INV_CMD 0xc1
#define IPMI_CC_INV_CMD_FOR_LUN 0xc2
#define IPMI_CC_TIMEOUT 0xc3
#define IPMI_CC_OUT_OF_SPACE 0xc4
#define IPMI_CC_RES_CANCELED 0xc5
#define IPMI_CC_REQ_DATA_TRUNC 0xc6
#define IPMI_CC_REQ_DATA_INV_LENGTH 0xc7
#define IPMI_CC_REQ_DATA_FIELD_EXCEED 0xc8
#define IPMI_CC_PARAM_OUT_OF_RANGE 0xc9
#define IPMI_CC_CANT_RET_NUM_REQ_BYTES 0xca
#define IPMI_CC_REQ_DATA_NOT_PRESENT 0xcb
#define IPMI_CC_INV_DATA_FIELD_IN_REQ 0xcc
#define IPMI_CC_ILL_SENSOR_OR_RECORD 0xcd
#define IPMI_CC_RESP_COULD_NOT_BE_PRV 0xce
#define IPMI_CC_CANT_RESP_DUPLI_REQ 0xcf
#define IPMI_CC_CANT_RESP_SDRR_UPDATE 0xd0
#define IPMI_CC_CANT_RESP_FIRM_UPDATE 0xd1
#define IPMI_CC_CANT_RESP_BMC_INIT 0xd2
#define IPMI_CC_DESTINATION_UNAVAILABLE 0xd3
#define IPMI_CC_INSUFFICIENT_PRIVILEGES 0xd4
#define IPMI_CC_NOT_SUPPORTED_PRESENT_STATE 0xd5
#define IPMI_CC_ILLEGAL_COMMAND_DISABLED 0xd6
#define IPMI_CC_UNSPECIFIED_ERROR 0xff
#endif /*IPMI_CC_H*/

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_CHANNEL_H

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_CHASSIS_H

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_CONSTANTS_H
@ -55,6 +51,8 @@
#define IPMI_SUSPEND_RESUME_PAYLOAD_ENCRYPTYION 0x55
#define IPMI_GET_SEL_TIME 0x48
#define IPMI_SET_SEL_TIME 0x49
#define IPMI_SET_USER_PAYLOAD_ACCESS 0x4c
#define IPMI_GET_USER_PAYLOAD_ACCESS 0x4d
#define IPMI_1_5_AUTH_TYPE_BIT_NONE 0x01
#define IPMI_1_5_AUTH_TYPE_BIT_MD2 0x02
@ -107,6 +105,15 @@
#define IPMI_CHASSIS_POLICY_PREVIOUS 0x1
#define IPMI_CHASSIS_POLICY_ALWAYS_OFF 0x0
#define IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS 0
#define IPMI_CHASSIS_BOOTPARAM_SVCPART_SELECT 1
#define IPMI_CHASSIS_BOOTPARAM_SVCPART_SCAN 2
#define IPMI_CHASSIS_BOOTPARAM_FLAG_VALID 3
#define IPMI_CHASSIS_BOOTPARAM_INFO_ACK 4
#define IPMI_CHASSIS_BOOTPARAM_BOOT_FLAGS 5
#define IPMI_CHASSIS_BOOTPARAM_INIT_INFO 6
#define IPMI_CHASSIS_BOOTPARAM_INIT_MBOX 7
/* From table 13-17 of the IPMI v2 specification */
#define IPMI_AUTH_RAKP_NONE 0x00
#define IPMI_AUTH_RAKP_HMAC_SHA1 0x01

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_ENTITY_H

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_EVENT_H

View File

@ -0,0 +1,106 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef IPMI_FIREWALL_H
#define IPMI_FIREWALL_H
#include <ipmitool/ipmi.h>
int ipmi_firewall_main(struct ipmi_intf *, int, char **);
#define BMC_GET_NETFN_SUPPORT 0x09
#define BMC_GET_COMMAND_SUPPORT 0x0A
#define BMC_GET_COMMAND_SUBFUNCTION_SUPPORT 0x0B
#define BMC_GET_CONFIGURABLE_COMMANDS 0x0C
#define BMC_GET_CONFIGURABLE_COMMAND_SUBFUNCTIONS 0x0D
#define BMC_SET_COMMAND_ENABLES 0x60
#define BMC_GET_COMMAND_ENABLES 0x61
#define BMC_SET_COMMAND_SUBFUNCTION_ENABLES 0x62
#define BMC_GET_COMMAND_SUBFUNCTION_ENABLES 0x63
#define BMC_OEM_NETFN_IANA_SUPPORT 0x64
#define SET_COMMAND_ENABLE_BYTE (BMC_SET_COMMAND_ENABLES / 8)
#define SET_COMMAND_ENABLE_BIT (BMC_SET_COMMAND_ENABLES % 8)
#define MAX_LUN 4
#define MAX_NETFN 64
#define MAX_NETFN_PAIR (MAX_NETFN/2)
#define MAX_COMMAND 256
#define MAX_SUBFN 32
#define MAX_COMMAND_BYTES (MAX_COMMAND>>3)
#define MAX_SUBFN_BYTES (MAX_SUBFN>>3)
// support is a bitfield with the following bits set...
#define BIT_AVAILABLE 0x01
#define BIT_CONFIGURABLE 0x02
#define BIT_ENABLED 0x04
extern int verbose;
struct command_support {
unsigned char support;
unsigned char version[3];
unsigned char subfn_support[MAX_SUBFN_BYTES];
unsigned char subfn_config[MAX_SUBFN_BYTES];
unsigned char subfn_enable[MAX_SUBFN_BYTES];
};
struct lun_netfn_support {
unsigned char support;
struct command_support command[MAX_COMMAND];
unsigned char command_mask[MAX_COMMAND_BYTES];
unsigned char config_mask[MAX_COMMAND_BYTES];
unsigned char enable_mask[MAX_COMMAND_BYTES];
};
struct lun_support {
unsigned char support;
struct lun_netfn_support netfn[MAX_NETFN_PAIR];
};
struct bmc_fn_support {
struct lun_support lun[MAX_LUN];
};
struct ipmi_function_params {
int channel;
int lun;
int netfn;
int command;
int subfn;
unsigned char force;
};
static inline int bit_test(const unsigned char * bf, int n) {
return !!(bf[n>>3]&(1<<(n%8)));
}
static inline void bit_set(unsigned char * bf, int n, int v) {
bf[n>>3] = (bf[n>>3] & ~(1<<(n%8))) | ((v?1:0)<<(n%8));
}
#endif /*IPMI_FIREWALL_H */

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_FRU_H
@ -122,7 +118,7 @@ struct fru_multirec_header {
#define FRU_RECORD_TYPE_MANAGEMENT_ACCESS 0x03
#define FRU_RECORD_TYPE_BASE_COMPATIBILITY 0x04
#define FRU_RECORD_TYPE_EXTENDED_COMPATIBILITY 0x05
#define FRU_RECORD_TYPE_PICMG_EXTENSION 0xc0
#define FRU_RECORD_TYPE_OEM_EXTENSION 0xc0
uint8_t type;
uint8_t format;
uint8_t len;
@ -211,7 +207,7 @@ struct fru_multirec_dcload {
uint16_t max_current;
} __attribute__ ((packed));
struct fru_multirec_picmgext_header {
struct fru_multirec_oem_header {
unsigned char mfg_id[3];
#define FRU_PICMG_BACKPLANE_P2P 0x04
#define FRU_PICMG_ADDRESS_TABLE 0x10
@ -256,6 +252,57 @@ struct fru_picmgext_link_desc {
#endif
} __attribute__ ((packed));
#define FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED 0x00
#define FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED1 0x01
#define FRU_PICMGEXT_AMC_LINK_TYPE_PCI_EXPRESS 0x02
#define FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING1 0x03
#define FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING2 0x04
#define FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET 0x05
#define FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO 0x06
#define FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE 0x07
/* This is used in command, not in FRU */
struct fru_picmgext_amc_link_info {
unsigned char linkInfo[3];
} __attribute__ ((packed));
struct fru_picmgext_amc_link_desc_core {
#ifndef WORDS_BIGENDIAN
unsigned int designator:12;
unsigned int type:8;
unsigned int ext:4;
unsigned int grouping:8;
#else
unsigned int grouping:8;
unsigned int ext:4;
unsigned int type:8;
unsigned int designator:12;
#endif
} __attribute__ ((packed));
struct fru_picmgext_amc_link_desc_extra {
#ifndef WORDS_BIGENDIAN
unsigned char asymetricMatch:2;
unsigned char reserved:6;
#else
unsigned char reserved:6;
unsigned char asymetricMatch:2;
#endif
} __attribute__ ((packed));
struct fru_picmgext_amc_link_desc {
#ifndef WORDS_BIGENDIAN
struct fru_picmgext_amc_link_desc_core core;/* lsb */
struct fru_picmgext_amc_link_desc_extra extra;
#else
struct fru_picmgext_amc_link_desc_extra extra;
struct fru_picmgext_amc_link_desc_core core;/* lsb */
#endif
} __attribute__ ((packed));
struct fru_picmgext_chn_desc {
#ifndef WORDS_BIGENDIAN
unsigned char remote_slot:8;
@ -276,11 +323,17 @@ struct fru_picmgext_slot_desc {
unsigned char chn_count;
} __attribute__ ((packed));
#define FRU_PICMGEXT_DESIGN_IF_BASE 0x00
#define FRU_PICMGEXT_DESIGN_IF_FABRIC 0x01
#define FRU_PICMGEXT_DESIGN_IF_BASE 0x00
#define FRU_PICMGEXT_DESIGN_IF_FABRIC 0x01
#define FRU_PICMGEXT_DESIGN_IF_UPDATE_CHANNEL 0x02
#define FRU_PICMGEXT_DESIGN_IF_RESERVED 0x03
struct fru_picmgext_carrier_activation_record {
unsigned short max_internal_curr;
unsigned char allowance_for_readiness;
unsigned char module_activation_record_count;
} __attribute__ ((packed));
struct fru_picmgext_activation_record {
unsigned char ibmb_addr;
unsigned char max_module_curr;
@ -318,5 +371,7 @@ static const char *chassis_type_desc[] __attribute__ ((unused)) = {
int ipmi_fru_main(struct ipmi_intf *intf, int argc, char **argv);
int ipmi_fru_print(struct ipmi_intf *intf, struct sdr_record_fru_locator *fru);
int ipmi_spd_print(uint8_t *data, int len);
int ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id);
#endif /* IPMI_FRU_H */

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_KFWUM_H

View File

@ -0,0 +1,41 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef IPMI_HPMFWUPG_H
#define IPMI_HPMFWUPG_H
#include <inttypes.h>
#include <ipmitool/ipmi.h>
int ipmi_hpmfwupg_main(struct ipmi_intf *, int, char **);
#endif /* IPMI_KFWUM_H */

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_INTF_H
@ -110,6 +106,7 @@ struct ipmi_session {
uint8_t integrity_alg;
uint8_t crypt_alg;
uint8_t max_priv_level;
uint8_t lookupbit;
uint32_t console_id;
uint32_t bmc_id;
@ -177,6 +174,8 @@ struct ipmi_intf {
uint8_t target_lun;
uint8_t target_channel;
uint8_t devnum;
int (*setup)(struct ipmi_intf * intf);
int (*open)(struct ipmi_intf * intf);
void (*close)(struct ipmi_intf * intf);
@ -194,6 +193,7 @@ void ipmi_intf_session_set_hostname(struct ipmi_intf * intf, char * hostname);
void ipmi_intf_session_set_username(struct ipmi_intf * intf, char * username);
void ipmi_intf_session_set_password(struct ipmi_intf * intf, char * password);
void ipmi_intf_session_set_privlvl(struct ipmi_intf * intf, uint8_t privlvl);
void ipmi_intf_session_set_lookupbit(struct ipmi_intf * intf, uint8_t lookupbit);
void ipmi_intf_session_set_cipher_suite_id(struct ipmi_intf * intf, uint8_t cipher_suite_id);
void ipmi_intf_session_set_sol_escape_char(struct ipmi_intf * intf, char sol_escape_char);
void ipmi_intf_session_set_kgkey(struct ipmi_intf * intf, char * kgkey);

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_ISOL_H

View File

@ -0,0 +1,45 @@
/*
* Copyright (c) 2004 Kontron Canada, Inc. All Rights Reserved.
*
* Base on code from
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef IPMI_KONTRONOEM_H
#define IPMI_KONTRONOEM_H
#include <inttypes.h>
#include <ipmitool/ipmi.h>
int ipmi_kontronoem_main(struct ipmi_intf *, int, char **);
#endif /* IPMI_KONTRONOEM_H */

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_LANP_H

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_MAIN_H

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_MC_H

View File

@ -26,10 +26,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_OEM_H

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF DELL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_PEF_H

View File

@ -1,75 +1,90 @@
/*
(C) Kontron
*/
#ifndef _IPMI_PICMG_H_
#define _IPMI_PICMG_H_
#include <ipmitool/ipmi.h>
/* PICMG commands */
#define PICMG_GET_PICMG_PROPERTIES_CMD 0x00
#define PICMG_GET_ADDRESS_INFO_CMD 0x01
#define PICMG_GET_SHELF_ADDRESS_INFO_CMD 0x02
#define PICMG_SET_SHELF_ADDRESS_INFO_CMD 0x03
#define PICMG_FRU_CONTROL_CMD 0x04
#define PICMG_GET_FRU_LED_PROPERTIES_CMD 0x05
#define PICMG_GET_LED_COLOR_CAPABILITIES_CMD 0x06
#define PICMG_SET_FRU_LED_STATE_CMD 0x07
#define PICMG_GET_FRU_LED_STATE_CMD 0x08
#define PICMG_SET_IPMB_CMD 0x09
#define PICMG_SET_FRU_POLICY_CMD 0x0A
#define PICMG_GET_FRU_POLICY_CMD 0x0B
#define PICMG_FRU_ACTIVATION_CMD 0x0C
#define PICMG_GET_DEVICE_LOCATOR_RECORD_CMD 0x0D
#define PICMG_SET_PORT_STATE_CMD 0x0E
#define PICMG_GET_PORT_STATE_CMD 0x0F
#define PICMG_COMPUTE_POWER_PROPERTIES_CMD 0x10
#define PICMG_SET_POWER_LEVEL_CMD 0x11
#define PICMG_GET_POWER_LEVEL_CMD 0x12
#define PICMG_RENEGOTIATE_POWER_CMD 0x13
#define PICMG_GET_FAN_SPEED_PROPERTIES_CMD 0x14
#define PICMG_SET_FAN_LEVEL_CMD 0x15
#define PICMG_GET_FAN_LEVEL_CMD 0x16
#define PICMG_BUSED_RESOURCE_CMD 0x17
/* Site Types */
#define PICMG_ATCA_BOARD 0x00
#define PICMG_POWER_ENTRY 0x01
#define PICMG_SHELF_FRU 0x02
#define PICMG_DEDICATED_SHMC 0x03
#define PICMG_FAN_TRAY 0x04
#define PICMG_FAN_FILTER_TRAY 0x05
#define PICMG_ALARM 0x06
#define PICMG_AMC 0x07
#define PICMG_PMC 0x08
#define PICMG_RTM 0x09
/*
(C) Kontron
*/
#ifndef _IPMI_PICMG_H_
#define _IPMI_PICMG_H_
#include <ipmitool/ipmi.h>
/* PICMG commands */
#define PICMG_GET_PICMG_PROPERTIES_CMD 0x00
#define PICMG_GET_ADDRESS_INFO_CMD 0x01
#define PICMG_GET_SHELF_ADDRESS_INFO_CMD 0x02
#define PICMG_SET_SHELF_ADDRESS_INFO_CMD 0x03
#define PICMG_FRU_CONTROL_CMD 0x04
#define PICMG_GET_FRU_LED_PROPERTIES_CMD 0x05
#define PICMG_GET_LED_COLOR_CAPABILITIES_CMD 0x06
#define PICMG_SET_FRU_LED_STATE_CMD 0x07
#define PICMG_GET_FRU_LED_STATE_CMD 0x08
#define PICMG_SET_IPMB_CMD 0x09
#define PICMG_SET_FRU_POLICY_CMD 0x0A
#define PICMG_GET_FRU_POLICY_CMD 0x0B
#define PICMG_FRU_ACTIVATION_CMD 0x0C
#define PICMG_GET_DEVICE_LOCATOR_RECORD_CMD 0x0D
#define PICMG_SET_PORT_STATE_CMD 0x0E
#define PICMG_GET_PORT_STATE_CMD 0x0F
#define PICMG_COMPUTE_POWER_PROPERTIES_CMD 0x10
#define PICMG_SET_POWER_LEVEL_CMD 0x11
#define PICMG_GET_POWER_LEVEL_CMD 0x12
#define PICMG_RENEGOTIATE_POWER_CMD 0x13
#define PICMG_GET_FAN_SPEED_PROPERTIES_CMD 0x14
#define PICMG_SET_FAN_LEVEL_CMD 0x15
#define PICMG_GET_FAN_LEVEL_CMD 0x16
#define PICMG_BUSED_RESOURCE_CMD 0x17
/* AMC.0 commands */
#define PICMG_AMC_SET_PORT_STATE_CMD 0x19
#define PICMG_AMC_GET_PORT_STATE_CMD 0x1A
/* Site Types */
#define PICMG_ATCA_BOARD 0x00
#define PICMG_POWER_ENTRY 0x01
#define PICMG_SHELF_FRU 0x02
#define PICMG_DEDICATED_SHMC 0x03
#define PICMG_FAN_TRAY 0x04
#define PICMG_FAN_FILTER_TRAY 0x05
#define PICMG_ALARM 0x06
#define PICMG_AMC 0x07
#define PICMG_PMC 0x08
#define PICMG_RTM 0x09
struct picmg_set_fru_activation_cmd {
unsigned char picmg_id; /* always 0*/
unsigned char fru_id; /* threshold setting mask */
unsigned char fru_id; /* threshold setting mask */
unsigned char fru_state; /* fru activation/deactivation */
} __attribute__ ((packed));
/* the LED color capabilities */
static unsigned char* led_color_str[] = {
"reserved",
static const char* led_color_str[] __attribute__((unused)) = {
"reserved",
"BLUE",
"RED",
"GREEN",
"AMBER",
"ORANGE",
"WHITE",
"AMBER",
"ORANGE",
"WHITE",
"reserved"
};
int ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv);
#endif
};
static const char* amc_link_type_str[] __attribute__((unused)) = {
" FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED",
" FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED1",
" FRU_PICMGEXT_AMC_LINK_TYPE_PCI_EXPRESS",
" FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING1",
" FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING2",
" FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET",
" FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO",
" FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE",
};
int ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv);
#endif

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_RAW_H
@ -40,7 +36,9 @@
#include <ipmitool/ipmi.h>
int ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv);
struct ipmi_rs * ipmi_master_write_read(struct ipmi_intf * intf, uint8_t addr, uint8_t * wdata, uint8_t wsize, uint8_t rsize);
struct ipmi_rs * ipmi_master_write_read(struct ipmi_intf * intf, uint8_t bus, uint8_t addr,
uint8_t * wdata, uint8_t wsize, uint8_t rsize);
int ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv);
int ipmi_rawspd_main(struct ipmi_intf * intf, int argc, char ** argv);
#endif /* IPMI_RAW_H */

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_SDR_H
@ -163,7 +159,7 @@ struct sdr_record_mask {
struct {
uint16_t assert_event; /* assertion event mask */
uint16_t deassert_event; /* de-assertion event mask */
uint16_t read; /* discrete reaading mask */
uint16_t read; /* discrete reading mask */
} discrete;
struct {
#if WORDS_BIGENDIAN
@ -236,44 +232,52 @@ struct sdr_record_mask {
uint16_t status_unr:1;
uint16_t reserved_2:1;
#endif
struct {
#if WORDS_BIGENDIAN /* settable threshold mask */
uint8_t reserved:2;
uint8_t unr:1;
uint8_t ucr:1;
uint8_t unc:1;
uint8_t lnr:1;
uint8_t lcr:1;
uint8_t lnc:1;
union {
struct {
#if WORDS_BIGENDIAN /* settable threshold mask */
uint16_t reserved:2;
uint16_t unr:1;
uint16_t ucr:1;
uint16_t unc:1;
uint16_t lnr:1;
uint16_t lcr:1;
uint16_t lnc:1;
/* padding lower 8 bits */
uint16_t readable:8;
#else
uint8_t lnc:1;
uint8_t lcr:1;
uint8_t lnr:1;
uint8_t unc:1;
uint8_t ucr:1;
uint8_t unr:1;
uint8_t reserved:2;
uint16_t readable:8;
uint16_t lnc:1;
uint16_t lcr:1;
uint16_t lnr:1;
uint16_t unc:1;
uint16_t ucr:1;
uint16_t unr:1;
uint16_t reserved:2;
#endif
} set;
struct {
#if WORDS_BIGENDIAN /* readable threshold mask */
uint8_t reserved:2;
uint8_t unr:1;
uint8_t ucr:1;
uint8_t unc:1;
uint8_t lnr:1;
uint8_t lcr:1;
uint8_t lnc:1;
} set;
struct {
#if WORDS_BIGENDIAN /* readable threshold mask */
/* padding upper 8 bits */
uint16_t settable:8;
uint16_t reserved:2;
uint16_t unr:1;
uint16_t ucr:1;
uint16_t unc:1;
uint16_t lnr:1;
uint16_t lcr:1;
uint16_t lnc:1;
#else
uint8_t lnc:1;
uint8_t lcr:1;
uint8_t lnr:1;
uint8_t unc:1;
uint8_t ucr:1;
uint8_t unr:1;
uint8_t reserved:2;
uint16_t lnc:1;
uint16_t lcr:1;
uint16_t lnr:1;
uint16_t unc:1;
uint16_t ucr:1;
uint16_t unr:1;
uint16_t reserved:2;
uint16_t settable:8;
#endif
} read;
} read;
};
} threshold;
} type;
} __attribute__ ((packed));
@ -726,7 +730,10 @@ struct ipmi_sdr_iterator {
struct sdr_record_list {
uint16_t id;
uint8_t version;
uint8_t type;
uint8_t length;
uint8_t *raw;
struct sdr_record_list *next;
union {
struct sdr_record_full_sensor *full;
@ -764,8 +771,9 @@ static const char *unit_desc[] __attribute__ ((unused)) = {
"overflow", "underrun", "collision", "packets", "messages",
"characters", "error", "correctable error", "uncorrectable error",};
/* sensor type codes (IPMI v1.5 table 36.3) */
#define SENSOR_TYPE_MAX 0x29
/* sensor type codes (IPMI v1.5 table 36.3)
/ Updated to v2.0 Table 42-3, Sensor Type Codes */
#define SENSOR_TYPE_MAX 0x2C
static const char *sensor_type_desc[] __attribute__ ((unused)) = {
"reserved",
"Temperature", "Voltage", "Current", "Fan",
@ -780,7 +788,8 @@ static const char *sensor_type_desc[] __attribute__ ((unused)) = {
"OS Boot", "OS Critical Stop", "Slot / Connector",
"System ACPI Power State", "Watchdog", "Platform Alert",
"Entity Presence", "Monitor ASIC", "LAN",
"Management Subsystem Health", "Battery"};
"Management Subsystem Health", "Battery","Session Audit",
"Version Change","FRU State" };
struct ipmi_sdr_iterator *ipmi_sdr_start(struct ipmi_intf *intf);
struct sdr_get_rs *ipmi_sdr_get_next_header(struct ipmi_intf *intf,
@ -796,15 +805,20 @@ int ipmi_sdr_print_listentry(struct ipmi_intf *intf,
char *ipmi_sdr_get_unit_string(uint8_t type, uint8_t base, uint8_t modifier);
const char *ipmi_sdr_get_status(struct sdr_record_full_sensor *sensor,
uint8_t stat);
double sdr_convert_sensor_tolerance(struct sdr_record_full_sensor *sensor,
uint8_t val);
double sdr_convert_sensor_reading(struct sdr_record_full_sensor *sensor,
uint8_t val);
double sdr_convert_sensor_hysterisis(struct sdr_record_full_sensor *sensor,
uint8_t val);
uint8_t sdr_convert_sensor_value_to_raw(struct sdr_record_full_sensor *sensor,
double val);
struct ipmi_rs *ipmi_sdr_get_sensor_reading(struct ipmi_intf *intf,
uint8_t sensor);
struct ipmi_rs *ipmi_sdr_get_sensor_reading_ipmb(struct ipmi_intf *intf,
uint8_t sensor,
uint8_t target);
uint8_t target,
uint8_t lun);
struct ipmi_rs *ipmi_sdr_get_sensor_thresholds(struct ipmi_intf *intf,
uint8_t sensor);
struct ipmi_rs *ipmi_sdr_get_sensor_hysteresis(struct ipmi_intf *intf,

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_SEL_H
@ -119,6 +115,67 @@ struct ipmi_event_sensor_types {
const char * desc;
};
/* The sel module uses the "iana" number to select the appropriate array at run time
This table if for iana number 15000 ( Kontron ), you can add you own OEM sensor types
using a similar constuct, look for switch(iana) in ipmi_sel.c
*/
static struct ipmi_event_sensor_types oem_kontron_event_types[] __attribute__((unused)) = {
/* event type details uses an oem event type */
{ 0xC0 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info", NULL },
{ 0xC0 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info", NULL },
{ 0xC1 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Push Button" },
{ 0xC1 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Bridge Reset" },
{ 0xC1 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Backplane" },
{ 0xC1 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hotswap Fault" },
{ 0xC1 , 0x04 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hotswap Healty" },
{ 0xC1 , 0x05 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Unknown" },
{ 0xC1 , 0x06 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "ITP" },
{ 0xC1 , 0x07 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hardware Watchdog" },
{ 0xC1 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Software Reset" },
/* Uses standard digital reading type */
{ 0xC2 , 0xFF , 0xff, IPMI_EVENT_CLASS_DIGITAL , "SDRR Init Agent", NULL },
/* based on PICMG IPMB-0 Link state sensor */
{ 0xC3 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "IPMB-L Link State", "IPMB L Disabled" },
{ 0xC3 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "IPMB-L Link State", "IPMB L Enabled" },
{ 0xC4 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Push Button" },
{ 0xC4 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Hardware Power Failure" },
{ 0xC4 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Unknown" },
{ 0xC4 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Hardware Watchdog" },
{ 0xC4 , 0x04 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Soft Reset" },
{ 0xC4 , 0x05 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Warm Reset" },
{ 0xC4 , 0x06 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Cold Reset" },
{ 0xC4 , 0x07 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "IPMI Command" },
{ 0xC4 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Setup Reset (Save CMOS)" },
{ 0xC4 , 0x09 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Power Up Reset" },
/* event type details uses a standard */
{ 0xC5 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Information Agent", NULL },
{ 0xC6 , 0x0E , 0xff, IPMI_EVENT_CLASS_DISCRETE , "POST Value", "Post Error (see data2)" },
{ 0xC7 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Upgrade" },
{ 0xC7 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Rollback(error)" },
{ 0xC7 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Errors (watchdog)" },
{ 0xC7 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Manual Rollback" },
{ 0xC7 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "Firmware Watchdog Bite, reset occured" },
{ 0xC8 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Not Loaded" },
{ 0xC8 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Initializing" },
{ 0xC8 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Ready" },
{ 0xC8 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Failure (see data2)" },
{ 0xC9 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Started" },
{ 0xC9 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Pass" },
{ 0xC9 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Fail" },
/* END */
{ 0x00, 0x00, 0xff, 0x00, NULL, NULL },
};
static struct ipmi_event_sensor_types generic_event_types[] __attribute__((unused)) = {
/* Threshold Based States */
{ 0x01, 0x00, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-critical going low " },
@ -520,23 +577,11 @@ static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unu
{ 0xF2, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Module Handle Opened" },
{ 0xF2, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Quiesced" },
{ 0xC0, 0x00, 0xff, 0x00, "OEM", NULL },
{ 0xC0, 0x00, 0xff, 0x00, "OEM", "OEM Specific" },
{ 0x00, 0x00, 0x00, 0x00, NULL, NULL },
};
/* These values are IANA numbers */
typedef enum IPMI_OEM {
IPMI_OEM_UNKNOWN = 0,
IPMI_OEM_SUN = 42,
IPMI_OEM_INTEL = 343,
IPMI_OEM_TYAN = 6653,
IPMI_OEM_NEWISYS = 9237,
IPMI_OEM_SUPERMICRO = 10876,
IPMI_OEM_KONTRON = 15000,
} IPMI_OEM;
int ipmi_sel_main(struct ipmi_intf *, int, char **);
void ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt);
void ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_record * evt);
@ -549,5 +594,6 @@ uint16_t ipmi_sel_get_std_entry(struct ipmi_intf * intf, uint16_t id, struct sel
char * get_newisys_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec);
IPMI_OEM ipmi_get_oem(struct ipmi_intf * intf);
char * ipmi_get_oem_desc(struct ipmi_intf * intf, struct sel_event_record * rec);
int ipmi_sel_oem_init(const char * filename);
#endif /* IPMI_SEL_H */

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_SENSOR_H

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_SESSION_H

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_SOL_H
@ -40,6 +36,7 @@
#include <ipmitool/ipmi.h>
#define SOL_ESCAPE_CHARACTER_DEFAULT '~'
#define SOL_KEEPALIVE_TIMEOUT 30
#define IPMI_SOL_SERIAL_ALERT_MASK_SUCCEED 0x08
#define IPMI_SOL_SERIAL_ALERT_MASK_DEFERRED 0x04

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_STRINGS_H
@ -57,5 +53,8 @@ extern const struct valstr ipmi_integrity_algorithms[];
extern const struct valstr ipmi_encryption_algorithms[];
extern const struct valstr ipmi_oem_info[];
extern const struct oemvalstr ipmi_oem_sdr_type_vals[];
#endif /*IPMI_STRINGS_H*/

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_SUNOEM_H

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_TSOL_H

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_USER_H

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMITOOL_LOG_H

View File

@ -27,10 +27,6 @@
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# You acknowledge that this software is not designed or intended for use
# in the design, construction, operation or maintenance of any nuclear
# facility.
INCLUDES = -I$(top_srcdir)/include
MAINTAINERCLEANFILES = Makefile.in
@ -41,7 +37,8 @@ libipmitool_la_SOURCES = helper.c ipmi_sdr.c ipmi_sel.c ipmi_sol.c ipmi_pef.c \
dimm_spd.c ipmi_sensor.c ipmi_channel.c ipmi_event.c \
ipmi_session.c ipmi_strings.c ipmi_user.c ipmi_raw.c \
ipmi_oem.c ipmi_isol.c ipmi_sunoem.c ipmi_fwum.c ipmi_picmg.c \
ipmi_main.c ipmi_tsol.c
ipmi_main.c ipmi_tsol.c ipmi_firewall.c ipmi_kontronoem.c \
ipmi_hpmfwupg.c
libipmitool_la_LDFLAGS = -export-dynamic
libipmitool_la_LIBADD = -lm

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <ipmitool/ipmi.h>
@ -673,13 +669,74 @@ const struct valstr jedec_id5_vals[] = {
};
int
ipmi_spd_print(struct ipmi_intf * intf, uint8_t id)
ipmi_spd_print(uint8_t *spd_data, int len)
{
int size;
if (len < 92)
return -1; /* we need first 91 bytes to do our thing */
size = spd_data[5] * (spd_data[31] << 2);
printf(" Memory Size : %d MB\n", size);
printf(" Memory Type : %s\n",
val2str(spd_data[2], spd_memtype_vals));
printf(" Voltage Intf : %s\n",
val2str(spd_data[8], spd_voltage_vals));
printf(" Error Detect/Cor : %s\n",
val2str(spd_data[11], spd_config_vals));
/* handle jedec table bank continuation values */
printf(" Manufacturer : ");
if (spd_data[64] != 0x7f)
printf("%s\n",
val2str(spd_data[64], jedec_id1_vals));
else {
if (spd_data[65] != 0x7f)
printf("%s\n",
val2str(spd_data[65], jedec_id2_vals));
else {
if (spd_data[66] != 0x7f)
printf("%s\n",
val2str(spd_data[66], jedec_id3_vals));
else {
if (spd_data[67] != 0x7f)
printf("%s\n",
val2str(spd_data[67],
jedec_id4_vals));
else
printf("%s\n",
val2str(spd_data[68],
jedec_id5_vals));
}
}
}
if (spd_data[73]) {
char part[19];
memcpy(part, spd_data+73, 18);
part[18] = 0;
printf(" Part Number : %s\n", part);
}
printf(" Serial Number : %02x%02x%02x%02x\n",
spd_data[95], spd_data[96], spd_data[97], spd_data[98]);
if (verbose) {
printf("\n");
printbuf(spd_data, len, "SPD DATA");
}
return 0;
}
int
ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
struct fru_info fru;
uint8_t spd_data[256], msg_data[4];
int len, offset, size;
int len, offset;
msg_data[0] = id;
@ -746,53 +803,8 @@ ipmi_spd_print(struct ipmi_intf * intf, uint8_t id)
offset += len;
} while (offset < fru.size);
if (verbose > 1)
printbuf(spd_data, offset, "SPD DATA");
if (offset < 92)
return -1; /* we need first 91 bytes to do our thing */
size = spd_data[5] * (spd_data[31] << 2);
printf(" Memory Size : %d MB\n", size);
printf(" Memory Type : %s\n",
val2str(spd_data[2], spd_memtype_vals));
printf(" Voltage Intf : %s\n",
val2str(spd_data[8], spd_voltage_vals));
printf(" Error Detect/Cor : %s\n",
val2str(spd_data[11], spd_config_vals));
/* handle jedec table bank continuation values */
printf(" Manufacturer : ");
if (spd_data[64] != 0x7f)
printf("%s\n",
val2str(spd_data[64], jedec_id1_vals));
else {
if (spd_data[65] != 0x7f)
printf("%s\n",
val2str(spd_data[65], jedec_id2_vals));
else {
if (spd_data[66] != 0x7f)
printf("%s\n",
val2str(spd_data[66], jedec_id3_vals));
else {
if (spd_data[67] != 0x7f)
printf("%s\n",
val2str(spd_data[67],
jedec_id4_vals));
else
printf("%s\n",
val2str(spd_data[68],
jedec_id5_vals));
}
}
}
if (spd_data[73]) {
char part[19];
memcpy(part, spd_data+73, 18);
part[18] = 0;
printf(" Part Number : %s\n", part);
}
/* now print spd info */
ipmi_spd_print(spd_data, offset);
return 0;
}

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <sys/types.h>
@ -53,9 +49,13 @@
#endif
#ifdef HAVE_PATHS_H
# include <paths.h> /* For _PATH_TTY */
# include <paths.h>
#else
# define _PATH_VARRUN "/var/run/"
#endif
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_intf.h>
#include <ipmitool/helper.h>
#include <ipmitool/log.h>
@ -99,18 +99,18 @@ void printbuf(const uint8_t * buf, int len, const char * desc)
if (verbose < 1)
return;
fprintf(stderr, "%s (%d bytes)\n", desc, len);
fprintf(stderr, "%s (%d bytes)\r\n", desc, len);
for (i=0; i<len; i++) {
if (((i%16) == 0) && (i != 0))
fprintf(stderr, "\n");
fprintf(stderr, "\r\n");
fprintf(stderr, " %2.2x", buf[i]);
}
fprintf(stderr, "\n");
fprintf(stderr, "\r\n");
}
const char * val2str(uint16_t val, const struct valstr *vs)
{
static char un_str[16];
static char un_str[32];
int i;
for (i = 0; vs[i].str != NULL; i++) {
@ -118,8 +118,37 @@ const char * val2str(uint16_t val, const struct valstr *vs)
return vs[i].str;
}
memset(un_str, 0, 16);
snprintf(un_str, 16, "Unknown (0x%02x)", val);
memset(un_str, 0, 32);
snprintf(un_str, 32, "Unknown (0x%x)", val);
return un_str;
}
const char * oemval2str(uint16_t oem, uint16_t val,
const struct oemvalstr *vs)
{
static char un_str[32];
int i;
for (i = 0; vs[i].oem != 0x00 && vs[i].str != NULL; i++) {
/* FIXME: for now on we assume PICMG capability on all IANAs */
if
(
(
vs[i].oem == oem
||
vs[i].oem == IPMI_OEM_PICMG
)
&&
vs[i].val == val
)
{
return vs[i].str;
}
}
memset(un_str, 0, 32);
snprintf(un_str, 32, "OEM reserved #%02x", val);
return un_str;
}
@ -152,7 +181,7 @@ print_valstr(const struct valstr * vs, const char * title, int loglevel)
if (title != NULL) {
if (loglevel < 0)
printf("\n%s:\n\n");
printf("\n%s:\n\n", title);
else
lprintf(loglevel, "\n%s:\n", title);
}
@ -201,7 +230,7 @@ print_valstr_2col(const struct valstr * vs, const char * title, int loglevel)
if (title != NULL) {
if (loglevel < 0)
printf("\n%s:\n\n");
printf("\n%s:\n\n", title);
else
lprintf(loglevel, "\n%s:\n", title);
}
@ -279,6 +308,18 @@ ipmi_open_file(const char * file, int rw)
}
}
#ifndef ENABLE_FILE_SECURITY
if (!rw) {
/* on read skip the extra checks */
fp = fopen(file, "r");
if (fp == NULL) {
lperror(LOG_ERR, "Unable to open file %s", file);
return NULL;
}
return fp;
}
#endif
/* it exists - only regular files, not links */
if (S_ISREG(st1.st_mode) == 0) {
lprintf(LOG_ERR, "File %s has invalid mode: %d",
@ -334,7 +375,7 @@ ipmi_open_file(const char * file, int rw)
}
void
ipmi_start_daemon(void)
ipmi_start_daemon(struct ipmi_intf *intf)
{
pid_t pid;
int fd;
@ -378,7 +419,7 @@ ipmi_start_daemon(void)
close(fd);
}
#else
if (setpgrp() == -1)
if (setpgid(0, 0) == -1)
exit(1);
pid = (pid_t) fork();
if (pid < 0 || pid > 0)
@ -388,11 +429,12 @@ ipmi_start_daemon(void)
chdir("/");
umask(0);
for (fd=0; fd<64; fd++)
close(fd);
for (fd=0; fd<64; fd++) {
if (fd != intf->fd)
close(fd);
}
open("/dev/null", O_RDWR);
dup(0);
dup(0);
}

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <stdlib.h>
@ -144,9 +140,9 @@ ipmi_get_channel_auth_cap(struct ipmi_intf * intf,
(auth_cap.kg_status) ? "non-zero" : "default (all zeroes)");
printf("Per message authentication : %sabled\n",
(auth_cap.per_message_auth) ? "en" : "dis");
(auth_cap.per_message_auth) ? "dis" : "en");
printf("User level authentication : %sabled\n",
(auth_cap.user_level_auth) ? "en" : "dis");
(auth_cap.user_level_auth) ? "dis" : "en");
printf("Non-null user names exist : %s\n",
(auth_cap.non_null_usernames) ? "yes" : "no");
@ -226,16 +222,16 @@ ipmi_get_channel_info(struct ipmi_intf * intf, uint8_t channel)
printf(" Session Support : ");
switch (channel_info.session_support) {
case 0x00:
case 0x0:
printf("session-less\n");
break;
case 0x40:
case 0x1:
printf("single-session\n");
break;
case 0x80:
case 0x2:
printf("multi-session\n");
break;
case 0xc0:
case 0x3:
default:
printf("session-based\n");
break;
@ -597,12 +593,10 @@ ipmi_get_channel_cipher_suites(struct ipmi_intf * intf,
if (rsp->data_len >= 1)
channel = rsp->data[0];
while ((rsp->data_len > 1) && (list_index < 0x3F))
while ((rsp->data_len > 1) && (rsp->data_len == 17) && (list_index < 0x3F))
{
//
//
// We got back cipher suite data -- store it.
//
//printf("copying data to offset %d\n", offset);
//printbuf(rsp->data + 1, rsp->data_len - 1, "this is the data");
memcpy(cipher_suite_data + offset, rsp->data + 1, rsp->data_len - 1);
@ -626,6 +620,16 @@ ipmi_get_channel_cipher_suites(struct ipmi_intf * intf,
}
}
/* Copy last chunk */
if(rsp->data_len > 1)
{
//
// We got back cipher suite data -- store it.
//printf("copying data to offset %d\n", offset);
//printbuf(rsp->data + 1, rsp->data_len - 1, "this is the data");
memcpy(cipher_suite_data + offset, rsp->data + 1, rsp->data_len - 1);
offset += rsp->data_len - 1;
}
//
// We can chomp on all our data now.
@ -846,7 +850,7 @@ ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv)
else
{
uint8_t ch = 0xe;
if (argc == 4)
if (argc == 3)
ch = (uint8_t)strtol(argv[2], NULL, 0);
retval = ipmi_get_channel_cipher_suites(intf,
argv[1], // ipmi | sol
@ -862,4 +866,3 @@ ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv)
return retval;
}

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <stdlib.h>
@ -176,7 +172,7 @@ ipmi_chassis_identify(struct ipmi_intf * intf, char * arg)
printf("default (15 seconds)\n");
} else {
if (identify_data.force_on != 0) {
printf("indefinate\n");
printf("indefinite\n");
} else {
if (identify_data.interval == 0)
printf("off\n");
@ -452,8 +448,10 @@ ipmi_chassis_set_bootparam(struct ipmi_intf * intf, uint8_t param, uint8_t * dat
return -1;
}
if (rsp->ccode > 0) {
lprintf(LOG_ERR, "Set Chassis Boot Parameter %d failed: %s",
param, val2str(rsp->ccode, completion_code_vals));
if (param != 0) {
lprintf(LOG_ERR, "Set Chassis Boot Parameter %d failed: %s",
param, val2str(rsp->ccode, completion_code_vals));
}
return -1;
}
@ -501,22 +499,49 @@ ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
printf("Boot parameter %d is %s\n", rsp->data[1] & 0x7f,
(rsp->data[1] & 0x80) ? "invalid/locked" : "valid/unlocked");
printf("Boot parameter data: %s\n", buf2str(rsp->data+2, rsp->data_len - 2));
return 0;
}
static int
ipmi_chassis_set_bootdev(struct ipmi_intf * intf, char * arg, int clearcmos)
ipmi_chassis_set_bootdev(struct ipmi_intf * intf, char * arg, uint8_t *iflags)
{
uint8_t flags[5];
int rc = 0;
int use_progress = 1;
if (use_progress) {
/* set set-in-progress flag */
memset(flags, 0, 5);
flags[0] = 0x01;
rc = ipmi_chassis_set_bootparam(intf,
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS, flags, 1);
if (rc < 0)
use_progress = 0;
}
memset(flags, 0, 5);
flags[0] = 0x01;
flags[1] = 0x01;
rc = ipmi_chassis_set_bootparam(intf, 4, flags, 2);
if (rc < 0)
return -1;
rc = ipmi_chassis_set_bootparam(intf, IPMI_CHASSIS_BOOTPARAM_INFO_ACK,
flags, 2);
if (rc < 0) {
if (use_progress) {
/* set-in-progress = set-complete */
memset(flags, 0, 5);
ipmi_chassis_set_bootparam(intf,
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
flags, 1);
}
return -1;
}
if (iflags == NULL)
memset(flags, 0, 5);
else
memcpy(flags, iflags, sizeof (flags));
memset(flags, 0, 5);
if (arg == NULL)
flags[1] = 0x00;
else if (strncmp(arg, "none", 4) == 0)
@ -544,17 +569,42 @@ ipmi_chassis_set_bootdev(struct ipmi_intf * intf, char * arg, int clearcmos)
flags[1] = 0x18;
else {
lprintf(LOG_ERR, "Invalid argument: %s", arg);
if (use_progress) {
/* set-in-progress = set-complete */
memset(flags, 0, 5);
ipmi_chassis_set_bootparam(intf,
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
flags, 1);
}
return -1;
}
if (clearcmos)
flags[1] |= 0x80;
/* set flag valid bit */
flags[0] = 0x80;
rc = ipmi_chassis_set_bootparam(intf, 5, flags, 5);
if (rc == 0)
flags[0] |= 0x80;
rc = ipmi_chassis_set_bootparam(intf, IPMI_CHASSIS_BOOTPARAM_BOOT_FLAGS,
flags, 5);
if (rc == 0) {
if (use_progress) {
/* set-in-progress = commit-write */
memset(flags, 0, 5);
flags[0] = 0x02;
ipmi_chassis_set_bootparam(intf,
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
flags, 1);
}
printf("Set Boot Device to %s\n", arg);
}
if (use_progress) {
/* set-in-progress = set-complete */
memset(flags, 0, 5);
ipmi_chassis_set_bootparam(intf,
IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS,
flags, 1);
}
return rc;
}
@ -651,7 +701,7 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
int rc = 0;
if ((argc == 0) || (strncmp(argv[0], "help", 4) == 0)) {
lprintf(LOG_NOTICE, "Chassis Commands: status, power, identify, policy, restart_cause, poh, bootdev, selftest");
lprintf(LOG_NOTICE, "Chassis Commands: status, power, identify, policy, restart_cause, poh, bootdev, bootparam, selftest");
}
else if (strncmp(argv[0], "status", 6) == 0) {
rc = ipmi_chassis_status(intf);
@ -752,7 +802,7 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_NOTICE, "bootparam set <option> [value ...]");
} else {
if (strncmp(argv[2], "bootflag", 8) == 0)
rc = ipmi_chassis_set_bootdev(intf, argv[3], 0);
rc = ipmi_chassis_set_bootdev(intf, argv[3], NULL);
else
lprintf(LOG_NOTICE, "bootparam set <option> [value ...]");
}
@ -764,6 +814,7 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
else if (strncmp(argv[0], "bootdev", 7) == 0) {
if ((argc < 2) || (strncmp(argv[1], "help", 4) == 0)) {
lprintf(LOG_NOTICE, "bootdev <device> [clear-cmos=yes|no]");
lprintf(LOG_NOTICE, "bootdev <device> [options=help,...]");
lprintf(LOG_NOTICE, " none : Do not change boot device order");
lprintf(LOG_NOTICE, " pxe : Force PXE boot");
lprintf(LOG_NOTICE, " disk : Force boot from default Hard-drive");
@ -771,17 +822,116 @@ ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_NOTICE, " diag : Force boot from Diagnostic Partition");
lprintf(LOG_NOTICE, " cdrom : Force boot from CD/DVD");
lprintf(LOG_NOTICE, " bios : Force boot into BIOS Setup");
lprintf(LOG_NOTICE, " floppy: Force boot from Floppy/primary removable media");
} else {
if (argc < 3)
rc = ipmi_chassis_set_bootdev(intf, argv[1], 0);
rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
else if (strncmp(argv[2], "clear-cmos=", 11) == 0) {
if (strncmp(argv[2]+11, "yes", 3) == 0)
rc = ipmi_chassis_set_bootdev(intf, argv[1], 1);
else
rc = ipmi_chassis_set_bootdev(intf, argv[1], 0);
if (strncmp(argv[2]+11, "yes", 3) == 0) {
uint8_t flags[5] = {0, (1<<7), 0, 0, 0};
rc = ipmi_chassis_set_bootdev(intf, argv[1], flags);
} else
rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
}
else if (strncmp(argv[2], "options=", 8) == 0) {
char *token;
char *saveptr = NULL;
int optionError = 0;
unsigned char flags[5];
static struct {
char *name;
int i;
unsigned char mask;
unsigned char value;
char *desc;
} options[] = {
/* data 1 */
{"valid", 0, (1<<7), (1<<7),
"Boot flags valid"},
{"persistent", 0, (1<<6), (1<<6),
"Changes are persistent for all future boots"},
{"efiboot", 0, (1<<5), (1<<5),
"Extensible Firmware Interface Boot (EFI)"},
/* data 2 */
{"clear-cmos", 1, (1<<7), (1<<7),
"CMOS clear"},
{"lockkbd", 1, (1<<6), (1<<6),
"Lock Keyboard"},
/* data2[5:2] is parsed elsewhere */
{"screenblank", 1, (1<<1), (1<<1),
"Screen Blank"},
{"lockoutreset", 1, (1<<0), (1<<0),
"Lock out Resetbuttons"},
/* data 3 */
{"lockout_power", 2, (1<<7), (1<<7),
"Lock out (power off/sleep request) via Power Button"},
{"verbose=default", 2, (3<<5), (0<<5),
"Request quiet BIOS display"},
{"verbose=no", 2, (3<<5), (1<<5),
"Request quiet BIOS display"},
{"verbose=yes", 2, (3<<5), (2<<5),
"Request verbose BIOS display"},
{"force_pet", 2, (1<<4), (1<<4),
"Force progress event traps"},
{"upw_bypass", 2, (1<<3), (1<<3),
"User password bypass"},
{"lockout_sleep", 2, (1<<2), (1<<2),
"Log Out Sleep Button"},
{"cons_redirect=default", 2, (3<<0), (0<<0),
"Console redirection occurs per BIOS configuration setting"},
{"cons_redirect=skip", 2, (3<<0), (1<<0),
"Suppress (skip) console redirection if enabled"},
{"cons_redirect=enable", 2, (3<<0), (2<<0),
"Suppress (skip) console redirection if enabled"},
/* data 4 */
/* data4[7:4] reserved */
/* data4[3] BIOS Shared Mode Override, not implemented here */
/* data4[2:0] BIOS Mux Control Override, not implemented here */
/* data5 reserved */
{NULL} /* End marker */
}, *op;
memset(&flags[0], 0, sizeof(flags));
token = strtok_r(argv[2] + 8, ",", &saveptr);
while (token != NULL) {
int i;
if (strcmp(token, "help") == 0) {
optionError = 1;
break;
}
for (op = options; op->name != NULL; ++op) {
if (strcmp(token, op->name) == 0) {
flags[op->i] &= op->mask;
flags[op->i] |= op->value;
break;
}
}
if (op->name == NULL) {
/* Option not found */
optionError = 1;
lprintf(LOG_ERR, "Invalid option: %s", token);
}
token = strtok_r(NULL, ",", &saveptr);
}
if (optionError) {
lprintf(LOG_NOTICE, "Legal options are:");
lprintf(LOG_NOTICE, "\thelp:\tprint this message");
for (op = options; op->name != NULL; ++op) {
lprintf(LOG_NOTICE, "\t%s:\t%s", op->name, op->desc);
}
return (-1);
}
rc = ipmi_chassis_set_bootdev(intf, argv[1], flags);
}
else
rc = ipmi_chassis_set_bootdev(intf, argv[1], 0);
rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
}
}
else {

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <stdlib.h>
@ -57,7 +53,7 @@
#include <ipmitool/ipmi_sdr.h>
static int
static void
ipmi_event_msg_print(struct ipmi_intf * intf, struct platform_event_msg * pmsg)
{
struct sel_event_record sel_event;
@ -75,7 +71,7 @@ ipmi_event_msg_print(struct ipmi_intf * intf, struct platform_event_msg * pmsg)
sel_event.sel_type.standard_type.event_data[0] = pmsg->event_data[0];
sel_event.sel_type.standard_type.event_data[1] = pmsg->event_data[1];
sel_event.sel_type.standard_type.event_data[2] = pmsg->event_data[2];
if (verbose)
ipmi_sel_print_extended_entry_verbose(intf, &sel_event);
else
@ -527,10 +523,10 @@ ipmi_event_fromfile(struct ipmi_intf * intf, char * file)
/* clip off trailing and leading whitespace */
ptr--;
while (isspace(*ptr) && ptr >= buf)
while (isspace((int)*ptr) && ptr >= buf)
*ptr-- = '\0';
ptr = buf;
while (isspace(*ptr))
while (isspace((int)*ptr))
ptr++;
if (strlen(ptr) == 0)
continue;

1136
ipmitool/lib/ipmi_firewall.c Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2398
ipmitool/lib/ipmi_hpmfwupg.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <stdlib.h>

View File

@ -0,0 +1,586 @@
/*
* Copyright (c) 2004 Kontron Canada, Inc. All Rights Reserved.
*
* Base on code from
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
/*
* Tue Mar 7 14:36:12 2006
* <stephane.filion@ca.kontron.com>
*
* This code implements an Kontron OEM proprietary commands.
*/
#include <string.h>
#include <ipmitool/helper.h>
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_intf.h>
#include <ipmitool/ipmi_fru.h>
extern int verbose;
extern int read_fru_area(struct ipmi_intf * intf, struct fru_info *fru,
uint8_t id, uint32_t offset, uint32_t length,
uint8_t *frubuf);
extern int write_fru_area(struct ipmi_intf * intf, struct fru_info *fru,
unsigned char id, unsigned int soffset,
unsigned int doffset, unsigned int length,
unsigned char *pFrubuf);
extern char * get_fru_area_str(uint8_t * data, uint32_t * offset);
static void ipmi_kontron_help(void);
static int ipmi_kontron_set_serial_number(struct ipmi_intf * intf);
static int ipmi_kontron_set_mfg_date (struct ipmi_intf * intf);
int
ipmi_kontronoem_main(struct ipmi_intf * intf, int argc, char ** argv)
{
int rc = 0;
if (argc == 0)
ipmi_kontron_help();
else if (strncmp(argv[0], "help", 4) == 0)
ipmi_kontron_help();
else if(!strncmp(argv[0], "setsn", 5))
{
if(argc >= 1)
{
if(ipmi_kontron_set_serial_number(intf) > 0)
{
printf("FRU serial number setted successfully\n");
}
else
{
printf("FRU serial number set failed\n");
}
}
else
{
printf("fru setsn\n");
}
}
else if(!strncmp(argv[0], "setmfgdate", 5))
{
if(argc >= 1)
{
if(ipmi_kontron_set_mfg_date(intf) > 0)
{
printf("FRU manufacturing date setted successfully\n");
}
else
{
printf("FRU manufacturing date set failed\n");
}
}
else
{
printf("fru setmfgdate\n");
}
}
else
{
printf("Invalid Kontron command: %s", argv[0]);
ipmi_kontron_help();
rc = -1;
}
return rc;
}
static void ipmi_kontron_help(void)
{
printf("Kontron Commands: setsn setmfgdate\n");
}
/* ipmi_fru_set_serial_number - Set the Serial Number in FRU
*
* @intf: ipmi interface
* @id: fru id
*
* returns -1 on error
* returns 1 if successful
*/
static int
ipmi_kontron_set_serial_number(struct ipmi_intf * intf)
{
struct ipmi_rs *rsp;
struct ipmi_rq req;
struct fru_info fru;
struct fru_header header;
uint8_t msg_data[4];
char *sn;
uint8_t sn_size, checksum;
uint8_t *fru_data;
char *fru_area;
uint32_t fru_data_offset, fru_data_offset_tmp, board_sec_len, prod_sec_len, i;
sn = NULL;
fru_data = NULL;
memset(msg_data, 0, 4);
msg_data[0] = 0xb4;
msg_data[1] = 0x90;
msg_data[2] = 0x91;
msg_data[3] = 0x8b;
memset(&req, 0, sizeof(req));
req.msg.netfn = 0x3E;
req.msg.cmd = 0x0C;
req.msg.data = msg_data;
req.msg.data_len = 4;
/* Set Lun, necessary for this oem command */
req.msg.lun = 0x03;
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL)
{
printf(" Device not present (No Response)\n");
return -11;
}
if (rsp->ccode > 0)
{
printf(" This option is not implemented for this board\n");
return -1;
}
sn_size = rsp->data_len;
sn = malloc(sn_size + 1);
if(sn == NULL)
{
printf("Out of memory!");
return -1;
}
memset(sn, 0, sn_size + 1);
memcpy(sn, rsp->data, sn_size);
if(verbose >= 1)
{
printf("Original serial number is : [%s]\n", sn);
}
memset(msg_data, 0, 4);
msg_data[0] = 0;
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_STORAGE;
req.msg.cmd = GET_FRU_INFO;
req.msg.data = msg_data;
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
printf(" Device not present (No Response)\n");
free(sn);
return -1;
}
if (rsp->ccode > 0) {
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
free(sn);
return(-1);
}
fru.size = (rsp->data[1] << 8) | rsp->data[0];
fru.access = rsp->data[2] & 0x1;
if (fru.size < 1) {
printf(" Invalid FRU size %d", fru.size);
free(sn);
return -1;
}
/*
* retrieve the FRU header
*/
msg_data[0] = 0;
msg_data[1] = 0;
msg_data[2] = 0;
msg_data[3] = 8;
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_STORAGE;
req.msg.cmd = GET_FRU_DATA;
req.msg.data = msg_data;
req.msg.data_len = 4;
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL)
{
printf(" Device not present (No Response)\n");
free(sn);
return(-1);
}
if (rsp->ccode > 0)
{
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
free(sn);
return(-1);
}
if (verbose > 1)
printbuf(rsp->data, rsp->data_len, "FRU DATA");
memcpy(&header, rsp->data + 1, 8);
if (header.version != 1)
{
printf(" Unknown FRU header version 0x%02x",
header.version);
free(sn);
return(-1);
}
/* Set the Board Section */
board_sec_len = (header.offset.product * 8) - (header.offset.board * 8);
fru_data = malloc( fru.size);
if(fru_data == NULL)
{
printf("Out of memory!");
free(sn);
return(-1);
}
memset(fru_data, 0, fru.size);
if(read_fru_area(intf ,&fru ,0 ,(header.offset.board * 8) ,board_sec_len , fru_data) < 0)
{
free(sn);
free(fru_data);
return(-1);
}
/*Position at Board Manufacturer*/
fru_data_offset = (header.offset.board * 8) + 6;
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
/*Position at Board Product Name*/
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
fru_data_offset_tmp = fru_data_offset;
/*Position at Serial Number*/
fru_area = get_fru_area_str(fru_data, &fru_data_offset_tmp);
fru_data_offset ++;
if(strlen(fru_area) != sn_size)
{
printf("The length of the serial number in the FRU Board Area is wrong.\n");
free(sn);
free(fru_data);
return(-1);
}
/* Copy the new serial number in the board section saved in memory*/
memcpy(fru_data + fru_data_offset, sn, sn_size);
checksum = 0;
/* Calculate Header Checksum */
for( i = (header.offset.board * 8); i < (((header.offset.board * 8)+board_sec_len) - 2) ; i ++ )
{
checksum += fru_data[i];
}
checksum = (~checksum) + 1;
fru_data[(header.offset.board * 8)+board_sec_len - 1] = checksum;
/* Write the new FRU Board section */
if(write_fru_area(intf, &fru, 0, (header.offset.board * 8), (header.offset.board * 8), board_sec_len, fru_data) < 0)
{
free(sn);
free(fru_data);
return(-1);
}
/* Set the Product Section */
prod_sec_len = (header.offset.multi * 8) - (header.offset.product * 8);
if(read_fru_area(intf ,&fru ,0 ,(header.offset.product * 8) ,prod_sec_len , fru_data) < 0)
{
free(sn);
free(fru_data);
return(-1);
}
/*Position at Product Manufacturer*/
fru_data_offset = (header.offset.product * 8) + 3;
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
/*Position at Product Name*/
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
/*Position at Product Part*/
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
/*Position at Product Version*/
fru_area = get_fru_area_str(fru_data, &fru_data_offset);
fru_data_offset_tmp = fru_data_offset;
/*Position at Serial Number*/
fru_area = get_fru_area_str(fru_data, &fru_data_offset_tmp);
fru_data_offset ++;
if(strlen(fru_area) != sn_size)
{
free(sn);
free(fru_data);
printf("The length of the serial number in the FRU Product Area is wrong.\n");
return(-1);
}
/* Copy the new serial number in the product section saved in memory*/
memcpy(fru_data + fru_data_offset, sn, sn_size);
checksum = 0;
/* Calculate Header Checksum */
for( i = (header.offset.product * 8); i < (((header.offset.product * 8)+prod_sec_len) - 2) ; i ++ )
{
checksum += fru_data[i];
}
checksum = (~checksum) + 1;
fru_data[(header.offset.product * 8)+prod_sec_len - 1] = checksum;
/* Write the new FRU Board section */
if(write_fru_area(intf, &fru, 0, (header.offset.product * 8), (header.offset.product * 8), prod_sec_len, fru_data) < 0)
{
free(sn);
free(fru_data);
return -1;
}
free(sn);
free(fru_data);
return(1);
}
/* ipmi_fru_set_mfg_date - Set the Manufacturing Date in FRU
*
* @intf: ipmi interface
* @id: fru id
*
* returns -1 on error
* returns 1 if successful
*/
static int
ipmi_kontron_set_mfg_date (struct ipmi_intf * intf)
{
struct ipmi_rs *rsp;
struct ipmi_rq req;
struct fru_info fru;
struct fru_header header;
uint8_t msg_data[4];
uint8_t mfg_date[3];
uint32_t board_sec_len, i;
uint8_t *fru_data, checksum;
memset(msg_data, 0, 4);
msg_data[0] = 0xb4;
msg_data[1] = 0x90;
msg_data[2] = 0x91;
msg_data[3] = 0x8b;
memset(&req, 0, sizeof(req));
req.msg.netfn = 0x3E;
req.msg.cmd = 0x0E;
req.msg.data = msg_data;
req.msg.data_len = 4;
/* Set Lun temporary, necessary for this oem command */
req.msg.lun = 0x03;
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL)
{
printf("Device not present (No Response)\n");
return(-1);
}
if (rsp->ccode > 0)
{
printf("This option is not implemented for this board\n");
return(-1);
}
if(rsp->data_len != 3)
{
printf("Invalid response for the Manufacturing date\n");
return(-1);
}
memset(mfg_date, 0, 3);
memcpy(mfg_date, rsp->data, 3);
memset(msg_data, 0, 4);
msg_data[0] = 0;
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_STORAGE;
req.msg.cmd = GET_FRU_INFO;
req.msg.data = msg_data;
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
printf(" Device not present (No Response)\n");
return(-1);
}
if (rsp->ccode > 0) {
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
return(-1);
}
fru.size = (rsp->data[1] << 8) | rsp->data[0];
fru.access = rsp->data[2] & 0x1;
if (fru.size < 1) {
printf(" Invalid FRU size %d", fru.size);
return(-1);
}
/*
* retrieve the FRU header
*/
msg_data[0] = 0;
msg_data[1] = 0;
msg_data[2] = 0;
msg_data[3] = 8;
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_STORAGE;
req.msg.cmd = GET_FRU_DATA;
req.msg.data = msg_data;
req.msg.data_len = 4;
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL)
{
printf(" Device not present (No Response)\n");
return(-1);
}
if (rsp->ccode > 0)
{
printf(" Device not present (%s)\n",
val2str(rsp->ccode, completion_code_vals));
return(-1);
}
if (verbose > 1)
printbuf(rsp->data, rsp->data_len, "FRU DATA");
memcpy(&header, rsp->data + 1, 8);
if (header.version != 1)
{
printf(" Unknown FRU header version 0x%02x",
header.version);
return(-1);
}
board_sec_len = (header.offset.product * 8) - (header.offset.board * 8);
fru_data = malloc( fru.size);
if(fru_data == NULL)
{
printf("Out of memory!");
return(-1);
}
memset(fru_data, 0, fru.size);
if(read_fru_area(intf ,&fru ,0 ,(header.offset.board * 8) ,board_sec_len , fru_data) < 0)
{
free(fru_data);
return(-1);
}
/* Copy the new manufacturing date in the board section saved in memory*/
memcpy(fru_data + (header.offset.board * 8) + 3, mfg_date, 3);
checksum = 0;
/* Calculate Header Checksum */
for( i = (header.offset.board * 8); i < (((header.offset.board * 8)+board_sec_len) - 2) ; i ++ )
{
checksum += fru_data[i];
}
checksum = (~checksum) + 1;
fru_data[(header.offset.board * 8)+board_sec_len - 1] = checksum;
/* Write the new FRU Board section */
if(write_fru_area(intf, &fru, 0, (header.offset.board * 8), (header.offset.board * 8), board_sec_len, fru_data) < 0)
{
free(fru_data);
return(-1);
}
free(fru_data);
return(1);
}

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <stdlib.h>
@ -276,7 +272,7 @@ __set_lan_param(struct ipmi_intf * intf, uint8_t chan,
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t msg_data[32];
if (param < 0)
return -1;
@ -398,9 +394,10 @@ ipmi_lanp_unlock(struct ipmi_intf * intf, uint8_t chan)
rc = __set_lan_param(intf, chan, IPMI_LANP_SET_IN_PROGRESS, &val, 1, 0);
if (rc < 0) {
lprintf(LOG_DEBUG, "LAN Parameter Commit not supported");
val = IPMI_LANP_WRITE_UNLOCK;
__set_lan_param(intf, chan, IPMI_LANP_SET_IN_PROGRESS, &val, 0, 0);
}
val = IPMI_LANP_WRITE_UNLOCK;
__set_lan_param(intf, chan, IPMI_LANP_SET_IN_PROGRESS, &val, 1, 0);
}
/* set_lan_param - Wrap LAN parameter write with set-in-progress lock
@ -452,7 +449,7 @@ lan_set_arp_interval(struct ipmi_intf * intf,
struct lan_param *lp;
uint8_t interval;
int rc = 0;
lp = get_lan_param(intf, chan, IPMI_LANP_GRAT_ARP);
if (lp == NULL)
return -1;
@ -460,7 +457,7 @@ lan_set_arp_interval(struct ipmi_intf * intf,
return -1;
if (ival != 0) {
interval = ((uint8_t)atoi(ival) * 2) - 1;
interval = ((uint8_t)atoi((const char *)ival) * 2) - 1;
rc = set_lan_param(intf, chan, IPMI_LANP_GRAT_ARP, &interval, 1);
} else {
interval = lp->data[0];
@ -524,7 +521,7 @@ lan_set_arp_respond(struct ipmi_intf * intf,
static char priv_level_to_char(unsigned char priv_level)
{
char ret = 'X';
switch (priv_level)
{
case IPMI_SESSION_PRIV_CALLBACK:
@ -737,12 +734,26 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
printf("%-24s: %02x:%02x:%02x:%02x:%02x:%02x\n", p->desc,
p->data[0], p->data[1], p->data[2], p->data[3], p->data[4], p->data[5]);
p = get_lan_param(intf, chan, IPMI_LANP_VLAN_ID);
if (p != NULL && p->data != NULL) {
int id = ((p->data[1] & 0x0f) << 8) + p->data[0];
if (p->data[1] & 0x80)
printf("%-24s: %d\n", p->desc, id);
else
printf("%-24s: Disabled\n", p->desc);
}
p = get_lan_param(intf, chan, IPMI_LANP_VLAN_PRIORITY);
if (p != NULL && p->data != NULL)
printf("%-24s: %d\n", p->desc, p->data[0] & 0x07);
/* Determine supported Cipher Suites -- Requires two calls */
p = get_lan_param(intf, chan, IPMI_LANP_RMCP_CIPHER_SUPPORT);
if (p == NULL)
return -1;
else if (p->data != NULL)
{
unsigned char cipher_suite_count = p->data[0];
p = get_lan_param(intf, chan, IPMI_LANP_RMCP_CIPHERS);
if (p == NULL)
return -1;
@ -751,9 +762,8 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
/* Now we're dangerous. There are only 15 fixed cipher
suite IDs, but the spec allows for 16 in the return data.*/
if ((p->data != NULL) && (p->data_len <= 16))
if ((p->data != NULL) && (p->data_len <= 17))
{
unsigned char cipher_suite_count = p->data[0];
unsigned int i;
for (i = 0; (i < 16) && (i < cipher_suite_count); ++i)
{
@ -769,7 +779,6 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
}
}
/* RMCP+ Messaging Cipher Suite Privilege Levels */
/* These are the privilege levels for the 15 fixed cipher suites */
p = get_lan_param(intf, chan, IPMI_LANP_RMCP_PRIV_LEVELS);
@ -793,7 +802,7 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan)
priv_level_to_char(p->data[7] & 0x0F),
priv_level_to_char(p->data[7] >> 4),
priv_level_to_char(p->data[8] & 0x0F));
/* Now print a legend */
printf("%-24s: %s\n", "", " X=Cipher Suite Unused");
printf("%-24s: %s\n", "", " c=CALLBACK");
@ -862,7 +871,7 @@ ipmi_lan_set_auth(struct ipmi_intf * intf, uint8_t chan, char * level, char * ty
data[2] = authtype;
else if (strncasecmp(p, "admin", 5) == 0)
data[3] = authtype;
else
else
lprintf(LOG_WARNING, "Invalid authentication level: %s", p);
p = strchr(p, ',');
if (p)
@ -888,7 +897,7 @@ ipmi_lan_set_password(struct ipmi_intf * intf,
data[1] = 0x02; /* set password */
if (password != NULL)
memcpy(data+2, password, __min(strlen(password), 16));
memcpy(data+2, password, __min(strlen((const char *)password), 16));
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_APP;
@ -910,7 +919,7 @@ ipmi_lan_set_password(struct ipmi_intf * intf,
/* adjust our session password
* or we will no longer be able to communicate with BMC
*/
ipmi_intf_session_set_password(intf, password);
ipmi_intf_session_set_password(intf, (char *)password);
printf("Password %s for user %d\n",
(password == NULL) ? "cleared" : "set", userid);
@ -995,37 +1004,90 @@ ipmi_set_channel_access(struct ipmi_intf * intf, uint8_t channel, uint8_t enable
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t rqdata[3];
uint8_t byteEnable;
memset(&req, 0, sizeof(req));
/* RETREIVE VALUE IN NVRAM */
req.msg.netfn = IPMI_NETFN_APP;
req.msg.cmd = 0x40;
req.msg.cmd = 0x41; /* Get Channel Access Command */
req.msg.data = rqdata;
req.msg.data_len = 2;
memset(rqdata, 0, 2);
rqdata[0] = channel & 0xf;
rqdata[1] = 0x40; /* retreive NV */
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
lprintf(LOG_ERR, "Unable to Get Channel Access for channel %d", channel);
return -1;
} else if (rsp->ccode > 0) {
lprintf(LOG_ERR, "Set Channel Access for channel %d failed: %s",
channel, val2str(rsp->ccode, completion_code_vals));
return -1;
} else {
byteEnable = *(rsp->data + 0);
}
/* SAVE TO NVRAM */
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_APP;
req.msg.cmd = 0x40; /* Set Channel Access Command */
req.msg.data = rqdata;
req.msg.data_len = 3;
/* SAVE TO NVRAM */
memset(rqdata, 0, 3);
rqdata[0] = channel & 0xf;
rqdata[1] = 0x40; /* set pef enabled, per-msg auth enabled */
rqdata[1] = 0x40 | (byteEnable & 0x38); /* use previously set values */
if (enable != 0)
rqdata[1] |= 0x2; /* set always available if enable is set */
rqdata[2] = 0x44; /* set channel privilege limit to ADMIN */
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
lprintf(LOG_ERR, "Unable to Set Channel Access for channel %d", channel);
return -1;
}
if (rsp->ccode > 0) {
} else if (rsp->ccode > 0) {
lprintf(LOG_ERR, "Set Channel Access for channel %d failed: %s",
channel, val2str(rsp->ccode, completion_code_vals));
return -1;
}
/* RETREIVE VALUE IN NVRAM */
req.msg.netfn = IPMI_NETFN_APP;
req.msg.cmd = 0x41; /* Get Channel Access Command */
req.msg.data = rqdata;
req.msg.data_len = 2;
memset(rqdata, 0, 2);
rqdata[0] = channel & 0xf;
rqdata[1] = 0x80; /* retreive NV */
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
lprintf(LOG_ERR, "Unable to Get Channel Access for channel %d", channel);
return -1;
} else if (rsp->ccode > 0) {
lprintf(LOG_ERR, "Set Channel Access for channel %d failed: %s",
channel, val2str(rsp->ccode, completion_code_vals));
return -1;
} else {
byteEnable = *(rsp->data + 0);
}
/* SAVE TO CURRENT */
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_APP;
req.msg.cmd = 0x40; /* Set Channel Access Command */
req.msg.data = rqdata;
req.msg.data_len = 3;
memset(rqdata, 0, 3);
rqdata[0] = channel & 0xf;
rqdata[1] = 0x80; /* set pef enabled, per-msg auth enabled */
rqdata[1] = 0x80 | (byteEnable & 0x38); /* use previously set values */
if (enable != 0)
rqdata[1] |= 0x2; /* set always available if enable is set */
rqdata[2] = 0x84; /* set channel privilege limit to ADMIN */
@ -1034,8 +1096,7 @@ ipmi_set_channel_access(struct ipmi_intf * intf, uint8_t channel, uint8_t enable
if (rsp == NULL) {
lprintf(LOG_ERR, "Unable to Set Channel Access for channel %d", channel);
return -1;
}
if (rsp->ccode > 0) {
} else if (rsp->ccode > 0) {
lprintf(LOG_ERR, "Set Channel Access for channel %d failed: %s",
channel, val2str(rsp->ccode, completion_code_vals));
return -1;
@ -1060,7 +1121,7 @@ ipmi_set_user_access(struct ipmi_intf * intf, uint8_t channel, uint8_t userid)
rqdata[1] = userid & 0x3f;
rqdata[2] = 0x4;
rqdata[3] = 0;
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_APP;
req.msg.cmd = 0x43;
@ -1113,7 +1174,7 @@ get_cmdline_cipher_suite_priv_data(char * arg, uint8_t * buf)
}
/*
* The first byte is reservered (0). The resst of the buffer is setup
* The first byte is reserved (0). The rest of the buffer is setup
* so that each nibble holds the maximum privilege level available for
* that cipher suite number. The number of nibbles (15) matches the number
* of fixed cipher suite IDs. This command documentation mentions 16 IDs
@ -1128,7 +1189,7 @@ get_cmdline_cipher_suite_priv_data(char * arg, uint8_t * buf)
for (i = 0; i < 15; ++i)
{
unsigned char priv_level;
unsigned char priv_level = IPMI_SESSION_PRIV_ADMIN;
switch (arg[i])
{
@ -1156,7 +1217,7 @@ get_cmdline_cipher_suite_priv_data(char * arg, uint8_t * buf)
ret = -1;
break;
}
if (ret != 0)
break;
else
@ -1173,7 +1234,7 @@ get_cmdline_cipher_suite_priv_data(char * arg, uint8_t * buf)
}
}
}
return ret;
}
@ -1209,9 +1270,11 @@ static void ipmi_lan_set_usage(void)
lprintf(LOG_NOTICE, " user Enable default user for this channel");
lprintf(LOG_NOTICE, " access <on|off> Enable or disable access to this channel");
lprintf(LOG_NOTICE, " alert <on|off> Enable or disable PEF alerting for this channel");
lprintf(LOG_NOTICE, " arp response <on|off> Enable or disable BMC ARP responding");
lprintf(LOG_NOTICE, " arp respond <on|off> Enable or disable BMC ARP responding");
lprintf(LOG_NOTICE, " arp generate <on|off> Enable or disable BMC gratuitous ARP generation");
lprintf(LOG_NOTICE, " arp interval <seconds> Set gratuitous ARP generation interval");
lprintf(LOG_NOTICE, " vlan id <off|<id>> Disable or enable VLAN and set ID (1-4094)");
lprintf(LOG_NOTICE, " vlan priority <priority> Set vlan priority (0-7)");
lprintf(LOG_NOTICE, " auth <level> <type,..> Set channel authentication types");
lprintf(LOG_NOTICE, " level = CALLBACK, USER, OPERATOR, ADMIN");
lprintf(LOG_NOTICE, " type = NONE, MD2, MD5, PASSWORD, OEM");
@ -1229,6 +1292,57 @@ static void ipmi_lan_set_usage(void)
lprintf(LOG_NOTICE, " O = OEM\n");
}
static void
ipmi_lan_set_vlan_usage(void)
{
lprintf(LOG_NOTICE,
"lan set <channel> vlan id <id>\n"
"lan set <channel> vlan id off\n"
"lan set <channel> vlan priority <priority>\n");
}
static int
ipmi_lan_set_vlan_id(struct ipmi_intf * intf, uint8_t chan, char *string)
{
uint8_t data[2];
int rc;
if (string == NULL) {
data[0] = 0;
data[1] = 0;
}
else {
int id = atoi(string);
if (id < 1 || id > 4094) {
lprintf(LOG_NOTICE, "vlan id must be between 1 and 4094.");
return -1;
}
else {
data[0] = (uint8_t)id;
data[1] = (uint8_t)(id >> 8) | 0x80;
}
}
rc = set_lan_param(intf, chan, IPMI_LANP_VLAN_ID, data, 2);
return rc;
}
static int
ipmi_lan_set_vlan_priority(struct ipmi_intf * intf, uint8_t chan, char *string)
{
uint8_t data;
int rc;
int priority = atoi(string);
if (priority < 0 || priority > 7) {
lprintf(LOG_NOTICE, "vlan priority must be between 0 and 7.");
return -1;
}
data = (uint8_t)priority;
rc = set_lan_param(intf, chan, IPMI_LANP_VLAN_PRIORITY, &data, 1);
return rc;
}
static int
ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
{
@ -1287,7 +1401,7 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
"example: lan set 7 arp gratuitous off\n");
}
else if (strncmp(argv[2], "interval", 8) == 0) {
rc = lan_set_arp_interval(intf, chan, argv[3]);
rc = lan_set_arp_interval(intf, chan, (uint8_t *)argv[3]);
}
else if (strncmp(argv[2], "generate", 8) == 0) {
if (argc < 4)
@ -1337,6 +1451,7 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
" static = static address (manually configured)\n"
" dhcp = address obtained by BMC running DHCP\n"
" bios = address loaded by BIOS or system software\n");
return 0;
}
else if (strncmp(argv[2], "none", 4) == 0)
data[0] = 0;
@ -1360,7 +1475,7 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
/* session password
* not strictly a lan setting, but its used for lan connections */
else if (strncmp(argv[1], "password", 8) == 0) {
rc = ipmi_lan_set_password(intf, 1, argv[2]);
rc = ipmi_lan_set_password(intf, 1, (uint8_t *)argv[2]);
}
/* snmp community string */
else if (strncmp(argv[1], "snmp", 4) == 0) {
@ -1437,6 +1552,25 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
rc = set_lan_param(intf, chan, IPMI_LANP_BAK_GATEWAY_MAC, data, 6);
}
}
else if (strncasecmp(argv[1], "vlan", 4) == 0) {
if (argc < 4 || strncmp(argv[2], "help", 4) == 0) {
ipmi_lan_set_vlan_usage();
}
else if (strncasecmp(argv[2], "id", 2) == 0) {
if (strncasecmp(argv[3], "off", 3) == 0) {
ipmi_lan_set_vlan_id(intf, chan, NULL);
}
else {
ipmi_lan_set_vlan_id(intf, chan, argv[3]);
}
}
else if (strncasecmp(argv[2], "priority", 8) == 0) {
ipmi_lan_set_vlan_priority(intf, chan, argv[3]);
}
else {
ipmi_lan_set_vlan_usage();
}
}
/* set PEF alerting on or off */
else if (strncasecmp(argv[1], "alert", 5) == 0) {
if (argc < 3) {
@ -1479,7 +1613,7 @@ ipmi_lan_set(struct ipmi_intf * intf, int argc, char ** argv)
else {
ipmi_lan_set_usage();
}
return rc;
}
@ -1562,6 +1696,7 @@ ipmi_lan_alert_print(struct ipmi_intf * intf, uint8_t channel, uint8_t alert)
paddr->data[10], paddr->data[11], paddr->data[12]);
printf("\n");
return 0;
}
static int
@ -1755,7 +1890,6 @@ ipmi_lan_alert(struct ipmi_intf * intf, int argc, char ** argv)
{
uint8_t alert;
uint8_t channel = 1;
struct lan_param * p;
if (argc < 1 ||
strncasecmp(argv[0], "help", 4) == 0) {
@ -1826,9 +1960,12 @@ ipmi_lan_alert(struct ipmi_intf * intf, int argc, char ** argv)
static int
ipmi_lan_stats_get(struct ipmi_intf * intf, uint8_t chan)
{
struct lan_param * p;
uint8_t medium;
int rc = 0;
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t msg_data[2];
uint16_t statsTemp;
if (chan < 1 || chan > IPMI_CHANNEL_NUMBER_MAX) {
lprintf(LOG_ERR, "Invalid Channel %d", chan);
@ -1844,76 +1981,65 @@ ipmi_lan_stats_get(struct ipmi_intf * intf, uint8_t chan)
return -1;
}
{
/* From here, we are ready to get the stats */
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t msg_data[2];
uint16_t statsTemp;
uint16_t * pStatsTemp;
/* From here, we are ready to get the stats */
msg_data[0] = chan;
msg_data[1] = 0; /* Don't clear */
msg_data[0] = chan;
msg_data[1] = 0; /* Don't clear */
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_TRANSPORT;
req.msg.cmd = IPMI_LAN_GET_STAT;
req.msg.data = msg_data;
req.msg.data_len = 2;
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_TRANSPORT;
req.msg.cmd = IPMI_LAN_GET_STAT;
req.msg.data = msg_data;
req.msg.data_len = 2;
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
lprintf(LOG_INFO, "Get LAN Stats command failed");
return 0;
}
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
lprintf(LOG_INFO, "Get LAN Stats command failed");
return 0;
}
if (rsp->ccode > 0) {
lprintf(LOG_INFO, "Get LAN Stats command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return 0;
}
if (verbose > 1)
{
uint8_t counter;
printf("--- Rx Stats ---\n");
for(counter=0;counter<18;counter+=2)
{
printf("%02X", *(rsp->data + counter));
printf(" %02X - ", *(rsp->data + counter+1));
}
printf("\n");
}
if (rsp->ccode > 0) {
lprintf(LOG_INFO, "Get LAN Stats command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return 0;
}
statsTemp = ((*(rsp->data + 0)) << 8) | (*(rsp->data + 1));
printf("IP Rx Packet : %d\n", statsTemp);
if (verbose > 1) {
uint8_t counter;
printf("--- Rx Stats ---\n");
for (counter=0; counter<18; counter+=2) {
printf("%02X", *(rsp->data + counter));
printf(" %02X - ", *(rsp->data + counter+1));
}
printf("\n");
}
statsTemp = ((*(rsp->data + 2)) << 8) | (*(rsp->data + 3));
printf("IP Rx Header Errors : %u\n", statsTemp);
statsTemp = ((*(rsp->data + 0)) << 8) | (*(rsp->data + 1));
printf("IP Rx Packet : %d\n", statsTemp);
statsTemp = ((*(rsp->data + 4)) << 8) | (*(rsp->data + 5));
printf("IP Rx Address Errors : %u\n", statsTemp);
statsTemp = ((*(rsp->data + 2)) << 8) | (*(rsp->data + 3));
printf("IP Rx Header Errors : %u\n", statsTemp);
statsTemp = ((*(rsp->data + 6)) << 8) | (*(rsp->data + 7));
printf("IP Rx Fragmented : %u\n", statsTemp);
statsTemp = ((*(rsp->data + 4)) << 8) | (*(rsp->data + 5));
printf("IP Rx Address Errors : %u\n", statsTemp);
statsTemp = ((*(rsp->data + 8)) << 8) | (*(rsp->data + 9));
printf("IP Tx Packet : %u\n", statsTemp);
statsTemp = ((*(rsp->data + 6)) << 8) | (*(rsp->data + 7));
printf("IP Rx Fragmented : %u\n", statsTemp);
statsTemp = ((*(rsp->data +10)) << 8) | (*(rsp->data +11));
printf("UDP Rx Packet : %u\n", statsTemp);
statsTemp = ((*(rsp->data + 8)) << 8) | (*(rsp->data + 9));
printf("IP Tx Packet : %u\n", statsTemp);
statsTemp = ((*(rsp->data + 12)) << 8) | (*(rsp->data + 13));
printf("RMCP Rx Valid : %u\n", statsTemp);
statsTemp = ((*(rsp->data +10)) << 8) | (*(rsp->data +11));
printf("UDP Rx Packet : %u\n", statsTemp);
statsTemp = ((*(rsp->data + 14)) << 8) | (*(rsp->data + 15));
printf("UDP Proxy Packet Received : %u\n", statsTemp);
statsTemp = ((*(rsp->data + 12)) << 8) | (*(rsp->data + 13));
printf("RMCP Rx Valid : %u\n", statsTemp);
statsTemp = ((*(rsp->data + 16)) << 8) | (*(rsp->data + 17));
printf("UDP Proxy Packet Dropped : %u\n", statsTemp);
statsTemp = ((*(rsp->data + 14)) << 8) | (*(rsp->data + 15));
printf("UDP Proxy Packet Received : %u\n", statsTemp);
}
statsTemp = ((*(rsp->data + 16)) << 8) | (*(rsp->data + 17));
printf("UDP Proxy Packet Dropped : %u\n", statsTemp);
return rc;
}
@ -1922,9 +2048,11 @@ ipmi_lan_stats_get(struct ipmi_intf * intf, uint8_t chan)
static int
ipmi_lan_stats_clear(struct ipmi_intf * intf, uint8_t chan)
{
struct lan_param * p;
uint8_t medium;
int rc = 0;
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t msg_data[2];
if (chan < 1 || chan > IPMI_CHANNEL_NUMBER_MAX) {
lprintf(LOG_ERR, "Invalid Channel %d", chan);
@ -1940,36 +2068,27 @@ ipmi_lan_stats_clear(struct ipmi_intf * intf, uint8_t chan)
return -1;
}
{
/* From here, we are ready to get the stats */
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t msg_data[2];
uint16_t statsTemp;
uint16_t * pStatsTemp;
/* From here, we are ready to get the stats */
msg_data[0] = chan;
msg_data[1] = 1; /* Clear */
msg_data[0] = chan;
msg_data[1] = 1; /* Clear */
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_TRANSPORT;
req.msg.cmd = IPMI_LAN_GET_STAT;
req.msg.data = msg_data;
req.msg.data_len = 2;
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_TRANSPORT;
req.msg.cmd = IPMI_LAN_GET_STAT;
req.msg.data = msg_data;
req.msg.data_len = 2;
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
lprintf(LOG_INFO, "Get LAN Stats command failed");
return 0;
}
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
lprintf(LOG_INFO, "Get LAN Stats command failed");
return 0;
}
if (rsp->ccode > 0) {
lprintf(LOG_INFO, "Get LAN Stats command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return 0;
}
}
if (rsp->ccode > 0) {
lprintf(LOG_INFO, "Get LAN Stats command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return 0;
}
return rc;
}
@ -1994,63 +2113,60 @@ int
ipmi_lanp_main(struct ipmi_intf * intf, int argc, char ** argv)
{
int rc = 0;
uint8_t chan = 0x0e;
uint8_t chan = find_lan_channel(intf, 1);
if (argc == 0 || (strncmp(argv[0], "help", 4) == 0)) {
print_lan_usage();
return -1;
return -1;
}
if (
(strncmp(argv[0], "printconf", 9) == 0)
||
(strncmp(argv[0], "print", 5) == 0)
)
{
if (strncmp(argv[0], "printconf", 9) == 0 ||
strncmp(argv[0], "print", 5) == 0)
{
if (argc > 1)
chan = (uint8_t)strtol(argv[1], NULL, 0);
if (chan < 1 || chan > IPMI_CHANNEL_NUMBER_MAX)
{
lprintf(LOG_ERR, "Invalid channel: %d", chan);
{
lprintf(LOG_ERR, "Invalid channel: %d", chan);
return -1;
}
}
else
rc = ipmi_lan_print(intf, chan);
}
else if (strncmp(argv[0], "set", 3) == 0)
{
rc = ipmi_lan_set(intf, argc-1, &(argv[1]));
rc = ipmi_lan_set(intf, argc-1, &(argv[1]));
}
else if (strncmp(argv[0], "alert", 5) == 0)
{
rc = ipmi_lan_alert(intf, argc-1, &(argv[1]));
}
else if (strncmp(argv[0], "stats", 5) == 0)
{
if(argc == 1)
{
print_lan_usage();
return -1;
}
else if (argc > 2)
chan = (uint8_t)strtol(argv[2], NULL, 0);
if (chan < 2 || chan > IPMI_CHANNEL_NUMBER_MAX)
{
lprintf(LOG_ERR, "Invalid channel: %d", chan);
return -1;
}
else if (strncmp(argv[1], "get", 3) == 0)
rc = ipmi_lan_stats_get(intf, chan);
else if (strncmp(argv[1], "clear", 5) == 0)
rc = ipmi_lan_stats_clear(intf, chan);
else
print_lan_usage();
rc = ipmi_lan_alert(intf, argc-1, &(argv[1]));
}
else
else if (strncmp(argv[0], "stats", 5) == 0)
{
lprintf(LOG_NOTICE, "Invalid LAN command: %s", argv[0]);
}
if(argc == 1)
{
print_lan_usage();
return -1;
}
else if (argc > 2)
chan = (uint8_t)strtol(argv[2], NULL, 0);
if (chan < 1 || chan > IPMI_CHANNEL_NUMBER_MAX)
{
lprintf(LOG_ERR, "Invalid channel: %d", chan);
return -1;
}
else if (strncmp(argv[1], "get", 3) == 0)
rc = ipmi_lan_stats_get(intf, chan);
else if (strncmp(argv[1], "clear", 5) == 0)
rc = ipmi_lan_stats_clear(intf, chan);
else
print_lan_usage();
}
else
{
lprintf(LOG_NOTICE, "Invalid LAN command: %s", argv[0]);
rc = -1;
}
return rc;
}

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <stdlib.h>
@ -60,6 +56,7 @@
#include <ipmitool/ipmi_lanp.h>
#include <ipmitool/ipmi_chassis.h>
#include <ipmitool/ipmi_mc.h>
#include <ipmitool/ipmi_firewall.h>
#include <ipmitool/ipmi_sensor.h>
#include <ipmitool/ipmi_channel.h>
#include <ipmitool/ipmi_session.h>
@ -74,9 +71,9 @@
#endif
#ifdef ENABLE_ALL_OPTIONS
# define OPTION_STRING "I:hVvcgsEao:H:P:f:U:p:C:L:A:t:m:S:l:b:e:k:"
# define OPTION_STRING "I:hVvcgsEao:H:d:P:f:U:p:C:L:A:t:m:S:l:b:e:k:O:"
#else
# define OPTION_STRING "I:hVvcH:f:U:p:S:"
# define OPTION_STRING "I:hVvcH:f:U:p:d:S:"
#endif
extern int verbose;
@ -219,6 +216,7 @@ ipmi_option_usage(const char * progname, struct ipmi_cmd * cmdlist, struct ipmi_
lprintf(LOG_NOTICE, " -V Show version information");
lprintf(LOG_NOTICE, " -v Verbose (can use multiple times)");
lprintf(LOG_NOTICE, " -c Display output in comma separated format");
lprintf(LOG_NOTICE, " -d N Specify a /dev/ipmiN device to use (default=0)");
lprintf(LOG_NOTICE, " -I intf Interface to use");
lprintf(LOG_NOTICE, " -H hostname Remote host name for LAN interface");
lprintf(LOG_NOTICE, " -p port Remote RMCP port [default=623]");
@ -231,6 +229,7 @@ ipmi_option_usage(const char * progname, struct ipmi_cmd * cmdlist, struct ipmi_
lprintf(LOG_NOTICE, " -C ciphersuite Cipher suite to be used by lanplus interface");
lprintf(LOG_NOTICE, " -k key Use Kg key for IPMIv2 authentication");
lprintf(LOG_NOTICE, " -L level Remote session privilege level [default=ADMINISTRATOR]");
lprintf(LOG_NOTICE, " Append a '+' to use name/privilege lookup in RAKP1");
lprintf(LOG_NOTICE, " -A authtype Force use of auth type NONE, PASSWORD, MD2, MD5 or OEM");
lprintf(LOG_NOTICE, " -P password Remote session password");
lprintf(LOG_NOTICE, " -E Read password from IPMI_PASSWORD environment variable");
@ -239,6 +238,7 @@ ipmi_option_usage(const char * progname, struct ipmi_cmd * cmdlist, struct ipmi_
lprintf(LOG_NOTICE, " -l lun Set destination lun for raw commands");
lprintf(LOG_NOTICE, " -t address Bridge request to remote target address");
lprintf(LOG_NOTICE, " -o oemtype Setup for OEM (use 'list' to see available OEM types)");
lprintf(LOG_NOTICE, " -O seloem Use file for OEM SEL event descriptions");
#endif
lprintf(LOG_NOTICE, "");
@ -271,6 +271,7 @@ ipmi_main(int argc, char ** argv,
uint8_t target_channel = 0;
uint8_t target_lun = 0;
uint8_t my_addr = 0;
uint8_t lookupbit = 0x10; /* use name-only lookup by default */
int authtype = -1;
char * tmp = NULL;
char * hostname = NULL;
@ -281,7 +282,9 @@ ipmi_main(int argc, char ** argv,
char * oemtype = NULL;
char * sdrcache = NULL;
char * kgkey = NULL;
char * seloem = NULL;
int port = 0;
int devnum = 0;
int cipher_suite_id = 3; /* See table 22-19 of the IPMIv2 spec */
int argflag, i, found;
int rc = -1;
@ -324,6 +327,9 @@ ipmi_main(int argc, char ** argv,
rc = 0;
goto out_free;
break;
case 'd':
devnum = atoi(optarg);
break;
case 'p':
port = atoi(optarg);
break;
@ -448,9 +454,15 @@ ipmi_main(int argc, char ** argv,
}
break;
case 'L':
i = strlen(optarg);
if ((i > 0) && (optarg[i-1] == '+')) {
lookupbit = 0;
optarg[i-1] = 0;
}
privlvl = str2val(optarg, ipmi_privlvl_vals);
if (privlvl == 0xFF)
if (privlvl == 0xFF) {
lprintf(LOG_WARN, "Invalid privilege level %s", optarg);
}
break;
case 'A':
authtype = str2val(optarg, ipmi_authtype_session_vals);
@ -470,6 +482,13 @@ ipmi_main(int argc, char ** argv,
case 'e':
sol_escape_char = optarg[0];
break;
case 'O':
seloem = strdup(optarg);
if (seloem == NULL) {
lprintf(LOG_ERR, "%s: malloc failure", progname);
goto out_free;
}
break;
#endif
default:
ipmi_option_usage(progname, cmdlist, intflist);
@ -558,6 +577,7 @@ ipmi_main(int argc, char ** argv,
ipmi_intf_session_set_privlvl(intf,
IPMI_SESSION_PRIV_ADMIN); /* default */
ipmi_intf_session_set_lookupbit(intf, lookupbit);
ipmi_intf_session_set_sol_escape_char(intf, sol_escape_char);
ipmi_intf_session_set_cipher_suite_id(intf, cipher_suite_id);
@ -567,6 +587,8 @@ ipmi_main(int argc, char ** argv,
/* setup destination channel if given */
intf->target_channel = target_channel ;
intf->devnum = devnum;
/* setup IPMB local and target address if given */
intf->my_addr = my_addr ? : IPMI_BMC_SLAVE_ADDR;
if (target_addr > 0) {
@ -583,6 +605,11 @@ ipmi_main(int argc, char ** argv,
ipmi_sdr_list_cache_fromfile(intf, sdrcache);
}
/* Parse SEL OEM file if given */
if (seloem != NULL) {
ipmi_sel_oem_init(seloem);
}
intf->cmdlist = cmdlist;
/* now we finally run the command */
@ -611,6 +638,8 @@ ipmi_main(int argc, char ** argv,
free(password);
if (oemtype != NULL)
free(oemtype);
if (seloem != NULL)
free(seloem);
return rc;
}

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <stdlib.h>
@ -416,7 +412,7 @@ ipmi_mc_get_guid(struct ipmi_intf * intf)
}
if (rsp->data_len == sizeof(struct ipmi_guid)) {
uint8_t tbuf[40];
char tbuf[40];
time_t s;
memset(tbuf, 0, 40);
memset(&guid, 0, sizeof(struct ipmi_guid));
@ -568,9 +564,13 @@ ipmi_mc_main(struct ipmi_intf * intf, int argc, char ** argv)
else if (strncmp(argv[0], "setenables", 10) == 0) {
rc = ipmi_mc_set_enables(intf, argc-1, &(argv[1]));
}
else if (!strncmp(argv[0], "selftest", 8)) {
else if (!strncmp(argv[0], "selftest", 8)) {
rc = ipmi_mc_get_selftest(intf);
}
else {
lprintf(LOG_ERR, "Invalid mc/bmc command: %s", argv[0]);
rc = -1;
}
return rc;
}

View File

@ -26,10 +26,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <string.h>
@ -39,8 +35,10 @@
#include <ipmitool/ipmi_constants.h>
#include <ipmitool/log.h>
#include <ipmitool/helper.h>
#include <ipmitool/ipmi_sel.h>
static int ipmi_oem_supermicro(struct ipmi_intf * intf);
static int ipmi_oem_ibm(struct ipmi_intf * intf);
static struct ipmi_oem_handle ipmi_oem_list[] = {
{
@ -60,7 +58,12 @@ static struct ipmi_oem_handle ipmi_oem_list[] = {
name: "icts",
desc: "IPMI 2.0 ICTS compliance support",
},
{ 0 },
{
name: "ibm",
desc: "IBM OEM support",
setup: ipmi_oem_ibm,
},
{ 0 }
};
/* Supermicro IPMIv2 BMCs use OEM authtype */
@ -71,6 +74,17 @@ ipmi_oem_supermicro(struct ipmi_intf * intf)
return 0;
}
static int
ipmi_oem_ibm(struct ipmi_intf * intf)
{
char * filename;
if ((filename = getenv("IPMI_OEM_IBM_DATAFILE")) == NULL) {
lprintf(LOG_ERR, "Unable to read IPMI_OEM_IBM_DATAFILE from environment");
return -1;
}
return ipmi_sel_oem_init((const char *)filename);
}
/* ipmi_oem_print - print list of OEM handles
*/
void
@ -96,7 +110,6 @@ int
ipmi_oem_setup(struct ipmi_intf * intf, char * oemtype)
{
struct ipmi_oem_handle * oem;
int i;
int rc = 0;
if (strncmp(oemtype, "help", 4) == 0 ||
@ -106,18 +119,13 @@ ipmi_oem_setup(struct ipmi_intf * intf, char * oemtype)
return -1;
}
for (oem=ipmi_oem_list, i=0; i < sizeof(ipmi_oem_list)/sizeof(struct ipmi_oem_handle); oem++, i++) {
if (oem->name == NULL)
continue;
for (oem=ipmi_oem_list; oem->name != NULL; oem++) {
if (strncmp(oemtype, oem->name, strlen(oem->name)) == 0)
break;
}
if (oem->name == NULL) {
/* nothing was found */
lprintf(LOG_ERR, "OEM support not found for \"%s\"", oemtype);
if (oem->name == NULL)
return -1;
}
/* save pointer for later use */
intf->oem = oem;
@ -150,4 +158,3 @@ ipmi_oem_active(struct ipmi_intf * intf, const char * oemtype)
return 0;
}

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF DELL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <string.h>
@ -311,7 +307,7 @@ ipmi_pef_print_lan_dest(struct ipmi_intf * intf, uint8_t ch, uint8_t dest)
"PET community");
else {
rsp->data[19] = '\0';
ipmi_pef_print_str("PET Community", &rsp->data[1]);
ipmi_pef_print_str("PET Community", (const char *)&rsp->data[1]);
}
}
ipmi_pef_print_dec("ACK timeout/retry (secs)", timeout);
@ -734,6 +730,7 @@ ipmi_pef_get_status(struct ipmi_intf * intf)
struct ipmi_rq req;
struct pef_cfgparm_selector psel;
char tbuf[40];
uint32_t timei;
time_t ts;
memset(&req, 0, sizeof(req));
@ -745,11 +742,12 @@ ipmi_pef_get_status(struct ipmi_intf * intf)
"Last S/W processed ID");
return;
}
memcpy(&timei, rsp->data, sizeof(timei));
#if WORDS_BIGENDIAN
ts = (time_t)(rsp->data[0]<<24 + rsp->data[1]<<16 + rsp->data[2]<<8 + rsp->data[3]);
#else
ts = (time_t)(*(long *)rsp->data);
timei = BSWAP_32(timei);
#endif
ts = (time_t)timei;
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&ts));
ipmi_pef_print_str("Last SEL addition", tbuf);
@ -847,6 +845,7 @@ int ipmi_pef_main(struct ipmi_intf * intf, int argc, char ** argv)
// PEF subcommand handling
*/
int help = 0;
int rc = 0;
if (!argc || !strncmp(argv[0], "info", 4))
ipmi_pef_get_info(intf);
@ -860,11 +859,14 @@ int ipmi_pef_main(struct ipmi_intf * intf, int argc, char ** argv)
ipmi_pef_list_entries(intf);
else {
help = 1;
rc = -1;
lprintf(LOG_ERR, "Invalid PEF command: '%s'\n", argv[0]);
}
if (help)
lprintf(LOG_NOTICE, "PEF commands: info status policy list");
else if (!verbose)
printf("\n");
return 0;
return rc;
}

File diff suppressed because it is too large Load Diff

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <string.h>
@ -43,9 +39,10 @@
#include <ipmitool/helper.h>
#include <ipmitool/ipmi_intf.h>
#include <ipmitool/ipmi_raw.h>
#include <ipmitool/ipmi_fru.h>
#include <ipmitool/ipmi_strings.h>
#define IPMI_I2C_MASTER_MAX_SIZE 0x40
#define IPMI_I2C_MASTER_MAX_SIZE 0x40 /* 64 bytes */
/* ipmi_master_write_read - Perform I2C write/read transactions
*
@ -53,6 +50,7 @@
* IPMI interface. It has a maximum transfer size of 32 bytes.
*
* @intf: ipmi interface
* @bus: channel number, i2c bus id and type
* @addr: i2c slave address
* @wdata: data to write
* @wsize: length of data to write (max 64 bytes)
@ -61,7 +59,8 @@
* Returns pointer to IPMI Response
*/
struct ipmi_rs *
ipmi_master_write_read(struct ipmi_intf * intf, uint8_t addr, uint8_t * wdata, uint8_t wsize, uint8_t rsize)
ipmi_master_write_read(struct ipmi_intf * intf, uint8_t bus, uint8_t addr,
uint8_t * wdata, uint8_t wsize, uint8_t rsize)
{
struct ipmi_rq req;
struct ipmi_rs * rsp;
@ -83,7 +82,7 @@ ipmi_master_write_read(struct ipmi_intf * intf, uint8_t addr, uint8_t * wdata, u
req.msg.data_len = 3;
memset(rqdata, 0, IPMI_I2C_MASTER_MAX_SIZE + 3);
rqdata[0] = 0x00; /* channel number, bus id, bus type */
rqdata[0] = bus; /* channel number, bus id, bus type */
rqdata[1] = addr; /* slave address */
rqdata[2] = rsize; /* number of bytes to read */
@ -128,9 +127,49 @@ ipmi_master_write_read(struct ipmi_intf * intf, uint8_t addr, uint8_t * wdata, u
return rsp;
}
#define RAW_SPD_SIZE 256
int
ipmi_rawspd_main(struct ipmi_intf * intf, int argc, char ** argv)
{
struct ipmi_rs *rsp;
uint8_t i2cbus = 0;
uint8_t i2caddr = 0;
uint8_t spd_data[RAW_SPD_SIZE];
int i;
memset(spd_data, 0, RAW_SPD_SIZE);
if (argc < 2 || strncmp(argv[0], "help", 4) == 0) {
lprintf(LOG_NOTICE, "usage: spd <i2cbus> <i2caddr>");
return 0;
}
i2cbus = (uint8_t)strtoul(argv[0], NULL, 0);
i2caddr = (uint8_t)strtoul(argv[1], NULL, 0);
i2cbus = ((i2cbus & 7) << 1) | 1;
for (i = 0; i < RAW_SPD_SIZE; i+= IPMI_I2C_MASTER_MAX_SIZE) {
rsp = ipmi_master_write_read(intf, i2cbus, i2caddr,
(uint8_t *)&i, 1, IPMI_I2C_MASTER_MAX_SIZE);
if (rsp == NULL) {
lprintf(LOG_ERR, "Unable to perform I2C Master Write-Read");
return -1;
}
memcpy(spd_data+i, rsp->data, IPMI_I2C_MASTER_MAX_SIZE);
}
ipmi_spd_print(spd_data, i);
return 0;
}
static void rawi2c_usage(void)
{
lprintf(LOG_NOTICE, "usage: i2c <i2caddr> <read bytes> [write data]");
lprintf(LOG_NOTICE, "usage: i2c [bus=public|# [chan=#]] <i2caddr> <read bytes> [write data]");
lprintf(LOG_NOTICE, " bus=public is default");
lprintf(LOG_NOTICE, " chan=0 is default, bus= must be specified to use chan=");
}
int
@ -141,20 +180,41 @@ ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv)
uint8_t i2caddr = 0;
uint8_t rsize = 0;
uint8_t wsize = 0;
int i;
unsigned int rbus = 0;
uint8_t bus = 0;
int i = 0;
if (argc < 2 || strncmp(argv[0], "help", 4) == 0) {
/* handle bus= argument */
if (argc > 2 && strncmp(argv[0], "bus=", 4) == 0) {
i = 1;
if (strncmp(argv[0], "bus=public", 10) == 0)
bus = 0;
else if (sscanf(argv[0], "bus=%u", &rbus) == 1)
bus = ((rbus & 7) << 1) | 1;
else
bus = 0;
/* handle channel= argument
* the bus= argument must be supplied first on command line */
if (argc > 3 && strncmp(argv[1], "chan=", 5) == 0) {
i = 2;
if (sscanf(argv[1], "chan=%u", &rbus) == 1)
bus |= rbus << 4;
}
}
if ((argc-i) < 2 || strncmp(argv[0], "help", 4) == 0) {
rawi2c_usage();
return 0;
}
else if (argc-2 > IPMI_I2C_MASTER_MAX_SIZE) {
else if (argc-i-2 > IPMI_I2C_MASTER_MAX_SIZE) {
lprintf(LOG_ERR, "Raw command input limit (%d bytes) exceeded",
IPMI_I2C_MASTER_MAX_SIZE);
return -1;
}
i2caddr = (uint8_t)strtoul(argv[0], NULL, 0);
rsize = (uint8_t)strtoul(argv[1], NULL, 0);
i2caddr = (uint8_t)strtoul(argv[i++], NULL, 0);
rsize = (uint8_t)strtoul(argv[i++], NULL, 0);
if (i2caddr == 0) {
lprintf(LOG_ERR, "Invalid I2C address 0");
@ -163,7 +223,7 @@ ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv)
}
memset(wdata, 0, IPMI_I2C_MASTER_MAX_SIZE);
for (i=2; i<argc; i++) {
for (; i < argc; i++) {
uint8_t val = (uint8_t)strtol(argv[i], NULL, 0);
wdata[i-2] = val;
wsize++;
@ -173,7 +233,7 @@ ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv)
i2caddr, rsize, wsize);
printbuf(wdata, wsize, "WRITE DATA");
rsp = ipmi_master_write_read(intf, i2caddr, wdata, wsize, rsize);
rsp = ipmi_master_write_read(intf, bus, i2caddr, wdata, wsize, rsize);
if (rsp == NULL) {
lprintf(LOG_ERR, "Unable to perform I2C Master Write-Read");
return -1;
@ -188,6 +248,9 @@ ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv)
if (verbose || wsize == 0)
printf("Read %d bytes from I2C device %02Xh\n", rsp->data_len, i2caddr);
if (rsp->data_len < rsize)
return -1;
/* print the raw response buffer */
for (i=0; i<rsp->data_len; i++) {
if (((i%16) == 0) && (i != 0))
@ -219,8 +282,6 @@ ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv)
struct ipmi_rq req;
uint8_t netfn, cmd, lun;
int i;
unsigned long ufn;
uint8_t data[256];
if (argc < 2 || strncmp(argv[0], "help", 4) == 0) {
@ -249,7 +310,7 @@ ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv)
memset(data, 0, sizeof(data));
memset(&req, 0, sizeof(req));
req.msg.netfn = netfn;
req.msg.lun = lun;
req.msg.lun = lun;
req.msg.cmd = cmd;
req.msg.data = data;
@ -294,4 +355,3 @@ ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv)
return 0;
}

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <string.h>
@ -60,6 +56,7 @@ extern int verbose;
static int use_built_in; /* Uses DeviceSDRs instead of SDRR */
static int sdr_max_read_len = GET_SDR_ENTIRE_RECORD;
static int sdr_extended = 0;
static long sdriana = 0;
static struct sdr_record_list *sdr_list_head = NULL;
static struct sdr_record_list *sdr_list_tail = NULL;
@ -96,7 +93,6 @@ ipmi_sdr_get_unit_string(uint8_t type, uint8_t base, uint8_t modifier)
return unitstr;
}
/* sdr_convert_sensor_reading - convert raw sensor reading
*
* @sensor: sensor record
@ -171,7 +167,161 @@ sdr_convert_sensor_reading(struct sdr_record_full_sensor *sensor, uint8_t val)
default:
break;
}
return result;
}
/* sdr_convert_sensor_hysterisis - convert raw sensor hysterisis
*
* Even though spec says histerisis should be computed using Mx+B
* formula, B is irrelevant when doing raw comparison
*
* threshold rearm point is computed using threshold +/- hysterisis
* with the full formula however B can't be applied in raw comparisons
*
* @sensor: sensor record
* @val: raw sensor reading
*
* returns floating-point sensor reading
*/
double
sdr_convert_sensor_hysterisis(struct sdr_record_full_sensor *sensor, uint8_t val)
{
int m, k1, k2;
double result;
m = __TO_M(sensor->mtol);
k1 = __TO_B_EXP(sensor->bacc);
k2 = __TO_R_EXP(sensor->bacc);
switch (sensor->unit.analog) {
case 0:
result = (double) (((m * val)) * pow(10, k2));
break;
case 1:
if (val & 0x80)
val++;
/* Deliberately fall through to case 2. */
case 2:
result = (double) (((m * (int8_t) val) ) * pow(10, k2));
break;
default:
/* Oops! This isn't an analog sensor. */
return 0.0;
}
switch (sensor->linearization & 0x7f) {
case SDR_SENSOR_L_LN:
result = log(result);
break;
case SDR_SENSOR_L_LOG10:
result = log10(result);
break;
case SDR_SENSOR_L_LOG2:
result = (double) (log(result) / log(2.0));
break;
case SDR_SENSOR_L_E:
result = exp(result);
break;
case SDR_SENSOR_L_EXP10:
result = pow(10.0, result);
break;
case SDR_SENSOR_L_EXP2:
result = pow(2.0, result);
break;
case SDR_SENSOR_L_1_X:
result = pow(result, -1.0); /*1/x w/o exception */
break;
case SDR_SENSOR_L_SQR:
result = pow(result, 2.0);
break;
case SDR_SENSOR_L_CUBE:
result = pow(result, 3.0);
break;
case SDR_SENSOR_L_SQRT:
result = sqrt(result);
break;
case SDR_SENSOR_L_CUBERT:
result = cbrt(result);
break;
case SDR_SENSOR_L_LINEAR:
default:
break;
}
return result;
}
/* sdr_convert_sensor_tolerance - convert raw sensor reading
*
* @sensor: sensor record
* @val: raw sensor reading
*
* returns floating-point sensor tolerance(interpreted)
*/
double
sdr_convert_sensor_tolerance(struct sdr_record_full_sensor *sensor, uint8_t val)
{
int m, k2;
double result;
m = __TO_M(sensor->mtol);
k2 = __TO_R_EXP(sensor->bacc);
switch (sensor->unit.analog) {
case 0:
/* as suggested in section 30.4.1 of IPMI 1.5 spec */
result = (double) ((((m * (double)val/2)) ) * pow(10, k2));
break;
case 1:
if (val & 0x80)
val++;
/* Deliberately fall through to case 2. */
case 2:
result = (double) (((m * ((double)((int8_t) val)/2))) * pow(10, k2));
break;
default:
/* Oops! This isn't an analog sensor. */
return 0.0;
}
switch (sensor->linearization & 0x7f) {
case SDR_SENSOR_L_LN:
result = log(result);
break;
case SDR_SENSOR_L_LOG10:
result = log10(result);
break;
case SDR_SENSOR_L_LOG2:
result = (double) (log(result) / log(2.0));
break;
case SDR_SENSOR_L_E:
result = exp(result);
break;
case SDR_SENSOR_L_EXP10:
result = pow(10.0, result);
break;
case SDR_SENSOR_L_EXP2:
result = pow(2.0, result);
break;
case SDR_SENSOR_L_1_X:
result = pow(result, -1.0); /*1/x w/o exception */
break;
case SDR_SENSOR_L_SQR:
result = pow(result, 2.0);
break;
case SDR_SENSOR_L_CUBE:
result = pow(result, 3.0);
break;
case SDR_SENSOR_L_SQRT:
result = sqrt(result);
break;
case SDR_SENSOR_L_CUBERT:
result = cbrt(result);
break;
case SDR_SENSOR_L_LINEAR:
default:
break;
}
return result;
}
@ -282,12 +432,13 @@ ipmi_sdr_get_sensor_reading(struct ipmi_intf *intf, uint8_t sensor)
* @intf: ipmi interface
* @sensor: sensor id
* @target: IPMB target address
* @lun: sensor lun
*
* returns ipmi response structure
*/
struct ipmi_rs *
ipmi_sdr_get_sensor_reading_ipmb(struct ipmi_intf *intf, uint8_t sensor,
uint8_t target)
uint8_t target, uint8_t lun)
{
struct ipmi_rq req;
struct ipmi_rs *rsp;
@ -368,7 +519,10 @@ ipmi_sdr_get_sensor_type_desc(const uint8_t type)
if (type < 0xc0)
snprintf(desc, 32, "reserved #%02x", type);
else
snprintf(desc, 32, "OEM reserved #%02x", type);
{
snprintf(desc, 32, oemval2str(sdriana,type,ipmi_oem_sdr_type_vals),
type);
}
return desc;
}
@ -475,7 +629,7 @@ ipmi_sdr_get_header(struct ipmi_intf *intf, struct ipmi_sdr_iterator *itr)
continue;
} else if (rsp->ccode == 0xc5) {
/* lost reservation */
lprintf(LOG_DEBUG, "SDR reserveration %04x cancelled. "
lprintf(LOG_DEBUG, "SDR reservation %04x cancelled. "
"Sleeping a bit and retrying...",
itr->reservation);
@ -497,6 +651,9 @@ ipmi_sdr_get_header(struct ipmi_intf *intf, struct ipmi_sdr_iterator *itr)
}
}
if (!rsp)
return NULL;
lprintf(LOG_DEBUG, "SDR record ID : 0x%04x", itr->next);
memcpy(&sdr_rs, rsp->data, sizeof (sdr_rs));
@ -926,7 +1083,6 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
int i = 0, validread = 1, do_unit = 1;
double val = 0.0, creading = 0.0;
struct ipmi_rs *rsp;
uint8_t min_reading, max_reading;
if (sensor == NULL)
return -1;
@ -948,7 +1104,7 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
desc, sensor->keys.sensor_num);
validread = 0;
}
if (rsp->ccode > 0) {
else if (rsp->ccode > 0) {
if (rsp->ccode == 0xcb) {
/* sensor not found */
validread = 0;
@ -966,14 +1122,6 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
} else if (IS_SCANNING_DISABLED(rsp->data[1])) {
/* Sensor Scanning Disabled */
validread = 0;
if (rsp->data[0] != 0) {
/* we might still get a valid reading */
val =
sdr_convert_sensor_reading(sensor,
rsp->data[0]);
if (val != 0.0)
validread = 1;
}
} else if (rsp->data[0] != 0) {
/* convert RAW reading into units */
val = sdr_convert_sensor_reading(sensor, rsp->data[0]);
@ -1074,7 +1222,7 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
i += snprintf(sval, sizeof (sval), "%.*f %s",
(val == (int) val) ? 0 : 2, val,
do_unit ? unitstr : "");
else if (IS_SCANNING_DISABLED(rsp->data[1]))
else if (rsp && IS_SCANNING_DISABLED(rsp->data[1]))
i += snprintf(sval, sizeof (sval), "disabled ");
else
i += snprintf(sval, sizeof (sval), "no reading ");
@ -1108,7 +1256,7 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
i += snprintf(sval, sizeof (sval), "%.*f %s",
(val == (int) val) ? 0 : 2, val,
do_unit ? unitstr : "");
else if (IS_SCANNING_DISABLED(rsp->data[1]))
else if (rsp && IS_SCANNING_DISABLED(rsp->data[1]))
i += snprintf(sval, sizeof (sval), "Disabled");
else
i += snprintf(sval, sizeof (sval), "No Reading");
@ -1134,7 +1282,7 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
printf(" Sensor Reading : ");
if (validread)
printf("%xh\n", (uint32_t) val);
else if (IS_SCANNING_DISABLED(rsp->data[1]))
else if (rsp && IS_SCANNING_DISABLED(rsp->data[1]))
printf("Disabled\n");
else
printf("Not Reading\n");
@ -1157,8 +1305,9 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
ipmi_sdr_print_discrete_state("States Asserted",
sensor->sensor.type,
sensor->event_type, rsp->data[2],
rsp->data[3]);
sensor->event_type,
rsp ? rsp->data[2] : 0,
rsp ? rsp->data[3] : 0);
ipmi_sdr_print_sensor_mask(&sensor->mask, sensor->sensor.type,
sensor->event_type, DISCRETE_SENSOR);
ipmi_sdr_print_sensor_event_status(intf,
@ -1183,11 +1332,11 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
printf(" Sensor Reading : ");
if (validread) {
uint16_t raw_tol = __TO_TOL(sensor->mtol);
double tol = sdr_convert_sensor_reading(sensor, raw_tol * 2);
double tol = sdr_convert_sensor_tolerance(sensor, raw_tol);
printf("%.*f (+/- %.*f) %s\n",
(val == (int) val) ? 0 : 3,
val, (tol == (int) tol) ? 0 : 3, tol, unitstr);
} else if (IS_SCANNING_DISABLED(rsp->data[1]))
} else if (rsp && IS_SCANNING_DISABLED(rsp->data[1]))
printf("Disabled\n");
else
printf("No Reading\n");
@ -1208,7 +1357,7 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
SENSOR_PRINT_THRESH("Lower non-critical", lower.non_critical, lnc);
creading =
sdr_convert_sensor_reading(sensor,
sdr_convert_sensor_hysterisis(sensor,
sensor->threshold.hysteresis.positive);
if (sensor->threshold.hysteresis.positive == 0x00
|| sensor->threshold.hysteresis.positive == 0xff || creading == 0)
@ -1217,7 +1366,7 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
printf(" Positive Hysteresis : %.3f\n", creading);
creading =
sdr_convert_sensor_reading(sensor,
sdr_convert_sensor_hysterisis(sensor,
sensor->threshold.hysteresis.negative);
if (sensor->threshold.hysteresis.negative == 0x00
|| sensor->threshold.hysteresis.negative == 0xff || creading == 0.0)
@ -1450,13 +1599,27 @@ ipmi_sdr_print_discrete_state(const char *desc,
}
if (evt->offset > 7) {
if ((1 << (evt->offset - 8)) & state2)
printf(" [%s]\n",
evt->desc);
if ((1 << (evt->offset - 8)) & state2) {
if (evt->desc) {
printf(" "
"[%s]\n",
evt->desc);
} else {
printf(" "
"[no description]\n");
}
}
} else {
if ((1 << evt->offset) & state1)
printf(" [%s]\n",
evt->desc);
if ((1 << evt->offset) & state1) {
if (evt->desc) {
printf(" "
"[%s]\n",
evt->desc);
} else {
printf(" "
"[no description]\n");
}
}
}
c++;
}
@ -1491,21 +1654,30 @@ ipmi_sdr_print_sensor_compact(struct ipmi_intf *intf,
desc, sensor->keys.sensor_num);
validread = 0;
}
if (rsp->ccode > 0 && rsp->ccode != 0xcd) {
/* completion code 0xcd is special case */
lprintf(LOG_DEBUG, "Error reading sensor %s (#%02x): %s",
desc, sensor->keys.sensor_num,
val2str(rsp->ccode, completion_code_vals));
validread = 0;
else if (rsp->ccode > 0) {
/* completion code 0xcd is special case */
if (rsp->ccode == 0xcd) {
/* sensor not found */
validread = 0;
} else {
lprintf(LOG_DEBUG, "Error reading sensor %s (#%02x): %s",
desc, sensor->keys.sensor_num,
val2str(rsp->ccode, completion_code_vals));
validread = 0;
}
} else {
if (IS_READING_UNAVAILABLE(rsp->data[1])) {
/* sensor reading unavailable */
validread = 0;
} else if (IS_SCANNING_DISABLED(rsp->data[1])) {
validread = 0;
/* check for sensor scanning disabled bit */
lprintf(LOG_DEBUG, "Sensor %s (#%02x) scanning disabled",
desc, sensor->keys.sensor_num);
}
}
/* check for sensor scanning disabled bit */
if (IS_SCANNING_DISABLED(rsp->data[1])) {
lprintf(LOG_DEBUG, "Sensor %s (#%02x) scanning disabled",
desc, sensor->keys.sensor_num);
validread = 0;
}
if (verbose) {
printf("Sensor ID : %s (0x%x)\n",
(sensor->id_code) ? desc : "", sensor->keys.sensor_num);
@ -2301,7 +2473,7 @@ ipmi_sdr_get_reservation(struct ipmi_intf *intf, uint16_t * reserve_id)
return -1;
*reserve_id = ((struct sdr_reserve_repo_rs *) &(rsp->data))->reserve_id;
lprintf(LOG_DEBUG, "SDR reserveration ID %04x", *reserve_id);
lprintf(LOG_DEBUG, "SDR reservation ID %04x", *reserve_id);
return 0;
}
@ -2343,6 +2515,8 @@ ipmi_sdr_start(struct ipmi_intf *intf)
}
devid = (struct ipm_devid_rsp *) rsp->data;
sdriana = (long)IPM_DEV_MANUFACTURER_ID(devid->manufacturer_id);
if (devid->device_revision & IPM_DEV_DEVICE_ID_SDR_MASK) {
if ((devid->adtl_device_support & 0x02) == 0) {
if ((devid->adtl_device_support & 0x01)) {
@ -2384,7 +2558,8 @@ ipmi_sdr_start(struct ipmi_intf *intf)
* IPMIv2.0 == 0x02
*/
if ((sdr_info.version != 0x51) &&
(sdr_info.version != 0x01) && (sdr_info.version != 0x02)) {
(sdr_info.version != 0x01) &&
(sdr_info.version != 0x02)) {
lprintf(LOG_WARN, "WARNING: Unknown SDR repository "
"version 0x%02x", sdr_info.version);
}
@ -2493,7 +2668,7 @@ ipmi_sdr_get_record(struct ipmi_intf * intf, struct sdr_get_rs * header,
continue;
case 0xc5:
/* lost reservation */
lprintf(LOG_DEBUG, "SDR reserveration cancelled. "
lprintf(LOG_DEBUG, "SDR reservation cancelled. "
"Sleeping a bit and retrying...");
sleep(rand() & 3);
@ -3195,39 +3370,39 @@ ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf, char *id)
for (e = sdr_list_head; e != NULL; e = e->next) {
switch (e->type) {
case SDR_RECORD_TYPE_FULL_SENSOR:
if (!strncmp(e->record.full->id_string, id,
__max(e->record.full->id_code & 0x1f,
idlen)))
if (!strncmp((const char *)e->record.full->id_string,
(const char *)id,
__max(e->record.full->id_code & 0x1f, idlen)))
return e;
break;
case SDR_RECORD_TYPE_COMPACT_SENSOR:
if (!strncmp(e->record.compact->id_string, id,
__max(e->record.compact->id_code & 0x1f,
idlen)))
if (!strncmp((const char *)e->record.compact->id_string,
(const char *)id,
__max(e->record.compact->id_code & 0x1f, idlen)))
return e;
break;
case SDR_RECORD_TYPE_EVENTONLY_SENSOR:
if (!strncmp(e->record.eventonly->id_string, id,
__max(e->record.eventonly->id_code & 0x1f,
idlen)))
if (!strncmp((const char *)e->record.eventonly->id_string,
(const char *)id,
__max(e->record.eventonly->id_code & 0x1f, idlen)))
return e;
break;
case SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR:
if (!strncmp(e->record.genloc->id_string, id,
__max(e->record.genloc->id_code & 0x1f,
idlen)))
if (!strncmp((const char *)e->record.genloc->id_string,
(const char *)id,
__max(e->record.genloc->id_code & 0x1f, idlen)))
return e;
break;
case SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR:
if (!strncmp(e->record.fruloc->id_string, id,
__max(e->record.fruloc->id_code & 0x1f,
idlen)))
if (!strncmp((const char *)e->record.fruloc->id_string,
(const char *)id,
__max(e->record.fruloc->id_code & 0x1f, idlen)))
return e;
break;
case SDR_RECORD_TYPE_MC_DEVICE_LOCATOR:
if (!strncmp(e->record.mcloc->id_string, id,
__max(e->record.mcloc->id_code & 0x1f,
idlen)))
if (!strncmp((const char *)e->record.mcloc->id_string,
(const char *)id,
__max(e->record.mcloc->id_code & 0x1f, idlen)))
return e;
break;
}
@ -3255,51 +3430,57 @@ ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf, char *id)
case SDR_RECORD_TYPE_FULL_SENSOR:
sdrr->record.full =
(struct sdr_record_full_sensor *) rec;
if (!strncmp
(sdrr->record.full->id_string, id,
__max(sdrr->record.full->id_code & 0x1f, idlen)))
if (!strncmp(
(const char *)sdrr->record.full->id_string,
(const char *)id,
__max(sdrr->record.full->id_code & 0x1f, idlen)))
found = 1;
break;
case SDR_RECORD_TYPE_COMPACT_SENSOR:
sdrr->record.compact =
(struct sdr_record_compact_sensor *) rec;
if (!strncmp
(sdrr->record.compact->id_string, id,
__max(sdrr->record.compact->id_code & 0x1f,
if (!strncmp(
(const char *)sdrr->record.compact->id_string,
(const char *)id,
__max(sdrr->record.compact->id_code & 0x1f,
idlen)))
found = 1;
break;
case SDR_RECORD_TYPE_EVENTONLY_SENSOR:
sdrr->record.eventonly =
(struct sdr_record_eventonly_sensor *) rec;
if (!strncmp
(sdrr->record.eventonly->id_string, id,
__max(sdrr->record.eventonly->id_code & 0x1f,
if (!strncmp(
(const char *)sdrr->record.eventonly->id_string,
(const char *)id,
__max(sdrr->record.eventonly->id_code & 0x1f,
idlen)))
found = 1;
break;
case SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR:
sdrr->record.genloc =
(struct sdr_record_generic_locator *) rec;
if (!strncmp
(sdrr->record.genloc->id_string, id,
__max(sdrr->record.genloc->id_code & 0x1f, idlen)))
if (!strncmp(
(const char *)sdrr->record.genloc->id_string,
(const char *)id,
__max(sdrr->record.genloc->id_code & 0x1f, idlen)))
found = 1;
break;
case SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR:
sdrr->record.fruloc =
(struct sdr_record_fru_locator *) rec;
if (!strncmp
(sdrr->record.fruloc->id_string, id,
__max(sdrr->record.fruloc->id_code & 0x1f, idlen)))
if (!strncmp(
(const char *)sdrr->record.fruloc->id_string,
(const char *)id,
__max(sdrr->record.fruloc->id_code & 0x1f, idlen)))
found = 1;
break;
case SDR_RECORD_TYPE_MC_DEVICE_LOCATOR:
sdrr->record.mcloc =
(struct sdr_record_mc_locator *) rec;
if (!strncmp
(sdrr->record.mcloc->id_string, id,
__max(sdrr->record.mcloc->id_code & 0x1f, idlen)))
if (!strncmp(
(const char *)sdrr->record.mcloc->id_string,
(const char *)id,
__max(sdrr->record.mcloc->id_code & 0x1f, idlen)))
found = 1;
break;
case SDR_RECORD_TYPE_ENTITY_ASSOC:
@ -3376,10 +3557,13 @@ ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile)
if (header.length == 0)
continue;
if (header.version != 0x51) {
if (header.version != 0x51 &&
header.version != 0x01 &&
header.version != 0x02) {
lprintf(LOG_WARN, "invalid sdr header version %02x",
header.version);
continue;
ret = -1;
break;
}
sdrr = malloc(sizeof (struct sdr_record_list));
@ -3729,42 +3913,62 @@ ipmi_sdr_dump_bin(struct ipmi_intf *intf, const char *ofile)
{
struct sdr_get_rs *header;
struct ipmi_sdr_iterator *itr;
struct sdr_record_list *sdrr;
FILE *fp;
int rc = 0;
fp = ipmi_open_file_write(ofile);
if (fp == NULL)
return -1;
/* open connection to SDR */
itr = ipmi_sdr_start(intf);
if (itr == NULL) {
lprintf(LOG_ERR, "Unable to open SDR for reading");
fclose(fp);
return -1;
}
printf("Dumping Sensor Data Repository to '%s'\n", ofile);
/* go through sdr records */
/* generate list of records */
while ((header = ipmi_sdr_get_next_header(intf, itr)) != NULL) {
int r;
uint8_t h[5];
uint8_t *rec;
sdrr = malloc(sizeof(struct sdr_record_list));
if (sdrr == NULL) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return -1;
}
memset(sdrr, 0, sizeof(struct sdr_record_list));
lprintf(LOG_INFO, "Record ID %04x (%d bytes)",
header->id, header->length);
rec = ipmi_sdr_get_record(intf, header, itr);
if (rec == NULL)
continue;
sdrr->id = header->id;
sdrr->version = header->version;
sdrr->type = header->type;
sdrr->length = header->length;
sdrr->raw = ipmi_sdr_get_record(intf, header, itr);
if (sdr_list_head == NULL)
sdr_list_head = sdrr;
else
sdr_list_tail->next = sdrr;
sdr_list_tail = sdrr;
}
ipmi_sdr_end(intf, itr);
/* now write to file */
fp = ipmi_open_file_write(ofile);
if (fp == NULL)
return -1;
for (sdrr = sdr_list_head; sdrr != NULL; sdrr = sdrr->next) {
int r;
uint8_t h[5];
/* build and write sdr header */
h[0] = header->id & 0xff;
h[1] = (header->id >> 8) & 0xff;
h[2] = header->version;
h[3] = header->type;
h[4] = header->length;
h[0] = sdrr->id & 0xff;
h[1] = (sdrr->id >> 8) & 0xff;
h[2] = sdrr->version;
h[3] = sdrr->type;
h[4] = sdrr->length;
r = fwrite(h, 1, 5, fp);
if (r != 5) {
@ -3775,18 +3979,16 @@ ipmi_sdr_dump_bin(struct ipmi_intf *intf, const char *ofile)
}
/* write sdr entry */
r = fwrite(rec, 1, header->length, fp);
if (r != header->length) {
r = fwrite(sdrr->raw, 1, sdrr->length, fp);
if (r != sdrr->length) {
lprintf(LOG_ERR, "Error writing %d record bytes "
"to output file %s", header->length, ofile);
"to output file %s", sdrr->length, ofile);
rc = -1;
break;
}
}
ipmi_sdr_end(intf, itr);
fclose(fp);
return rc;
}
@ -3995,6 +4197,9 @@ ipmi_sdr_main(struct ipmi_intf *intf, int argc, char **argv)
lprintf(LOG_ERR, " type [sensor type]");
lprintf(LOG_ERR,
" list Get a list of available sensor types");
lprintf(LOG_ERR,
" get Retrieve the state of a specified sensor");
lprintf(LOG_ERR, " info");
lprintf(LOG_ERR,
" Display information about the repository itself");

View File

@ -28,16 +28,13 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <string.h>
#include <math.h>
#define __USE_XOPEN /* glibc2 needs this for strptime */
#include <time.h>
#include <ctype.h>
#include <ipmitool/helper.h>
#include <ipmitool/log.h>
@ -50,8 +47,151 @@
#include <ipmitool/ipmi_sensor.h>
extern int verbose;
static int sel_extended = 0;
static int sel_oem_nrecs = 0;
struct ipmi_sel_oem_msg_rec {
int value[14];
char *string[14];
char *text;
} *sel_oem_msg;
#define SEL_BYTE(n) (n-3) /* So we can refer to byte positions in log entries (byte 3 is at index 0, etc) */
/*
* Reads values found in message translation file. XX is a wildcard, R means reserved.
* Returns -1 for XX, -2 for R, -3 for non-hex (string), or positive integer from a hex value.
*/
static int ipmi_sel_oem_readval(char *str)
{
int ret;
if (!strcmp(str, "XX")) {
return -1;
}
if (!strcmp(str, "R")) {
return -2;
}
if (sscanf(str, "0x%x", &ret) != 1) {
return -3;
}
return ret;
}
/*
* This is where the magic happens. SEL_BYTE is a bit ugly, but it allows
* reference to byte positions instead of array indexes which (hopefully)
* helps make the code easier to read.
*/
static int ipmi_sel_oem_match(uint8_t *evt, struct ipmi_sel_oem_msg_rec rec)
{
if (evt[2] == rec.value[SEL_BYTE(3)] &&
((rec.value[SEL_BYTE(4)] < 0) || (evt[3] == rec.value[SEL_BYTE(4)])) &&
((rec.value[SEL_BYTE(5)] < 0) || (evt[4] == rec.value[SEL_BYTE(5)])) &&
((rec.value[SEL_BYTE(6)] < 0) || (evt[5] == rec.value[SEL_BYTE(6)])) &&
((rec.value[SEL_BYTE(7)] < 0) || (evt[6] == rec.value[SEL_BYTE(7)])) &&
((rec.value[SEL_BYTE(11)] < 0) || (evt[10] == rec.value[SEL_BYTE(11)])) &&
((rec.value[SEL_BYTE(12)] < 0) || (evt[11] == rec.value[SEL_BYTE(12)]))) {
return 1;
} else {
return 0;
}
}
int ipmi_sel_oem_init(const char * filename)
{
FILE * fp;
int i, j, k, n, byte;
char buf[15][150];
if (filename == NULL) {
lprintf(LOG_ERR, "No SEL OEM filename provided");
return -1;
}
fp = ipmi_open_file_read(filename);
if (fp == NULL) {
lprintf(LOG_ERR, "Could not open %s file", filename);
return -1;
}
/* count number of records (lines) in input file */
sel_oem_nrecs = 0;
while (fscanf(fp, "%*[^\n]\n") == 0) {
sel_oem_nrecs++;
}
printf("nrecs=%d\n", sel_oem_nrecs);
rewind(fp);
sel_oem_msg = (struct ipmi_sel_oem_msg_rec *)calloc(sel_oem_nrecs,
sizeof(struct ipmi_sel_oem_msg_rec));
for (i=0; i < sel_oem_nrecs; i++) {
n=fscanf(fp, "\"%[^\"]\",\"%[^\"]\",\"%[^\"]\",\"%[^\"]\",\""
"%[^\"]\",\"%[^\"]\",\"%[^\"]\",\"%[^\"]\",\""
"%[^\"]\",\"%[^\"]\",\"%[^\"]\",\"%[^\"]\",\""
"%[^\"]\",\"%[^\"]\",\"%[^\"]\"\n",
buf[0], buf[1], buf[2], buf[3], buf[4], buf[5],
buf[6], buf[7], buf[8], buf[9], buf[10], buf[11],
buf[12], buf[13], buf[14]);
if (n != 15) {
lprintf (LOG_ERR, "Encountered problems reading line %d of %s",
i+1, filename);
fclose(fp);
fp = NULL;
sel_oem_nrecs = 0;
/* free all the memory allocated so far */
for (j=0; j<i ; j++) {
for (k=3; k<17; k++) {
if (sel_oem_msg[j].value[SEL_BYTE(k)] == -3) {
free(sel_oem_msg[j].string[SEL_BYTE(k)]);
}
}
}
free (sel_oem_msg);
return -1;
}
for (byte = 3; byte < 17; byte++) {
if ((sel_oem_msg[i].value[SEL_BYTE(byte)] =
ipmi_sel_oem_readval(buf[SEL_BYTE(byte)])) == -3) {
sel_oem_msg[i].string[SEL_BYTE(byte)] =
(char *)malloc(strlen(buf[SEL_BYTE(byte)]) + 1);
strcpy(sel_oem_msg[i].string[SEL_BYTE(byte)],
buf[SEL_BYTE(byte)]);
}
}
sel_oem_msg[i].text = (char *)malloc(strlen(buf[SEL_BYTE(17)]) + 1);
strcpy(sel_oem_msg[i].text, buf[SEL_BYTE(17)]);
}
fclose(fp);
fp = NULL;
return 0;
}
static void ipmi_sel_oem_message(struct sel_event_record * evt, int verbose)
{
/*
* Note: although we have a verbose argument, currently the output
* isn't affected by it.
*/
int i, j;
for (i=0; i < sel_oem_nrecs; i++) {
if (ipmi_sel_oem_match((uint8_t *)evt, sel_oem_msg[i])) {
printf (csv_output ? ",\"%s\"" : " | %s", sel_oem_msg[i].text);
for (j=4; j<17; j++) {
if (sel_oem_msg[i].value[SEL_BYTE(j)] == -3) {
printf (csv_output ? ",%s=0x%x" : " %s = 0x%x",
sel_oem_msg[i].string[SEL_BYTE(j)],
((uint8_t *)evt)[SEL_BYTE(j)]);
}
}
}
}
}
static const struct valstr event_dir_vals[] = {
{ 0, "Assertion Event" },
@ -78,7 +218,7 @@ ipmi_get_event_type(uint8_t code)
static char *
ipmi_sel_timestamp(uint32_t stamp)
{
static uint8_t tbuf[40];
static char tbuf[40];
time_t s = (time_t)stamp;
memset(tbuf, 0, 40);
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&s));
@ -88,7 +228,7 @@ ipmi_sel_timestamp(uint32_t stamp)
static char *
ipmi_sel_timestamp_date(uint32_t stamp)
{
static uint8_t tbuf[11];
static char tbuf[11];
time_t s = (time_t)stamp;
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y", localtime(&s));
return tbuf;
@ -97,7 +237,7 @@ ipmi_sel_timestamp_date(uint32_t stamp)
static char *
ipmi_sel_timestamp_time(uint32_t stamp)
{
static uint8_t tbuf[9];
static char tbuf[9];
time_t s = (time_t)stamp;
strftime(tbuf, sizeof(tbuf), "%H:%M:%S", localtime(&s));
return tbuf;
@ -107,7 +247,7 @@ static char *
hex2ascii (uint8_t * hexChars, uint8_t numBytes)
{
int count;
static uint8_t hexString[SEL_OEM_NOTS_DATA_LEN+1]; /*Max Size*/
static char hexString[SEL_OEM_NOTS_DATA_LEN+1]; /*Max Size*/
if(numBytes > SEL_OEM_NOTS_DATA_LEN)
numBytes = SEL_OEM_NOTS_DATA_LEN;
@ -130,8 +270,6 @@ ipmi_get_oem(struct ipmi_intf * intf)
struct ipmi_rs * rsp;
struct ipmi_rq req;
struct ipm_devid_rsp *devid;
uint32_t manufacturer_id;
int i;
if (intf->fd == 0)
return IPMI_OEM_UNKNOWN;
@ -216,10 +354,10 @@ ipmi_sel_add_entries_fromfile(struct ipmi_intf * intf, const char * filename)
/* clip off trailing and leading whitespace */
ptr--;
while (isspace(*ptr) && ptr >= buf)
while (isspace((int)*ptr) && ptr >= buf)
*ptr-- = '\0';
ptr = buf;
while (isspace(*ptr))
while (isspace((int)*ptr))
ptr++;
if (strlen(ptr) == 0)
continue;
@ -263,7 +401,36 @@ ipmi_sel_add_entries_fromfile(struct ipmi_intf * intf, const char * filename)
return rc;
}
static struct ipmi_event_sensor_types oem_kontron_event_reading_types[] __attribute__((unused)) = {
{ 0x70 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info 1", "Reserved" },
{ 0x71 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info 2", "Reserved" },
};
char *
get_kontron_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
{
char * description = NULL;
/*
* Kontron OEM events are described in the product's user manual, but are limited in favor of
* sensor specific
*/
/* Only standard records are defined so far */
if( rec->record_type < 0xC0 ){
struct ipmi_event_sensor_types *st=NULL;
for ( st=oem_kontron_event_reading_types ; st->type != NULL; st++){
if (st->code == rec->sel_type.standard_type.event_type ){
size_t len =strlen(st->desc);
description = (char*)malloc( len + 1 );
memcpy(description, st->desc , len);
description[len] = 0;;
return description;
}
}
}
return "Unsupported event";
}
char *
get_newisys_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
@ -328,7 +495,6 @@ get_newisys_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
return description;
}
char *
ipmi_get_oem_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
{
@ -339,6 +505,16 @@ ipmi_get_oem_desc(struct ipmi_intf * intf, struct sel_event_record * rec)
case IPMI_OEM_NEWISYS:
desc = get_newisys_evt_desc(intf, rec);
break;
case IPMI_OEM_SUN:
case IPMI_OEM_INTEL:
case IPMI_OEM_TYAN:
case IPMI_OEM_SUPERMICRO:
case IPMI_OEM_KONTRON:
desc = get_kontron_evt_desc(intf, rec);
break;
case IPMI_OEM_UNKNOWN:
default:
break;
}
return desc;
@ -349,7 +525,7 @@ void
ipmi_get_event_desc(struct ipmi_intf * intf, struct sel_event_record * rec, char ** desc)
{
uint8_t code, offset;
struct ipmi_event_sensor_types *evt;
struct ipmi_event_sensor_types *evt = NULL;
if (desc == NULL)
return;
@ -359,8 +535,29 @@ ipmi_get_event_desc(struct ipmi_intf * intf, struct sel_event_record * rec, char
*desc = ipmi_get_oem_desc(intf, rec);
return;
} else if (rec->sel_type.standard_type.event_type == 0x6f) {
evt = sensor_specific_types;
code = rec->sel_type.standard_type.sensor_type;
if( rec->sel_type.standard_type.sensor_type >= 0xC0 && rec->sel_type.standard_type.sensor_type < 0xF0) {
IPMI_OEM iana = ipmi_get_oem(intf);
switch(iana){
case IPMI_OEM_KONTRON:
lprintf(LOG_DEBUG, "oem sensor type %x %d using oem type supplied description",
rec->sel_type.standard_type.sensor_type , iana);
evt = oem_kontron_event_types;
code = rec->sel_type.standard_type.sensor_type;
break;
/* add your oem sensor assignation here */
}
if( evt == NULL ){
lprintf(LOG_DEBUG, "oem sensor type %x using standard type supplied description",
rec->sel_type.standard_type.sensor_type );
}
}
if( evt == NULL ){
evt = sensor_specific_types;
code = rec->sel_type.standard_type.sensor_type;
}
} else {
evt = generic_event_types;
code = rec->sel_type.standard_type.event_type;
@ -382,11 +579,54 @@ ipmi_get_event_desc(struct ipmi_intf * intf, struct sel_event_record * rec, char
memset(*desc, 0, strlen(evt->desc)+48);
sprintf(*desc, "%s", evt->desc);
return;
}
}
evt++;
}
}
const char *
ipmi_sel_get_oem_sensor_type(IPMI_OEM iana, uint8_t code)
{
struct ipmi_event_sensor_types *st = NULL;
switch(iana){
case IPMI_OEM_KONTRON:
st = oem_kontron_event_types;
break;
/* add you oem sensor type lookup assignement here */
}
if( st != NULL )
for (; st->type != NULL; st++)
if (st->code == code)
return st->type;
return ipmi_sel_get_sensor_type(code);
}
const char *
ipmi_sel_get_oem_sensor_type_offset(IPMI_OEM iana, uint8_t code, uint8_t offset)
{
struct ipmi_event_sensor_types *st = NULL;
switch(iana){
case IPMI_OEM_KONTRON:
st = oem_kontron_event_types;
break;
/* add you oem sensor type lookup assignement here */
}
if( st != NULL )
for (; st->type != NULL; st++)
{
if (st->code == code && st->offset == (offset&0xf))
return st->type;
}
return ipmi_sel_get_oem_sensor_type(iana,code);
}
const char *
ipmi_sel_get_sensor_type(uint8_t code)
{
@ -404,6 +644,7 @@ ipmi_sel_get_sensor_type_offset(uint8_t code, uint8_t offset)
for (st = sensor_specific_types; st->type != NULL; st++)
if (st->code == code && st->offset == (offset&0xf))
return st->type;
return ipmi_sel_get_sensor_type(code);
}
@ -640,7 +881,13 @@ ipmi_sel_print_event_file(struct ipmi_intf * intf, struct sel_event_record * evt
evt->sel_type.standard_type.event_data[0],
evt->sel_type.standard_type.event_data[1],
evt->sel_type.standard_type.event_data[2],
ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0]),
(
(evt->sel_type.standard_type.sensor_type >=0xC0 && evt->sel_type.standard_type.sensor_type < 0xF0)
?
ipmi_sel_get_oem_sensor_type_offset(ipmi_get_oem(intf),evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
:
ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
),
evt->sel_type.standard_type.sensor_num,
(description != NULL) ? description : "Unknown");
@ -744,13 +991,22 @@ ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt)
for(data_count=0;data_count < SEL_OEM_NOTS_DATA_LEN;data_count++)
printf("%02x", evt->sel_type.oem_nots_type.oem_defined[data_count]);
}
ipmi_sel_oem_message(evt, 0);
printf ("\n");
return;
}
/* lookup SDR entry based on sensor number and type */
if (sdr != NULL) {
printf("%s ", ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0]));
printf("%s ",
(
(evt->sel_type.standard_type.sensor_type >=0xC0 && evt->sel_type.standard_type.sensor_type < 0xF0)
?
ipmi_sel_get_oem_sensor_type_offset(ipmi_get_oem(intf),evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
:
ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
)
);
switch (sdr->type) {
case SDR_RECORD_TYPE_FULL_SENSOR:
printf("%s", sdr->record.full->id_string);
@ -775,7 +1031,13 @@ ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt)
break;
}
} else {
printf("%s", ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0]));
printf("%s",(
(evt->sel_type.standard_type.sensor_type >=0xC0 && evt->sel_type.standard_type.sensor_type < 0xF0)
?
ipmi_sel_get_oem_sensor_type_offset(ipmi_get_oem(intf),evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
:
ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
));
if (evt->sel_type.standard_type.sensor_num != 0)
printf(" #0x%02x", evt->sel_type.standard_type.sensor_num);
}
@ -916,6 +1178,7 @@ ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_recor
for(data_count=0;data_count < SEL_OEM_NOTS_DATA_LEN;data_count++)
printf("%02x", evt->sel_type.oem_nots_type.oem_defined[data_count]);
printf(" [%s]\n\n",hex2ascii (evt->sel_type.oem_nots_type.oem_defined, SEL_OEM_NOTS_DATA_LEN));
ipmi_sel_oem_message(evt, 1);
}
return;
}
@ -925,7 +1188,14 @@ ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_recor
printf(" EvM Revision : %02x\n",
evt->sel_type.standard_type.evm_rev);
printf(" Sensor Type : %s\n",
ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0]));
(
(evt->sel_type.standard_type.sensor_type >=0xC0 && evt->sel_type.standard_type.sensor_type < 0xF0)
?
ipmi_sel_get_oem_sensor_type_offset(ipmi_get_oem(intf),evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
:
ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0])
)
);
printf(" Sensor Number : %02x\n",
evt->sel_type.standard_type.sensor_num);
printf(" Event Type : %s\n",
@ -948,12 +1218,13 @@ ipmi_sel_print_extended_entry_verbose(struct ipmi_intf * intf, struct sel_event_
{
struct sdr_record_list * sdr;
char * description;
int data_count;
if (!evt)
return;
sdr = ipmi_sdr_find_sdr_bynumtype(intf, evt->sel_type.standard_type.sensor_num, evt->sel_type.standard_type.sensor_type);
sdr = ipmi_sdr_find_sdr_bynumtype(intf,
evt->sel_type.standard_type.sensor_num,
evt->sel_type.standard_type.sensor_type);
if (sdr == NULL) {
ipmi_sel_print_std_entry_verbose(intf, evt);
return;
@ -1094,6 +1365,11 @@ ipmi_sel_print_extended_entry_verbose(struct ipmi_intf * intf, struct sel_event_
evt->sel_type.standard_type.event_data[2] & 0x0f,
(evt->sel_type.standard_type.event_data[2] & 0xf0) >> 4);
}
else
{
/* FIXME : Add sensor specific discrete types */
printf(" Event Interpretation Missing\n");
}
} else if (evt->sel_type.standard_type.event_type >= 0x70 && evt->sel_type.standard_type.event_type <= 0x7f) {
/* OEM */
} else {
@ -1139,7 +1415,7 @@ __ipmi_sel_savelist_entries(struct ipmi_intf * intf, int count, const char * sav
if (rsp->data[1] == 0 && rsp->data[2] == 0) {
lprintf(LOG_ERR, "SEL has no entries");
return -1;
return 0;
}
memset(&req, 0, sizeof(req));
@ -1190,7 +1466,7 @@ __ipmi_sel_savelist_entries(struct ipmi_intf * intf, int count, const char * sav
if (savefile != NULL) {
fp = ipmi_open_file_write(savefile);
}
}
while (next_id != 0xffff) {
curr_id = next_id;
@ -1332,7 +1608,7 @@ ipmi_sel_get_time(struct ipmi_intf * intf)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
static uint8_t tbuf[40];
static char tbuf[40];
uint32_t timei;
time_t time;
@ -1356,12 +1632,13 @@ ipmi_sel_get_time(struct ipmi_intf * intf)
"Invalid data length %d", rsp->data_len);
return -1;
}
memcpy(&timei, rsp->data, 4);
#if WORDS_BIGENDIAN
timei = BSWAP_32(time);
#endif
time = (time_t)(BSWAP_32(timei));
#else
time = (time_t)timei;
#endif
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&time));
printf("%s\n", tbuf);
@ -1409,7 +1686,7 @@ ipmi_sel_set_time(struct ipmi_intf * intf, const char * time_string)
}
timei = (uint32_t)t;
req.msg.data = (uint8_t *)&timei;
req.msg.data = (uint8_t *)&timei;
req.msg.data_len = 4;
#if WORDS_BIGENDIAN
@ -1497,7 +1774,7 @@ ipmi_sel_delete(struct ipmi_intf * intf, int argc, char ** argv)
msg_data[0] = id & 0xff;
msg_data[1] = id >> 8;
for (argc; argc != 0; argc--)
for (; argc != 0; argc--)
{
id = atoi(argv[argc-1]);
msg_data[2] = id & 0xff;
@ -1737,7 +2014,7 @@ int ipmi_sel_main(struct ipmi_intf * intf, int argc, char ** argv)
} else {
lprintf(LOG_ERR, "sel time commands: get set");
}
}
}
else {
lprintf(LOG_ERR, "Invalid SEL command: %s", argv[0]);
rc = -1;
@ -1745,4 +2022,3 @@ int ipmi_sel_main(struct ipmi_intf * intf, int argc, char ** argv)
return rc;
}

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <string.h>
@ -47,6 +43,7 @@
extern int verbose;
#define SCANNING_DISABLED 0x40
#define READING_UNAVAILABLE 0x20
static
@ -106,13 +103,16 @@ ipmi_sensor_print_full_discrete(struct ipmi_intf *intf,
*/
rsp = ipmi_sdr_get_sensor_reading_ipmb(intf,
sensor->keys.sensor_num,
sensor->keys.owner_id);
sensor->keys.owner_id,
sensor->keys.lun);
if (rsp == NULL) {
lprintf(LOG_ERR, "Error reading sensor %s (#%02x)",
id, sensor->keys.sensor_num);
return -1;
} else if (rsp->ccode > 0 || (rsp->data[1] & READING_UNAVAILABLE)) {
validread = 0;
} else if (!(rsp->data[1] & SCANNING_DISABLED)) {
validread = 0;
} else {
/* convert RAW reading into units */
val = rsp->data[0];
@ -146,16 +146,19 @@ ipmi_sensor_print_full_discrete(struct ipmi_intf *intf,
printf(" Sensor Type (Discrete): %s\n",
ipmi_sdr_get_sensor_type_desc(sensor->sensor.
type));
ipmi_sdr_print_discrete_state("States Asserted",
sensor->sensor.type,
sensor->event_type,
rsp->data[2],
rsp->data[3]);
printf("\n");
if( validread )
{
ipmi_sdr_print_discrete_state("States Asserted",
sensor->sensor.type,
sensor->event_type,
rsp->data[2],
rsp->data[3]);
printf("\n");
}
}
}
return 0;
return (validread ? 0 : -1 );
}
static int
@ -185,13 +188,16 @@ ipmi_sensor_print_full_analog(struct ipmi_intf *intf,
*/
rsp = ipmi_sdr_get_sensor_reading_ipmb(intf,
sensor->keys.sensor_num,
sensor->keys.owner_id);
sensor->keys.owner_id,
sensor->keys.lun);
if (rsp == NULL) {
lprintf(LOG_ERR, "Error reading sensor %s (#%02x)",
id, sensor->keys.sensor_num);
return -1;
} else if (rsp->ccode || (rsp->data[1] & READING_UNAVAILABLE)) {
validread = 0;
} else if (!(rsp->data[1] & SCANNING_DISABLED)) {
validread = 0;
} else {
/* convert RAW reading into units */
val = (rsp->data[0] > 0)
@ -303,8 +309,8 @@ ipmi_sensor_print_full_analog(struct ipmi_intf *intf,
if (validread) {
uint16_t raw_tol = __TO_TOL(sensor->mtol);
double tol =
sdr_convert_sensor_reading(sensor,
raw_tol * 2);
sdr_convert_sensor_tolerance(sensor,
raw_tol);
printf("%.*f (+/- %.*f) %s\n",
(val == (int) val) ? 0 : 3, val,
(tol == (int) tol) ? 0 : 3, tol,
@ -387,7 +393,7 @@ ipmi_sensor_print_full_analog(struct ipmi_intf *intf,
}
}
return 0;
return (validread ? 0 : -1 );
}
int
@ -421,13 +427,16 @@ ipmi_sensor_print_compact(struct ipmi_intf *intf,
*/
rsp = ipmi_sdr_get_sensor_reading_ipmb(intf,
sensor->keys.sensor_num,
sensor->keys.owner_id);
sensor->keys.owner_id,
sensor->keys.lun);
if (rsp == NULL) {
lprintf(LOG_ERR, "Error reading sensor %s (#%02x)",
id, sensor->keys.sensor_num);
return -1;
} else if (rsp->ccode || (rsp->data[1] & READING_UNAVAILABLE)) {
validread = 0;
} else if (!(rsp->data[1] & SCANNING_DISABLED)) {
validread = 0;
} else {
/* convert RAW reading into units */
val = rsp->data[0];
@ -462,16 +471,20 @@ ipmi_sensor_print_compact(struct ipmi_intf *intf,
printf(" Sensor Type (Discrete): %s\n",
ipmi_sdr_get_sensor_type_desc(sensor->sensor.
type));
ipmi_sdr_print_discrete_state("States Asserted",
sensor->sensor.type,
sensor->event_type,
rsp->data[2],
rsp->data[3]);
printf("\n");
if(validread)
{
ipmi_sdr_print_discrete_state("States Asserted",
sensor->sensor.type,
sensor->event_type,
rsp->data[2],
rsp->data[3]);
printf("\n");
}
}
}
return 0;
return (validread ? 0 : -1 );
}
static int
@ -731,6 +744,75 @@ ipmi_sensor_set_threshold(struct ipmi_intf *intf, int argc, char **argv)
return ret;
}
static int
ipmi_sensor_get_reading(struct ipmi_intf *intf, int argc, char **argv)
{
struct sdr_record_list *sdr;
struct ipmi_rs *rsp;
int i, rc=0;
double val = 0.0;
if (argc < 1 || strncmp(argv[0], "help", 4) == 0) {
lprintf(LOG_NOTICE, "sensor reading <id> ... [id]");
lprintf(LOG_NOTICE, " id : name of desired sensor");
return -1;
}
for (i = 0; i < argc; i++) {
sdr = ipmi_sdr_find_sdr_byid(intf, argv[i]);
if (sdr == NULL) {
lprintf(LOG_ERR, "Sensor \"%s\" not found!",
argv[i]);
rc = -1;
continue;
}
switch (sdr->type) {
case SDR_RECORD_TYPE_FULL_SENSOR:
if (sdr->record.full->linearization >= SDR_SENSOR_L_NONLINEAR) {
lprintf(LOG_ERR, "Sensor \"%s\" non-linear!", argv[i]);
continue;
}
rsp = ipmi_sdr_get_sensor_reading_ipmb(intf,
sdr->record.full->keys.sensor_num,
sdr->record.full->keys.owner_id,
sdr->record.full->keys.lun);
if (rsp == NULL) {
lprintf(LOG_ERR, "Error reading sensor \"%s\"", argv[i]);
rc = -1;
continue;
} else if (rsp->ccode > 0) {
continue;
} else if (rsp->data[1] & READING_UNAVAILABLE) {
continue;
} else if (!(rsp->data[1] & SCANNING_DISABLED)) {
continue;
} else if (rsp->data[0] > 0) {
/* convert RAW reading into units */
val = sdr_convert_sensor_reading(sdr->record.full, rsp->data[0]);
} else {
val = 0.0;
}
if (csv_output)
printf("%s,%.*f\n", argv[i],
(val == (int)val) ? 0 : 3, val);
else
printf("%-16s | %.*f\n", argv[i],
(val == (int)val) ? 0 : 3, val);
break;
case SDR_RECORD_TYPE_COMPACT_SENSOR:
break;
default:
continue;
}
}
return rc;
}
static int
ipmi_sensor_get(struct ipmi_intf *intf, int argc, char **argv)
{
@ -800,13 +882,15 @@ ipmi_sensor_main(struct ipmi_intf *intf, int argc, char **argv)
if (argc == 0) {
rc = ipmi_sensor_list(intf);
} else if (strncmp(argv[0], "help", 4) == 0) {
lprintf(LOG_NOTICE, "Sensor Commands: list thresh get");
lprintf(LOG_NOTICE, "Sensor Commands: list thresh get reading");
} else if (strncmp(argv[0], "list", 4) == 0) {
rc = ipmi_sensor_list(intf);
} else if (strncmp(argv[0], "thresh", 5) == 0) {
rc = ipmi_sensor_set_threshold(intf, argc - 1, &argv[1]);
} else if (strncmp(argv[0], "get", 3) == 0) {
rc = ipmi_sensor_get(intf, argc - 1, &argv[1]);
} else if (strncmp(argv[0], "reading", 7) == 0) {
rc = ipmi_sensor_get_reading(intf, argc - 1, &argv[1]);
} else {
lprintf(LOG_ERR, "Invalid sensor command: %s", argv[0]);
rc = -1;

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <stdlib.h>
@ -97,19 +93,11 @@ print_session_info_csv(const struct get_session_info_rsp * session_info,
if (data_len == 18)
{
/* We have 802.3 LAN data */
#ifdef __CYGWIN__
printf(",%d.%d.%d.%d",
session_info->channel_data.lan_data.console_ip[0],
session_info->channel_data.lan_data.console_ip[1],
session_info->channel_data.lan_data.console_ip[2],
session_info->channel_data.lan_data.console_ip[3]);
#else
printf(",%s",
inet_ntop(AF_INET,
&(session_info->channel_data.lan_data.console_ip),
buffer,
16));
#endif
printf(",%02x:%02x:%02x:%02x:%02x:%02x",
session_info->channel_data.lan_data.console_mac[0],
@ -137,19 +125,11 @@ print_session_info_csv(const struct get_session_info_rsp * session_info,
printf(",%d",
session_info->channel_data.modem_data.destination_selector);
#ifdef __CYGWIN__
printf(",%d.%d.%d.%d",
session_info->channel_data.modem_data.console_ip[0],
session_info->channel_data.modem_data.console_ip[1],
session_info->channel_data.modem_data.console_ip[2],
session_info->channel_data.modem_data.console_ip[3]);
#else
printf(",%s",
inet_ntop(AF_INET,
&(session_info->channel_data.modem_data.console_ip),
buffer,
16));
#endif
if (data_len == 14)
{
@ -201,19 +181,11 @@ print_session_info_verbose(const struct get_session_info_rsp * session_info,
if (data_len == 18)
{
/* We have 802.3 LAN data */
#ifdef __CYGWIN__
printf("console ip : %d.%d.%d.%d\n",
session_info->channel_data.lan_data.console_ip[0],
session_info->channel_data.lan_data.console_ip[1],
session_info->channel_data.lan_data.console_ip[2],
session_info->channel_data.lan_data.console_ip[3]);
#else
printf("console ip : %s\n",
inet_ntop(AF_INET,
&(session_info->channel_data.lan_data.console_ip),
buffer,
16));
#endif
printf("console mac : %02x:%02x:%02x:%02x:%02x:%02x\n",
session_info->channel_data.lan_data.console_mac[0],
@ -241,19 +213,11 @@ print_session_info_verbose(const struct get_session_info_rsp * session_info,
printf("Destination selector : %d\n",
session_info->channel_data.modem_data.destination_selector);
#ifdef __CYGWIN__
printf("console ip : %d.%d.%d.%d\n",
session_info->channel_data.modem_data.console_ip[0],
session_info->channel_data.modem_data.console_ip[1],
session_info->channel_data.modem_data.console_ip[2],
session_info->channel_data.modem_data.console_ip[3]);
#else
printf("console ip : %s\n",
inet_ntop(AF_INET,
&(session_info->channel_data.modem_data.console_ip),
buffer,
16));
#endif
if (data_len == 14)
{

File diff suppressed because it is too large Load Diff

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <stddef.h>
@ -48,10 +44,29 @@ const struct valstr ipmi_oem_info[] = {
{ IPMI_OEM_TYAN, "Tyan Computer Corporation" },
{ IPMI_OEM_NEWISYS, "Newisys" },
{ IPMI_OEM_SUPERMICRO, "Supermicro" },
{ IPMI_OEM_GOOGLE, "Google" },
{ IPMI_OEM_KONTRON, "Kontron" },
{ IPMI_OEM_NOKIA, "Nokia" },
{ 0xffff , NULL },
};
const struct oemvalstr ipmi_oem_sdr_type_vals[] = {
/* Keep OEM grouped together */
{ IPMI_OEM_KONTRON , 0xC0 , "OEM Firmware Info" },
{ IPMI_OEM_KONTRON , 0xC2 , "OEM Init Agent" },
{ IPMI_OEM_KONTRON , 0xC3 , "OEM IPMBL Link State" },
{ IPMI_OEM_KONTRON , 0xC4 , "OEM Board Reset" },
{ IPMI_OEM_KONTRON , 0xC5 , "OEM FRU Information Agent" },
{ IPMI_OEM_KONTRON , 0xC6 , "OEM POST Value Sensor" },
{ IPMI_OEM_KONTRON , 0xC7 , "OEM FWUM Status" },
{ IPMI_OEM_KONTRON , 0xC8 , "OEM Switch Mngt Software Status" },
{ IPMI_OEM_PICMG , 0xF0 , "PICMG FRU Hotswap" },
{ IPMI_OEM_PICMG , 0xF1 , "PICMG IPMB0 Link State" },
{ 0xffff, 0x00, NULL }
};
const struct valstr ipmi_netfn_vals[] = {
{ IPMI_NETFN_CHASSIS, "Chassis" },
{ IPMI_NETFN_BRIDGE, "Bridge" },
@ -165,18 +180,26 @@ const struct valstr entity_id_vals[] = {
{ 0x26, "Remote Management Device" },
{ 0x27, "External Environment" },
{ 0x28, "Battery" },
{ 0x29, "Processing Blade" },
{ 0x2A, "Connectivity Switch" },
{ 0x2B, "Processor/Memory Module" },
{ 0x2C, "I/O Module" },
{ 0x2D, "Processor/IO Module" },
{ 0x2E, "Management Controller Firmware" },
{ 0x2F, "IPMI Channel" },
{ 0x30, "PCI Bus" },
{ 0x31, "PCI Express Bus" },
{ 0x32, "SCSI Bus (parallel)" },
{ 0x33, "SATA/SAS Bus" },
{ 0x34, "Processor/Front-Side Bus" },
{ 0x29, "Processing Blade" },
{ 0x2A, "Connectivity Switch" },
{ 0x2B, "Processor/Memory Module" },
{ 0x2C, "I/O Module" },
{ 0x2D, "Processor/IO Module" },
{ 0x2E, "Management Controller Firmware" },
{ 0x2F, "IPMI Channel" },
{ 0x30, "PCI Bus" },
{ 0x31, "PCI Express Bus" },
{ 0x32, "SCSI Bus (parallel)" },
{ 0x33, "SATA/SAS Bus" },
{ 0x34, "Processor/Front-Side Bus" },
/* PICMG */
{ 0xA0, "PICMG Front Board" },
{ 0xC0, "PICMG Rear Transition Module" },
{ 0xC1, "PICMG AdvancedMC Module" },
{ 0xF0, "PICMG Shelf Management Controller" },
{ 0xF1, "PICMG Filtration Unit" },
{ 0xF2, "PICMG Shelf FRU Information" },
{ 0xF3, "PICMG Alarm Panel" },
{ 0x00, NULL },
};

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <stdlib.h>
@ -62,7 +58,7 @@ static const struct valstr sunoem_led_type_vals[] = {
{ 1, "SERVICE" },
{ 2, "ACT" },
{ 3, "LOCATE" },
{ 0, NULL },
{ 0xFF, NULL },
};
static const struct valstr sunoem_led_mode_vals[] = {
@ -82,6 +78,8 @@ static const struct valstr sunoem_led_mode_optvals[] = {
{ 0xFF, NULL },
};
int is_sbcmd = 0;
static void
ipmi_sunoem_usage(void)
{
@ -104,6 +102,14 @@ ipmi_sunoem_usage(void)
lprintf(LOG_NOTICE, " led set <sensorid> <ledmode> [ledtype]");
lprintf(LOG_NOTICE, " Set mode of LED found in Generic Device Locator.");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, " sbled get <sensorid> [ledtype]");
lprintf(LOG_NOTICE, " Read status of LED found in Generic Device Locator");
lprintf(LOG_NOTICE, " for Sun Blade Modular Systems.");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, " sbled set <sensorid> <ledmode> [ledtype]");
lprintf(LOG_NOTICE, " Set mode of LED found in Generic Device Locator");
lprintf(LOG_NOTICE, " for Sun Blade Modular Systems.");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, " Use 'sdr list generic' command to get list of Generic");
lprintf(LOG_NOTICE, " Devices that are controllable LEDs.");
lprintf(LOG_NOTICE, "");
@ -190,21 +196,34 @@ sunoem_led_get(struct ipmi_intf * intf,
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t rqdata[5];
uint8_t rqdata[7];
int rqdata_len = 5;
if (dev == NULL)
return NULL;
rqdata[0] = dev->dev_slave_addr;
rqdata[1] = ledtype;
if (ledtype == 0xFF)
rqdata[1] = dev->oem;
else
rqdata[1] = ledtype;
rqdata[2] = dev->dev_access_addr;
rqdata[3] = dev->oem;
rqdata[4] = 0;
if (is_sbcmd) {
rqdata[4] = dev->entity.id;
rqdata[5] = dev->entity.instance;
rqdata[6] = 0;
rqdata_len = 7;
}
else {
rqdata[4] = 0;
}
req.msg.netfn = IPMI_NETFN_SUNOEM;
req.msg.cmd = IPMI_SUNOEM_LED_GET;
req.msg.lun = dev->lun;
req.msg.data = rqdata;
req.msg.data_len = 5;
req.msg.data_len = rqdata_len;
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
@ -227,23 +246,37 @@ sunoem_led_set(struct ipmi_intf * intf,
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t rqdata[7];
uint8_t rqdata[9];
int rqdata_len = 7;
if (dev == NULL)
return NULL;
rqdata[0] = dev->dev_slave_addr;
rqdata[1] = ledtype;
if (ledtype == 0xFF)
rqdata[1] = dev->oem;
else
rqdata[1] = ledtype;
rqdata[2] = dev->dev_access_addr;
rqdata[3] = dev->oem;
rqdata[4] = ledmode;
rqdata[5] = 0;
rqdata[6] = 0;
if (is_sbcmd) {
rqdata[5] = dev->entity.id;
rqdata[6] = dev->entity.instance;
rqdata[7] = 0;
rqdata[8] = 0;
rqdata_len = 9;
}
else {
rqdata[5] = 0;
rqdata[6] = 0;
}
req.msg.netfn = IPMI_NETFN_SUNOEM;
req.msg.cmd = IPMI_SUNOEM_LED_SET;
req.msg.lun = dev->lun;
req.msg.data = rqdata;
req.msg.data_len = 7;
req.msg.data_len = rqdata_len;
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
@ -333,6 +366,13 @@ sunoem_led_set_byentity(struct ipmi_intf * intf, uint8_t entity_id,
* [byte 4] force 1 = directly access the device
* 0 = go thru its controller
* Ignored if LED is local
*
* The format below is for Sun Blade Modular systems only
* [byte 4] entityID The entityID field from the SDR record
* [byte 5] entityIns The entityIns field from the SDR record
* [byte 6] force 1 = directly access the device
* 0 = go thru its controller
* Ignored if LED is local
*/
static int
ipmi_sunoem_led_get(struct ipmi_intf * intf, int argc, char ** argv)
@ -341,20 +381,22 @@ ipmi_sunoem_led_get(struct ipmi_intf * intf, int argc, char ** argv)
struct sdr_record_list *sdr;
struct sdr_record_list *alist, *a;
struct sdr_record_entity_assoc *assoc;
int ledtype = 0;
int ledtype = 0xFF;
int i;
/*
* sunoem led get <id> [type]
* sunoem led/sbled get <id> [type]
*/
if (argc < 1 || strncmp(argv[0], "help", 4) == 0) {
lprintf(LOG_NOTICE, "usage: sunoem led get <id> [type]");
ipmi_sunoem_usage();
return 0;
}
if (argc > 1) {
ledtype = str2val(argv[1], sunoem_led_type_vals);
if (ledtype == 0xFF)
lprintf(LOG_ERR, "Unknow ledtype, will use data from the SDR oem field");
}
if (strncasecmp(argv[0], "all", 3) == 0) {
@ -471,6 +513,14 @@ ipmi_sunoem_led_get(struct ipmi_intf * intf, int argc, char ** argv)
* Ignored if LED is local
* [byte 6] role Used by BMC for authorization purposes
*
* The format below is for Sun Blade Modular systems only
* [byte 5] entityID The entityID field from the SDR record
* [byte 6] entityIns The entityIns field from the SDR record
* [byte 7] force TRUE - directly access the device
* FALSE - go thru its controller
* Ignored if LED is local
* [byte 8] role Used by BMC for authorization purposes
*
*
* IPMI Response Data: 1 byte
*
@ -485,11 +535,11 @@ ipmi_sunoem_led_set(struct ipmi_intf * intf, int argc, char ** argv)
struct sdr_record_list *alist, *a;
struct sdr_record_entity_assoc *assoc;
int ledmode;
int ledtype = 0;
int ledtype = 0xFF;
int i;
/*
* sunoem led set <id> <mode> [type]
* sunoem led/sbled set <id> <mode> [type]
*/
if (argc < 2 || strncmp(argv[0], "help", 4) == 0) {
@ -508,6 +558,8 @@ ipmi_sunoem_led_set(struct ipmi_intf * intf, int argc, char ** argv)
if (argc > 3) {
ledtype = str2val(argv[2], sunoem_led_type_vals);
if (ledtype == 0xFF)
lprintf(LOG_ERR, "Unknow ledtype, will use data from the SDR oem field");
}
if (strncasecmp(argv[0], "all", 3) == 0) {
@ -739,11 +791,14 @@ ipmi_sunoem_main(struct ipmi_intf * intf, int argc, char ** argv)
}
}
if (strncmp(argv[0], "led", 3) == 0) {
if ((strncmp(argv[0], "led", 3) == 0) || (strncmp(argv[0], "sbled", 5) == 0)) {
if (argc < 2) {
ipmi_sunoem_usage();
return -1;
}
if (strncmp(argv[0], "sbled", 5) == 0) {
is_sbcmd = 1;
}
if (strncmp(argv[1], "get", 3) == 0) {
if (argc < 3) {
char * arg[] = { "all" };

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <sys/types.h>
@ -51,10 +47,15 @@
#include <sys/select.h>
#include <sys/time.h>
#ifdef __linux__
# include <linux/termios.h>
#else
#include <sys/ioctl.h>
#if defined(HAVE_CONFIG_H)
# include <config.h>
#endif
#if defined(HAVE_TERMIOS_H)
# include <termios.h>
#elif defined (HAVE_SYS_TERMIOS_H)
# include <sys/termios.h>
#endif
@ -66,14 +67,14 @@
#include <ipmitool/ipmi_strings.h>
#include <ipmitool/bswap.h>
#include <config.h>
static struct timeval _start_keepalive;
static struct termios _saved_tio;
static struct winsize _saved_winsize;
static int _in_raw_mode = 0;
static int _altterm = 0;
extern int verbose;
static int
ipmi_tsol_command(struct ipmi_intf * intf, char *recvip, int port, unsigned char cmd)
{
@ -81,31 +82,25 @@ ipmi_tsol_command(struct ipmi_intf * intf, char *recvip, int port, unsigned char
struct ipmi_rq req;
unsigned char data[6];
unsigned ip1, ip2, ip3, ip4;
uint16_t portin;
#if WORDS_BIGENDIAN
portin = BSWAP_16(port);
#else
portin = port;
#endif
if (sscanf(recvip, "%d.%d.%d.%d", &ip1, &ip2, &ip3, &ip4) != 4) {
lprintf(LOG_ERR, "Invalid IP address: %s", recvip);
return -1;
}
memset(&req, 0, sizeof(struct ipmi_rq));
req.msg.netfn = IPMI_NETFN_TSOL;
req.msg.cmd = cmd;
req.msg.data_len = 6;
req.msg.data = data;
memset(data, 0, sizeof(data));
data[0] = ip1;
data[1] = ip2;
data[0] = ip1;
data[1] = ip2;
data[2] = ip3;
data[3] = ip4;
data[4] = (portin & 0xff00) >> 8;
data[5] = (portin & 0xff);
data[4] = (port & 0xff00) >> 8;
data[5] = (port & 0xff);
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
@ -133,14 +128,15 @@ ipmi_tsol_stop(struct ipmi_intf * intf, char *recvip, int port)
return ipmi_tsol_command(intf, recvip, port, IPMI_TSOL_CMD_STOP);
}
static int
static int
ipmi_tsol_send_keystroke(struct ipmi_intf * intf, char *buff, int length)
{
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
unsigned char data[16];
static unsigned char keyseq = 0;
memset(&req, 0, sizeof(struct ipmi_rq));
req.msg.netfn = IPMI_NETFN_TSOL;
req.msg.cmd = IPMI_TSOL_CMD_SENDKEY;
req.msg.data_len = length + 2;
@ -150,26 +146,28 @@ ipmi_tsol_send_keystroke(struct ipmi_intf * intf, char *buff, int length)
data[0] = length + 1;
memcpy(data + 1, buff, length);
data[length + 1] = keyseq++;
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
lprintf(LOG_ERR, "Unable to send keystroke");
return -1;
if (verbose) {
if (rsp == NULL) {
lprintf(LOG_ERR, "Unable to send keystroke");
return -1;
}
if (rsp->ccode > 0) {
lprintf(LOG_ERR, "Unable to send keystroke: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
}
}
if (rsp->ccode > 0) {
lprintf(LOG_ERR, "Unable to send keystroke: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
}
return length;
}
}
static int
tsol_keepalive(struct ipmi_intf * intf)
{
struct timeval end;
gettimeofday(&end, 0);
if (end.tv_sec - _start_keepalive.tv_sec <= 30)
@ -363,7 +361,7 @@ static void
print_tsol_usage(void)
{
struct winsize winsize;
lprintf(LOG_NOTICE, "Usage: tsol [recvip] [port=NUM] [ro|rw] [rows=NUM] [cols=NUM] [altterm]");
lprintf(LOG_NOTICE, " recvip Receiver IP Address [default=local]");
lprintf(LOG_NOTICE, " port=NUM Receiver UDP Port [default=%d]",
@ -385,7 +383,6 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
struct pollfd fds_wait[3], fds_data_wait[3], *fds;
struct sockaddr_in sin, myaddr;
socklen_t mylen;
char recvip_c[] = "0.0.0.0";
char *recvip = NULL;
char out_buff[IPMI_BUF_SIZE * 8], in_buff[IPMI_BUF_SIZE];
char buff[IPMI_BUF_SIZE + 4];
@ -425,18 +422,13 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
}
}
/* create udp socket to receive the packet */
/* create udp socket to receive the packet */
memset(&sin, 0, sizeof(sin));
sin.sin_family = AF_INET;
sin.sin_port = htons(port);
#ifdef __CYGWIN__
result = inet_aton((const char *)intf->session->hostname,
&intf->session->addr.sin_addr);
#else
result = inet_pton(AF_INET, (const char *)intf->session->hostname,
&intf->session->addr.sin_addr);
#endif
if (result <= 0) {
struct hostent *host = gethostbyname((const char *)intf->session->hostname);
@ -484,7 +476,7 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
enter_raw_mode();
/*
* talk to smdc to start Console redirect - IP address and port as parameter
* talk to smdc to start Console redirect - IP address and port as parameter
* ipmitool -I lan -H 192.168.168.227 -U Administrator raw 0x30 0x06 0xC0 0xA8 0xA8 0x78 0x1A 0x0A
*/
result = ipmi_tsol_start(intf, recvip, port);
@ -496,7 +488,7 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
printf("[SOL Session operational. Use %c? for help]\r\n",
intf->session->sol_escape_char);
gettimeofday(&_start_keepalive, 0);
gettimeofday(&_start_keepalive, 0);
fds_wait[0].fd = fd_socket;
fds_wait[0].events = POLLIN;
@ -507,7 +499,7 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
fds_wait[2].fd = -1;
fds_wait[2].events = 0;
fds_wait[2].revents = 0;
fds_data_wait[0].fd = fd_socket;
fds_data_wait[0].events = POLLIN | POLLOUT;
fds_data_wait[0].revents = 0;
@ -517,11 +509,11 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
fds_data_wait[2].fd = fileno(stdout);
fds_data_wait[2].events = POLLOUT;
fds_data_wait[2].revents = 0;
out_buff_fill = 0;
in_buff_fill = 0;
fds = fds_wait;
for (;;) {
result = poll(fds, 3, 15*1000);
if (result < 0)
@ -560,7 +552,7 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
do_terminal_cleanup();
return result;
}
if (read_only)
if (read_only)
bytes = 0;
in_buff_fill += bytes;
}
@ -576,7 +568,7 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
}
if ((fds[0].revents & POLLOUT) && in_buff_fill) {
/*
* translate key and send that to SMDC using IPMI
* translate key and send that to SMDC using IPMI
* ipmitool -I lan -H 192.168.168.227 -U Administrator raw 0x30 0x03 0x04 0x1B 0x5B 0x43
*/
result = ipmi_tsol_send_keystroke(intf, in_buff, __min(in_buff_fill,14));
@ -588,9 +580,9 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
}
}
}
fds = (in_buff_fill || out_buff_fill )?
fds = (in_buff_fill || out_buff_fill )?
fds_data_wait : fds_wait;
}
return 0;
}

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <stdlib.h>
@ -76,11 +72,10 @@ extern int csv_output;
*/
static int
ipmi_get_user_access(
struct ipmi_intf * intf,
uint8_t channel_number,
uint8_t user_id,
struct user_access_rsp * user_access)
struct ipmi_intf *intf,
uint8_t channel_number,
uint8_t user_id,
struct user_access_rsp *user_access)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@ -96,7 +91,7 @@ ipmi_get_user_access(
/* The channel number will remain constant throughout this function */
msg_data[0] = channel_number;
msg_data[1] = user_id;
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
@ -133,10 +128,9 @@ ipmi_get_user_access(
*/
static int
ipmi_get_user_name(
struct ipmi_intf * intf,
uint8_t user_id,
char * user_name)
struct ipmi_intf *intf,
uint8_t user_id,
char *user_name)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@ -145,13 +139,13 @@ ipmi_get_user_name(
memset(user_name, 0, 17);
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_APP; /* 0x06 */
req.msg.cmd = IPMI_GET_USER_NAME; /* 0x45 */
req.msg.netfn = IPMI_NETFN_APP; /* 0x06 */
req.msg.cmd = IPMI_GET_USER_NAME; /* 0x45 */
req.msg.data = msg_data;
req.msg.data_len = 1;
msg_data[0] = user_id;
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL) {
@ -189,7 +183,6 @@ dump_user_access(
"Channel Priv Limit\n");
printed_header = 1;
}
printf("%-4d%-17s%-8s%-11s%-11s%-s\n",
user_id,
@ -205,9 +198,9 @@ dump_user_access(
static void
dump_user_access_csv(
uint8_t user_id,
const char * user_name,
struct user_access_rsp * user_access)
uint8_t user_id,
const char *user_name,
struct user_access_rsp *user_access)
{
printf("%d,%s,%s,%s,%s,%s\n",
user_id,
@ -223,8 +216,8 @@ dump_user_access_csv(
static int
ipmi_print_user_list(
struct ipmi_intf * intf,
uint8_t channel_number)
struct ipmi_intf *intf,
uint8_t channel_number)
{
/* This is where you were! */
char user_name[17];
@ -245,8 +238,7 @@ ipmi_print_user_list(
current_user_id,
user_name))
return -1;
if ((current_user_id == 0) ||
user_access.link_auth_access ||
user_access.ipmi_messaging_access ||
@ -312,9 +304,9 @@ ipmi_print_user_summary(
*/
static int
ipmi_user_set_username(
struct ipmi_intf * intf,
uint8_t user_id,
const char * name)
struct ipmi_intf *intf,
uint8_t user_id,
const char *name)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
@ -330,7 +322,7 @@ ipmi_user_set_username(
/* The channel number will remain constant throughout this function */
msg_data[0] = user_id;
memset(msg_data + 1, 0, 16);
strcpy(msg_data + 1, name);
strcpy((char *)(msg_data + 1), name);
rsp = intf->sendrecv(intf, &req);
@ -347,49 +339,48 @@ ipmi_user_set_username(
return 0;
}
static int
ipmi_user_set_userpriv(
struct ipmi_intf * intf,
uint8_t channel,
uint8_t user_id,
const unsigned char privLevel)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t msg_data[17];
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_APP; /* 0x06 */
req.msg.cmd = IPMI_SET_USER_ACCESS; /* 0x43 */
req.msg.data = msg_data;
req.msg.data_len = 3;
/* The channel number will remain constant throughout this function */
msg_data[0] = (channel & 0x0f); /* Do not change any bytes */
msg_data[1] = (user_id & 0x3f);
msg_data[2] = (privLevel & 0x0f);
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL)
{
lprintf(LOG_ERR, "Set Privilege Level command failed (user %d)",
user_id);
return -1;
}
if (rsp->ccode > 0)
{
lprintf(LOG_ERR, "Set Privilege Level command failed (user %d)",
user_id);
return -1;
}
return 0;
}
static int
ipmi_user_set_userpriv(
struct ipmi_intf *intf,
uint8_t channel,
uint8_t user_id,
const unsigned char privLevel)
{
struct ipmi_rs *rsp;
struct ipmi_rq req;
uint8_t msg_data[4];
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_APP; /* 0x06 */
req.msg.cmd = IPMI_SET_USER_ACCESS; /* 0x43 */
req.msg.data = msg_data;
req.msg.data_len = 4;
/* The channel number will remain constant throughout this function */
msg_data[0] = (channel & 0x0f);
msg_data[0] |= 0x90; /* enable ipmi messaging */
msg_data[1] = (user_id & 0x3f);
msg_data[2] = (privLevel & 0x0f);
msg_data[3] = 0;
rsp = intf->sendrecv(intf, &req);
if (rsp == NULL)
{
lprintf(LOG_ERR, "Set Privilege Level command failed (user %d)",
user_id);
return -1;
}
if (rsp->ccode > 0)
{
lprintf(LOG_ERR, "Set Privilege Level command failed (user %d): %s",
user_id, val2str(rsp->ccode, completion_code_vals));
return -1;
}
return 0;
}
/*
* ipmi_user_set_password
@ -400,19 +391,19 @@ ipmi_user_set_userpriv(
*/
static int
ipmi_user_set_password(
struct ipmi_intf * intf,
uint8_t user_id,
uint8_t operation,
const char * password,
int is_twenty_byte_password)
struct ipmi_intf * intf,
uint8_t user_id,
uint8_t operation,
const char *password,
int is_twenty_byte_password)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
char * msg_data;
uint8_t * msg_data;
int password_length = (is_twenty_byte_password? 20 : 16);
msg_data = (char*)malloc(password_length + 2);
msg_data = (uint8_t*)malloc(password_length + 2);
memset(&req, 0, sizeof(req));
@ -424,16 +415,16 @@ ipmi_user_set_password(
/* The channel number will remain constant throughout this function */
msg_data[0] = user_id;
if (is_twenty_byte_password)
msg_data[0] |= 0x80;
msg_data[1] = operation;
memset(msg_data + 2, 0, password_length);
if (password != NULL)
strncpy(msg_data + 2, password, password_length);
strncpy((char *)(msg_data + 2), password, password_length);
rsp = intf->sendrecv(intf, &req);
@ -490,7 +481,6 @@ ipmi_user_test_password(
return ((ret == 0) ? 0 : -1);
}
/*
* print_user_usage
@ -504,7 +494,7 @@ print_user_usage(void)
lprintf(LOG_NOTICE, " set password <user id> [<password>]");
lprintf(LOG_NOTICE, " disable <user id>");
lprintf(LOG_NOTICE, " enable <user id>");
lprintf(LOG_NOTICE, " priv <user id> <privile level> [<channel number>]");
lprintf(LOG_NOTICE, " priv <user id> <privilege level> [<channel number>]");
lprintf(LOG_NOTICE, " test <user id> <16|20> [<password]>\n");
}
@ -551,7 +541,7 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
channel = (uint8_t)strtol(argv[1], NULL, 0);
else
{
print_user_usage();
print_user_usage();
return -1;
}
@ -572,7 +562,7 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
channel = (uint8_t)strtol(argv[1], NULL, 0);
else
{
print_user_usage();
print_user_usage();
return -1;
}
@ -594,8 +584,8 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
char * password = NULL;
int password_length = atoi(argv[2]);
uint8_t user_id = (uint8_t)strtol(argv[1],
NULL,
0);
NULL,
0);
if (user_id == 0)
{
lprintf(LOG_ERR, "Invalid user ID: %d", user_id);
@ -610,7 +600,6 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
char * tmp;
const char * password_prompt =
ipmi_user_build_password_prompt(user_id);
#ifdef HAVE_GETPASSPHRASE
tmp = getpassphrase (password_prompt);
#else
@ -641,7 +630,6 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
}
}
/*
* Set
*/
@ -651,12 +639,12 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
* Set Password
*/
if ((argc >= 3) &&
(strncmp("password", argv[1], 8) == 0))
(strncmp("password", argv[1], 8) == 0))
{
char * password = NULL;
uint8_t user_id = (uint8_t)strtol(argv[2],
NULL,
0);
NULL,
0);
if (user_id == 0)
{
lprintf(LOG_ERR, "Invalid user ID: %d", user_id);
@ -713,7 +701,6 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_ERR, "Password is too long (> 20 bytes)");
return -1;
}
retval = ipmi_user_set_password(intf,
user_id,
@ -721,7 +708,6 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
password,
strlen(password) > 16);
}
/*
* Set Name
@ -737,8 +723,8 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
retval = ipmi_user_set_username(intf,
(uint8_t)strtol(argv[2],
NULL,
0),
NULL,
0),
argv[3]);
}
else
@ -746,40 +732,38 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
print_user_usage();
return -1;
}
}
}
else if (strncmp(argv[0], "priv", 4) == 0)
{
uint8_t user_id;
uint8_t priv_level;
uint8_t channel = 0x0e; /* Use channel running on */
if (
(argc != 3) &&
(argc != 4)
)
if (argc == 4)
{
channel = (uint8_t)strtol(argv[3], NULL, 0);
channel = (channel & 0x0f);
}
user_id = (uint8_t)strtol(argv[1], NULL, 0);
priv_level = (uint8_t)strtol(argv[2], NULL, 0);
priv_level = (priv_level & 0x0f);
if (user_id == 0)
{
lprintf(LOG_ERR, "Invalid user ID: %d", user_id);
{
uint8_t user_id;
uint8_t priv_level;
uint8_t channel = 0x0e; /* Use channel running on */
if (argc != 3 && argc != 4)
{
print_user_usage();
return -1;
}
if (argc == 4)
{
channel = (uint8_t)strtol(argv[3], NULL, 0);
channel = (channel & 0x0f);
}
user_id = (uint8_t)strtol(argv[1], NULL, 0);
priv_level = (uint8_t)strtol(argv[2], NULL, 0);
priv_level = (priv_level & 0x0f);
if (user_id == 0)
{
lprintf(LOG_ERR, "Invalid user ID: %d", user_id);
return -1;
}
retval = ipmi_user_set_userpriv(intf,channel,user_id,priv_level);
}
retval = ipmi_user_set_userpriv(intf,channel,user_id,priv_level);
}
/*
* Disable / Enable
@ -800,8 +784,8 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
}
user_id = (uint8_t)strtol(argv[1],
NULL,
0);
NULL,
0);
if (user_id == 0)
{
lprintf(LOG_ERR, "Invalid user ID: %d", user_id);
@ -818,11 +802,10 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
null_password,
0); /* This field is ignored */
}
else
{
retval = -1;
lprintf(LOG_ERR, "Invalid user command: '%s'\n", argv[0]);
print_user_usage();
}

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <unistd.h>
@ -74,7 +70,7 @@ void lprintf(int level, const char * format, ...)
if (logpriv->daemon)
syslog(level, "%s", logmsg);
else
fprintf(stderr, "%s\n", logmsg);
fprintf(stderr, "%s\r\n", logmsg);
return;
}
@ -96,7 +92,7 @@ void lperror(int level, const char * format, ...)
if (logpriv->daemon)
syslog(level, "%s: %s", logmsg, strerror(errno));
else
fprintf(stderr, "%s: %s\n", logmsg, strerror(errno));
fprintf(stderr, "%s: %s\r\n", logmsg, strerror(errno));
return;
}
@ -118,7 +114,7 @@ void log_init(const char * name, int isdaemon, int verbose)
logpriv->name = strdup(LOG_NAME_DEFAULT);
if (logpriv->name == NULL)
fprintf(stderr, "ipmitool: malloc failure\n");
fprintf(stderr, "ipmitool: malloc failure\r\n");
logpriv->daemon = isdaemon;
logpriv->level = verbose + LOG_NOTICE;

View File

@ -27,10 +27,6 @@
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# You acknowledge that this software is not designed or intended for use
# in the design, construction, operation or maintenance of any nuclear
# facility.
INCLUDES = -I$(top_srcdir)/include
SUBDIRS = plugins

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <stdio.h>
@ -44,23 +40,30 @@
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>
#ifdef __FreeBSD__
# include <signal.h>
# include <paths.h>
#if defined(HAVE_CONFIG_H)
# include <config.h>
#endif
#include <config.h>
#ifdef HAVE_PATHS_H
# include <paths.h>
#else
# define _PATH_VARRUN "/var/run/"
#endif
#ifdef IPMI_INTF_OPEN
# ifdef HAVE_OPENIPMI_H
# include <linux/compiler.h>
# if defined(HAVE_OPENIPMI_H)
# if defined(HAVE_LINUX_COMPILER_H)
# include <linux/compiler.h>
# endif
# include <linux/ipmi.h>
# include <sys/poll.h>
# else /* HAVE_OPENIPMI_H */
# elif defined(HAVE_FREEBSD_IPMI_H)
# include <sys/ipmi.h>
# else
# include "plugins/open/open.h"
# endif
# include <sys/poll.h>
# endif /* HAVE_OPENIPMI_H */
#endif /* IPMI_INTF_OPEN */
#include <ipmitool/helper.h>
@ -72,6 +75,9 @@
#include <ipmitool/ipmi_strings.h>
#include <ipmitool/ipmi_main.h>
#define DEFAULT_PIDFILE _PATH_VARRUN "ipmievd.pid"
char pidfile[64];
/* global variables */
int verbose = 0;
int csv_output = 0;
@ -83,6 +89,7 @@ int selwatch_timeout = 10; /* default to 10 seconds */
struct ipmi_event_intf {
char name[16];
char desc[128];
char prefix[72];
int (*setup)(struct ipmi_event_intf * eintf);
int (*wait)(struct ipmi_event_intf * eintf);
int (*read)(struct ipmi_event_intf * eintf);
@ -101,6 +108,7 @@ static int openipmi_read(struct ipmi_event_intf * eintf);
static struct ipmi_event_intf openipmi_event_intf = {
name: "open",
desc: "OpenIPMI asyncronous notification of events",
prefix: "",
setup: openipmi_setup,
wait: openipmi_wait,
read: openipmi_read,
@ -189,27 +197,34 @@ log_event(struct ipmi_event_intf * eintf, struct sel_event_record * evt)
return;
if (evt->record_type == 0xf0) {
lprintf(LOG_ALERT, "Linux kernel panic: %.11s", (char *) evt + 5);
lprintf(LOG_ALERT, "%sLinux kernel panic: %.11s",
eintf->prefix, (char *) evt + 5);
return;
}
else if (evt->record_type >= 0xc0) {
lprintf(LOG_NOTICE, "IPMI Event OEM Record %02x", evt->record_type);
lprintf(LOG_NOTICE, "%sIPMI Event OEM Record %02x",
eintf->prefix, evt->record_type);
return;
}
type = ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type, evt->sel_type.standard_type.event_data[0]);
type = ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type,
evt->sel_type.standard_type.event_data[0]);
ipmi_get_event_desc(intf, evt, &desc);
sdr = ipmi_sdr_find_sdr_bynumtype(intf, evt->sel_type.standard_type.sensor_num, evt->sel_type.standard_type.sensor_type);
sdr = ipmi_sdr_find_sdr_bynumtype(intf, evt->sel_type.standard_type.sensor_num,
evt->sel_type.standard_type.sensor_type);
if (sdr == NULL) {
/* could not find matching SDR record */
if (desc) {
lprintf(LOG_NOTICE, "%s sensor - %s",
type, desc);
lprintf(LOG_NOTICE, "%s%s sensor - %s",
eintf->prefix, type, desc);
free(desc);
} else {
lprintf(LOG_NOTICE, "%s sensor %02x",
type, evt->sel_type.standard_type.sensor_num);
lprintf(LOG_NOTICE, "%s%s sensor %02x",
eintf->prefix, type,
evt->sel_type.standard_type.sensor_num);
}
return;
}
@ -233,7 +248,8 @@ log_event(struct ipmi_event_intf * eintf, struct sel_event_record * evt)
sdr->record.full, evt->sel_type.standard_type.event_data[2]);
}
lprintf(LOG_NOTICE, "%s sensor %s %s (Reading %.*f %s Threshold %.*f %s)",
lprintf(LOG_NOTICE, "%s%s sensor %s %s (Reading %.*f %s Threshold %.*f %s)",
eintf->prefix,
type,
sdr->record.full->id_string,
desc ? : "",
@ -251,8 +267,8 @@ log_event(struct ipmi_event_intf * eintf, struct sel_event_record * evt)
/*
* Discrete Event
*/
lprintf(LOG_NOTICE, "%s sensor %s %s",
type, sdr->record.full->id_string, desc ? : "");
lprintf(LOG_NOTICE, "%s%s sensor %s %s",
eintf->prefix, type, sdr->record.full->id_string, desc ? : "");
if (((evt->sel_type.standard_type.event_data[0] >> 6) & 3) == 1) {
/* previous state and/or severity in event data byte 2 */
}
@ -261,26 +277,29 @@ log_event(struct ipmi_event_intf * eintf, struct sel_event_record * evt)
/*
* OEM Event
*/
lprintf(LOG_NOTICE, "%s sensor %s %s",
type, sdr->record.full->id_string, desc ? : "");
lprintf(LOG_NOTICE, "%s%s sensor %s %s",
eintf->prefix, type, sdr->record.full->id_string, desc ? : "");
}
break;
case SDR_RECORD_TYPE_COMPACT_SENSOR:
if (evt->sel_type.standard_type.event_type == 0x6f) {
lprintf(LOG_NOTICE, "%s sensor %s - %s %s",
lprintf(LOG_NOTICE, "%s%s sensor %s - %s %s",
eintf->prefix,
type, sdr->record.compact->id_string,
desc ? : "",
evt->sel_type.standard_type.event_dir ? "Deasserted" : "Asserted");
} else {
lprintf(LOG_NOTICE, "%s sensor %s - %s",
type, sdr->record.compact->id_string, desc ? : "");
lprintf(LOG_NOTICE, "%s%s sensor %s - %s",
eintf->prefix, type,
sdr->record.compact->id_string, desc ? : "");
}
break;
default:
lprintf(LOG_NOTICE, "%s sensor - %s",
type, evt->sel_type.standard_type.sensor_num, desc ? : "");
lprintf(LOG_NOTICE, "%s%s sensor - %s",
eintf->prefix, type,
evt->sel_type.standard_type.sensor_num, desc ? : "");
break;
}
@ -371,7 +390,7 @@ openipmi_read(struct ipmi_event_intf * eintf)
uint8_t data[80];
int rv;
recv.addr = (char *) &addr;
recv.addr = (unsigned char *) &addr;
recv.addr_len = sizeof(addr);
recv.msg.data = data;
recv.msg.data_len = sizeof(data);
@ -584,11 +603,29 @@ selwatch_wait(struct ipmi_event_intf * eintf)
}
/*************************************************************************/
static void
ipmievd_cleanup(int signal)
{
struct stat st1;
if (lstat(pidfile, &st1) == 0) {
/* cleanup daemon pidfile */
(void)unlink(pidfile);
}
exit(EXIT_SUCCESS);
}
int
ipmievd_main(struct ipmi_event_intf * eintf, int argc, char ** argv)
{
int i, rc;
int daemon = 1;
struct sigaction act;
memset(pidfile, 0, 64);
sprintf(pidfile, "%s%d", DEFAULT_PIDFILE, eintf->intf->devnum);
lprintf(LOG_NOTICE, "ipmievd: using pidfile %s", pidfile);
for (i = 0; i < argc; i++) {
if (strncasecmp(argv[i], "help", 4) == 0) {
@ -612,10 +649,50 @@ ipmievd_main(struct ipmi_event_intf * eintf, int argc, char ** argv)
else if (strncasecmp(argv[i], "timeout=", 8) == 0) {
selwatch_timeout = strtoul(argv[i]+8, NULL, 0);
}
else if (strncasecmp(argv[i], "pidfile=", 8) == 0) {
memset(pidfile, 0, 64);
strncpy(pidfile, argv[i]+8,
__min(strlen((const char *)(argv[i]+8)), 63));
}
}
if (daemon)
ipmi_start_daemon();
/*
* We need to open interface before forking daemon
* so error messages are not lost to syslog and
* return code is successfully returned to initscript
*/
if (eintf->intf->open(eintf->intf) < 0) {
lprintf(LOG_ERR, "Unable to open interface");
return -1;
}
if (daemon) {
FILE *fp;
struct stat st1;
ipmi_start_daemon(eintf->intf);
if (lstat(pidfile, &st1) == 0) {
/* already exists, erase first */
if (unlink(pidfile) != 0) {
lprintf(LOG_WARN, "Unable to erase pidfile");
}
}
fp = ipmi_open_file_write(pidfile);
if (fp != NULL) {
fprintf(fp, "%d\n", (int)getpid());
fclose(fp);
}
}
/* register signal handler for cleanup */
act.sa_handler = ipmievd_cleanup;
act.sa_flags = 0;
sigemptyset(&act.sa_mask);
sigaction(SIGINT, &act, NULL);
sigaction(SIGQUIT, &act, NULL);
sigaction(SIGTERM, &act, NULL);
log_halt();
log_init("ipmievd", daemon, verbose);
@ -626,6 +703,7 @@ ipmievd_main(struct ipmi_event_intf * eintf, int argc, char ** argv)
lprintf(LOG_DEBUG, "Sensors cached");
/* call event handler setup routine */
if (eintf->setup != NULL) {
rc = eintf->setup(eintf);
if (rc < 0) {
@ -661,6 +739,12 @@ ipmievd_sel_main(struct ipmi_intf * intf, int argc, char ** argv)
eintf->intf = intf;
if (intf->session != NULL) {
snprintf(eintf->prefix,
strlen((const char *)intf->session->hostname) + 3,
"%s: ", intf->session->hostname);
}
return ipmievd_main(eintf, argc, argv);
}

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <stdio.h>
@ -52,14 +48,19 @@
# include <config.h>
#endif
#define EXEC_BUF_SIZE 1024
#define EXEC_ARG_SIZE 32
#define EXEC_BUF_SIZE 2048
#define EXEC_ARG_SIZE 64
extern const struct valstr ipmi_privlvl_vals[];
extern const struct valstr ipmi_authtype_session_vals[];
#ifdef HAVE_READLINE
/* avoid warnings errors due to non-ANSI type declarations in readline.h */
#define _FUNCTION_DEF
#define USE_VARARGS
#define PREFER_STDARG
#include <readline/readline.h>
#include <readline/history.h>
#define RL_PROMPT "ipmitool> "
@ -96,7 +97,7 @@ static int rl_event_keepalive(void)
int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
{
char *ptr, *pbuf, **ap, *__argv[20];
char *ptr, *pbuf, **ap, *__argv[EXEC_ARG_SIZE];
int __argc, rc=0;
rl_readline_name = "ipmitool";
@ -111,7 +112,7 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
shell_intf = intf;
rl_event_hook = rl_event_keepalive;
#if defined(RL_READLINE_VERSION) && RL_READLINE_VERSION >= 0x0402
/* There is a bug in readline 4.2 and later (at least on FreeBSD):
/* There is a bug in readline 4.2 and later (at least on FreeBSD and NetBSD):
* timeout equal or greater than 1 second causes an infinite loop. */
rl_set_keyboard_input_timeout(1000 * 1000 - 1);
#endif
@ -136,14 +137,14 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
/* for the all-important up arrow :) */
add_history(pbuf);
/* change "" and '' with spaces in the middle to ~ */
ptr = pbuf;
while (*ptr != '\0') {
if (*ptr == '"') {
ptr++;
while (*ptr != '"') {
if (isspace(*ptr))
if (isspace((int)*ptr))
*ptr = '~';
ptr++;
}
@ -151,7 +152,7 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
if (*ptr == '\'') {
ptr++;
while (*ptr != '\'') {
if (isspace(*ptr))
if (isspace((int)*ptr))
*ptr = '~';
ptr++;
}
@ -188,7 +189,7 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
}
if (**ap != '\0') {
if (++ap >= &__argv[20])
if (++ap >= &__argv[EXEC_ARG_SIZE])
break;
}
}
@ -200,7 +201,8 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
&(__argv[1]));
free(pbuf);
}
}
printf("\n");
return rc;
}
@ -223,6 +225,8 @@ int ipmi_echo_main(struct ipmi_intf * intf, int argc, char ** argv)
printf("%s ", argv[i]);
}
printf("\n");
return 0;
}
static void
@ -359,7 +363,7 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv)
if (*ptr == '"') {
ptr++;
while (*ptr != '"') {
if (isspace(*ptr))
if (isspace((int)*ptr))
*ptr = '~';
ptr++;
}
@ -367,7 +371,7 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv)
if (*ptr == '\'') {
ptr++;
while (*ptr != '\'') {
if (isspace(*ptr))
if (isspace((int)*ptr))
*ptr = '~';
ptr++;
}
@ -377,10 +381,10 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv)
/* clip off trailing and leading whitespace */
ptr--;
while (isspace(*ptr) && ptr >= buf)
while (isspace((int)*ptr) && ptr >= buf)
*ptr-- = '\0';
ptr = buf;
while (isspace(*ptr))
while (isspace((int)*ptr))
ptr++;
if (strlen(ptr) == 0)
continue;
@ -433,4 +437,3 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv)
fclose(fp);
return rc;
}

View File

@ -31,10 +31,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <ipmitool/ipmi.h>
@ -61,6 +57,9 @@
#include <ipmitool/ipmi_sunoem.h>
#include <ipmitool/ipmi_fwum.h>
#include <ipmitool/ipmi_picmg.h>
#include <ipmitool/ipmi_kontronoem.h>
#include <ipmitool/ipmi_firewall.h>
#include <ipmitool/ipmi_hpmfwupg.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
@ -80,6 +79,7 @@ int verbose = 0;
struct ipmi_cmd ipmitool_cmd_list[] = {
{ ipmi_raw_main, "raw", "Send a RAW IPMI request and print response" },
{ ipmi_rawi2c_main, "i2c", "Send an I2C Master Write-Read command and print response" },
{ ipmi_rawspd_main, "spd", "Print SPD info from remote I2C device" },
{ ipmi_lanp_main, "lan", "Configure LAN Channels" },
{ ipmi_chassis_main, "chassis", "Get chassis status and set power state" },
{ ipmi_power_main, "power", "Shortcut to chassis power commands" },
@ -98,14 +98,17 @@ struct ipmi_cmd ipmitool_cmd_list[] = {
{ ipmi_channel_main, "channel", "Configure Management Controller channels" },
{ ipmi_session_main, "session", "Print session information" },
{ ipmi_sunoem_main, "sunoem", "OEM Commands for Sun servers" },
{ ipmi_kontronoem_main, "kontronoem", "OEM Commands for Kontron devices"},
{ ipmi_picmg_main, "picmg", "Run a PICMG/ATCA extended cmd"},
{ ipmi_fwum_main, "fwum", "Update IPMC using Kontron OEM Firmware Update Manager" },
{ ipmi_firewall_main,"firewall","Configure Firmware Firewall" },
#ifdef HAVE_READLINE
{ ipmi_shell_main, "shell", "Launch interactive IPMI shell" },
#endif
{ ipmi_exec_main, "exec", "Run list of commands from file" },
{ ipmi_set_main, "set", "Set runtime variable for shell and exec" },
{ ipmi_echo_main, "echo", NULL }, /* for echoing lines to stdout in scripts */
{ ipmi_hpmfwupg_main,"hpm", "Update HPM components using PICMG HPM.1 file"},
{ NULL },
};

View File

@ -27,17 +27,13 @@
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# You acknowledge that this software is not designed or intended for use
# in the design, construction, operation or maintenance of any nuclear
# facility.
MAINTAINERCLEANFILES = Makefile.in
INCLUDES = -I$(top_srcdir)/include
SUBDIRS = @INTF_LAN@ @INTF_LANPLUS@ @INTF_OPEN@ @INTF_LIPMI@ @INTF_IMB@ @INTF_BMC@
DIST_SUBDIRS = lan lanplus open lipmi imb bmc
SUBDIRS = @INTF_LAN@ @INTF_LANPLUS@ @INTF_OPEN@ @INTF_LIPMI@ @INTF_IMB@ @INTF_BMC@ @INTF_FREE@
DIST_SUBDIRS = lan lanplus open lipmi imb bmc free
noinst_LTLIBRARIES = libintf.la
libintf_la_SOURCES = ipmi_intf.c

View File

@ -27,10 +27,6 @@
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# You acknowledge that this software is not designed or intended for use
# in the design, construction, operation or maintenance of any nuclear
# facility.
MAINTAINERCLEANFILES = Makefile.in

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef _IPMI_BMC_H_

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef _BMC_INTF_H

View File

@ -0,0 +1,9 @@
MAINTAINERCLEANFILES = Makefile.in
INCLUDES = -I$(top_srcdir)/include
EXTRA_LTLIBRARIES = libintf_free.la
noinst_LTLIBRARIES = @INTF_FREE_LIB@
libintf_free_la_LIBADD = $(top_builddir)/lib/libipmitool.la
libintf_free_la_SOURCES = free.c
libintf_free_la_LDFLAGS = -lfreeipmi

View File

@ -0,0 +1,157 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_intf.h>
#include <freeipmi/freeipmi.h>
#include <freeipmi/udm/ipmi-udm.h>
#include <config.h>
ipmi_device_t dev = NULL;
extern int verbose;
static int ipmi_free_open(struct ipmi_intf * intf)
{
if (getuid() != 0) {
fprintf(stderr, "Permission denied, must be root\n");
return -1;
}
if (!(dev = ipmi_open_inband (IPMI_DEVICE_KCS,
0,
0,
0,
NULL,
IPMI_FLAGS_DEFAULT))) {
if (!(dev = ipmi_open_inband (IPMI_DEVICE_SSIF,
0,
0,
0,
NULL,
IPMI_FLAGS_DEFAULT))) {
perror("ipmi_open_inband()");
goto cleanup;
}
}
intf->opened = 1;
return 0;
cleanup:
if (dev)
ipmi_close_device(dev);
return -1;
}
static void ipmi_free_close(struct ipmi_intf * intf)
{
if (dev)
ipmi_close_device(dev);
intf->opened = 0;
}
static struct ipmi_rs * ipmi_free_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
{
u_int8_t lun = 0;
u_int8_t cmd = req->msg.cmd;
u_int8_t netfn = req->msg.netfn;
u_int8_t rq_buf[IPMI_BUF_SIZE];
u_int8_t rs_buf[IPMI_BUF_SIZE];
u_int32_t rs_buf_len = IPMI_BUF_SIZE;
int32_t rs_len;
static struct ipmi_rs rsp;
/* achu: FreeIPMI requests have the cmd as the first byte of
* the data. Responses have cmd as the first byte and
* completion code as the second byte. This differs from some
* other APIs, so it must be compensated for within the ipmitool
* interface.
*/
if (!intf || !req)
return NULL;
if (!intf->opened && intf->open && intf->open(intf) < 0)
return NULL;
if (req->msg.data_len > IPMI_BUF_SIZE)
return NULL;
memset(rq_buf, '\0', IPMI_BUF_SIZE);
memset(rs_buf, '\0', IPMI_BUF_SIZE);
memcpy(rq_buf, &cmd, 1);
if (req->msg.data)
memcpy(rq_buf + 1, req->msg.data, req->msg.data_len);
if ((rs_len = ipmi_cmd_raw(dev,
lun,
netfn,
rq_buf,
req->msg.data_len + 1,
rs_buf,
rs_buf_len)) < 0) {
perror("ipmi_cmd_raw");
return NULL;
}
memset(&rsp, 0, sizeof(struct ipmi_rs));
rsp.ccode = (unsigned char)rs_buf[1];
rsp.data_len = (int)rs_len - 2;
if (!rsp.ccode && rsp.data_len)
memcpy(rsp.data, rs_buf + 2, rsp.data_len);
return &rsp;
}
struct ipmi_intf ipmi_free_intf = {
name: "free",
desc: "FreeIPMI IPMI Interface",
open: ipmi_free_open,
close: ipmi_free_close,
sendrecv: ipmi_free_send_cmd,
target_addr: IPMI_BMC_SLAVE_ADDR,
};

View File

@ -27,10 +27,6 @@
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# You acknowledge that this software is not designed or intended for use
# in the design, construction, operation or maintenance of any nuclear
# facility.
MAINTAINERCLEANFILES = Makefile.in

View File

@ -28,10 +28,6 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <stdio.h>

View File

@ -28,17 +28,14 @@
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <config.h>
#if defined(HAVE_CONFIG_H)
# include <config.h>
#endif
#include <ipmitool/ipmi_intf.h>
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_sdr.h>
@ -62,6 +59,9 @@ extern struct ipmi_intf ipmi_lan_intf;
#ifdef IPMI_INTF_LANPLUS
extern struct ipmi_intf ipmi_lanplus_intf;
#endif
#ifdef IPMI_INTF_FREE
extern struct ipmi_intf ipmi_free_intf;
#endif
struct ipmi_intf * ipmi_intf_table[] = {
#ifdef IPMI_INTF_OPEN
@ -81,6 +81,9 @@ struct ipmi_intf * ipmi_intf_table[] = {
#endif
#ifdef IPMI_INTF_LANPLUS
&ipmi_lanplus_intf,
#endif
#ifdef IPMI_INTF_FREE
&ipmi_free_intf,
#endif
NULL
};
@ -215,6 +218,15 @@ ipmi_intf_session_set_privlvl(struct ipmi_intf * intf, uint8_t level)
intf->session->privlvl = level;
}
void
ipmi_intf_session_set_lookupbit(struct ipmi_intf * intf, uint8_t lookupbit)
{
if (intf->session == NULL)
return;
intf->session->v2_data.lookupbit = lookupbit;
}
void
ipmi_intf_session_set_cipher_suite_id(struct ipmi_intf * intf, uint8_t cipher_suite_id)
{
@ -263,6 +275,12 @@ ipmi_intf_session_set_authtype(struct ipmi_intf * intf, uint8_t authtype)
if (intf->session == NULL)
return;
/* clear password field if authtype NONE specified */
if (authtype == IPMI_SESSION_AUTHTYPE_NONE) {
memset(intf->session->authcode, 0, IPMI_AUTHCODE_BUFFER_SIZE);
intf->session->password = 0;
}
intf->session->authtype_set = authtype;
}

View File

@ -27,10 +27,6 @@
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# You acknowledge that this software is not designed or intended for use
# in the design, construction, operation or maintenance of any nuclear
# facility.
MAINTAINERCLEANFILES = Makefile.in

Some files were not shown because too many files have changed in this diff Show More