Compare commits

..

1501 Commits

Author SHA1 Message Date
ef92ab51e3 man: Add documentation for chassis bootmbox
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-06-10 12:27:48 +03:00
994d47b415 man: Update the chassis bootparam section
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-06-10 12:27:47 +03:00
90131f19fa chassis: Add boot initiator mailbox support
Add `chassis bootmbox` command to set and get Boot Initiator Mailbox
boot parameter (id 7) the easy way. The command allows for getting
and setting the data both in hex and text modes, as well as properly
decodes IANA Enterprise number for block 0. It can get/set the whole
mailbox at once or operate on separate data blocks.

This commit enhances the chassis_get_boot_param() function with extra
arguments to re-use its code in handling of the added command.

Documentation update will follow.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-06-10 12:27:47 +03:00
9bc1143e96 chassis: Use command-specific completion code parser
Get/set system boot option commands have some command-specific
completion codes that are now reported as "Unknown (0080)", etc.

Use the previously introduced specific_val2str() to convert those
specific error codes to human-readable strings.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-06-04 12:18:23 +03:00
69a44963d0 Add support for command-specific completion codes
Some commands may return command-specific completion codes.
Now they are all reported as 'Unknown'.
Add helper functions to support such command-specific codes.
Command handlers will need to define their own valstr arrays
with completion code descriptions and then use specific_val2str()
instead of generic val2str() to convert the completion code into
a string.

Also reduce code duplication in helper.c

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-06-04 12:18:23 +03:00
ca3a80fef8 Add a helper htoipmi24() function
The function converts a host 32-bit integer into an IPMI
24-bit value (LSB first).

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-06-04 12:18:23 +03:00
80350a744f Add a helper args2buf() function
The function converts a set of command line arguments representing
byte values into a byte buffer and verifies each individual value
to be a valid data byte.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-06-04 12:18:23 +03:00
619a02cf5d man: Cleanup the manpage formatting tags
The manpage contained a lot of redundant .RS/.RE tag pairs
with no content between the tags. This commits removes those.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-06-04 12:17:44 +03:00
e65a96b38d create_pen_list: only print if values are set
On a failed download of the PEN list, the create_pen_list script
improperly printed an invalid entry of { , "" } causing the build to
fail. The last line print must check that it has something to print or
it will print the wrong thing.

Partially resolves ipmitool/ipmitool#11

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
2019-05-29 15:56:11 +03:00
9fa01f1a54 chassis: Refactor to reduce code duplication
Move boot information acknowledgement clearing code into
a helper funcion, call it instead of copy-pasted code.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-05-28 16:54:52 +03:00
432ea31804 chassis: Refactor to reduce code duplication
Get rid of repeated code that sets the set-in-progress parameter.
Introduce chassis_bootparam_set_in_progress() function to do
the job.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-05-28 14:49:43 +03:00
12e2f5da63 sdr: Fix segfault on invalid unit types
The program would crash if the BMC returned an out of range (>90)
unit type for a full sensor record. This commit adds a range check
and also add support for IPMI 2.0 additional unit types 91 and 92
("fatal error" and "grams").

Resolves ipmitool/ipmitool#118

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-05-27 15:38:23 +03:00
d818c2ff85 vendor: Add YADRO TATLIN Storage Controller ID
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-04-17 16:01:11 +03:00
cdd9d51c5f exchange-bmc-os-info: Remove dependency on ipmi.service
Resolves ipmitool/ipmitool#46

Most modern systems do not require ipmi.service to load the kernel
modules. Checking for /dev/ipmi* would be sufficient.

v2: Use Assert in place of Condition to explicitly fail based on
   AlexanderAmelkin's feedback.
Signed-off-by: Charles Rose <charles.rose@dell.com>
2019-04-16 11:41:51 +03:00
95038ba01b Add mechanism to configure to set the default interface
In some cases, the user may want to have a different default interface
without the need to always specify it on the command line. Add a
configure option that sets the default interface without the need to
patch the code.

Configure as: ./configure DEFAULT_INTF=name
where name is an interface name that might be enabled with
--enable-intf-<name>.

The configure will enforce that the selected default interface is
enabled.

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
2019-04-16 11:31:18 +03:00
b0d84e0f15 ci: Update INSTALL to reflect recent changes
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-04-15 20:50:17 +03:00
1b636434a6 ci: Set up matrix builds with Travis CI
Enable CI building for Xenial and Trusty,
as well as for MacOS X 10.14 (Xcode 10.2).

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-04-15 20:50:17 +03:00
400622760f Enable Travis build of D-Bus interface
By default the D-Bus interface is not enabled, so in order to get it to
build in Travis, it must be enabled explicitly. This installs the
packages needed and sets the configure flag.

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
2019-04-15 18:41:47 +03:00
b7b455a38c add OpenBMC D-Bus interface
OpenBMC runs a D-Bus interface internally and has the option of
compiling ipmitool so it can run natively on the BMC. This adds the
D-Bus interface to ipmitool so it can be used with the OpenBMC project.

Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
2019-04-15 18:41:47 +03:00
fa8e2ced19 Fix "ipmitool pef {status,info}" not printing final newline
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
2019-04-01 18:00:31 +03:00
55ec2df41f Remove unused include
The endian.h header is not used for anything and was earlier
added by mistake. It however hampers building on some systems
where it doesn't exist.

Resolves ipmitool/ipmitool#101
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-03-04 12:22:23 +03:00
48f4fba39a Fix IPMI DCMI message typo
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
2019-02-21 13:58:18 +03:00
df076b9547 open: swap free() calls for free_n()
Swap calls to free() with calls to free_n() to leverage helper method
and handle clearing pointers after freeing in one step.

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-20 18:29:09 +03:00
51634fd77c open: checking received msg id against expectation
Check the received IPMI response message id against
the id expected given the IPMI request.  They need to
match.  It is possible that request A times out,
request B is sent, and then request A responds to the
request B.  The value for request B may be behind it
in the queue.

Note: This may only be possible if the file is kept
open between multiple IPMI messages (a common
occurrence).

Resolves: #82

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-20 18:29:09 +03:00
3bfa1da201 open: fix whitespace
Apply whitespace fixes via clang-format-6.0 to src/plugins/open/open.c
to cleanup spaces and fixup line lengths, etc.

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-20 18:29:09 +03:00
08348f1b72 Refactor free_n() function
Make the argument to free_n() compatible with any pointers,
thus reducing the number of compilation warnings.

End-user-impact: None
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2019-02-20 14:56:37 +03:00
a8b3b6282b fru: swap free() calls for free_n()
Swap calls to free() with calls to free_n() to leverage helper method
and handle clearing pointers after freeing in one step.

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-13 21:28:14 +03:00
eb5f26060a fru: Fix write chunk reduction code
Check against FRU_AREA_MAXIMUM_BLOCK_SZ instead of FRU_BLOCK_SZ
when checking if the write chunk needs to be reduced.
Apparently, that was the original intention, and then there
was just a typo. In other places the same check is done properly.

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-13 21:28:14 +03:00
feecd2bbf4 fru: add macro FRU_AREA macros
Use two macros defining the FRU block sizes instead of hard-coded magic
values.

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-13 21:28:14 +03:00
be3d57c013 fru: replace magic return codes with macros
Use the return code macros instead of magic numbers.

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-13 21:28:14 +03:00
f64044a3de fru header: add return error codes specific to fru
Add two special return codes specific to the IPMI
FRU commands.

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-13 21:28:14 +03:00
3737b035e8 fru: fix ipmi_fru_picmg_ext_edit as bool
Fix ipmi_fru_picmg_ext_edit to use bools instead
of an int treated as a boolean.

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-13 21:28:14 +03:00
6b003c3852 fru: use bool with ipmi_fru_oemkontron_edit
Convert ipmi_fru_oemkontron_edit to return a bool
type instead of an int used as a bool.

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-13 21:28:14 +03:00
8991f5a9a0 fru: change ipmi_fru_query_new_value to return bool
Change ipmi_fru_query_new_value to return the bool type
instead of an int that's being used as a boolean value.

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-13 21:28:14 +03:00
49384e47be fru: mark ipmi_fru_query_new_value as static
Mark ipmi_fru_query_new_value as static as it's only
used internally in this object.

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-13 21:28:14 +03:00
6dcb168442 fru: add fru_cc_rq2big helper method for code checks
Add fru_cc_rq2big helper method to reduce duplicate
code checking for specific size-based IPMI response
codes.

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-13 21:28:14 +03:00
1c4a00d26b fru: cleanup ipmi_fru_upg_ekeying
Cleanup ipmi_fru_upg_ekeying such that it exits from
one place that handles cleanup.

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-13 21:28:14 +03:00
aef8a1ccb4 fru: use ipmi_cc defined maros for return codes
Use the macros defined in ipmi_cc for IPMI return
codes instead of magic numbers.

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-13 21:28:14 +03:00
81761e6f60 fru: drop extraneous parentheses on negative returns
Drop extraneous parentheses when returning a
negative value.

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-13 21:28:14 +03:00
715c7b8a1f fru: delete unused variable matchInstance
Delete unused variable matchInstance.  The variable is repeatedly
assigned, but nothing reads it.

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-13 21:28:14 +03:00
92ee477cde fru: cleanup ipmi_fru_oemkontron_get
Cleanup style in method ipmi_fru_oemkontron_get as well as add inverted
logic checks to reduce indentation.

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-13 21:28:14 +03:00
6d515dd06b fru: fixup array bounds checking
Fixup the following array bounds checking bugs:
[lib/ipmi_fru.c:1003]: (style) Array index 'i' is
used before limits check.
[lib/ipmi_fru.c:1127]: (style) Array index 'i' is
used before limits check.
[lib/ipmi_fru.c:1262]: (style) Array index 'i' is
used before limits check.

Signed-off-by: Patrick Venture <venture@google.com>
2019-02-13 21:28:14 +03:00
7941806a9b hpm: Adhere to centralized exiting
Replace `return`s with `goto`s to appropriate labels
(with or without closing the file).
2019-01-24 15:22:21 +03:00
4631d3f942 hpm: Minor refactoring
Remove an `if()` with a condition that is always true.
Merge two calls to time() into one.
2019-01-24 15:22:21 +03:00
272d9d0d9b hpm: Fix resource leak
fclose(pImageFile) was missing before returning from
HpmfwupgGetBufferFromFile()
2019-01-24 15:22:21 +03:00
0ca9c66b84 sol: Make interface timeout obey the -N option
For `sol activate` the timeout on lanplus interface was hard-coded
to 1 second, overriding the value set with the `-N` option.

Resolves ipmitool/ipmitool#87

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-12-28 16:33:18 +03:00
8b6d127bb1 helper: add free_n method to handle clearing pointers
free_n() will free the memory and clear the pointer, which will reduce
the probability a developer will forget to clear the pointer after
freeing.

Resolves: #79

Signed-off-by: Patrick Venture <venture@google.com>
2018-12-24 19:17:48 +03:00
34fc86bd75 cygwin: imb: Fix build error (wchar_t)
For Win32/Cygwin, the imb plugin was failing to build with
the following message:

imbapi.h:140:9: error: unknown type name 'wchar_t'
 typedef wchar_t      WCHAR;

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
2018-12-07 18:46:55 +03:00
9ec2232321 lanplus: Fix segfault for truncated dcmi response
On occasion a dcmi power reading will return error C6, and a
truncated response payload. As the decrypted payload is shorter
than the expected length, lanplus_decrypt_aes_cbc_128() adjusts
the payload_size downward by one byte. In ipmi_lan_poll_single()
the calculation to determine if the payload size has increased
erroniously sets extra_data_length to -1, with a subsequent
segv when calling a memmove to shift response data.
The fix is to check for a positive value in the extra_data_length.

Resolves ipmitool/ipmitool#72
2018-12-06 12:41:22 +03:00
64727f59c4 lanplus: Cleanup. Refix 6dec83ff, fix be2c0c4b
This is a cleanup commit.

Commit 6dec83ff removed assignment of `rsp` pointer
in SOL-processing block of ipmi_lan_poll_single(),
but left the check for the pointer validity in place.
Although that has effectively fixed the bug of potentially
accessing the null `rsp` pointer in the `else` block introduced
with be2c0c4b, the resulting if/else looked suspicious and left
and impression that a NULL pointer could still be accessed.

This commit removes the check for `rsp` from the `if`
as it is checked at the start of the function where `rsp`
is initialized (and that is the only place where it is ever changed).

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-11-29 13:19:29 +03:00
5183b2c288 Move led color static array to source file
Move led color static array from header to ipmi_picmg module
and introduce `picmg_led_color_str()` function for use in
ipmi_vita module.

Partially resolves ipmitool/ipmitool#13

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-11-23 16:41:06 +03:00
83fee27624 drop unused static arrays
Originally marked unused, now dropped.

Partially resolves ipmitool/ipmitool#13

Signed-off-by: Patrick Venture <venture@google.com>
2018-11-23 16:41:06 +03:00
3e0ecc5edc move static objects to source file
Move static objects declared in headers to the source files where
they're used.

Partially resolves ipmitool/ipmitool#13

Signed-off-by: Patrick Venture <venture@google.com>
2018-11-23 16:41:06 +03:00
8ea6094118 cleanup all unused-parameter warnings
Cleanup all unused-parameter warnings.  Each warning was examined to
verify it wasn't simply a case of a build macro difference.

Partially resolves ipmitool/ipmitool#13

Signed-off-by: Patrick Venture <venture@google.com>
2018-11-23 16:41:06 +03:00
d6d9c85139 use __UNUSED__ macro instead of gcc specific attribute
Use __UNUSED__ macro defined in helper.h instead of the gcc-specific
attribute unused macro.

Partially resolves ipmitool/ipmitool#13

Signed-off-by: Patrick Venture <venture@google.com>
2018-11-23 16:41:06 +03:00
9a55136bfb implement __UNUSED__ macro for marking unused
Implement __UNUSED__ macro for marking symbols unused safely.

Partially resolves ipmitool/ipmitool#13

Signed-off-by: Patrick Venture <venture@google.com>
2018-11-23 16:41:06 +03:00
4ac93853a6 Add .dirstamp to .gitignore
Add the .dirstamp path to .gitignore.  .dirstamp is automatically
generated by some build systems.

Signed-off-by: Patrick Venture <venture@google.com>
2018-11-23 16:41:06 +03:00
a4c1040420 fru: Fix processing of unspecified board mfg. date
FRU board mfg. date uses a different value for 'unspecified'
timestamp than the general IPMI specification.

This commit makes ekanalyzer and fru commands process unspecified
FRU dates properly, displaying 'Unspecified' instead of
'Mon Jan  1 03:00:00 1996'.

Resolves ipmitool/ipmitool#57

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-11-16 22:25:27 +03:00
576d4855d9 [compiler-warnings-fixes] use correct fall through comment
In some of the SDR calculating code, there were switch statements that
had cases that would fall through deliberately into the next case. But
the compiler didn't like the comment and would complain about the fall
through anyway. This changes to a comment that the compiler recognizes.

Partially resolves ipmitool/ipmitool#13

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
2018-11-11 14:55:43 +03:00
f2780c5d86 [compiler-warnings-fixes] ipmi_start_daemon: check return values
Some return values were being ignored in ipmi_start_daemon. This adds
checks to the values and changes some hard-coded numbers into named
values.

Partially resolves ipmitool/ipmitool#13

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
2018-11-11 14:55:43 +03:00
dc9b4ebfc9 [compiler-warnings-fixes] ipmi_sdr.c: remove unused function parameters
Several functions were passed a struct ipmi_intf* even though it was
unused. This removes the unused parameters and changes calls and
signatures.

Partially resolves ipmitool/ipmitool#13

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
2018-11-11 14:55:43 +03:00
6e2b688e24 lan: Fix processing disabled VLAN
Before this fix `ipmitool` would complain that VLAN ID
is out of range when trying to disable an already disabled VLAN
on a lan channel. With this fix it will properly report that
VLAN is already disabled.

Resolves ipmitool/ipmitool#55

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-11-11 11:57:12 +03:00
6c3d4b56c9 Make ipmitool respect system locale settings
Dates, times and floating point numbers from now on
will be displayed using system locale settings.

Resolves ipmitoo/ipmitool#23

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-11-08 21:26:32 +03:00
4f05b95f6c Fix strftime() non-literal argument warning
There is a bug in gcc since 4.3.2 and still not fixed in 8.1.0.
Even if __attribute__((format(strftime... is specified for a
wrapper function around strftime, gcc still complains about strftime
being called from the wrapper with a "non-literal" format argument.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39438

This commit adds 'ugly hacks' from that discussion to call strftime()
from strftime-formatted wrappers and silence the warnings.

Partially resolves ipmitool/ipmitool#23

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-11-07 18:50:10 +03:00
f0d5c17ea7 Refactor timestamp handling
Handle all date/time stamps uniformly, taking in account the host
endianness. Respect the local time zone and the '-Z' option for
all ipmitool commands. Unify the date and time formatting.
Add correct handling of IPMI timestamps 'since system startup'
and for 'unspecified' timestamps.

Partially resolves ipmitool/ipmitool#23

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-11-07 18:11:58 +03:00
a4ac8ce4ab doc: Update manpage with new contact info 2018-11-01 19:32:11 +03:00
65a2c548d8 lanplus: Refactoring
Some minor formatting corrections.
Also introduced a new helper function to reduce nesting level.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-11-01 19:29:45 +03:00
1283382e82 lanplus: Fix -C option processing
Cipher suite ID is a byte as per IPMI spec.
Use the appropriate function and consider target endianness
(so write to a temporary variable).

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-11-01 19:29:45 +03:00
7772254b62 lanplus: Auto-select 'best' cipher suite available
Based on current crypto alogrithms, one could rank cipher suites along
these lines:

17 > 3 >> all the rest

17 and 3 are the only cipher suites that implement any sort of
confidentiality alogorithm that is secure. In addition, any hmac-md5 or
md5 integrity algorithm used in integrity is weak at best and dangerous
for authentication.

This could possibly be enabled in a simpler mechanism by simply checking
for 17 and then choosing it before falling back to 3, but the way this
is implemented, it makes it easy to change the list of acceptable
algorithms from two to three or more items.

Resolves ipmitool/ipmitool#29

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
2018-11-01 19:29:45 +03:00
a8862d7508 lanplus: Fix compile with deprecated APIs disabled.
From the man page:

EVP_CIPHER_CTX was made opaque in OpenSSL 1.1.0. As a result,
EVP_CIPHER_CTX_reset() appeared and EVP_CIPHER_CTX_cleanup() disappeared.
EVP_CIPHER_CTX_init() remains as an alias for EVP_CIPHER_CTX_reset().

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2018-10-31 16:29:19 +03:00
081bde8e1b doc: Update home page links 2018-10-01 18:55:00 +03:00
9e05c0b120 doc: Update formatting of ipmitool man page 2018-10-01 18:54:43 +03:00
6f336d04f1 sensor: Refactor ipmi_sensor_print_fc_threshold()
Break the function into smaller pieces to reduce
complexity.
2018-09-25 14:32:46 +03:00
9d49a6edfe sensor: Add support for csv output 2018-09-25 14:32:46 +03:00
c70665c3d1 plugins: open: Properly enable event receiver (#35)
The ioctl to enable the event receiver in the OpenIPMI interface is
called with an argument of 0, which tells OpenIPMI to disable it. Set
the argument to 1 instead so that it will be enabled.

Signed-off-by: Benjamin Fair <benjaminfair@google.com>
2018-09-09 14:48:58 +03:00
2ed677c388 lan: Refactoring: Remove unused function
Function ipmi_lan_build_rsp() is never used anywhere.
Remove it.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-08-21 18:32:35 +03:00
03d2b53c97 strings: Refix 329ebdff: Enlarge data type
Make val in valstr 32-bit to accomodate the values added
by commit 329ebdff.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-08-21 18:18:07 +03:00
4c155320be general: Get rid of some unused parameter warnings
Silence the unused parameter warnings in helper.c
introduced earlier.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-08-21 18:10:28 +03:00
40d52b5fa1 mc: guid: Implement encoding autodetection
With this commit the GUID encoding is now by default detected
automatically based on the validity of the version field,
and the timestamp (for time-based version 1 GUIDs).

The version is considered valid if it is 1 through 5.
The timestamp is considered valid if the year is past UNIX Epoch
and before the current year.

Resolves ipmitool/ipmitool#25

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-08-21 18:10:28 +03:00
0b6abe8cd9 mc: guid: Fix timestamp decoding
Before this commit the 'Timestamp' line was always printed
for all versions of GUID, even for non-time-based ones.

Plus, only the time_low field was used, and it was used as if
it contained seconds since UNIX Epoch, which it didn't. In fact
this field along with other time_* fields constitute a single
60-bit value representing the count of 100ns intervals since
adoption of Gregorial calendar (00:00:00.00 15 Oct 1582).

For non-time-based versions of GUID, the time_* fields do
not represent any time at all.

So, after this commit, the timestamp will be properly decoded
for time-based GUID version 1 only. For other versions the
'Timestamp' line will not be displayed. A line showing the
GUID version will be added to the output.

Partially resolves ipmitool/ipmitool#25

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-08-21 17:30:26 +03:00
f43a78bfc3 mc: guid: Add support for non-standard encodings
There are lots of BMC implementations that violate the IPMI
specification in regard to GUID encoding and instead encode
GUIDs according to either RFC4122 or SMBIOS specifications.

This commit restores the default behavior of `mc guid` to
SMBIOS-based decoding and adds options to allow for decoding
according to IPMI or RFC4122 specifications.

It also allows to simply dump the received GUID as is
without any parsing.

It is possible that in future versions `ipmitool` will
change default behavior to 'ipmi' instead of 'smbios'.

Partially resolves ipmitool/ipmitool#25

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-08-21 17:30:25 +03:00
b44ec2fb65 mc: guid: Fix byte ordering to follow IPMI spec
Before this commit the bytes for the GUID 'node' part were displayed in
reverse order as if they were reported by BMC according to SMBIOS
specification, not accordint to IPMI.

The field order in guid_t was also specified according to RFC4122/SMBIOS,
which is the reverse of IPMI specification. It has now been fixed.

The time_low field of GUID was taken directly, without taking in
account the ipmitool host endianness. It is now properly converted
from IPMI little-endian to host byte order. Other GUID fields are
also properly converted now. As of now, ipmitool does not generally work
properly when built for a big-endian target, but that's out of scope
of this commit.

Please note that this commit most probably breaks the output of
`ipmitool mc guid` with most existing BMC implementations, but that's
just an indication of them being broken. A follow-up commit will
re-add support for the broken behavior.

Partially resolves ipmitool/ipmitool#25

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-08-21 17:30:25 +03:00
e9716e216d Refactoring: optimize pointer checks
Remove all direct comparisons to 'NULL' for pointers.
Replace them with boolean-like 'if (ptr)' and 'if (!ptr)'.
This makes conditions shorter and easier to read.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-08-21 17:30:25 +03:00
f3ef88724f imb: Refactoring: remove duplicate code
Merge GetAsyncImbpMessage() and GetAsyncImbpMessage_Ex() functions
as they share 95% of the code. Make the former call the latter().

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-08-21 11:55:03 +03:00
9ecfb762bd Refactoring: get rid of superfluous comparisons
Make code better readable by replacing `if (rsp->ccode > 0)`
and 'if (rsp->ccode != 0)' with just `if (rsp->ccode)` as
rsp->ccode is anyway an unsigned byte and can't be negative.
Also replace 'if (rsp->ccode == 0)' with 'if (!rsp->ccode)'.

All these changes make lines shorter and easier to read as
a non-zero ccode is an indication of some failure, and so !ccode
naturally reads as 'no error'.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-08-21 11:55:03 +03:00
bb1a4cc805 Refactoring. Improve code reuse ratio.
Add ARRAY_SIZE() macro.

Use the new macro in all places where array size is calculated by
means of sizeof(array)/sizeof(array[0]).

Fix minor bugs and warnings in the affected code.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-08-14 16:44:52 +03:00
232773d171 general: Fix several misspellings
Fix misspellings found by codespell in code comments,
console output and documentation.

Resolves ipmitool/ipmitool#28
2018-08-06 15:59:06 +03:00
a8f3413dc2 mc: Fix compiler warnings
Fix a number of warnings in ipmi_mc.c, including a potentially
uninitialized variable for `mc watchdog set` command.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-08-02 00:48:32 +03:00
29e7d26edb general: Add array_byteswap() to helper
Make unconditional array byte swapping publicly available

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-08-01 15:57:37 +03:00
7747d86cc4 lanplus: Make byteswapping generic
Get rid of lanplus-specific yet very generic in nature
lanplus_swap() function that unconditionally swaps bytes
in an arbitrary byte array. Move it to helper module and
add two conditionally working interfaces to it:

 - array_ntoh() for network (BE) to host conversion, and
 - array_letoh() for ipmi (LE) to host conversion.

The added functions will only perform byte swapping if
the target architecture differs in endianness from the
data source. array_ntoh() will only do swap on LE machines,
while array_letoh() will only do it on BE ones.

These functions are introduced for future use in other
places of ipmitool.

Partially resolves ipmitool/ipmitool#26

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-08-01 11:33:44 +03:00
5491b12596 refix 249e0929: Fix byteswapping helpers
Commit 249e0929 added extra conditionals in byteswapping functions.
They are not needed and didn't work properly.
Now those functions must finally be ok.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-08-01 10:45:22 +03:00
3db2bf6c4b framework: Update .gitignore 2018-07-31 12:12:41 +03:00
5a684b54ed framework: Switch to C11 standard with GNU extensions
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-07-31 12:12:41 +03:00
6d6411d2fc framework: ci: Add support for Travis CI
Future commits to ipmitool will be verified by Travis CI.
This commit adds a basic configuration for that purpose.
2018-07-29 01:16:56 +03:00
5c033c06ab oem: Add basic support for Quanta 2018-07-28 19:15:10 +03:00
72b4b25b05 intf: Refactoring. Remove unused sendrsp()
The sendrsp() callback is never ever called from anywhere.
Remove it from interface structure.
2018-07-27 17:22:31 +03:00
3aade24297 dummy: Add default dummy socket
fake-ipmistack uses a default socket at /tmp/.ipmi_dummy.
Use it when IPMI_DUMMY_SOCK environment variable is not set.
2018-07-27 17:13:18 +03:00
329ebdff84 mc: Fix manufacturer ID masking
A potential future problem has been identified in the manufacturer
ID processing code for `mc info` command. Only 16 of 24 bits were
used. This is fixed now.

Also added support for ID 0x0FFFFF, the 'reserved' value as per
IPMI specification. It is now reported as 'Unspecified' unlike other
non-listed IDs that are still reported as 'Unknown'.

ID 0xFFFFFE is used for debugging purposes in hope that IANA won't
reach that number of entities any soon. If it will though, then
IANA's assignment will take precedence.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-07-26 19:54:57 +03:00
6ee52071dd Refactoring. Remove useless feature test macros.
There are lots of feature test macros like _POSIX_SOURCE,
_BSD_SOURCE, etc. chaotically placed at the beginning of
multiple files without apparent reason, sometime purely
erroneously.

This commit removes them all for the sake of cleaner code.

No new warnings are added due to that at least for gcc 5.4
on Linux with glibc 2.23.
2018-07-25 15:58:00 +03:00
249e092967 general: Make byteswapping arch-independent
ipmiXXtoh() and htoipmiXX() functions were broken
and only worked properly for big-endian hosts.

This commit makes them endianness-independent.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-07-20 19:43:56 +03:00
b3d258b234 sel: Minor refactoring
Minor code duplication reduction

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-07-20 19:12:33 +03:00
928716244d sdr: Refactor/optimize code. No functional changes. 2018-07-20 14:23:33 +03:00
2de8a5e1a9 mc: Refix 861ffb4 2018-07-20 14:23:33 +03:00
861ffb4680 Add an option to display all dates in UTC
Added an option -Z to display all dates in UTC.

Resolves ipmitool/ipmitool#19
Change-Id: Iac3a61190eefde12d95c892af26072ec01f60474
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>

Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
2018-07-19 19:13:42 +03:00
0310208383 mc: Code refactor to reduce copy-paste ratio
* Replace with a macro all calls to val2str() for completion codes
* Replace with a macro all calls to val2str() for manufacturer name
* Replace with a macro all calls to val2str() for product name
* Add ipmi24toh() and ipmi32toh() helpers, unify ipmi*toh() interface

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-06-17 13:38:07 +03:00
e8e94d8976 mc: watchdog set: Refactor to reduce complexity
Move option parsing for `mc wathdog set` to a separate
function, add a function for host to ipmi integer
conversion (reduce manual byte juggling).
2018-06-17 12:38:05 +03:00
e49a20eece mc: watchdog set: Fix intr setting
The previous commit contained a bug due to which
the `intr` option value was never passed to the BMC.
2018-06-17 12:13:35 +03:00
6c00d448d5 mc: watchdog get: Update to match IPMI 2.0 spec
* Add output of "don't log" and "pre-timeout interrupt" fields
* Display timers with 100ms precision
* List timer use expiration flags as text, not just numerically

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-06-17 02:01:19 +03:00
2a78ff2482 mc: watchdog: Add set command
Add `ipmitool mc watchdog set` command in full compliance
with IPMI spec 2.0 section 27.6. Setting of all fields
is fully supported.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-06-17 01:36:46 +03:00
27f2f00dc6 framework: Make git ignore cscope.out 2018-06-16 23:22:41 +03:00
f222df3081 plugins/open: Fix for interrupted select
The select syscall can be interrupted for signals like SIGPROF. The IPMI
command sent will still be outstanding but the send_command will return
an error. When the next command is sent it will get the completion for
the previous command and has the tendency to break state of end users.

Signed-off-by: William A. Kennington III <wak@google.com>
2018-06-16 22:53:46 +03:00
8c0e76c21a nm: Fix policy range (#12)
From Node Manager spec 4.0, policy ID is one Byte data and the range is 0-255.
2018-05-30 19:08:26 +03:00
432f06db3f Replace user_id masks with a macro (#8)
In multiple places throughout ipmi_user.c a user id mask
was used as a magic number, in some places the mask was wrong.
This commit replaces all those magic numbers with a single
IPMI_UID() macro.

Resolves ipmitool/ipmitool#6
2018-05-30 18:57:20 +03:00
564aef2aff fru: internaluse: Fix segmentation fault (#9)
A segmentation fault was trigged by executing 'ipmitool fru internaluse 1 info'.
A memset() was attempted on the address of a pointer, not on the pointer itself.
The erroneous memset() is removed with this commit because it duplicates
the memset() in line 4072.

Resolves ipmitool/ipmitool#9
Signed-off-by: Kylix Lo <kylix0713@gmail.com>
2018-05-30 18:31:24 +03:00
ef7564a7ac Re-apply commit 58d510f90f
Commit 58d510f90f ("ID : 103 picmg discover messages should
be DEBUG, not INFO") changed picmg discover messages from DEBUG
to INFO. However, commit f1c6118c72 ("ID:320 - Add VITA 46.11
support") reverted this without explanation.

This patch reverts the picmg discover messages back to DEBUG.
2018-05-11 14:24:17 +03:00
724f7329a3 dcmi: Refactor
- Refactor the ipmi_dcmi code for better readability;
- Get rid of space indents;
- Use tabs for indent, spaces for alignment;
- Wrap too long lines;
2018-04-05 21:08:22 +03:00
f498e3e296 ID:508 - Refix 6d9c540: Forgotten changes
Some array terminators were left unmodifed.
This commit removes the diversity to make all terminators unified.
2018-04-05 20:11:30 +03:00
6d9c540f6b ID:508 - Fix segfaults in dcmi command handlers
Some command lists were not terminated properly.
This commit fixes that.
2018-04-03 19:46:35 +03:00
60723084e6 vendor: Add YADRO VESNIN identification
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-03-30 12:45:03 +03:00
9d41136c9b ID:491 - Fetch vendor IDs from IANA
Prior to this commit, ipmitool had hard-coded list
of OEM Vendor IDs that it recognized.

With this commit, the list is fetched directly from
IANA PEN registry at build time, so that each release
will now contain an up-to-date list of vendors.

Only basic ASCII characters are supported now. Any
Unicode or extended ASCII will be either transliterated
(cyrillic and diacritic) or simply removed (chinese).

Closes:
ID:491 https://sourceforge.net/p/ipmitool/bugs/491/
ID:505 https://sourceforge.net/p/ipmitool/bugs/505/

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-03-30 02:33:35 +03:00
ecb4cfbff8 ID:472 - Fix The Most recent Addition/Erase date
Fix the Most recent Addition/Erase date are not matched between in-band and
out-band.

ipmitool SDR code doesn't have to check for valid date to print
based on 'Delete SDR command supported' and 'Partial Add SDR command
supported', if 0xffffffff is taken. Also 'Timestamp' data type needs to change
to time_t(long) because same data type is using for gmtime(time_t) API, it has
different behaviour for Linux and Windows C.
2017-04-06 21:51:45 +02:00
1664902525 ID:480 - Call EVP_CIPHER_CTX_free() instead of EVP_CIPHER_CTX_cleanup()
Call EVP_CIPHER_CTX_free() instead of EVP_CIPHER_CTX_cleanup() to fix memory
leak.
2017-04-04 20:54:22 +02:00
f004b4b719 ID:480 - ipmitool coredumps in EVP_CIPHER_CTX_init
IPMI tool coredumps due to changes introduced in ID:461. This shouldn't be
surprise as a NULL pointer is passed to init. Commit addresses this issue by
calling EVP_CIPHER_CTX_new() instead of EVP_CIPHER_CTX_init(), which is
deprecated, and by checking return value of call to former function.
2017-03-26 15:15:30 +02:00
ba01dc84b4 Make git revision more descriptive
The previously introduced mechanism of generating
a git revision was only using the abbreviated hash.
That approach doesn't give a clue whether version
1.8.18.2c99bf6 is newer or older than 1.8.18.7f8d374.

The project uses tags, so `git describe` can be
employed to produce an incremental revision number
since the last tag. Version 1.8.18.13 is much more
understandable and comparable. Howerver that doesn't
answer the question "what codebase was used". To
address that, the abbreviated hash should also be
preserved. Hence, this commit introduces a new
versioning scheme like `1.8.18.13.gee01aa5`.

For git snapshots when git program is absent the
version will be like `1.8.18.0.gsnapshot`.

For cases when .git directory is missing (Release
compilation?) the suffix part will be omitted
completely yielding a version like `1.8.18`.

The suffix generation has been moved to the added
csv-revision script. The script is absolutely
POSIX-ly correct and doesn't require XSI or any
other POSIX extensions.
2017-03-19 18:55:11 +01:00
497f7767cd ID:477 - fru: Fix decoding of non-text data in get_fru_area_str()
The get_fru_area_str() function is used to decode FRU area
fields into text. Areas may be encoded as text, binary,
BCDplus or 6-bit ASCII. Decoding of 6-bit ASCII and BCDplus
was broken. There was an error in the formulas used to
calculate the resulting string length, plus the decoding
formulas for BCDplus was wrong.

For BCDplus the resulting length was considered equal
the encoded data length, while in fact it's twice as big.
Only one character instead of two was being extracted from
a single input byte while two nibbles must have been taken
into account.

For 6-bit ASCII rounding of 3 to 4 bytes conversion was done
improperly adding 2 to the original length instead of the
result of multiplication.
2017-02-08 11:46:04 +03:00
7b0302cef5 ID:479 - ekanalyzer: fix processing of custom mfg. fields
Ekanalyzer was not reading the type/length byte for the 2nd and
subsequent custom fields. Also the message it displayed when
lacked data for custom fields was very relaxing and incorrect.
2017-02-08 11:45:59 +03:00
840f573083 ID:478 - ekanalyzer: Fixed decoding of FRU fields
Got rid of the field decoding code that was only capable of
processing ASCII and binary fields, and switched to using
get_fru_area_str() that can also decode BCDplus and 6-bit ASCII
and maybe will eventually be enabled to decode Unicode text
as well.

This is the first step to completely get rid of the completely
awfully written FRU data decoding functionality of ekanalyzer
that essentially duplicates that of ipmi_fru.c module.
2017-02-02 16:02:57 +03:00
41fa699ae9 Add some more configure/build/editor byproducts to .gitignore 2017-02-02 15:43:12 +03:00
b35a634908 Add git hash and dirty mark to ipmitool version
Replace the static 'csv' suffix with a short hash
and a 'dirty' mark (when the tree is modified).

When git is not available, '.git_snapshot' suffix
will be used.
2017-02-02 15:42:36 +03:00
bc7d23761d Prevent autoreconf from complaining about missing NEWS 2017-01-31 00:22:40 +03:00
e45dc6234b Add bootstrap support for Mac 2017-01-31 00:22:40 +03:00
5db314f694 ID:474 - Compile fix on nonlinux systems
This patch fixes compilation on systems without a separate <malloc.h>.
2017-01-21 16:50:52 +01:00
77fe563503 ID:461 - Make compiler happier about changes related to OpenSSL 1.1
Complaint was that ctx isn't initialized.
2017-01-15 15:11:25 +01:00
7b102293e8 Merge commit 'b57487e360916ab3eaa50aa6d021c73b6337a4a0' 2017-01-15 15:01:38 +01:00
b57487e360 ID:461 - OpenSSL 1.1 compatibility - "error: storage size of 'ctx' isn't known"
In OpenSSL 1.1 EVP_CIPHER_CTX became opaque, cf. `man 3ssl EVP_EncryptInit`

Fixes: ID:461
2016-11-30 17:33:00 +01:00
80345ac56a Merge branch 'master' of ssh://git.code.sourceforge.net/u/spruckb/ipmitool 2016-11-02 10:33:09 +01:00
0ea110a247 fix typo 2016-11-02 10:32:36 +01:00
076ffb5650 Merge /u/spruckb/ipmitool/ branch master into master
https://sourceforge.net/p/ipmitool/source/merge-requests/12/
2016-10-08 08:28:15 +00:00
b5ce925744 Release Version 1.8.18
Update ChangeLog, configure.ac
2016-10-08 10:17:55 +02:00
1487681b8c ID:465 - Supermicro memory ecc Modify the memory ecc error display of SEL for new supermicro boards. 2016-10-06 06:14:42 +02:00
75a79e164d ID: 464 - ipmievd crash fix in log_event
added missing format specifier for sensor number in lprintf
2016-09-24 21:16:02 +02:00
2d4762d573 ID:463 - Removal of Nokia Siemens Networks 2016-09-24 20:50:11 +02:00
2cc196d518 fix typo 2016-09-06 16:31:11 +02:00
89cffb984b replaced/removed defines which are already present in ipmi_picmg.h
Signed-off-by: Bjoern Spruck <bspruck@uni-mainz.de>
2016-09-01 11:27:38 +02:00
3f7e82a6b4 added microTCA major version
Signed-off-by: Bjoern Spruck <bspruck@uni-mainz.de>
2016-09-01 11:27:10 +02:00
c6cd49ea37 fix typo
Signed-off-by: Bjoern Spruck <bspruck@uni-mainz.de>
2016-09-01 11:26:44 +02:00
052655cd91 ID:456 - Unable to disable the VLAN ID using ipmitool
Currently, when a LAN parameter set command is sent through ipmitool, the
corresponding parameter data is requested and compared to the command to verify
that the data was written correctly. Since we do send the VLAN ID in this return
data, regardless of whether VLAN is disabled or not, this mismatch between
requested and received parameters causes ipmitool to retry the command 10 times
and return an error.

ipmitool is sending "0x00 0x00" reading back data from BMC as "0x01 0x00" which
is NOT matching & hence pops up the error /warning "LAN Parameter Data does not
match! Write may have failed."
After 10 retries when we check "ipmitool lan print" VLAN ID is disabled
successfully.
2016-08-31 19:34:18 +02:00
fa2c1550b9 ID: 459 - Fix reading FRU on Artesyn (Emerson) shelf manager, MF105.
Treat 0xC7 as an indication that requested data length in the
FRU read shall be decreased.
2016-08-28 10:21:55 +02:00
51198a1749 ID: 38 - Protocol violating SOL retries when talking to SIMSO-HTC
c&p from the ticket:
~~~
When I try to use CVS-ipmitool on Ubuntu 8.04 x86_64 to talk to a SuperMicros
SIMSO-HTC (Rev. 2.5, IPMI 2.0) chip on a X7SBi-Board via SOL I often get doubled
characters when typing fast, making the SOL interface basically unusable for
anyone accustomed to using a keyboard for longer than a month ;)

At first I thought this was an issue with SuperMicros implementation of the
protocol and/or the flow control
setup on the machine, but their own app works fine (but not the Linux CLI, which
is maybe
based on ipmitool?). But after reading the IPMI 2.0 SOL specs and watching the
debug output for a bit, it seems that is really an issue with lanplus-SOL
protocol implentation of ipmitool in general.

Specifically, in lanplus.c:ipmi_lanplus_send_payload, when waiting for a SOL
response the case that a non SOL packet is returned is not being
checked. Also the "if (is_sol_packet(rsp) && rsp->data_len)" branch does
terminate with a break, but instead goes for a send try, that seems
counterintuitive, Both these things cause doubled characters for me.

The attached patch seems to solve these issues in my case, but I don't claim to
fully understand your protocol code and/or the protocol, so maybe it will cause
problems elsewhere, especially under packet loss conditions.
~~~
2016-08-21 13:16:16 +02:00
cc9a6b3964 ID:457 - Display User ID enable/disable status
Commit implements `Enable status` which shows/is in alignment with (22.27) Get
User Access Command and displays User ID Enable/Disable status of given User ID
at given channel.
2016-08-21 12:17:10 +02:00
ea471ed5fa ID:454 - Add support for PICMG 3.1 R2.0 Link Types and Link Classes.
PICMG 3.1 R2.0 introduces new a new Link Class field in the FRU
Link Descriptors which is the upper 4 bits of the Link Type field.
This new Link Class field specifies SERDES lanes with 10.3125Gbd
signalling rate.

It also introduces the new Base-KX and Base-KX4 types which are the
new IEEE replacements for the PICMG 3.0 Base-BX and Base-BX4 types.

This patch decodes these new types and fields and will print out
proper descriptions for each one based on PICMG 3.1 R2.0
2016-08-21 09:48:55 +02:00
e30c357db7 ID:375 - Add lan6 subcommand to handle IPv6 LAN parameters 2016-08-21 08:59:27 +02:00
95eb252ecd ID:261 - Fix err. output consistency for % ipmitool chassis INV_PARAM; 2016-07-31 20:19:30 +02:00
2c99bf69ec Fix missing goto out_free; when ipmi_parse_hex() returns (-1) 2016-07-31 08:56:38 +02:00
34711329c2 Add mac2str() and str2mac() to print/parse MAC address 2016-07-31 08:52:40 +02:00
2f76ab3d3a Export find_lan_channel() as global 2016-07-31 08:52:40 +02:00
7f8d37493f Rewrite code with the notion that Kg is binary data, not string
- use uint8_t as the storage type
  - allocate kgkey on stack
  - do not treat incoming kgkey as 0-trminated string in
    ipmi_intf_session_set_kgkey()
2016-07-31 08:52:40 +02:00
f9211f8ed9 Moved ipmi_parse_hex() to helper.c 2016-07-31 08:52:40 +02:00
ea46724878 Fix warning for buf2str argument 2016-07-31 08:52:40 +02:00
9a6ba64651 Extend buf2str to allow separator 2016-07-31 08:52:40 +02:00
f8a711b9e8 ID:452 - Add PICMG extension 5.x for PICMG extension check
PICMG extension 5(UTCA, MicroTCA) is not detected as valid extension.
The following patch fixes that at one place. In the second place the board type
is detected in a similar way, but it isn't clear if a patch is needed there, too.
2016-07-31 07:29:49 +02:00
fcf7445bce ID:451 - Modify the memory ecc error display of SEL for new supermicro motherboards. 2016-07-31 07:25:30 +02:00
a3bec1d365 ID:449 - ipmitool close console session for sol deactivate command
In the new version of ipmitool 1.8.15 and above, sol deactivate command was not
closing the session, This patch is to fix close console session When we issue
sol deactivate command.
2016-06-29 20:06:29 +02:00
8bd9659101 ID:230 - check return value of malloc() in lib/ipmi_ekanalyzer.c
Return value of malloc() must be checked. Commit mends this.
2016-06-11 21:30:04 +02:00
9341982a38 ID:335 - Check return value of fseek(), prevent segfault
Commit adds a check as a workaround for segfault reported in ID:335. However,
the proper fix is to rewrite parts of lib/ipmi_hpmfwupg.c not to put whole
firmware image into memory. Also, MD5 checksum part needs to be rewritten,
because it won't work for large firmware images.
2016-06-09 12:01:48 +02:00
4ecac48c68 Revert "ID:335 - Check return value of fseek(), prevent segfault"
This reverts commit 6d8ad594cc because of wrong
e-mail address in commit.
2016-06-09 12:01:29 +02:00
6d8ad594cc ID:335 - Check return value of fseek(), prevent segfault
Commit adds a check as a workaround for segfault reported in ID:335. However,
the proper fix is to rewrite parts of lib/ipmi_hpmfwupg.c not to put whole
firmware image into memory. Also, MD5 checksum part needs to be rewritten,
because it won't work for large firmware images.
2016-06-09 11:48:29 +02:00
a203644728 ID:447 - Fix access beyond array limits in serial_terminal 2016-06-08 21:30:53 +02:00
d56220f81f ID:355 - Fix ``warning: ISO C forbids zero-size array 'data''' 2016-06-08 20:25:35 +02:00
c89be0354a ID:446 - Fix broken firewall reset iterator
The netfn structures are populated sequentially in the _gather_info
function and they are accessed only by even indices (and to the double
of its real length). This results in a segmentation fault if you run

* ipmitool firewall reset

This patch fixes the behaviour so that the ipmi_firewall_reset function
treats the structure the same way as the rest of the code does.

Signed-off-by: Boris Ranto <branto@redhat.com>
2016-06-06 06:43:35 +02:00
0fdfbce8b6 ID:355 - Replace DEBUG() macro with lprintf(LOG_DEBUG, ...)
Commit replaces parametric macro DEBUG() in insrc/plugins/imb/imbapi.c.
2016-06-05 14:00:56 +02:00
2153bd7aa3 Change formatting, remove commented-out code in src/plugins/imb/imbapi.c
Commit changes formatting in src/plugins/imb/imbapi.c and also removes commented
out code.
2016-06-05 13:46:29 +02:00
9b1a1a1e82 Fix indentation of #define in src/plugins/imb/imbapi.c 2016-06-05 07:20:02 +02:00
0ffe39dedc ID:445 - Fix of compilation on FreeBSD 2016-05-31 22:26:19 +02:00
7e991a18e0 ID:355 - Fix statements without effect in lib/ipmi_ekanalyzer.c 2016-05-30 20:38:46 +02:00
b42c16d9dc ID:355 - Fix printf format in lib/ipmi_sunoem.c 2016-05-30 20:38:17 +02:00
55834ec3aa ID:355 - Fix different pointer type in lib/ipmi_picmg.c
... just change `char` to uint8_t, really.
2016-05-30 20:36:37 +02:00
a7b0c213f9 ID:355 - Fix missing struct initializers in lib/ipmi_firewall.c 2016-05-30 20:19:33 +02:00
70253df032 ID:355 - Fix signedness warnings in lib/ipmi_sdr.c 2016-05-30 06:42:13 +02:00
ec8ba928d4 ID:355 - Comment out statement without effect in lib/ipmi_sel.c 2016-05-30 06:41:38 +02:00
f62a16f7f2 ID:355 - Fix printf() related warnings in lib/ipmi_delloem.c 2016-05-30 06:38:09 +02:00
681bc21d32 ID:355 - Move section_id from ipmi_fru. to ipmi_fru.c
... since that's the only place where it's used right now. It might be worth to
rework this concept.
2016-05-29 21:03:25 +02:00
fe2fcaf3ef ID:444 - Cleanup of defaults in configure.ac
Since BMC is disabled by default, there seems to be no need to disable it again
per detected OS.
2016-05-28 18:55:46 +02:00
27ac0c15ac ID:443 - Disable USB driver by default on non-Linux systems
Commit disables USB driver by default on non-Linux systems.
2016-05-28 18:46:33 +02:00
8ca47f21ca ID:441 - Add support for HMAC_MD5 and HMAC_SHA256
Commit adds support for cipher suites 6/7/8 (HMAC-MD5) and cipher
suites 15/16/17 (HMAC_SHA256).
This also fixes:
* ID:442 - IPMI_AUTH_RAKP_HMAC_MD5 support in lanplus
* ID:141 - RMCP+ Cipher-suite 17 not supported

Original author Liebig Holger(Fujitsu).
Code cleanup done by Florian Breu and Zdenek Styblik.
2016-05-28 13:32:45 +02:00
b74c20c5d5 ID:312 - Fix bitmask in _ipmi_set_pef_policy_entry()
Commit fixes wrong bitmask in _ipmi_set_pef_policy_entry(). Also, bitmask
defined by macro is used in _ipmi_get_pef_policy_entry() as well.
2016-05-22 18:51:27 +02:00
997b3ea328 ID:289 - bmx-snmp-proxy: PEF alerting does not work for multiple destinations 2016-05-19 21:53:57 +02:00
ebe6b0ce48 ID:287 - Fix print-out of DDR3 SDRAM Serial Number
Commit fixes print-out of DDR3 SDRAM Serial Number. This was caused by printing
out more bytes/chars and some weird pointer tricks.
2016-05-17 20:54:09 +02:00
b44366e92d ID:400 - Add support for VITA-specific sensor types and events.
Reworked event type code/sensor type parsing in order to support
VITA-specific extensions. Added VITA-specific sensor-specific event
types and VITA-specific sensor types.
2016-05-17 20:49:06 +02:00
e88e5c8186 ID:287 - Remove trailing white-spaces from dimm_spd.c
Commit removes trailing white-spaces from lib/dimm_spd.c
2016-05-16 21:55:52 +02:00
a65b49c387 ID:355 - Fix 'missing initializer' in struct lan_param 2016-05-16 20:46:39 +02:00
107e6affd0 ID:312 - BREAKING CHANGE - Re-design of PEF user interface
Commit re-works user interface of PEF module as well as internal functions.
Not all of the functionality is implemented as the main aim was interface
layout.
It's possible this commit introduces some breaking changes.

Changes are based on patch submitted by Jordan Hargrave, Dell Inc.
2016-05-16 19:18:19 +02:00
5fca596492 Re-work ipmi_mc_get_guid() and turn it into reusable code 2016-05-16 19:18:19 +02:00
244ce02f91 Expose _ipmi_get_channel_info()
... so it can be used elsewhere.
2016-05-16 19:18:19 +02:00
ccfa5aec4f ID 408 - fix sel list last X listing
The events can be removed as desired on certain machines so the only way
to get the proper last X events is to traverse them all not outputting
the first NR_EVENTS - X events.

Signed-off-by: Boris Ranto <branto@redhat.com>
2016-05-03 06:32:07 +02:00
eb94a394ba Release Version 1.8.17
Update configure.ac and ChangeLog to 1.8.17.
2016-05-01 10:03:39 +02:00
1636dbcf0c ID 440 - remove obsolete headers from lib/ipmi_sunoem.c
Commit removes headers which have been obsoleted by POSIX.1-2001.
2016-04-24 18:24:14 +02:00
9f2072e6c3 ID 440 - Fix 'unknown type name fd_set" error.
Cygwin64 build fails at 'lib/ipmi_sunoem.c' due to
missing include. This patch fixes the issue.
2016-04-24 18:10:58 +02:00
d57bf32668 Check rsp->data_len in ipmi_sel_get_info()
Commit adds check of response's data_len in ipmi_sel_get_info() as returned data
length is unconditional. If incorrect, resp. short, data_len is returned, we
might end up reading memory at places we're not supposed to.
2016-04-12 21:09:52 +02:00
0d6a45357b Fix several implicit function declarations in lib/ipmi_fru.c
* ipmi_intf_get_max_request_data_size
* ipmi_intf_get_max_response_data_size
* ipmi_spd_print_fru
2016-04-11 17:18:46 +02:00
d1b0e68515 Fix warning: suggest parentheses around '+' inside '<<' in lib/ipmi_main.c 2016-04-11 17:18:46 +02:00
4520b6ff0e Fix several implicit declarations of functions in lib/ipmi_main.c
* ipmi_vita_ipmb_address
* vita_discover
* ipmi_kontronoem_set_large_buffer
* ipmi_intf_set_max_request_data_size
2016-04-11 17:18:46 +02:00
a40737f856 Fix implicit declarations of functions 'HpmfwupgPreUpgradeCheck' and 'ipmi_intf_get_max_request_data_size' in lib/ipmi_hpmfwupg.c 2016-04-11 17:18:46 +02:00
a40d51abff Fix implicit declaration of function 'get_nic_selection_mode_12g' in lib/ipmi_delloem.c 2016-04-11 17:18:46 +02:00
9fd4dedd37 Fix warning: suggest parentheses around arithmetic in operand of '|' in include/ipmitool/hpm2 2016-04-11 17:18:40 +02:00
baa2c08ab3 Fix implicit declarations of functions 'ipmi_intf_set_max_request_data_size' and 'ipmi_intf_set_max_response_data_size' in lib/hpm2.c 2016-04-11 17:18:40 +02:00
955a875274 Fix implicit declaration of function 'ipmi_get_oem' in src/plugins/lanplus/lanplus.c 2016-04-11 17:18:40 +02:00
5d271b0f67 Fix implicit declaration of function 'ipmi_get_oem' in src/plugins/open/open.c 2016-04-11 17:18:40 +02:00
954859e330 Fix implicit declaration of function 'ipmi_get_oem' in src/plugins/imb/imb.c 2016-04-11 17:18:40 +02:00
19423c68d0 Fix implicit function declaration of ipmi_intf_get_max_response_data_size in lib/ipmi_sdr.c 2016-04-11 17:18:40 +02:00
0f896e36f2 Fix "redirecting incorrect #include <sys/poll.h> to <poll.h>" warning with musl libc 2016-04-11 17:18:40 +02:00
0008072590 ID:426 - Fallback to run-time detection of PAGESIZE if compile-time detection is not supported
Fixes an error ('EXEC_PAGESIZE' undeclared) with musl libc.

Should adhere to sysconf(3) and posixoptions(7).
2016-04-11 17:18:40 +02:00
aeba39bffc ID:426 - Include wchar.h instead of defining wchar_t ourselves
Fixes a compilation error with musl libc
2016-04-11 17:18:40 +02:00
f3f4361568 ID:426 - Include sys/socket.h instead of asm/socket.h
Fixes a compilation error with musl libc.
2016-04-11 17:18:34 +02:00
aede0cee75 Add INSTALL and NEWS, mandated by autoconf 2016-04-11 17:11:58 +02:00
61d2f24090 git-ignore autoconf-generated files 2016-04-11 17:11:58 +02:00
3123ce01b5 ID:322 - let 'ekanalyzer frushow' run without a working IPMI target
Commit changes a dummy interface in a way that it acts as a dummy interface when
no IPMI_DUMMY_SOCK env variable is set. Therefore, it's possible to run
'ekanalyzer frushow' without having BMC. Still, you need to specify this IPMI
interface.
If IPMI_DUMMY_SOCK is set, then dummy interface will work as it was working
before.
2016-04-10 19:40:11 +02:00
f70a19cf63 Added missing ipmi_sel_supermicro.h to template Makefile.am 2016-04-10 18:19:49 +02:00
02cdde0264 Make bootstrap script part of dist packages 2016-04-10 18:17:02 +02:00
19293f08df ID:355 - Change CFLAG -std=c99 to -std=gnu99
... until we're more C99 compliant and ready, because C99 flag really and
seriously breaks IPMI tool, or so it seems.
2016-04-10 17:36:12 +02:00
c7169bc27e ID:437 - sel: Fix "sel time set <time>"
Presently 'sel time set' doesn't account 'minute' difference between timezone.
So depending on host timezone it may set time to +/-30 mins. This patch adds
minute difference to delta_hour caluclation so that it sets time properly.

output without patch:
  # ./ipmitool sel time get
  03/24/2016 12:34:03
  # ./ipmitool sel time set "03/24/2016 12:34:03"
  03/24/2016 12:04:03
  # ./ipmitool sel time get
  03/24/2016 12:06:09

output with patch:

  # ./ipmitool sel time get
  03/30/2016 08:49:47
  # ./ipmitool sel time set "03/30/2016 08:09:47"
  03/30/2016 08:09:47
  # ./ipmitool sel get
  03/30/2016 08:09:57

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
2016-04-10 15:57:07 +02:00
d6ca800da2 ID:430 - Change Nokia Siemens Networks to Nokia Solutions and Networks 2016-03-27 20:28:58 +02:00
8fe8a5c74c Fix automake compatibility warnings
Commit fixes future compatibility warnings from automake.
2016-03-16 19:41:38 +01:00
9639cb3fa1 Get rid of old INCLUDES macro, use AM_CPPFLAGS instead. 2016-03-15 12:08:23 +01:00
d65658aacc Remove #if 0 code aka not-compiled-in
Commit removes code which resides in `#if 0` block. Why? Because this code
doesn't get compiled in, so there is no reason for it to be around.
2016-03-14 21:19:52 +01:00
4648843f81 Remove trailing white-spaces in lib/log.c 2016-03-14 20:37:33 +01:00
24ebe2fed9 ID:355 - Remove declared, but not used variables
Commit removes bunch of declared, but not used, variables.
2016-03-14 20:19:35 +01:00
2b8974fb22 ID:355 - Add #include <strings.h> to lib/ipmi_sel.c 2016-03-14 18:56:11 +01:00
38241decc7 ID:427 - Cleanup comment in ipmi_sdr_get_header()
Commit cleans up comment in ipmi_sdr_get_header() a bit.
2016-03-13 18:21:38 +01:00
a6a67e5e9c ID:427 - The first two bytes of dumped raw SDR data is wrong.
When we dumped the raw SDR data, the first Record ID will overwrite by 0x0000
2016-03-13 18:18:29 +01:00
ac646c329b ID:428 - Update IANA numbers / Product Name for IBM and ADLINK
Updated ID String of IANA Enterprise numbers for IBM and ADLINK
Updated ID String of ADLINK Products
2016-03-13 18:02:31 +01:00
25e39b337c ID:425 - Disable USB interface for OS X/darwin
Commit disables USB interface for OS X/darwin by default as it seems that
<scsi/sg.h> is absent.
2016-03-13 17:57:06 +01:00
cacdd1b6ec ID:431 - Fix correct interpretation of led states
The LED state bits are not mutually exclusive. Bit [0] says LEDs can be
controlled locally and the state bit [1] says wheter the default local
settings or the override settings are used. This means that both bits can be
set at the same time.

Bit [2], the lamp test, indicates wether the test is in progress and logically
works the same as [1].

If bit [0] is not set then bit [1] and [2] has no meaning.

Signed-off-by: Jens Nyberg <jens.nyberg@ericsson.com>
2016-03-13 11:54:07 +01:00
eb5c73c04e ID:355 - Add macros and #include and reduce number of warnings
Commit adds macros and #include in order to bring down the number of `warning:
implicit declaration of function 'X' [-Wimplicit-function-declaration]`
warnings.
2016-03-13 11:40:10 +01:00
55b024f573 ID:424 - Update dimm_spd.c with data from the latest JEDEC List
Commit updates code in 'lib/dimm_spd.c' with the data from the latest JEDEC list.
2016-02-27 14:06:15 +01:00
e1897e2a1d ID:423 - Don't assume internal use area is present in ekanalyzer
... use information in FRU header instead.

Patch by Hinko Kocevar.
2016-02-27 13:36:40 +01:00
9289aeb8c2 ID:407 - Avoid assert on mismatched session ID
Move the logic that checks the session ID from read_session_data_v2x
function to the ipmi_lan_poll_single function in order to avoid calling
assert in this case. We can continue with the next packet if we detect
a session ID mismatch.

Signed-off-by: Boris Ranto <branto@redhat.com>
2016-02-27 13:24:44 +01:00
4e707af583 ID:355 - Move Super Micro stuff into dedicated header file
Commit moves Super Micro stuff into dedicated header file in order to cut down
on compiler warnings. It seems these aren't used elsewhere other than in
'lib/ipmi_sel.c'.
2016-02-27 13:17:29 +01:00
dc5dead291 ID:414 - ekanalyzer frushow fails to show 'Product Info' correctly
Commit removes redundant fread() which led to 'ekanalyzer frushow' not to show
'Product Info' correctly.
2016-02-27 10:12:06 +01:00
b8ca3cac3a ID:417 - Fix some typos
Commit fixes typos in texts in code, print-outs, README and man page.

Submitted by Jörg Frings-Fürst
2016-02-27 10:03:44 +01:00
a74e837562 ID:421 - Fix memleak for sol output
CC: Thomas Renninger <trenn@suse.com>
2016-02-27 09:56:15 +01:00
6a196c4a6a ID:418 - Fix Compiling under Mac OS X
NI_MAXHOST and NI_MAXSERV is only defined in /usr/include/netdb.h if
_DARWIN_C_SOURCE is defined or _POSIX_C_SOURCE is undefined.

From /usr/include/netdb.h OS 10.11 - El Capitan:

  /*
   * Constants for getnameinfo()
   */
  #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
  #define	NI_MAXHOST	1025
  #define	NI_MAXSERV	32
  #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
2016-02-27 09:48:30 +01:00
909fc7815c ID:419 - List dummy.h in Makefile.am, so it gets included in a release tarball 2016-02-24 21:38:22 +01:00
65ea078bdf ID:410 - Enable/disable USB interface by "auto"
Commit changes help text for USB interface to "auto" as its default value will
rely on pre-defined value in configure.ac, if no value is specified by user.
2016-02-04 06:41:47 +01:00
89dbad1655 ID:410 - Disable USB interface for Windows/Cygwin by default.
USB interface fails to be built under Windows/Cygwin.
This patch disables the feature if being built for Windows/Cygwin.
2016-02-04 06:41:41 +01:00
9020b67347 ID:411 - Fix HPM.2 revision check for R1.1 and subsequent specification revisions. 2016-01-20 07:09:44 +01:00
f62b924cb4 ID:413 - Print new line chne character when setting user privilege.
The ouput sting on setting user privilege level is missing the trailing new line character.
Add the missing character.
2016-01-19 20:41:58 +01:00
8055e0d9fb ID:412 - Check errors when setting a user password.
An error which can happen when setting a user password is silently ignored.
Add a completion code check and report error if any.
2016-01-19 20:40:15 +01:00
f67a7a3b2f ID:409 - Fix IPv6 socket creation on Windows/Cygwin.
IPv6-based LAN interface connection using global IPv6 address fails under Windows/Cygwin.
This patch fixes the problem.
2016-01-19 20:24:55 +01:00
ac1b3e1d46 ID:404 - Edit FRU information update problem
Targets as a problem with editing FRUs (like ipmitool ....
fru edit 0 field b 0 "blahblah") where the header (multirecord area offset) is
not correctly updated.

It is supposed to modify the header offset to muti-record area if any of
the three previous areas has been edited.

Remark: this has to occur before the new header crc is calculated.
Thats the reson the modification is not close to the actual movement of the
data. Maybe it would be nicer to change the order in the code here. But
I do not want to add undesired behaviour, thus keeping a clear and small
patch.
2015-12-14 07:00:36 +01:00
336b2cb1ab ID:405 - Use meaningful Generator ID for "ipmitool sel add"
"ipmitool sel add" always sets the Generator ID field of the generated SEL entry
to 0x0000.

Looking at the IPMI spec v2, §13.2, this is questionable. The value 0 would be
read as a HW-generated event from IPMB with slave address 0, which is the
broadcast or ["general call"]http://www.i2c-bus.org/addressing/ address.

The spec says that the Generator ID should be "Software ID if event was
generated from system software", and goes on to say that bit 0 should be set to
1 and bit 1-7 should be set to the Software ID for software-generated events.
SEL entries generated by ipmitool will usually be software-generated.

Out of the SWIDs defined in §5.5 of the IPMI spec, "System management Software"
or "OEM" would match ipmitool's use best, thus it would make sense to set the
generator ID field to 0x0041 or 0x0061. I am using 0x0041 here.

Signed-off-by: Martin Wilck <martin.wilck@ts.fujitsu.com>
2015-12-09 07:53:13 +01:00
2c3a876a73 Release Version 1.8.16
Update configure.ac and ChangeLog to 1.8.16.
2015-11-22 13:50:54 +01:00
37307c93e9 ID:401 - Fixed 30 second delay when activating SOL on 'dumb' Intel MACs.
Boards equipped with 'dumb' Intel MAC can do only SOL. IPMITool performs
several autodetection requests before initiating SOL, which are not
recognized by the boards. With each request retried 5 times it takes
about 30 seconds to establish SOL. This patch resolves the problem.
2015-11-06 09:27:15 +01:00
c9e3e6a01b ID:397 - Fixed picmg policy set command.
'picmg policy set' command uses too restrictive input values check
which allow setting/clearing only the Activation Locked Bit (#0).
This patch fixes the check to allow setting/clearing Deactivation
Locked Bit (#1) as well.
2015-11-06 09:03:32 +01:00
603c14274a ID:396 - Fixed invalid length check in picmg led cap command.
'picmg led cap' command expects FRU LED Capabilities response
length 5 bytes minimum (excluding the completion code byte),
while it is only 4 bytes long. This patch makes the command
expect 4 bytes instead.
2015-11-06 09:02:15 +01:00
14368335b2 ID:402 - Misguiding error print-out when using some 'lan' commands.
Redundant call for find_lan_channel() for several 'lan' commands
produces misguiding error output. Those commands require expicit
specification of the channel number and calling to find_lan_channel()
for them is useless. For the rest 'lan' commands which allow
ommiting of the channels number, the find_lan_channel() is called
additionally.
2015-11-06 08:59:53 +01:00
c56b5c9667 ID:399 - Fixed channel getciphers command.
'channel getciphers' command uses wrong command-line argument
when parsing the target channel number. This patch fixes
this problem.
2015-11-06 08:53:38 +01:00
718a242205 ID:398 - Fixed channel setaccess command.
'channel setaccess' command uses wrong command-line arguments
to construct the set user access request. This patch fixes
this problem.
2015-11-06 08:52:29 +01:00
636a785d82 ID:336 - ipmitool does not fall back to IPv4 for IPMI v2 / RMCP+ sessions
Commit implements '-4' and '-6' switch in order to enforce IPv4 or IPv6
connection. In order to do so, struct ipmi_intf has been extended to carry
ai_family flag.
2015-11-05 17:31:54 +01:00
c38ecd063f ID:374 - Check/set LED Duration correctly 2015-11-04 13:44:52 +01:00
b6d0afb0f6 ID:395 - Fix fru string without resizing it
Editing a fru without resizing it caused the checksum being incorrect and not
being updated. This fix changes this, so the checksum is now being correctly
calculated and written to the right place.
2015-10-26 19:03:35 +01:00
5be090f047 ID:394 - close fp if isn't NULL and set it NULL afterwards in USB plugin
Commit brings back check whether fp is or isn't NULL. If fp isn't NULL, close()
is called and fp is set to NULL afterwards.
2015-10-20 22:03:51 +02:00
607cfe6f47 ID:394 - plugins/usb: Fix probe for SCSI devices
The current USB plugin doesn't find my IPMI channel:

  # ipmitool -I usb mc info
  Error in USB session setup

  Unable to setup interface usb
  Error loading interface usb

This is beacuse I have more than 8 scsi-generic devices that identify
as AMI:

  # grep -c ^AMI /proc/scsi/sg/device_strs
  13

So we end up hitting the max in FindG2CDROM, and abort without finding
the actual IPMI endpoint (on my system, this is /dev/sg11).

This change bumps that maximum up to 16.

However, that means we hit another bug in scsiProbeNew, where if
we hit the end of the file without completely filling the array,
we return with an error. This change handles the EOF condition
gracefully instead.

Also, fp is never going to become NULL; we don't need to check for that
condition.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
2015-10-20 21:58:04 +02:00
999cd0ad91 ID:393 - ipmitool man page addition for Node Manager support. 2015-10-10 07:26:43 +02:00
ffeb535db8 ID:392 - _ipmi_get_user_name() work-around for some BMCs
Commit adds a work-around for some BMCs which return ccode 0xCC when user is
disabled. However, this isn't reason to stop listing users as this ccode is
perceived as being "normal".
When 0xCC is returned, empty user name will be printed instead of bailing out.
2015-10-09 20:53:24 +02:00
4a8691f477 ID:333 - Set read timeout to 15s in OpenIPMI interface
Commit sets read timeout in OpenIPMI interface to 15s in order to eliminate
possible infinite hang.
2015-10-09 20:47:31 +02:00
c04aa9bb4e ID:388 - Turn all messages into LOG_INFO in VITA discovery
... because people without VITA support don't care about errors related to VITA
discovery. This has been suggested as a part of the ticket and "copied" after
PICMG discovery.
2015-10-04 15:44:09 +02:00
329281bbce ID:388 - Handle ccode 0xCC as well in VITA discovery 2015-10-04 15:42:32 +02:00
e2c5b322d8 ID:390 - Support for new Communication Interface (USB Medium)
This feature request is for adding support for USB Medium as an interface in
IPMITool. AMI BMC (OEM feature) provides Virtual USB devices in the host as
part of its feature list. IPMITool can use this 'Virtual USB device' as a
medium for Inband communication with BMC.

Just like any other interface, use can just give 'ipmitool -I usb xxxx' to
communicate with the BMC via USB Interface.
2015-09-11 19:01:31 +02:00
13a2a29156 Remove trailing white-spaces in src/plugins/dummy/dummy.c 2015-09-11 06:14:18 +02:00
3412d86143 ID:391 - changing data_len from 17 to 16 according to ipmi spec 22.29, first byte is completion code 2015-09-11 06:09:49 +02:00
a98eedb272 Remove trailing white-spaces in ipmi_user.c 2015-09-11 06:09:25 +02:00
372b458e0f ID:388 - Fix Error message always printed if BMC does not support VITA
Print error message for 0xC1 to LOG_DEBUG instead of LOG_ERR, because it isn't
an error if VITA isn't supported.
2015-09-11 06:00:44 +02:00
0caa68115e ID:389 - Add on of Advantech IANA number 2015-09-02 08:49:35 +02:00
a5c1120dbb Cleanup trailing white-spaces in ipmi_vita.c 2015-08-26 09:18:35 +02:00
1add1486f9 ID:355 - Fix couple compiler warnings in ipmi_lanp.h
Commit fixes couple compiler warnings which come from ipmi_lanp.h by setting
values of struct attrs.
2015-08-07 21:50:43 +02:00
89e9e63443 ID:376 - Add means to configure "Bad Password Threshold"
Add support for setting and printing of the "Bad Password Threshold"
LAN configuration parameter.
2015-08-06 07:28:54 +02:00
30becb3588 ID:384 - Fix compilation under cygwin64
Patch fixes several compile-time errors which appear during IPMITOOL
compilation in Cygwin64 environment.

Commit for: Dmitry Bazhenov
2015-08-01 10:08:20 +02:00
0d8f9a7453 ID:383 - Fix compile-time error in src/plugins/lan/lan.c
Patch fixes an error of incompatible pointer type which appears during LAN
plugin compilation.

Commit for: Dmitry Bazhenov
2015-08-01 10:05:48 +02:00
ff80a188f3 ID:382 - Fix memcpy() params in HpmFwupgActionUploadFirmware()
The 'bufLength' variable holds a constant chunk size. If the actual
data length is less than the 'bufLength', then it crashes IPMITool. The
code was already there to calculate the remaining data length, but was
not used in memcpy(). We changed it to use the 'count' variable which
holds the proper available data length.

Commit for: Viswanathan Swaminathan
2015-07-27 06:37:37 +02:00
169d9ac3fc Merge /u/whissi/ipmitool/ branch fix-pidfile-handling into master
http://sourceforge.net/p/ipmitool/source/merge-requests/8/
2015-07-25 11:38:09 +00:00
6dec83ff5d ID:369 - Fix lanplus interface bridging and response matching
Request/response matching for bridged and double-bridged requests is broken.
This patch reworks the sending and command construction code, and fixes the
response matching problems.
Since the polling code is retried several times, it was moved into a separate
function in order to make the code more readable.

Commit for: Dmitry Bazhenov
2015-07-25 13:15:41 +02:00
c87aa0b96a ID:368 - Fix handling of bridging-related parameters
1. my_addr is not set if an interface does not expose set_my_addr.
   Currently, the only interface which requires some special handling to set
   my_addr is OpenIPMI. But changing of my_addr still needed for other interfaces.
   So, we must set it regardless of presence of set_my_addr().
2. Since set_my_addr() for serial interfaces only sets my_addr, we remove them
   as redundand.
3. Bridging is enabled when either trasit_addr or target_addr is not 0.
   Currentle transit_addr is not regarded.
4. target_lun does not relate to briging. It is needed for "raw" command. We
   set it regardles of bridging.

Commit for: Dmitry Bazhenov
2015-07-25 13:03:37 +02:00
fb6e311d27 ID:367 - Fix building of non-bridged LAN interface commands
When bridging is used (-t specifies an address which is different from 20h),
presession command must go to BMC_SLAVE_ADDR, not to target_addr.
BMC_SLAVE_ADDR is always used as the responder address in outer Send Message
request, when message is forwarded. Use the same approach for non-bridged
commands.

Commit for:  Dmitry Bazhenov
2015-07-25 12:53:16 +02:00
24fd406506 ID:366 - Properly clean LAN and LAN+ interfaces on close
When closing, LAN and LAN+ interfaces do not do proper cleaning of request
entries. Some pointers remain non NULL. This may cause bad memory references.

Commit for: Dmitry Bazhenov
2015-07-25 12:51:10 +02:00
a585af7e0c ID:365 - Fix for ipmitool crash when using serial-terminal interface
Negative value returned by serial_read_line() function was not properly
recognized, since the storage type was unsigned. This caused ipmitool crash in
some sutuations. This patch fixes the problem.

Commit for: Dmitry Bazhenov
2015-07-25 12:49:07 +02:00
e8450850e3 ID:364 - Fix for serial-basic interface bridging
Response matching for bridged serial-basic interface request is broken.
This patch fixes the problem.

Commit for: Dmitry Bazhenov
2015-07-25 12:47:20 +02:00
2d79e69f5f Merge commit '2f5789750183d4ef8be125b8cb32019441dd0530'
Return codes of functions should be either used or evaluated - always. This
merge is necessary for shell scripting to, eg. signal there was an error during
execution.
2015-07-25 10:16:38 +02:00
259500e127 ID: 380 raw commands override retry and timeout values
Remove the hard coded override for retry and timeout in ipmi_master_write_read
2015-07-25 09:43:57 +02:00
70099a3c40 ID: 380 - raw commands override retry and timeout values
Correct compiler warnings in ipmi_raw.c
2015-07-25 09:43:51 +02:00
82f6175dc7 ID:381 - Script to log installation status as SEL events
This script helps with logging OS install status to BMC as SEL
events.

Signed-off-by: Charles Rose <charles_rose@dell.com>
2015-07-25 09:42:55 +02:00
d12b3b4870 Output pidfile only in verbose mode 2015-03-27 01:26:46 +01:00
ace0e646a1 Don't output pidfile before parsing command line arguments 2015-03-27 01:16:25 +01:00
eb54136775 ID:319 - Interface safe re-open
Currently, interface-management code in the ipmitool does not allow safe
interface re-opening (i.e. closing and opening again). It is because the session
is allocated in the interface setup callback while is freed in the close
callback. So, normal re-opening of the interface, which can be required for
example durng the HPM.1 upgrade, leads to segmentation fault. That's why in the
ipmi_hpmfwupg.c instead of normal closing interface, directly access the
interface data for subsequent re-opening.

Commit for Dmitry Bazhenov
2015-03-11 19:41:34 +01:00
9caa78be38 ID:371 - add ericsson oem
Change-Id: I4fa230b2388e83ae0bc560539675d4dd8783a33e
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.xx.bhuvaragan@ericsson.com>
2015-02-17 15:43:03 +01:00
925a2fe55c ID:370 - add anonymous union support in CFLAGS for older gcc
In older GCC versions when an element in an anonymous unions/structures are
addressed by name, gcc must use -fms-extensions.

Change-Id: Id80617ad9336c7a02fbe613b58e3f337fa4baeee
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.xx.bhuvaragan@ericsson.com>
2015-02-17 15:42:58 +01:00
531569ec62 ID:373 - Fix compilation of IMB on Windows
Commit fixes compilation of IMB driver under Cygwin.
* don't redefine PAGESIZE if defined already
* fix missing include of <asm/socket.h> - required by IO calls
2015-02-17 15:23:30 +01:00
ce861658c0 Node Manager Feature, correct 1268194 missing break. 2015-02-17 14:51:44 +01:00
f1c6118c72 ID:320 - Add VITA 46.11 support
Commit adds support for VITA 46.11 by Dmitry Bazhenov.
2015-02-05 18:43:49 +01:00
d5c2e976d4 ID:355 - remove unused variables from ipmi_dcmi.c
I'd swear I've already removed those, hmm.
2015-02-05 18:37:07 +01:00
7a854623aa ID:363 - fix Coverity issues in NM implementation
Commit fixes issues pointed out by Coverity.
2015-02-05 18:32:06 +01:00
fd5fdc59f2 ID:363 - Node Manager feature patch. 2015-02-05 18:31:07 +01:00
4725cfd6d9 Hook ipmi_set_alert_enable() to _ipmi_*()
Commit hooks ipmi_set_alert_enable() to _ipmi_*() functions and is sort of
rewrite of that function with the same functionality.
2015-02-03 11:47:38 +01:00
5a30d18af2 _ipmi_set_channel_access() - zero-out variable data before use 2015-02-03 11:45:59 +01:00
11bbf18345 Rewrite ipmi_set_channel_access()
Commit is a rewrite of ipmi_set_channel_access(). Function utilizes _ipmi_*()
functions now in order to avoid code repetition. Other than that, functionality
should remain the same.
2015-02-03 07:42:10 +01:00
026a8b6fce Add _ipmi_set_channel_access() function
Commit adds _ipmi_set_channel_access() function which in implementation of
(22.22) Set Channel Access Command.
2015-02-03 07:33:08 +01:00
410606e868 Hook ipmi_set_user_access() to _ipmi_set_user_access()
Commit hooks ipmi_set_user_access() to _ipmi_set_user_access() and removes
duplicate code.
2015-01-30 13:16:44 +01:00
8081427543 _ipmi_set_user_password() - fix missing intf parameter in documentation 2015-01-30 13:15:36 +01:00
8f1f31cfdc Remove ipmi_user_set_password()
Commit removes ipmi_user_set_password() as it's not being used anywhere.
2015-01-30 07:53:03 +01:00
90e2134413 Hook ipmi_lan_set_password() to _ipmi_set_user_password()
Commit hooks ipmi_lan_set_password() to _ipmi_set_user_password() in order to
get rid off code duplication.
2015-01-30 07:47:52 +01:00
66eee40df4 Hook functions in ipmi_user to _ipmi_set_user_password()
Commit hooks functions in ipmi_user to _ipmi_set_user_password() instead of
ipmi_user_set_password().
2015-01-30 07:46:39 +01:00
a6d47ceba4 Add _ipmi_set_user_password() function
Commit adds _ipmi_set_user_password() which is implementation of (22.30) Set
User Command. Function doesn't print anything on stdout/stderr.
2015-01-30 07:33:04 +01:00
21151953a5 Move #define from ipmi_user.c to ipmi_user.h
Commit moves defines of Set User Password operations to header file.
2015-01-30 07:08:57 +01:00
b591bc2ab7 Handle more retcodes in eval_ccode() 2015-01-30 07:04:39 +01:00
0e99dafa12 Merge commit '4c5058cdc33d6be46b3155458df3ba210ea8ad5e' 2015-01-27 08:34:59 +01:00
4c5058cdc3 Replace s6_addr16 with s6_addr since Mac OS X does not have it 2015-01-25 14:56:23 -08:00
f35ed010f0 Cleanup formatting in ipmi_lan_set_vlan_id() and ipmi_lan_set_vlan_priority() 2015-01-23 18:40:09 +01:00
512ec41ab4 Fix typo vlan->VLAN in ipmi_lan_set_vlan_id() and ipmi_lan_set_vlan_priority() 2015-01-23 18:40:05 +01:00
b88a523ded Add limits check in get_cmdline_macaddr()
Commit adds range check prior to cast down to uint8_t. Also, adds a bit of help
text about get_cmdline_macaddr().
2015-01-23 18:30:10 +01:00
75843864ba Move all help texts into their own functions in ipmi_lanp.c
Commit moves all help texts into their own functions in order to unclutter code
a bit.
2015-01-23 18:18:54 +01:00
45c54aad0e Add bunch of TODO marks in ipmi_lanp.c 2015-01-23 08:43:15 +01:00
32c4690950 ID:355 - Fix comparison of unsigned expression
Commit fixes comparison of unsigned expression in ipmi_firewall_reset()
and ipmi_firewall_enable_disable().
2015-01-22 12:55:26 +01:00
03d8aa1882 ID:355 - Remove defined but unused variable in _set_command_enables() 2015-01-22 12:53:59 +01:00
d874267e9b ID:361 - Add a OEM IANA information 2015-01-22 12:16:25 +01:00
c59e7247dd Remove redundant user-input conversion from ipmi_sel_delete()
Commit removes redundant conversion of user input from ipmi_sel_delete(). This
is probably some omitted leftover.
2015-01-22 12:12:38 +01:00
88891f69d6 Fix big parameter passed by value in ipmi_sel_oem_match() - CID#1261347
Pass struct as a pointer instead.
2015-01-22 06:21:54 +01:00
aabd9eb1ac ID:355 - Fix zero-length format string warning in get_supermicro_evt_desc() 2015-01-22 06:20:55 +01:00
82a0caa38b Change formatting of ipmi_sel_oem_match() 2015-01-21 17:47:49 +01:00
55b1a41855 Fix wrong size argument in ipmi_sdr_list_cache_fromfile() - CID#1149056 2015-01-20 18:58:15 +01:00
c56458da18 Clenaup formatting in ipmi_sel_show_entry() 2015-01-20 16:30:31 +01:00
ce3f35d9d9 Fix resource leak in ipmi_kontron_set_serial_number() - CID#1149041 2015-01-19 15:37:05 +01:00
4dfb15281e Remove dead code in fru_area_print_product() - CID#1148999 2015-01-19 14:47:46 +01:00
7bd7c4fdd1 Remove dead code in fru_area_print_board() - CID#1149001 2015-01-19 14:46:09 +01:00
f0acdf1b50 Remove dead code in fru_area_print_chassis() - CID#1149000
I guess this really can't happen.
2015-01-19 14:44:33 +01:00
ece5e55745 Fix resource leak in fru_area_print_product() - CID#1149046 2015-01-19 06:43:42 +01:00
99721b52e4 Fix resource leak in fru_area_print_chassis() - CID#1149047 2015-01-19 06:42:05 +01:00
0b54fac782 Fix resource leak in fru_area_print_board() - CDI#1149048 2015-01-19 06:40:33 +01:00
312f95930d Fix uninitialized struct in ipmi_fru_upg_ekeying() - CID#1149065 2015-01-19 06:37:07 +01:00
d36cfcb817 ID:355 - Fix formatting warning in get_cmdline_ipaddr()
Commit also adds validation prior casting down to uint8_t.
2015-01-17 12:25:50 +01:00
33f9336e85 ID:355 - Fix compiler warnings
Commit removes all unused variables reported by compiler.
2015-01-17 11:44:46 +01:00
6febd10121 Put functions in ipmi_channel.c in A-Z order 2015-01-17 07:11:07 +01:00
6b8d55d68b Re-work ccode eval in ipmi_get_channel_medium()
Commit re-works ccode eval in ipmi_get_channel_medium() as the previous one
didn't work and led to dead-code.
2015-01-16 21:05:56 +01:00
12b85b3c7b Init user_access_t struct in ipmi_user_priv() 2015-01-16 20:49:06 +01:00
0ff2d6e464 ID:357 - out-of-bound access in DDR4 code
Commit increases RAW_SPD_SIZE from 256 to 512 as an attempt to fix OOB in
ipmi_rawspd_main(), resp. ipmi_spd_print().
2015-01-16 20:18:41 +01:00
dab7f5bf81 Remove unused variable from ipmi_get_channel_cipher_suites()
Commit removes unused variable oem_record from ipmi_get_channel_cipher_suites().
2015-01-16 20:11:29 +01:00
6c3f60e57c Remove get_channel_access_rsp and get_channel_info_rsp structs
Commit removes unused structures get_channel_access_rsp and
get_channel_info_rsp as they were replaced.
2015-01-16 20:08:46 +01:00
278dc84b22 Print error message to STDERR in ipmi_channel.c
Print error message to STDERR and not STDOUT in ipmi_channel_main().
2015-01-16 20:07:26 +01:00
0801b4588d Hook ipmi_get_channel_medium() to new _ipmi_get_*() functions
Commit hooks ipmi_get_channel_medium() to new _ipmi_get_*() functions.
2015-01-16 20:04:31 +01:00
56aa025dc2 Hook ipmi_get_channel_info() to _ipmi_get_*()
Commit hooks ipmi_get_channel_info() to new _ipmi_get_*() functions.
2015-01-16 20:03:07 +01:00
238d3c4ea9 Add _ipmi_get_channel_access() and _ipmi_get_channel_info()
Commit adds _ipmi_get_channel_access() and _ipmi_get_channel_info() as well as
supporting structures.
2015-01-16 20:01:50 +01:00
69f668309b ipmi_get_user_access() - change var name 'userid' to 'user_id'
Commit changes variable/param name from 'userid' to 'user_id' in order to keep
consistency.
2015-01-13 13:36:25 +01:00
585cb7c83d Add documentation to 'getaccess' and 'setaccess' functions 2015-01-11 09:39:13 +01:00
708be8bc45 Hook ipmi_user_priv() to _ipmi_set_user_access()
Commit hooks ipmi_user_priv() to _ipmi_set_user_access(). Later got extended for
'change_priv_limit_only', because of the former.
Commit removes ipmi_user_set_userpriv(), because it's not used anywhere.
2015-01-09 12:48:35 +01:00
d6deeb264e Hook ipmi_print_user_list() and friends to _ipmi_* functions
Commit hooks ipmi_print_user_list() and related functions to new _ipmi_*
functions. It also removes old/unused functions and user_access_rsp struct.
2015-01-09 11:40:52 +01:00
bcb96209c5 ID:355 - Fix compiler warnings in dimm_spd.c
* remove unused variable
* add (...) as suggested
2015-01-09 08:00:07 +01:00
8227384c02 ID: 355 - Fix compiler warnings for Dummy Interface
Commit fixes compiler warnings for Dummy Interface:
* fix variable name
* remove unused variables
2015-01-09 07:31:55 +01:00
39fb1af285 ID:355 - Fix Enumeration value not handled in ipmi_get_event_desc()
Commit fixes ``Enumeration value not handled'' in ipmi_get_event_desc() by
adding 'default' to the switch.
2015-01-09 07:23:05 +01:00
faae8fd247 Fix identical code for diff branches in DellOEM - CID#1261326
Commit adds error messages in order to fix CID#1261326.
2015-01-09 07:01:51 +01:00
b6ec5072f4 Remove length checks in get_supermicro_evt_desc()
Commit removes length checks in get_supermicro_evt_desc(), because they make no
sense. Fixes out-of-bound-reads CID#1149029 and CID#1149030
2015-01-08 22:44:55 +01:00
fb36c69391 ipmi_print_user_summary() to utilize _ipmi_get_user_access()
Commit changes ipmi_print_user_summary() to utilize _ipmi_get_user_access() and
user_access_t instead of user_access_rsp.
2015-01-08 21:54:41 +01:00
d099dca9c5 Fix/remove pointer cast in _ipmi_set_user_access()
Commit removes invalid pointer in _ipmi_set_user_access().
2015-01-08 21:29:30 +01:00
af276d4082 Fix out-of-bound-reads in get_supermicro_evt_desc()
CID#1149029 and CID#1149030
2015-01-08 20:22:15 +01:00
e4be291c65 Re-work 'channel getaccess' and 'channel setaccess'
Commit is a re-work of 'channel getaccess' and 'channel setaccess'. These are
using _ipmi_* now. Also, bitfields and two structs are replaced by one unified
struct.
2015-01-08 19:45:22 +01:00
bb35d370ba Add eval_ccode() into helper
Commit adds eval_ccode() into helper in order to save some code repetition on
evaluation of retvals from _ipmi_* functions.
2015-01-08 19:43:27 +01:00
31f9d4c635 Add _ipmi_get_user_access() and _ipmi_set_user_access()
Commit adds reusable functions _ipmi_get_user_access() and
_ipmi_set_user_access().
2015-01-08 16:44:18 +01:00
6d1afbf3a7 Add _ipmi_get_user_name()
Commit adds function _ipmi_get_user_name() which does nothing but fetches User
Name as per 22.29. There are no print-outs when the called.
2015-01-08 16:13:51 +01:00
d9acbc4cd0 ID:358 - check data length in else branch of ipmi_spd_print()
Commit adds data length check into '} else {' branch of ipmi_spd_print() in
order to avoid out-of-bound access.
2015-01-04 14:58:37 +01:00
9811f79eae ID:357 - out-of-bound access in DDR4 code
ID:356 -  DIMM4 Die Count is unreachable
2015-01-01 09:16:34 -07:00
2d66f8d5cf Change expression in ipmi_pef_list_policies() in order to silence Coverity 2014-12-31 12:23:56 +01:00
8775af38f5 Remove dead code - rsp can't be NULL at this point - CID#1149005 2014-12-31 05:53:24 +01:00
9fc4a39fda Remove dead(duplicate) code from ipmi_sol_main() - CID#1148996 2014-12-31 05:47:00 +01:00
a6957f875c Delete dead code from ipmi_sunoem_echo() - CID#1261338
Commit removes a dead code from ipmi_sunoem_echo(). Code didn't make any sense
in given context.
2014-12-30 20:12:11 +01:00
4ef4618366 Remove commented-out code in ipmi_picmg_clk_set() - CID#1261339
Originally ``Printf arg type mismatch''.
2014-12-30 20:07:12 +01:00
8ac8361aca Fix Identical code for different branches in ipmi_tsol_main() - CID#1261346
Commit adds error message and retval (-1) for an invalid tsol command/parameter.
2014-12-30 20:00:56 +01:00
fb69b5dc9e Fix Assign instead of compare in KfwumGetDeviceInfo() - CID#1149034 2014-12-30 18:20:34 +01:00
c2e65d0dce Fix dead code in ipmi_firewall_reset() - CID#1261342 2014-12-30 17:40:07 +01:00
12eeca602c Fix missing return in ipmi_kontronoem_main() - CID#1261317 2014-12-30 17:20:49 +01:00
c076fde0a6 Fix file descriptor leak in ipmi_exec_main() - CID#1149040 2014-12-30 16:21:52 +01:00
ecfaeb2706 Change expression in ipmi_pef_get_info() in order to silence Coverity
Commit changes expression from ``if (!ptbl)'' to ``if (ptbl != NULL)'' in order
to silence Coverity. CID#1149049
2014-12-30 16:02:21 +01:00
61db4df637 Fix memory leak in ipmi_ek_display_board_info_area() - CID#1149051 2014-12-30 15:51:49 +01:00
e37e3ab7de Fix memory leak in get_supermicro_evt_desc()
Commit fixes memory leak in get_supermicro_evt_desc() - CID#1149050
2014-12-30 15:43:55 +01:00
c97dbd3461 Fix eval logic in ipmi_user_priv()
Commit fixes bug in eval logic of user input sanitization, resp. && -> ||. Also,
priv_level and user_id variables are initialized to 0 now(CID#1261318).
2014-12-30 15:33:05 +01:00
48117f5ddf ID:355 - Fix ``ISO C forbids omitting the middle term of a ?: expression''
Commit fixes omitted middle terms of ternary expressions.
2014-12-30 08:00:23 +01:00
70984dcad5 ID:355 - Fix ``obsolete use of designated initializer with ‘:’'' warning
Commit fixes compiler warning ``obsolete use of designated initializer with
‘:’''. Use of ``fieldname: value'' has been obsolete since GCC 2.5.
2014-12-29 09:33:22 +01:00
ce02ffaf2a ID:354 - forcefully switch to C99 and more strict CFLAGS
Commit changes CFLAGS which include C99 and more strict flags. Watch out for
falling rocks.
2014-12-23 14:37:25 +01:00
3105812a44 ID:354 - struct member h_addr has been replaced
Struct member h_addr has been replaced some time ago and kept for backward
compatibility. Let's reflect on this and replace it with h_addr_list[0].
2014-12-23 14:33:29 +01:00
148d0e0904 ID:354 - uint8_t >= 0 is always true, don't test it
Commit removes test whether value is greater or equal to 0 in
is_ipmi_channel_num(), because it's always true(and it makes compiler mad).
2014-12-23 14:22:00 +01:00
6ca88cb687 ID:354 - replace/drop caddr_t in IMB
Commit replaces caddr_t in IMB driver with char *. This is a wild guess
replacement, because caddr_t doesn't have to be char *. However, it shouldn't be
used and so shouldn't mmap(). So we'll have to see how things work out.

http://computer-programming-forum.com/47-c-language/556a90938d01f023.htm
2014-12-23 14:10:34 +01:00
6d4e2bb632 ID:354 - Replace obsolete u_int[0-9]+_t with standardized types in Free iface 2014-12-23 12:29:07 +01:00
104a7176ac ID:354 - Replace obsolete u_int with uint32_t in dimm_spd.c 2014-12-23 12:21:11 +01:00
d9f89a8da0 Fix of previous commit - memset() expects pointer
Commit fixes replacement of bzero() with memset(). memset() expects pointer and
pointer should be given to it.
2014-12-23 05:56:47 +01:00
0a1f5c03e5 Replace deprecated bzero() with memset()
Commit replaces deprecated bzero() with memset().
2014-12-23 05:46:28 +01:00
140add9d77 Fix user input validation in Channel and User sub-commands
Commit fixes validation of user input in Channel and User sub-commands.
2014-12-22 18:21:51 +01:00
0562c809af Cleanup if/else in ipmi_channel_main() 2014-12-22 08:49:58 +01:00
a87b2ccc67 Cleanup of code formatting in ipmi_channel.c
At least a bit.
2014-12-22 07:57:18 +01:00
ad77da2065 ID:349 - user set password - add option to choose 16/20 byte password
Commit adds option to 'user set password' to choose whether password should be
stored as 16 byte or 20 byte. From now on, it's possible to store even 5 bytes
long password as 20 byte password which should make it useless for IPMI v1.5
auth/sessions.
2014-12-20 16:40:55 +01:00
6e6a04f971 Make user User Privilege Limit is within range
Despite the fact we could leave this up to IPMI stack, we won't do that.
Therefore, is_ipmi_user_priv_limit() is added and user provided value checked.
2014-12-20 13:57:06 +01:00
befb21497f Create ask_password() and re-use code
Commit add function ask_password() which leads to code re-usability and shedding
couple lines of otherwise redundant code.
2014-12-20 13:43:38 +01:00
1d1ce49bf4 Fix 'user help' output
Commit fixes padding of 'user help' output. Also, list of expected values of
privilege leves have been added.
2014-12-19 09:57:49 +01:00
50bd7d01a8 Don't use tmp variable since it's not necessary in ipmi_user_test() 2014-12-19 08:49:20 +01:00
4d3decc4c0 Split ipmi_user_main() into smaller functions
Commit splits ipmi_user_main() into smaller functions. Hopefully, this will be
better than giant main() function.
2014-12-18 18:40:51 +01:00
f8ce85ee6c Clenaup formatting in ipmi_user_main() 2014-12-09 18:59:37 +01:00
2aa5d8c902 Code cleanup in ipmi_user_main()
This is just a tip of an iceberg, really.
2014-12-09 18:59:36 +01:00
3c34aa0e1d Cleanup formatting in ipmi_user_main() 2014-12-09 18:59:36 +01:00
a58a627fae Remove trailing white-spaces in ipmi_user.c 2014-12-09 18:59:36 +01:00
aaf98b89d5 ID:348 Add support for the "System Firmware Version"
Add support for the "System Firmware Version" parameter selector (1) to the "Get
System Info Parameters" command ("mc getsysinfo system_fw_version"). The "mc
getsysinfo" command was already implemented and supported, but strangely, only
standard parameter selecter values 2, 3, 4 and Dell-defined parameters were
supported; the standard parameter value 1 (system firmare version) was not
supported.
2014-12-05 14:15:02 +01:00
7cd86aaf1e ID:347 - Incorrect reserved channel number
Fix validation of IPMI channel numbers according to IPMIv2.0 rev1.1 and update
documentation as well.
2014-12-05 13:39:31 +01:00
dd4cab8153 ID:343 - Remove AC_FUNC_MALLOC
Fix cross-compile build error regarding to 'rpl_malloc'.
ipmitool actually does not need the GNU's malloc(0) behavior.
So, remove AC_FUNC_MALLOC from AC-script in order to help
cross-compiling ipmitool without need to directly specify
ac_cv_func_malloc_0_nonnull environment variable.
2014-12-05 13:33:12 +01:00
d671052143 ID:345 - Do not do several close session retries when catching SIGINT
Reduce number of retries to 1 when closing interface on SIGINT.
This reduces time needed to terminate the LAN connection.
2014-11-29 18:06:13 +01:00
e9c3de03c3 ID:346 - lib/ipmi_sdradd.c ipmi_sdr_read_record has a file descriptor leak
'lib/ipmi_sdradd.c' ipmi_sdr_read_records() opens a file descriptor and never
closes it. Here is a patch in use by SGI for quite some time now. Suggested
patch attached.
2014-11-29 17:52:18 +01:00
1cf65c3236 ID:344 - Fix HPM.2 long message support
Due to a typo in the result checking. HPM.2 long message support detection does
not work.
2014-11-29 17:45:41 +01:00
0eaa2eae51 ID:343 - Print actual sensor thresholds in 'sensors' comand
Use Get Sensor Threshold command for obtaining thresholds, since SDR records may
contain not actual threhsolds.
2014-11-29 17:44:07 +01:00
f56d740d98 ID: 307 - Intel I82751 super pass through mode fixup
The patch adds missing check for the Intel i82751 MAC being in the super
pass-through mode, which has known deviations in RMCP+ from the IPMI
specification.
2014-11-29 17:26:48 +01:00
342f44b9f3 Update ChangeLog for 1.8.15 rleease 2014-11-24 06:40:17 -07:00
e1c7b532bd Release Version 1.8.15 2014-11-24 06:30:52 -07:00
3314024867 Remove debian from extra distribution rule for make dist 2014-10-23 14:27:06 -06:00
15499d014f Update ChangeLog for 1.8.15RC1 2014-10-23 14:02:38 -06:00
21fbd0e967 ID#340 - ipmitool sol session improperly closes on packet retry
Commit for Pat Donlin
2014-10-17 20:14:12 +02:00
deb9a4ed5d ID#277 - support for hostnames longer than 64 chars
ID#313 ipmitool doesn't support hostname long than 64 symbols
ID#277 Minor issue with ipmi_intf_session_set_hostname()

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

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

Author: Jörg Frings-Fürst <debian@jff-webhosting.net>
Origin: based on patch from SriniG <srinivas_g_gowda@dell.com>
Bug: http://sourceforge.net/p/ipmitool/patches/102/
Bug-debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=756555
Forwarded: http://sourceforge.net/p/ipmitool/patches/102/
Reviewed-by: 2014-08-07 SriniG <srinivas_g_gowda@dell.com>
2014-09-20 15:30:55 +02:00
f49c9eec53 print message header and data in verbose print
Change-Id: I613e35e180c815279d2a50f44956a5ed5bf5461b
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.xx.bhuvaragan@ericsson.com>
2014-09-03 10:01:07 +02:00
a6f34c9029 fix incorrect data validation
Change-Id: I6c277b4716445e8ae9a6851cca48e1ad95df49b4
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.xx.bhuvaragan@ericsson.com>
2014-09-03 09:53:56 +02:00
bee3fda656 update result ptr before return
Change-Id: If976f5c769d8ba83eefa1693e6969ef17f357ba8
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.xx.bhuvaragan@ericsson.com>
2014-09-03 09:44:57 +02:00
737b801768 delete duplicate macros
Change-Id: Ie219c955c4644b8ab9822fd1e5523d70038b5261
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.xx.bhuvaragan@ericsson.com>
2014-09-03 09:42:11 +02:00
96b19bb62d ID: 325 DDR4 DIMM Decoding Logic
Bug 325 was associated with identification of DDR4 SDRAM, but correct decoding
logic was necessary to actually support DDR4 decode.    This commit adds the
necessary logic to decode and display DDR4 DIMMS.
2014-08-13 07:12:42 -06:00
9372d2e34e ID: 328 HPM.2 fixes
Fix commited for Dmitry Bazhenov
2014-08-11 11:21:23 -06:00
9babab10f3 ID: 329 hpm.1 upgrade fixes
Fix commited for Dmitry Bazhenov
2014-08-11 11:17:41 -06:00
58d510f90f ID : 103 picmg discover messages should be DEBUG, not INFO
Changed picmg discover messages to LOG_DEBUG
2014-08-11 10:49:10 -06:00
ea49700ec1 ID: 331 Passwords provided in file (-f option) truncated on space
Code changed to remove truncation on space since space is valid in a password
2014-08-11 10:38:09 -06:00
732be1b968 ID: 325 - Can not identify DDR4 SDRAM 2014-08-11 08:34:58 -06:00
2f57897501 ipmitool delloem: ipmitool delloem extension always return success - fix it
The delloem extension functions all return sane error codes, but they
are not used and not passed on. Fix it.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-07-08 18:25:53 +02:00
d79b0e05af ID: 318 - ipmi_tsol.c: fix buffer overflow
Commit fixes buffer over-flow in ipmi_tsol caused by mis-calculation in buffer
size, resp. using wrong variables completely.
2014-05-29 20:19:37 +02:00
3b15a7c0e2 ID: 306 - "fru print" command prints the FRU #0 twice
This patch make the command to spit FRU info #0 only once.

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

Commit for Dmitry Bazhenov
2014-05-25 08:48:50 +02:00
3473670051 lib/ipmi_tsol.c - remove dead code 2014-05-24 10:05:30 +02:00
aefd287222 lib/ipmi_tsol.c - make code formatting saner 2014-05-24 10:05:05 +02:00
6d25903a0b ID: 317 - ipmi_fwum.c: fix typo 2014-05-24 09:18:32 +02:00
26da519310 ID: 315 - buildsystem: configure.in is deprecated
As per https://lists.gnu.org/archive/html/automake/2013-05/msg00049.html,
renamed to configure.ac
2014-05-24 09:16:52 +02:00
edfee17f21 ID: 316 - Directory debian is outdated
Debian upstream will take care of packaging.
2014-05-24 09:14:47 +02:00
b37b914973 ID: 103 - 'lib/ipmi_ekanalyzer.c' needs a re-work
Most of the code is reformatted. I've removed some if blocks which didn't make
sense along the way. However, huge pile of work remains.
2014-05-19 05:35:16 +02:00
4e4a92100c ID: 103 - 'lib/ipmi_ekanalyzer.c' needs a re-work
Remove trailing empty lines.
2014-05-18 06:32:44 +02:00
8f7837364b ID: 46 - SEL OEM record corner case
According to 31.6.1 SEL Record Type Ranges, IPMIv2.0 specification, timestamped
OEM SEL records are in interval of <C0h,DFh> and not <C0h,DFh).
2014-05-17 11:39:42 +02:00
be7917f9f5 Changes Integrated since 1.8.14RC2 2014-05-05 07:26:36 -06:00
a7d3bda08d ID: 311 man page update for new sunoem commands 2014-05-05 06:58:08 -06:00
d531785a23 ID: 280 - man page cleanup 2014-04-29 09:38:11 -06:00
eeeb973e39 Make comment about 'source offset' explicit 2014-04-26 14:43:30 +02:00
166ae1da23 ID: 308 - "fru edit" no longer works for non-zero fields
1. Warnings about "FRU Area Length" based on uninitialized (malloc'd) memory
contents (due to fru->max_read_size not being initialized, left at 0) and
fru_data not being zeroed after malloc() in ipmi_fru_set_field_string().

2. "fru edit" commands for any field index other than 0 would fail (with "Field
not found !" error) due to a couple offset and length calculation errors (for
all the supported "area" types) in ipmi_fru_set_field_string().

3. "fru edit" commands would corrupt the FRU Inventory Area due to incorrect
"source offset" value being specified in write_fru_area() call in
impi_fru_set_field_string().

Commit for Rob Swindell
2014-04-25 20:48:40 +02:00
4f0967779e ID: 310 - lanplus retry regression
The lanplus driver for has a bug in ipmi_lanplus_open_session(). There is
an extra and undesired check for a null response (timeout). As a result, it
returns 1 to the caller. The result of this is an occasional assertion. Commit
mends this.

Commit for Pat Donlin
2014-04-25 20:40:36 +02:00
9d88837ef3 Add ticket IDs, if we have one 2014-04-18 06:39:09 +02:00
824c0ed4a0 Add hpm2.h to list of distributed include files 2014-04-17 14:01:22 -06:00
7ea04d8f77 Update ChangeLog for 1.8.14RC2 changes 2014-04-17 13:28:54 -06:00
8d5e8fcf7a Incorrect byteswap in SOL maximum payload code
max_inbound_payload_size, max_outbound_payload_size and port are
assembled byte by byte using shifts. This works correctly in both
little and big endian and doing a subsequent byte swap is wrong.

To highlight this issue I dumped the values on a big endian machine:

max_inbound_payload_size 51200
max_outbound_payload_size 51200
port 28418

And after this fix:

max_inbound_payload_size 200
max_outbound_payload_size 200
port 623

Signed-off-by: Zdenek Styblik <stybla@turnovfree.net>
2014-04-12 15:13:25 +02:00
2c7526be6b Fix build error in HPM.2 code
lib/hpm2.c uses BSWAP_16 without including ipmitool/bswap.h.

Signed-off-by: Zdenek Styblik <stybla@turnovfree.net>
2014-04-12 15:08:39 +02:00
a88db0d181 ID: 300 - new sunoem functionality
Main changes include:

 * direct connection to ILOM command line interface
 * ability to add/delete ssh keys fot ILOM users
 * ability to set ILOM properties
 * ability to retrieve various logs from SP
 * removal of obsolete/non-functioning code and other misc changes

Commit for Martin Hovorka of Oracle
2014-04-09 21:24:05 +02:00
42aba7eb4f ID: 144 - Fix 'dcmi power set_limit action <value>'
From the ticket:
(v1.8.12) "dcmi power set_limit action <value>" (where <value> is either
"sel_logging" or "power_off") does not actually send the "Set Power Limit"
command (so no change to the power limit policy is made).

This was caused by all atoi(), strtol(), strtoul() calls being replaced. This
patch should fix it.

Commit for Holger Liebig
2014-04-08 15:24:55 +02:00
23e9340b49 ID:302 - HPM.2 long message support
This patch adds basic long message support for PICMG-based systems according to
the HPM.2 specification.
It also introduces APIs for setting inbound and outbound messages sizes per
selected interface.
This APIs are used in LAN and LAN+ interfaces to set autonomously detected
inbound and outbound message sizes.
The newly introduced APIs also replace the existing message size detection code
in several ipmitool commands in order to leverage the advantages of long message
support (HPM.1 upgrade, SDR acquring, FRU inventory read and write).
The Kontron-specific long message support is moved under a OEM option.

Commit for Dmitry Bazhenov
2014-04-08 15:18:50 +02:00
707d77ffbc Add new SEL entries for ipmi 2.0 rev 1.1
Signed-off-by: Jordan Hargrave <jordan_hargrave@dell.com>
Signed-off-by: Zdenek Styblik <stybla@turnovfree.net>
2014-04-05 11:38:08 +02:00
7584b96c1d Update ipmtool version to 1.8.14-cvs 2014-03-28 07:35:25 -06:00
cc85ce1333 Update For 1.8.14 Release 2014-03-28 07:24:06 -06:00
2c7a5f91ef ID: 299 - openipmi plugin writes zero to wrong byte
The intent is to zero the byte that no longer contains valid data (because the
data was shifted one byte to the left). However, the wrong byte is being zeroed.
One way this shows up is when displaying the descriptions with hpm compprop.
2014-03-27 20:29:44 +01:00
9e3dba7e97 ID: 301 - Add OS/Hypervisor installation status events
Add OS/Hypervisor installation status event types to SEL as noted in table-24 in
section 42.2.

Commit-for: Charles Rose
2014-03-27 19:57:30 +01:00
176774cf9f ID: 298 - fix LANplus retry
``I had submitted a patch back on Nov 19, 2013 regarding a fix to lanplus retry.
This had resolved a problem whereby a retry of a payload type of
IPMI_PAYLOAD_TYPE_IPMI first removed the request from the queue before going
back for a retry of the message. I have been able to determine why this fix
works correctly. More importantly I have been able to resolve other retry
problems in lanplus where assertion panics were hitting on certain retry
operations. A new, replacement patch for resolving both of these types of retry
bugs follows.

The first bug,where the ipmi_lanplus_send_payload() is sending a payload type of
IPMI_PAYLOAD_TYPE_IPMI is retryable, however I found in testing that it did not
remove the previous request entry from the list of requests chain. If the
original message had timed out, a second message sent, the second reply would
not match up to the right entry on the list as the req command and sequence
numbers are the same. By first removing the first request from the chain this
resolves it. The consequence of not removing the stale entry was random errors.

The second bug is when waiting for a message response times out during the
ipmi_lanplus_send_payload types IPMI_PAYLOAD_TYPE(s) RCMP_OPEN_REQUEST, RAKP1,
RAKP_3. In various testing where the message timed out on either of these three
payload types, ipmitool would assertion panic upon retry as the session_state
was wrong. The timeout could be due to the message never getting to the BMC, the
BMC never acting/responding to the message, or the reply message packet dropped
(it is UDP after all). If the BMC had acted on the message but the reply was not
received, the BMC state would had advanced, and a retry of any of these three
commands would error. It is not knowable at retry time if the BMC had acted on
the message or not. The solution is upon message timeout failure, retry all
three commands in the sequence. This has shown to be reliable and does not
result in assertions or any unexpected BMC behaviors. Should the original
message response eventually arrive very late, it is just discarded.

The testing for these problems was elusive until we found a moderately slow BMC
and had separate sessions direct a fusillade of nmap operations on the BMC, then
run simple ipmitool commands. This caused sufficient loading of the network and
BMC to cause lengthy delays and outright packet drops. The general approach on
the second fix is to return a timeout error code back through ipmi_lanplus_open
where the sequence can be retried.''

Patch-by: Pat Donlin
2014-03-23 08:15:51 +01:00
cab450a052 ID: 295 - inform user if SOL session disconnected
Currently if we are connected to ipmitool sol session and if service processor
goes down due to reset/reload, then user has no way to know that sol session has
been disconnected. Commit aims to fix such case.

Patch-by: Mamatha Inamdar
2014-03-23 07:58:11 +01:00
250eb15f92 ID: 297 - don't print-out SEL entry if ID not present
Don't print-out SEL log entry if SEL Record ID isn't present.

Patch-by: Mamatha Inamdar
2014-03-23 07:51:05 +01:00
02e4a0361c ID:296 - Fix PSD size decoding
Commit replaces size decoding code with code ported from "decode-dimms" Perl
script found in i2c-tools 3.0.3. Former code has reported incorrect size of DDR2
modules.

Patch-by: Alexander Amelkin
2014-03-23 07:37:58 +01:00
ca5cc560f6 Add options to chassis bootparam set bootflag 2014-03-11 10:26:43 -06:00
b4a9d2f9a2 ID: 293 - Use of uninitialized variable in ipmi_main()
The variable addr is used uninitialized on line 918 of ipmi_main(). Commit
ensures it is initialized to 0 before being used.

Reported-by: NUXI
2014-02-27 08:56:28 +01:00
8d44c55feb Properly handle plugin non-zero target adddress with -t specification Bug 292 2014-02-10 06:05:49 -07:00
c18ec02f33 Move all files one level up in the file hierarcy, to avoid the useless ipmitool directory. 2014-02-05 17:30:32 +01:00
b0aad15d67 Add myself to AUTHORS to test git commit emails. 2014-01-31 11:58:47 +01:00
adbf585bd4 Add link to commit archive to test git commit emails. 2014-01-31 11:51:59 +01:00
9393bf0133 Typo, missing semicolon. 2014-01-31 06:13:58 +00:00
2c2844ac03 Use TIOCFLUSH if TCFLSH is missing to get the serial plugin building on Hurd. 2014-01-30 18:55:46 +00:00
c186e2a681 Disable imb and open plugins by default on Hurd. The platform lack the required kernel support. 2014-01-30 18:33:47 +00:00
e02ed2ca2c Change serial plugin to only try to disable the IUCLC serial line flag on platforms supporting it. Fixes build problem on Hurd and FreeBSD. 2014-01-30 18:17:45 +00:00
a06f8a26d4 Add missing break; in switch block (Coverity CID 1149010). 2014-01-15 08:58:04 +00:00
a324db391c Add missing format string placeholder (Coverity CID 1149038). 2014-01-15 08:55:38 +00:00
b086e876d7 Add missing format string placeholder (Coverity CID 1149037). 2014-01-15 08:54:00 +00:00
555a08ece0 Add missing format string placeholder (Coverity CID 1149036). 2014-01-15 08:52:23 +00:00
696ccb0787 Set pointer to NULL just after free() two other places too. 2014-01-11 07:58:50 +00:00
86cb5ee175 Make sure to set free()ed pointer to NULL immediately, as specified by
<URL: http://sourceforge.net/p/ipmitool/wiki/coding_standards/ >.
2014-01-11 07:43:12 +00:00
99fff91f9d Make sure blockId buffer is never overflown (Coverity CID 1149058). 2014-01-11 07:22:46 +00:00
df3e3c7969 Fix incorrect printf() arguments (Coverity CID 1149035). 2014-01-11 07:11:41 +00:00
135977a497 Make sure to release malloc()-ed data when fread() fail to read board
type data (Coverity CID 1149052).
2014-01-11 06:50:57 +00:00
4e220bebb0 Check return value from open() in ipmi_start_daemon() (Coverity CID CID 1148983). 2014-01-11 06:45:44 +00:00
4698e667f5 Make sure input_file is not used if it is NULL (Coverity CID 1149055). 2014-01-11 06:29:01 +00:00
ff1dbe3d5b ID: 278 - Error in sol looptest
Commit fixes use of uninitialized variable in SOL "looptest".
2013-12-17 05:17:55 +00:00
d42890ef17 ID: 290 - ipmi_sol.c needs a clean-up
ipmi_sol_payload_access() - change formatting and simplify.
2013-12-17 05:05:43 +00:00
2d7fe32687 ID: 85 - Supermicro memory ecc error display
Commit adds memory ECC error display for Supermicro boards and adds a
Supermicro oem sensor type for SEL.
2013-12-17 04:56:18 +00:00
3a852a8849 ID: 85 - Supermicro memory ECC error display
Commit adds ipmi_get_oem_id() function.
2013-12-17 04:53:20 +00:00
c9e047c334 ID: 290 - ipmi_sol.c needs a clean-up
Clean up code formatting in ipmi_sol_main().
2013-12-08 20:45:17 +00:00
6cf6b4b845 ID: 286 - Open session retries hit assert in ipmi_lanplus_send_payload
If we have to retry an open session request, we hit an assert
that assumes we can only be in LANPLUS_STATE_PRESESSION state.

Add LANPLUS_STATE_OPEN_SESSION_SENT so we don't abort if
we retry.

Commit for Anton Blanchard
2013-12-08 19:12:21 +00:00
36c11f6033 ID: 285 - Fix SEGV in ipmi_lanplus_open_session
If ipmi_lanplus_send_payload fails we get a NULL pointer
returned. Error out straight away instead of continuing on
and getting a SEGV when we dereference rsp.

Commit for Anton Blanchard
2013-12-08 19:06:13 +00:00
5dc9585e77 ID: 284 - Fix SEGV in ipmi_main
Check the return code of ipmi_main_intf->open(), and take the
error path if it fails. Right now we continue on blindly which
results in a SEGV.

Commit for Anton Blanchard
2013-12-08 18:59:28 +00:00
0b97d32c25 ID: 283 - ipmi_intf_socket_connect fails with IPv4 hosts
A recent IPv6 patch broke IPv4 connections. Fix the incorrect
conditional to get it going again.

Commit for Anton Blanchard
2013-12-08 18:54:18 +00:00
5949b19d44 Fix code formatting, at least a bit. 2013-12-08 18:46:53 +00:00
0cd8f46c42 Reverting commit ``Add support for enabling/disabling PEF policy entries'' as
there is no ticket/ticket number missing and no code review.
2013-11-26 04:25:46 +00:00
2ff745286b Add support for enabling/disabling PEF policy entries 2013-11-25 21:38:04 +00:00
f6cabfb089 PA: 83 - Revised IPv6 patch
Author: Holger Liebig
Deduplicated socket connection shared among lan and lanplus.
Allows IPv6 address and tries to pick correct scope ID.
2013-11-14 12:56:49 +00:00
d3ca7cb090 FR: 24 - Exchange OS Name Hostname BMC URL during startup
Correct sysconfig defaults in comment. Systemd dependencies.
2013-11-05 13:01:36 +00:00
6871fe1c8e FR: 24 - Exchange OS Name Hostname BMC URL during startup
Add service, systemd unit, sysconfig in contrib
2013-11-05 12:27:00 +00:00
b9a0c5a091 ID: 46 - ipmi_fwum needs some re-work
Commit changes to 'include/ipmitool/ipmi_fwum.h'.
2013-10-28 05:21:46 +00:00
1cc4ba699d ID: 46 - ipmi_fwum needs some re-work
Move 'struct' and 'enum' into header file
2013-10-26 19:31:44 +00:00
b779439ad0 ID: 46 - ipmi_fwum needs some re-work
Replace tKFWUM_Status with int

Commit replaces tKFWUM_Status with int. tKFWUM_Status is all nice and neat, but
if int can do, why would you use something that makes your lines unnecessarily
longer?
2013-10-26 19:30:15 +00:00
63ef18e6e0 ID: 46 - ipmi_fwum needs some re-work
Remove keyword 'static'

Commit removes ``static'' as I see no point, no point at all to have it here.
2013-10-26 19:29:49 +00:00
935b215514 ID: 46 - ipmi_fwum needs some re-work
Rename saveFirmwareInfo -> save_fw_nfo
2013-10-26 19:29:29 +00:00
cd524c2d25 ID: 46 - ipmi_fwum needs some re-work
File name is no longer ``uchar *'' - remove casts

File name is no longer ``unsigned char *'', therefore remove pointless casts to
``char *''.
2013-10-26 19:29:05 +00:00
e24c7f75f2 ID: 46 - ipmi_fwum needs some re-work
Remove duplicate Kontron IANA number

Commit removes/replaces duplicate Kontron IANA number which can be found in
'include/ipmitool/ipmi.h' as well. Therefore there is no need to have it here.
2013-10-26 19:28:40 +00:00
da4b779adf ID: 46 - ipmi_fwum needs some re-work
Group together and order[a-z] function prototypes
2013-10-26 19:27:43 +00:00
aca8d6ad7b ID: 46 - ipmi_fwum needs some re-work
Dismantle KfwumMain() - download/upgrade fw

Commit removes KfwumMain() and creates ipmi_fwum_fwupgrade() instead.
2013-10-26 19:27:15 +00:00
5416af78a5 ID: 46 - ipmi_fwum needs some re-work
Dismantle KfwumMain() - start fw upgrade

Commit moves start-fw-upgrade out of KfwumMain(). It also changes return type of
KfwumStartFirmwareUpgrade().
2013-10-26 19:26:38 +00:00
770e61663f ID: 46 - ipmi_fwum needs some re-work
Dismantle KfwumMain() - tracelog

Commit moves tracelog out of KfwumMain() and changes return type of
KfwumGetTraceLog().
2013-10-26 19:26:16 +00:00
22f294fc27 ID: 46 - ipmi_fwum needs some re-work
Dismantle KfwumMain() - status

Commit moves status out of KfwumMain().
2013-10-26 19:25:16 +00:00
a675601da4 ID: 46 - ipmi_fwum needs some re-work
Dismantle KfwumMain() - info

Commit moves 'info' out of KfwumMain().
2013-10-26 19:24:02 +00:00
645120f545 ID: 46 - ipmi_fwum needs some re-work
Dismantle KfwumMain() - rollback

Commit moves 'rollback' out of KfwumMain() and changes return value of
KfwumManualRollback().
2013-10-26 19:23:37 +00:00
2df9ca914f ID: 46 - ipmi_fwum needs some re-work
KfwumMain() - return value void -> int

KfwumMain() returns int instead of void now in order to report success or
failure of given task.
2013-10-26 19:23:16 +00:00
a5d55b5d51 ID: 46 - ipmi_fwum needs some re-work
Move #define into header file
2013-10-26 19:20:50 +00:00
f2ba7fcd60 ID: 46 - ipmi_fwum needs some re-work
Rename VERSION_MAJ and VERSION_MIN

Commit renames VERSION_MAJ to VER_MAJOR and VERSION_MIN to VER_MINOR.
2013-10-26 19:18:34 +00:00
24923222f6 ID: 46 - ipmi_fwum needs some re-work
Finish off formatting, remove useless comments

Commit finishes off formatting changes and removes useless, out-of-date,
comments.
2013-10-26 19:18:01 +00:00
5bf68a4769 ID: 46 - ipmi_fwum needs some re-work
KfwumGetInfoFromFirmware() - code formatting, simplify
2013-10-26 19:16:36 +00:00
4e2ac7d097 ID: 46 - ipmi_fwum needs some re-work
KfwumOutputInfo() -> printf_kfwum_info() + code formatting
2013-10-26 19:15:15 +00:00
d5d86d4dcb ID: 46 - ipmi_fwum needs some re-work
KfwumGetTraceLog() - code formatting, simplification
2013-10-26 19:14:43 +00:00
0a4a5cafbc ID: 46 - ipmi_fwum needs some re-work
KfwumStartFirmwareUpgrade() - code formatting
2013-10-26 19:13:43 +00:00
043c42160e ID: 46 - ipmi_fwum needs some re-work
KfwumGetStatus() - formatting, simplify, documentation
2013-10-26 19:12:44 +00:00
49879b387c ID: 46 - ipmi_fwum needs some re-work
KfwumShowProgress() - code formatting, fix

Commit fixes code formatting in KfwumShowProgress() and replaces ``unsigned
char'', which didn't make any sense, with a ``signed char'', resp. ``char''.
2013-10-26 19:11:33 +00:00
38121041c1 ID: 46 - ipmi_fwum needs some re-work
KfwumUploadFirmware() - code formatting
2013-10-26 19:10:16 +00:00
d8f27165d1 ID: 46 - ipmi_fwum needs some re-work
KfwumFinishFirmareImage() - code formatting
2013-10-26 19:09:15 +00:00
5a1e81a948 ID: 46 - ipmi_fwum needs some re-work
KfwumSaveFirmwareImage() - formatting, clean-up

Commit cleans up formatting, code and, hopefully, simplifies
KfwumSaveFirmwareImage().
2013-10-26 19:08:12 +00:00
f12b976ebc ID: 46 - ipmi_fwum needs some re-work
KfwumStartFirmwareImage() - code formatting, simplify
2013-10-26 19:07:04 +00:00
0dddcfe450 ID: 46 - ipmi_fwum needs some re-work
KfwumManualRollback() - code formatting, simplify
2013-10-26 19:06:28 +00:00
700658e91e ID: 46 - ipmi_fwum needs some re-work
KfwumGetDeviceInfo() - simplify, code formatting
2013-10-26 19:04:42 +00:00
3df72b68bc ID: 46 - ipmi_fwum needs some re-work
KfwumGetInfo() - simplify logic, code formatting
2013-10-26 19:03:54 +00:00
068bcb02e4 ID: 46 - ipmi_fwum needs some re-work
Rename KfwumValidFirmwareForBoard(), document

Commit renames KfwumValidFirmwareForBoard() to ipmi_kfwum_checkfwcompat() and
adds a bit of documentation about this function.
Code formatting of this function changed as well.
2013-10-26 18:38:24 +00:00
52634a708f ID: 46 - ipmi_fwum needs some re-work
KfwumGetFileSize() - small re-work
2013-10-26 18:37:45 +00:00
2b08fd405e ID: 46 - ipmi_fwum needs some re-work
KfwumMain() - change code formatting

Commit changes code formatting of KfwumMain() into readable form and to make
sense out of it.
2013-10-26 18:37:00 +00:00
fb3c6f292e ID: 46 - ipmi_fwum needs some re-work
Rename KfwumOutputHelp() to printf_kfwum_help()
2013-10-26 18:35:44 +00:00
d02492f1c7 ID: 46 - ipmi_fwum needs some re-work
Remove trailing tabs and white spaces.
2013-10-26 17:12:29 +00:00
9517cb332b ID: 46 - ipmi_fwum needs some re-work
ipmi_fwum_main() re-work.
2013-10-26 17:10:14 +00:00
ae96dd3229 ID: 50 - ipmi_hpmfwupg needs a clean up
I really don't believe you meant 'static' + function(), seriously.
2013-10-26 14:40:05 +00:00
968f5d6552 ID: 50 - ipmi_hpmfwupg needs a clean up
Rather major re-work of internal logic in HpmfwupgPreparationStage().
2013-10-26 14:18:48 +00:00
f4730e1f67 ID: 50 - ipmi_hpmfwupg needs a clean up
ComponentId has its own declaration now.
2013-10-26 07:08:13 +00:00
b782311e10 ID: 50 - ipmi_hpmfwupg needs a clean up
* print error if not enough parameters given, return code 1
* recognize 'help' as a valid parameter
* print error if a invalid parameter is given, return code 1
2013-10-26 06:55:18 +00:00
45d0a4255a ID: #279 ipmitool sdr list broken
Restoration of the interface target address and channel after a bridged
request was incorrectly tied to a non-zero saved target address.  This does
not work for the Openipmi interface because the default interface target address
for the Openipmi interface is zero by default.
2013-10-23 20:32:40 +00:00
ac9513025c ID: 50 - ipmi_hpmfwupg needs a clean up
Remove "changelog". That's why we have tickets, SCM, ChangeLog etc.
2013-10-11 04:45:55 +00:00
60a3e63429 ID: 50 - ipmi_hpmfwupg needs a clean up
HpmfwupgQuerySelftestResult() - kill one level of indentation.
2013-10-11 04:14:59 +00:00
f19ed0a90b ID: 50 - ipmi_hpmfwupg needs a clean up
HpmfwupgUpgradeStage() - kill one level of indentation by changing one if().
2013-10-10 12:26:46 +00:00
7a0b451fd7 ID: 50 - ipmi_hpmfwupg needs a clean up
HpmfwupgValidateImageIntegrity() - re-write a bit to make it more compact.
2013-10-10 12:17:22 +00:00
a8119d13a8 ID: 50 - ipmi_hpmfwupg needs a clean up
Add missing ``rsp == NULL'' comp.
2013-10-10 12:06:00 +00:00
f56cea1253 ID: 50 - ipmi_hpmfwupg needs a clean up
HpmfwupgQueryRollbackStatus() - kill one level of indentation.
2013-10-10 12:04:52 +00:00
7b5683d85d ID: 50 - ipmi_hpmfwupg needs a clean up
HpmfwupgManualFirmwareRollback() - kill one level of indentation.
2013-10-10 11:56:04 +00:00
80c03570ac ID: 50 - ipmi_hpmfwupg needs a clean up
HpmfwupgActivateFirmware(), HpmfwupgGetUpgradeStatus() - kill one level of
indentation.
2013-10-10 11:49:53 +00:00
6de0796079 ID: 50 - ipmi_hpmfwupg needs a clean up
HpmfwupgUploadFirmwareBlock() - kill a bit of indent by re-writing one if().
2013-10-10 11:42:32 +00:00
18aadc30d0 ID: 50 - ipmi_hpmfwupg needs a clean up
HpmfwupgInitiateUpgradeAction() - kill unnecessary indent.
2013-10-10 11:33:27 +00:00
08f50ad301 ID: 50 - ipmi_hpmfwupg needs a clean up
HpmfwupgAbortUpgrade() - simplify function.
2013-10-10 11:29:40 +00:00
b803224398 ID: 50 - ipmi_hpmfwupg needs a clean up
HpmfwupgGetComponentProperties() - kill indent by rewriting two if() conditions.
2013-10-10 11:23:35 +00:00
5d3c64f028 ID: 50 - ipmi_hpmfwupg needs a clean up
HpmfwupgGetTargetUpgCapabilities() - remove unnecessary if() and kill indent.
2013-10-10 11:13:44 +00:00
942dcb71d8 ID: 50 - ipmi_hpmfwupg needs a clean up
HpmfwupgGetDeviceId() - simplify function.
2013-10-10 10:37:46 +00:00
29af592773 ID: 50 - ipmi_hpmfwupg needs a clean up
HpmfwupgGetBuffersFromFile() - simplify function in order to kill unnecessary
indent. Also, notify user about malloc failure and exit early.
2013-10-10 10:17:33 +00:00
ada4b48baf ID: 50 - ipmi_hpmfwupg needs a clean up
Move struct and #define into header file where they belong.
2013-10-10 09:48:58 +00:00
47831b3c15 ID: 50 - ipmi_hpmfwupg needs a clean up
Commit changes code formatting only. No functionality changes have been made.
2013-10-10 09:14:50 +00:00
efdeb12724 ID: 44 - dummy interface support - fake-ipmistack project
Commit adds support for a 'dummy' interface in order to communicate with
fake-ipmistack.
2013-10-04 05:03:33 +00:00
c7412e5815 ID: 48 - Remove hard-coded FRU inventory access length restriction
The patch removes hard-coded 16-byte length restriction onf FRU inventory
transactions. Instead, it adds an optional command-line argument for devices
which need such restriction.
For other devices, 32 bytes cap length is used.
Also, the patch contains several code optimizations as well as several bug-fixes
in API implementations where absolute FRU device offsets were used instead on
relative.

Commit for Dmitry Bazhenov
2013-10-04 04:57:20 +00:00
041d8e4bf8 ID: 276 - HPM.1 upgrade combined patch
This patch does the following:
- Fixes percentage visualization for short upgrade images
- Resolves ambiguity for action record checksum calculation
- Skips the activation stage when all components are skipped
- Partially fixes formatting
- Adds several code optimizations

Commit for Dmitry Bazhenov
2013-10-04 03:49:58 +00:00
6a02cccb70 Updated for final 1.8.13 release 2013-09-09 15:45:53 +00:00
3d9c5ae746 ID: 273 - SOL Input buffer size. Reduce max_inbound_payload_size by the SOL
header size.  Committed for Liebig, Holger
2013-09-09 15:38:46 +00:00
49350157fe ID: 274 - bmc-snmp-proxy does not enable PEF alterting 2013-09-05 08:58:18 +00:00
c6f6550f27 update version string for rc1-cvs 2013-08-26 17:01:30 +00:00
ad86adac54 Update ChangeLog for ipmitool-1.8.13
Commit updates list of bugs fixed in 1.8.13
2013-08-23 18:47:38 +00:00
f04ccaf79e ID: 222 - 'lib/ipmi_sdr.c' - a typo 'Not Reading' -> 'No Reading'
Commit replaces spurious/confusing text 'Not Reading' wiht 'No Reading'
in 'lib/ipmi_sdr.c'.
2013-08-23 18:45:54 +00:00
fa74f3bf3a ID: 99 - 'lib/ipmi_sel.c' - possible int *flow
Commit handles possible int *flow via user input. atol()/make_int() calls
got replaced and, at least, 'errno' is being checked after strtol() calls
while reading data from file.

Reported-by: Duncan Idaho
2013-08-23 15:37:11 +00:00
8e95964938 ID: 242 - Incorrect DCMI Power Reading "IPMI timestamp" interpretation
The "IPMI timestamp" is being interpretted as a UTC time, when IPMI timestamps
are actually in localtime (to the BMC).

Commit for Rob Swindell
2013-08-23 15:23:13 +00:00
558bf55c41 ID: 229 - 'lib/ipmi_ekanalyzer.c' - a typo ``Too few argument!''
Commit replaces text in question and prints error text on STDERR.
2013-08-23 14:45:30 +00:00
393ae97425 ID: 266 - file descriptor leak in ipmi_fwum and ipmi_ekanalyzer
Commit fixes fd leaks in 'lib/ipmi_ekananlyzer.c' and 'lib/ipmi_fwum.c'.

Commit fixes file descriptor leaks in ipmi_ekanalyzer_fru_file2structure(),
source 'lib/ipmi_ekanalyzer.c', and in KfwumGetFileSize(),
source 'lib/ipmi_fwum.c'.

Reported-by: dcb
2013-08-23 14:39:52 +00:00
ee6c9be382 ID: 41 - ipmi_sel_interpret() - clean up formatting and kill indentation
Commit cleans up formatting and indentation in ipmi_sel_interpret()
in 'lib/ipmi_sel.c'.
2013-08-16 09:56:15 +00:00
5177966867 ID: 267 - Corruption in "lan alert print" output
Commit fixes corruption in 'lan alert print' output. This bug comes from two
consecutive calls to get_lan_param_select() which returns pointer to struct. In
the end, the second call would over-write data from the first one, as 'ptype'
and 'paddr' were pointing at the same address.

Thanks to Rob Swindell for logging this bug and testing the patch.
2013-08-16 09:36:17 +00:00
f6dbaf231b Added -cvs to the revision string so that cvs built version can be
differentiated from release built versions.
2013-08-15 16:43:17 +00:00
8cd3acb188 Commit adds ``ID: 269 - Fixes for configure.in for cross compilation''
to ChangeLog
2013-08-14 13:20:14 +00:00
2c6ca03f8a ID: 269 - Fixes for configure.in for cross compilation
Commit removes '-Wno-unused-result' from configure.in

This used to be tracked under ID#65.
2013-08-14 12:24:12 +00:00
aebc7d3616 ID: 65 - Fixes for configure.in for cross compilation
Check return values of scanf() in order to get rid off compiler warnings.

Commit for Dan Gora
2013-08-14 12:12:13 +00:00
157132be8c FR: 35 - Script to setup redirection of SNMP to/from BMC
Provides configuration script, systemd unit and sysconfig defaults.
On hosts running net-snmp and PEF alerting on BMC:
1. Redirect SNMP get requests to BMC (Service Processor).
2. Redirect SNMP Traps from BMC (Service Processor) to the Hosts' configured Trap sink.
2013-08-13 13:44:50 +00:00
8525fdd2a3 Added ``ID#264 - incorrect array index in get_lan_param_select()'' to ChangeLog 2013-08-13 05:20:49 +00:00
f8cecaa71a ID: 264 - incorrect array index in get_lan_param_select()
Commit fixes incorrect array index in get_lan_param_select(). The param value
matches the cmd in the lan_param struct, but it's not the same as the
ipmi_lan_params[] array index. Here is an example of what I mean. This problem
becomes apparent with the OEM extensions which use values 192+.

Commit for Jeff Bastian
2013-08-13 04:28:43 +00:00
a771107c47 Added ``ID#212 - 'lib/ipmi_dcmi.c' - possible int *flow'' to ChangeLog 2013-08-12 18:06:19 +00:00
afd015709b ID: 212 - 'lib/ipmi_dcmi.c' - possible int *flow
Commit replaces strtol() calls with appropriate str2*() ones in order to prevent
possible integer *flow via user input.
2013-08-12 18:03:10 +00:00
bfba2f83f5 ID: 3528308 - 'lib/ipmi_hpmfwupg.c' - possible int *flow
Commit replaces atoi() call with str2int() and puts a limit on accepted values
for Component ID to <0..7>.
2013-08-12 17:49:07 +00:00
8e94374cf1 Make date format YYYY-MM-DD 2013-08-09 18:04:22 +00:00
ced5794e48 Revision should be 1.8.13rc0 at this point 2013-08-08 17:28:01 +00:00
a298d2e704 Documentation, version, and admin changes in prep for 1.8.13 release 2013-08-08 16:46:52 +00:00
2d71d428f3 ID: 65 - Fixes for configure.in for cross compilation
Check return value of fread() in 'lib/ipmi_hpmfwupg.c'.

Commit for Dan Gora
2013-07-25 11:56:54 +00:00
2e5fbc878b ID: 65 - Fixes for configure.in for cross compilation
Fixed some printf() formatting warnings in 'lib/ipmi_fru.c'.

Commit for Dan Gora
2013-07-24 06:42:02 +00:00
8b7969a46f ID: 65 - Fixes for configure.in for cross compilation
Changes to ipmi_ekanalyzer_fru_file2structure() in order to get rid off
warnings.

Commit for Dan Gora
2013-07-24 05:47:11 +00:00
04ba23bc5d ID: 65 - Fixes for configure.in for cross compilation
Changes to ipmi_ek_display_board_info_area() in order to get rid off warnings.

Commit for Dan Gora
2013-07-24 05:42:23 +00:00
977c587fde ID: 65 - Fixes for configure.in for cross compilation
Commit makes small changes to ipmi_ek_display_product_info_area() in order to
get rid off warnings.
2013-07-24 05:37:12 +00:00
dd377108ee ID: 65 - Fixes for configure.in for cross compilation
Commit is a small re-work of ipmi_ek_display_chassis_info_area() (not limited)
to get rid off warnings.
2013-07-24 05:32:42 +00:00
4aea72e46f ID: 65 - Fixes for configure.in for cross compilation
Commit is a re-work of ipmi_ek_display_fru_header_detail() (not limited to) to
get rid off warnings.
2013-07-24 05:28:53 +00:00
39bcb37d14 ID: 104 'src/ipmishell.c' - possible int *flow
Commit replaces atoi() and strtol() calls in 'src/ipmishell.c' in order to
properly handle user input.
2013-07-24 04:32:14 +00:00
7770739372 ID: 65 - Fixes for configure.in for cross compilation
'src/plugins/imb/imbapi.c' - don't cast NULL to int, ever!!!
2013-07-22 08:35:23 +00:00
2ac947f6e1 ID: 65 - Fixes for configure.in for cross compilation
'lib/ipmi_dcmi.c' - return (-1) as the rest of the function does and don't
return NULL.
2013-07-22 08:34:09 +00:00
c94c7a5c86 ID: 65 - Fixes for configure.in for cross compilation
Fixed silly error where the return from fseek was compared to (unsigned
int) NULL, which makes no sense at all.

Commit for Dan Gora
2013-07-21 19:31:57 +00:00
4fdbe5bbd0 ID: 263 - ipmi_ek_display_fru_header() - file descriptor leak
Commit fixes small file descriptor leak which happens when error occurs.
2013-07-21 16:05:30 +00:00
c49bc06c39 ID: 65 - Fixes for configure.in for cross compilation
Commit is practically a re-work of ipmi_ek_display_fru_header() in order to
eliminate warnings.
Check those return values!

Commit for Dan Gora
2013-07-21 11:36:22 +00:00
55524327ce ID: 65 - Fixes for configure.in for cross compilation
NULL should never be cast to an int.

Commit for Dan Gora
2013-07-21 11:33:57 +00:00
85ff7dc46a ID: 262 - 'set' segfaults when no IPMI inf present
Commit fixes segfault in 'set' sub-command when no IPMI interface is
present/available. This is caused by 'intf->session' being used without check
whether it's NULL or not which leads to NULL reference in printf().
2013-07-18 03:20:10 +00:00
8c5013b0ba ID: 101 - 'lib/ipmi_sol.c' - possible int *flow
Fix function name - str2uint() -> str2uchar().
2013-07-18 03:10:55 +00:00
ea8ce15131 ID: 70 - Fixes and updates for ipmitool hpm
Fixed the hpm upgstatus command to print the results of the command
without having to specify -v to enable verbose operation.

It's not clear that this command is even useful to the user at all.
Perhaps it should be removed entirely.

Commit for Dan Gora
2013-07-17 10:45:56 +00:00
6d89531096 ID: 70 - Fixes and updates for ipmitool hpm
We now will print the decoded strings as well as the error value for
error response codes from the target.

Commit for Dan Gora
2013-07-17 10:42:19 +00:00
e56e914866 ID: 70 - Fixes and updates for ipmitool hpm
Update the help menu for the ipmitool hpm command.  Fix the formatting
and explain better the options.

Changed the option 'upgrade <file> all' to 'upgrade <file> force'.
This makes it clearer that the user is overriding the version check
that 'upgrade <file>' performs.

Commit for Dan Gora
2013-07-17 10:38:48 +00:00
cee8fc659a ID: 70 - Fixes and updates for ipmitool hpm
Added a new field to show the Deferred firmware version value as part
of the 'hpm check' subcommand.

The deferred firmware version is the version of the firmware which has
been loaded with the 'hpm upgrade' command, but not yet activated.

Commit for Dan Gora
2013-07-17 10:36:07 +00:00
25fa0f80ae ID: 70 - Fixes and updates for ipmitool hpm
There is no point in putting the size of things in hex.

Commit for Dan Gora
2013-07-17 10:32:56 +00:00
22e38bc46f ID: 70 - Fixes and updates for ipmitool hpm
Fixed a bug where the rolling percentage display could corrupt the
version line if the first call to HpmDisplayUpgrade resulted in a
non-zero percentage.

This was produced by performing:

ipmitool hpm upgrade hpm1fru.img

where hpm1fru.img is a small (820 byte) file.

We now call HpmDisplayUpgrade before we transfer any data to ensure
that we get 0% printed before the transfer starts.

Commit for Dan Gora
2013-07-17 10:30:23 +00:00
3bd53a2f78 ID: 70 - Fixes and updates for ipmitool hpm
Add two additional chars to the component name string.  For the
default Pigeon Point firmware names we need a couple of extra chars
to actually be able to tell what component is which.

Before:
-----------------------------------------------------
|ID | Name      |             Versions              |
|   |           |     Active      |     Backup      |
-----------------------------------------------------
|*0 |H8S-AMCc F/|   2.00 10000000 |   2.00 0F000000 |
| 1 |H8S-AMCc B/|   2.00 00000000 | ---.-- -------- |
| 2 |H8S-AMCc F/|   2.00 10000000 | ---.-- -------- |
-----------------------------------------------------

After:
--------------------------------------------------------
|ID  | Name        |             Versions              |
|    |             |     Active      |     Backup      |
--------------------------------------------------------
|*  0|H8S-AMCc F/W |   2.00 10000000 |   2.00 0F000000 |
|   1|H8S-AMCc B/L |   2.00 00000000 | ---.-- -------- |
|   2|H8S-AMCc F/I |   2.00 10000000 | ---.-- -------- |
--------------------------------------------------------

Commit for Dan Gora
2013-07-17 10:25:28 +00:00
30e4efe8a4 ID: 70 - Fixes and updates for ipmitool hpm
Added a '^' character to the ID field which will be set if the
component can be upgraded with the specified file with the 'hpm check
<file>' subcommand.

Commit for Dan Gora
2013-07-17 10:22:37 +00:00
bf8acad458 ID: 70 - Fixes and updates for ipmitool hpm
Update HpmfwupgPreUpgradeCheck to check if the Aux version is also
different when it compares the Image version to the active and
rollback versions.

Fixed the indenting and style of HpmfwupgPreUpgradeCheck to make it
more readable.

Commit for Dan Gora
2013-07-17 10:19:43 +00:00
2db7f5f6b9 ID: 259 - small memory leak in ipmi_user.c
Commit fixes a small memory leak in 'lib/ipmi_user.c' via strdup().
One typo got fixed in the process.
2013-07-16 17:41:19 +00:00
71dea69efc Squash white spaces in 'lib/ipmi_dcmi.c'
Commit squashes white spaces in 'lib/ipmi_dcmi.c'. Tabulators are used for
indentation now. I've tried to clean up comments, long lines, trailing white
spaces and tabs, code formatting. However, more work is needed especially in
ipmi_dcmi_main() where indentation level is reaching one too many.

No functional changes.
2013-07-16 11:07:24 +00:00
9f51d8f188 ID: 256 - ipmitool could crash when IPv6 address is returned
gethostbyname() can't handle IPv6. Despite this fact it seems worth of
nothing to check whether gethostbyname() really returned AF_INET or
not. And that's what attached patch does, resp. in case IPv6 is
returned then ipmitool shoud/will terminate.
2013-07-16 04:17:39 +00:00
8a40297308 ID: 257 ipmitool exec segfaults if invalid input given
Commit mitigates segfault in 'exec'/ipmishell when
invalid input is given. Code expects another _'_ or _"_ to come, but
if it doesn't, it ends up r/w unallocated memory.
2013-07-16 04:12:09 +00:00
fb5d8559e6 ID: 101 - 'lib/ipmi_sol.c' - possible int *flow
Don't make ref out of ref -> segfault.
2013-07-13 03:51:49 +00:00
2a260d32e9 ID: 260 - ipmi_user.c - replace atoi() call
Commit replaces deprecated atoi() call.
2013-07-12 12:35:19 +00:00
94c0bd0a6c ID: 101 - 'lib/ipmi_sol.c' - possible int *flow
Commit replaces unhandled strtol() calls with appropriate str2*() functions and
wrappers.

Reported-by: Duncan Idaho
2013-07-12 12:06:08 +00:00
3cb937f15e Use tabs instead of white spaces for indentation in 'lib/ipmi_chassis.c'. 2013-07-10 04:22:12 +00:00
edc700ed9a Added code to support sensors on other luns (On behalf of Kontron Germany) 2013-07-09 12:25:12 +00:00
287b313e26 ID: 113 - delloem exec file won't handle more than one command
Commit fixes issue with 'delloem' subcommands being executed via 'exec'. State
of variable 'current_arg' is kept between calls which leads to incorrect argv
parsing.
Set variable 'current_arg' every time ipmi_delloem_main() is called.
2013-07-09 11:10:03 +00:00
47d53000ce ID: 211 - 'lib/ipmi_dcmi.c' - typo & error printed on STDOUT
Commit fixes couple typos and replaces incorrect printf() calls with appropriate
lprintf() ones.
2013-07-09 05:00:42 +00:00
66399810f0 ID: 153 - 'lib/ipmi_firewall.c' - printf() used instead of lprintf()
Commit adds printf_firewall_info_usage().
2013-07-09 04:32:33 +00:00
0ab78dbf02 ID: 153 - 'lib/ipmi_firewall.c' - printf() used instead of lprintf()
Use lprintf() for error/help messages.
2013-07-09 04:20:17 +00:00
c048c9f311 ID: 93 - 'lib/ipmi_firewall.c' - str-to-int conversion is weak
Commit does:
* adds is_ipmi_channel_num() in 'lib/helper.c' for IPMI Channel validation
* replaces unhandled strtol() calls in 'lib/ipmi_firewall.c'
2013-07-09 03:42:37 +00:00
c32228d7c1 ID: 226 - 'lib/ipmi_sdradd.c' - typo
Fix I2c -> I2C.
2013-07-08 09:55:29 +00:00
a855c37619 ID: 258 - ipmi_sdradd.c - error printed on STDOUT
Commit changes printf("...") -> lprintf(LOG_ERR, "...");
2013-07-08 09:54:08 +00:00
6a66405177 ID: 226 - 'lib/ipmi_sdradd.c' - redundant newline
Commit removes redundant new-lines from error messages in 'lib/ipmi_sdradd.c'.
2013-07-08 09:51:03 +00:00
4a4331ef6d ID: 255 Fix some typos in ipmitool.1 (Debian Bug #554348)
Commit fixes couple typos in ipmitool's man page.

Commit for Stéphane Aulery
2013-07-08 08:42:55 +00:00
41288eb5e4 ID: 161 - documentation
Commit contains following documentation changes and related code usage changes:
* sorted arguments
* sorted command line commands
* adds missing arguments
* adds hidden aliases arguments with note of deprecation (feel free to remove if
  not deprecated)
* fixes incomplete synopsis
* restructures synopsis to logical blocks
* conditional argument and command combination overrides to fixed defaults

Commit for Ales Ledvinka
2013-07-08 08:29:20 +00:00
dbd2db71f2 ID: 253 - Fix lanplus retransmission
Retransmission of lanplus request is broken. ipmi_lanplus_send_payload() keeps
current timeout in local variable 'timeout' and increases it by one with each
retransmission. But ipmi_lan_poll_recv() waits for response for session->timeout
seconds, which is not incremented -> the request is retransmitted only once,
when timeout and session->timeout equals. No other retransmissions are ever
sent.

In addition, the time is measured in seconds, therefore 'time(NULL) - ltime'
often equals 'timeout' and retransmission should be sent in this case (i.e.
'xmit' should be set).

Commit for Jan Safranek
2013-07-07 15:28:13 +00:00
a472c382f4 ID: 254 - Fix retry of authentication capabilities retrieval
When lan or lanplus session is being opened, ipmi_get_auth_capabilities_cmd() is
called twice. Now that we have -R and -N options it's not necessary to have such
weird code, especially with comment ``I'm not sure why we accept a failure for
the first call''.

Commit for Jan Safranek
2013-07-07 15:22:10 +00:00
e8125c2405 ID: 244 - "0.0" displayed for unspecified threshold values
Not all SEL entries have a "threshold value" specified, yet ipmitool sel elist
always displays a threshold value (as "0.0"), even when one is not specified.

Commit for Rob Swindell
2013-07-07 12:42:42 +00:00
c0f41fa647 ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
ipmi_macinfo() - return (-1) on error
2013-07-07 12:07:21 +00:00
5c74d2935e ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
ipmi_delloem_lan_main() - return (-1) on error.
2013-07-07 12:06:21 +00:00
cd6b7039f0 ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
ipmi_powermgmt_clear - remove pointless if-else
Set clearType to 1 by default, so there is no need for if-else anymore.
2013-07-07 12:05:11 +00:00
b4cb02a4d9 ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
Remove `` )'' - white space.
2013-07-07 12:03:42 +00:00
91fdb17260 ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
Don't ``function ()'' - remove white space.
2013-07-07 12:02:05 +00:00
2302e83db5 ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
ipmi_lcd_set_single_line_text - invalid retval - Return (-1) on error as
specified instead of 1.
2013-07-07 11:58:13 +00:00
b0294b96fd ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
pmi_macinfo_drac_idrac_mac - simplify - Return immediately if NicNum doesn't
meet expectations or UseVirtualMacAddress isn't 0.
2013-07-07 11:56:47 +00:00
f1f2cbb18b ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
ipmi_macinfo_drac_virtual_mac - simplify - Return immediately if NicNum doesn't
meet expectations.
2013-07-07 11:54:36 +00:00
eb65a625a2 ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
ipmi_lcd_get_info - simplify - Remove pointless ``if () { } else { }'' and
return immediately on error.
2013-07-07 11:52:06 +00:00
516fe51505 ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
ipmi_lcd_get_info_wh - simplify - Remove pointless ``if () { } else { }'' and
return immediately on error.
2013-07-07 11:49:19 +00:00
5d5251f7da ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
ipmi_get_power_consumption_data - simplify - If rsp is NULL or ccode is not 0,
then return immediately.
2013-07-07 11:47:49 +00:00
5819b314af ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
Remove unnecessary if() from ipmi_print_power_cnsmpt_history().
2013-07-07 11:43:10 +00:00
630934cb89 ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
ipmi_get_sd_card_info - return (-1) if no SD card is present.
2013-07-07 11:41:27 +00:00
d44be6e5f5 ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
Don't prefix error message with extra white space(s).
2013-07-07 11:39:15 +00:00
078ff3a04e ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
lprintf() doesn't need '\n', so don't give it one.
2013-07-07 11:34:59 +00:00
865c435b4c ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
ipmi_delloem_vFlash_process() - use two lprintf() calls instead of one combined.
2013-07-07 11:29:23 +00:00
1d9dd4e2de ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
Re-format all usage functions.
2013-07-07 11:28:00 +00:00
e95a4cf998 ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
Don't ``printf (...)'' -> ``printf(...)''.
2013-07-07 11:26:45 +00:00
38f89a449d ID: 28 - 'lib/ipmi_delloem.c' - clean up the code
Use lprintf() instead of printf() for error messages.
2013-07-07 11:24:45 +00:00
64e0b9ab64 ID: 239 - typo in 'mc selftest', add details
Commit fixes a typo and adds details to 'mc selftest' command.

Commit for Rob Swindell
2013-06-10 04:14:21 +00:00
e30f3726a6 ID: 143 - Reversed 'channel authcap' capabilities
Commit fixes reversed IPMIv1.5/2.0 'channel authcap' capabilities
in 'include/ipmitool/ipmi_channel.h'.

Commit for Rob Swindell
2013-06-10 04:05:54 +00:00
63ba1cc610 ID: 3587318 - "dcmi discover" is not DCMI 1.5 compatible
Command "dcmi discover" fails with ``ERROR! This command is not available on this
platform'' unless the DCMI implementation advertises DCMI 1.0 or 1.1 conformance.
This means command will fail DCMI 1.5 capable hardware. Commit fixes this issue.

Commit for Rob Swindell
2013-06-02 13:19:57 +00:00
384618d1bc ID: 3612237 - If DCMI command fails, incorrect completion code is printed
If any DCMI command fails, the function chk_rsp() in ipmi_dcmi.c displays the
incorrect byte as the completion code.

$ ipmitool dcmi power activate
DCMI request failed because: Unspecified error (dc)

The "dc" value printed is actually the "Group extension identification" byte
which *always* has the value 0xdc for DCMI responses.

Commit for Rob Swindell
2013-06-02 12:58:47 +00:00
b0020e0bae ID: 3612382 - Typos in 'dcmi' help output
Commit fixes typos in DCMI help output.

Commit for Rob Swindell
2013-06-02 12:51:05 +00:00
7a861ffba6 ID: 3612371 - Typo in impi_sel debug output
IANA is decimal, so don't prefix it with '0x'.

Commit for Rob Swindell
2013-06-02 12:45:01 +00:00
811da1307a ID: 3612372 - Recognize Broadcom IANA number and BCM5725 product
Commit adds BCM IANA and BCM5725 product number.

Commit for Rob Swindell
2013-06-02 12:38:23 +00:00
8489426a63 ID: 3608003 - 'lib/ipmi_fru.c' - atol() should be replaced with str2*()
Commit replaces atol() calls with str2int() ones in 'lib/ipmi_fru.c'.
2013-06-02 12:27:41 +00:00
dbe514a558 ID: 3613042 - add missing Entity IDs
Commit adds missing Entity IDs as defined by 43.14 Entity IDs, IPMI
Specification, V2.0, Markup for Addendum, Rev. 4.

Reported-by: Ulrich Windl
2013-06-02 12:24:36 +00:00
d5ab51f2cd ID: 3611905 - Direct Serial Basic/Terminal Mode Interface drivers
The patch adds support for direct serial interface drivers (Terminal and Basic
mode).
Despite both drivers implement single and double bridging, it doesn't work at
the moment. Making this functionality to work depends on outcome of
ID#3611226(?).

Commit for Dmitry Bazhenov
2013-05-28 07:38:55 +00:00
0cea01e42f ID: 3611254 - OEM handle for Intel 82751 in SPT mode
Intel 82751 MAC has several deviations in its RMCP+ implementation while working
in the super pass-through mode.
This patch adds a OEM handle which allows IPMItool succesfully interract with
boards equipped with this NIC.

Commit for Dmitry Bazhenov
2013-05-28 04:18:22 +00:00
38d71179e9 ID: 3613575 - memory leak - ipmi_password_file_read()
Commit fixes memory leak in ipmi_password_file_read() in 'lib/ipmi_main.c'.
2013-05-23 03:34:14 +00:00
cc48c433fd ID: 3522740 - reading password from file is limited to 16byte passwords
Commit fixes switched values(const<->size) passed to memset().
2013-05-22 13:51:40 +00:00
51dd9cf1f0 ID: 3613605 - 'lib/ipmi_main.c' - call free() on pointer to static data
getpass() and getpassphrase() library functions return pointer to a static
data array. When free() is called on such pointer, it abnormally terminates
application.

Commit for Dmitry Bazhenov
2013-05-22 10:16:59 +00:00
44247a8743 ID: 3522740 - reading password from file is limited to 16byte passwords
Reading password from file is no longer limited to 16bytes.

Reported-by: Dune Idaho
2013-05-22 10:05:06 +00:00
d82a29d813 ID: 3528308 - 'lib/ipmi_hpmfwupg.c' - possible int *flow
Commit replaces strtol() calls with str2uchar() ones in order to mitigate
possible *flow via user input.
Also, limits are applied to 'Component ID' and 'Properties selector' now.

Reported-by: Dune Idaho
2013-05-22 09:50:10 +00:00
c5324e879c ID: 3528371 - 'lib/ipmi_sensor.c' - possible int *flow
Commit replaces strtod() calls with str2double() ones in order to mitigate
possible *flow via user input.

Reported-by: Dune Idaho
2013-05-22 09:45:30 +00:00
a8f6341728 ID: 3528310 - 'lib/ipmi_picmg.c' - possible int *flow
Commit replaces atoi() and strtoul() calls with wrappers in order to prevent
possible int *flow via user input.
Also, limits on user provided values are applied wherever possible.

Reported-by: Dune Idaho
2013-05-18 06:31:02 +00:00
7472986e1c ID: 3528310 - add str2char(), move is_fru_id() into 'lib/helper.c'
Commit adds new function str2char() into 'lib/helper.c'. Also, function
is_fru_id() moves from 'lib/ipmi_fru.c' into 'lib/helper.c' in order to be
utilized by other modules.
2013-05-18 06:08:13 +00:00
72dd3edde4 "Bridging fixes for PICMG Platforms. Interface is always opened prior to
first IPMI request.  Addition of macro to determine necessity of sensor
bridging and PICMG target address discover.   See ID: 3611226"
2013-05-06 14:08:56 +00:00
cf6740b3f6 Add missing newlines when cvs output is specified see ID 3611912 for details 2013-04-26 20:52:43 +00:00
14e26ac8a0 ID: 3611253 - configure.in - do not override OS-default values for interfaces
Commit fixes bug where OS default values were over-ridden if the corresponding
enable/disable arguments weren't provided via command-line parameters.
Commit also changes IPMI shell default configuration setting from 'yes' to
'auto'.

Commit for Dmitry Bazhenov
2013-04-26 19:16:31 +00:00
cee211da31 ID: 3611253 - configure.in - fixed build for the newer autotool releases
Commit for Dmitry Bazhenov
2013-04-25 08:50:53 +00:00
3818c0d296 ID: 3611253 - Don't print AUX info if IPMC returns 12byte Get Device ID response
Commit for Dmitry Bazhenov
2013-04-25 08:40:56 +00:00
ae05861b62 ID: 3611253 - 'lib/ipmi_sel.c' - avoid reading of uninitialized data
Zero data before making request in order to avoid reading of uninitialized data
in ipmi_sel_add_entry().

Commit for Dmitry Bazhenov
2013-04-25 08:29:45 +00:00
c29cf4bcd3 ID: 3611303 - 'src/plugins/lan/lan.c' - error check is missing braces
Fixed a bug where connecting to a remote shelf manager via the lan
interface would always fail with:

``Activate Session error: Session sequence out of range Error: Unable
to establish LAN session''

This is due to a bug introduced in get_random() by fix for ID#3600963 where
braces were missing from an error check.

Commit for Dan Gora
2013-04-25 07:50:45 +00:00
723e3da037 ID: 3611306 - 'lib/ipmi_tsol.c' - fix always fail in case of error
Commit fixes bug introduced by fix for ID#3600946 where
an error case was missing braces, so it would always fail.

Commit for Dan Gora
2013-04-25 07:43:07 +00:00
c72afa37ee ID: 3608760 - Add bswap.h to ipmi_chassis.c and ipmi_pef.c
ID: 3564701 - ipmitool 1.8.12 doesn't build on big endian architectures

Compilation would fail on big endian architecture because BSWAP_32 was not
defined in 'ipmi_chassis.c' and 'ipmi_pef.c'.

The problem was '#include <ipmitool/bswap.h>' depended on WORDS_BIGENDIAN which
comes from '<config.h>'. However, none of the previous header files
would include '<config.h>', so it remained undefined.

'bswap.h' gets included unconditionally now.

Commit for Dan Gora
2013-04-25 07:34:44 +00:00
fa5bdb2f3d ID: 3608765 - improve debug output in ipmi_ekanalyzer_fru_file2structure()
Format the records a little more clearly by adding offsets.

Commit for Dan Gora
2013-04-23 07:28:53 +00:00
49784a9ec8 ID: 3608765 - Fix indentation of ipmi_ek_create_amc_p2p_record()
Commit changes indentation and formatting in ipmi_ek_create_amc_p2p_record().

Commit for Dan Gora
2013-04-22 11:12:11 +00:00
d1d404fef4 ID: 3608765 - Fix signed offset in ipmi_ekanalyzer_fru_file2structure
If the offset was greater than 127, then the multi_offset would end
up being a negative value, which is not what we want.

Commit for Dan Gora
2013-04-22 10:31:50 +00:00
de1dee44bd ID: 3608765 - ipmi_ekanalyzer_fru_file2structure would return error
ipmi_ekanalyzer_fru_file2structure would return ERROR_STATUS even if
it finished sucessfully.

Commit for Dan Gora
2013-04-22 10:18:11 +00:00
e1728327f6 ID: 3608765 - Fix printing in ipmi_ek_display_amc_p2p_record()
Change the amc channel descriptor ports to be displayed in decimal
instead of hex. This matches the 'fru -v' output in ipmitool.

Add decimal value of Link Asymetric Match values. So people don't have to
look up the value in the source or in the PIGMG spec.

Commit for Dan Gora
2013-04-22 10:05:53 +00:00
3b77db9a86 ID: 3608765 - ipmi_ekanalyzer.c - fix reading amc channel and link descriptors
Due to a bug in gcc where unaligned bit fields were not packed correctly
before gcc 4.4, we changed the fru_picmgext_amc_channel_desc_record
and fru_picmgext_amc_link_desc_record structures to use
larger types to be packed correctly. This then requires
us to use the FRU_PICMGEXT_AMC_CHANNEL_DESC_RECORD_SIZE and
FRU_PICMGEXT_AMC_LINK_DESC_RECORD_SIZE defines instead of sizeof for
these structures.

Updated ipmi_ek_create_amc_p2p_record() and
ipmi_ek_display_amc_p2p_record() to read data in the correct byte order
on both big and little endian machines.

Commit for Dan Gora
2013-04-22 09:50:53 +00:00
2abad0e504 ID: 3608757 - ipmi_fru.h/ipmi_fru.c - various fixes
Fixed several bugs with printing out the Carrier and AMC connectivity
information with 'ipmitool -v fru'

There were several bugs that were caused due to using bitfields with
char types in ipmi_fru.h. GCC versions before v4.4 had a bug where
they did not pack the bitfields correctly if the bitfields were not
cleanly aligned with the underlying char type.

Fixed and cleaned up all other PICMG FRU records.

Commit for Dan Gora
2013-04-22 08:37:13 +00:00
0411186443 ID: 3608765 - Fixed big endian bug in ipmi_ek_display_carrier_connectivity.
Fixed a bug where the carrier connectivity point to point descriptor
was not being displayed properly when compiled on big endian machines.

Commit for Dan Gora
2013-04-18 08:45:50 +00:00
1e96d20277 ID: 3608765 - Fixed bug reading length in fru info on big endian machines
Fixed bugs in ipmi_ek_display_chassis_info_area(),
ipmi_ek_display_product_info_area(), and
ipmi_ekanalyzer_fru_file2structure() where fread was being called to
read one byte of data into a int or long data type. This would result
in the value being byte swapped since the byte was read into the most
significant byte of the int (ie byte 0) on big endian machines.

Commit for Dan Gora
2013-04-18 08:27:33 +00:00
de4de4fc96 ID: 3608765 - Fixed bug in ipmi_ek_display_board_info_area()
Previous versions were not setting the file_offset properly if a Custom
board type was found, which would prevent subsequent dissectors from
operating properly and terminating the output of 'ipmitool ekanalyze
frushow oc=<atca carrier fruinfo>' early.

Rewrote ipmi_ek_display_board_info_area() to fix indentation and
to properly set the file_offset and end the while loop if a Custom
board_type was found.

Previous versions were also abusing the board_length variable,
treating it as an int and using it to break out of the loop.

Commit for Dan Gora
2013-04-18 07:57:26 +00:00
4299cfa385 ID: 3608765 - 'lib/ipmi_ekanalyzer.c' - reverse checks to reduce indentation
Rewrote ipmi_ek_display_chassis_info_area,
ipmi_ek_display_product_info_area, and
ipmi_ekanalyzer_fru_file2structure to reverse the checks of error
conditions to reduce the amount of indentation required.

Commit for Dan Gora
2013-04-15 11:33:17 +00:00
184994586e ID: 3608763 - 'lib/ipmi_sdr.c' - update main help
Commit updates main help of 'lib/ipmi_sdr.c'. Changes:
* LOG_ERR -> LOG_NOTICE
* add error messages, eg. Invalid command, Not enough parameters etc.
* handle 'sdr fill INV_PARAM'
* return codes on error
* general fixes and changes of SDR help output

Reported-by: Dan Gora
2013-04-15 08:24:13 +00:00
692861f292 ID: 3608763 - 'lib/ipmi_sdr.c' - fix 'nosats' -> 'nosat'
I forgot to modify size of compared string passed to strncmp() while changing
'nosats' to 'nosat'.
2013-04-12 14:52:14 +00:00
39408ea589 ID: 3608763 - ipmi_sdr_print_type() print error if sensor not found
'sdr type <TYPE_OF_SENSOR>' - print error message if sensor of given type
was not found.

Commit for Dan Gora
2013-04-12 13:11:26 +00:00
1602e0a7a2 ID: 3608763 - 'lib/ipmi_sdr.c' - fix 'nosats' -> 'nosat'
Commit fixes typo in strncmp() comparison of argv and changes 'nosats'
to 'nosat'.

Commit for Dan Gora
2013-04-12 13:01:07 +00:00
f074f76620 ID: 3608765 - 'lib/ipmi_ekanalyzer.c' - multiple increments in args to printf()
Performing prefix or postfix increments, eg. ++var or var++, in the
arguments to printf is inherently non-portable and may give different
results on different platforms.
Commit mends this issue.

Commit for Dan Gora
2013-04-09 10:20:02 +00:00
87e6c7279d ID: 3608765 - Remove unused variables from ipmi_ekanalyzer_ekeying_match().
Commit removes unused local variables from ipmi_ekanalyzer_ekeying_match().

Commit for Dan Gora
2013-04-09 10:00:40 +00:00
1f1dc806fe ID: 3608765 - Fix spelling of ipmi_ek_diplay_carrier_connectivity()
Commit corrects spelling of function ipmi_ek_display_carrier_connectivity().

Commit for Dan Gora
2013-04-09 09:55:03 +00:00
8afb3c315b ID: 3608763 - 'lib/ipmi_sdr.c' - display hex values of Sensors
Commit adds the hex value for the sensor type to displays so that the user
can correlate sensor type values with their hex values without having to
look them up in the IPMI spec.

Commit for Dan Gora
2013-04-09 08:38:31 +00:00
4aae41904d ID: 3608763 - Update sensor_type_desc values to differentiate watchdogs
Previous versions had two values for "Watchdog" in the list which
means that users could not perform # ipmitool sdr type "Watchdog";
and get the IPMI v1.0 and later version of the watchdog sensor,
eg. 0x23 instead of 0x11.

Commit for Dan Gora
2013-04-09 08:08:20 +00:00
41a44b037f ID: 3608759 - Remove '-Wno-packed-bitfield-compat' from CFLAGS
Commit removes -Wno-packed-bitfield-compat from 'configure.in'. This was hiding
an important bug in ipmi_fru.h and is not a valid flag for older versions of
gcc.

Commit for Dan Gora
2013-04-09 07:38:35 +00:00
49a7ceee70 ID: 3608761 - 'lib/ipmi_main.c' - PICMG Get Device Locator was never run
This code was moved to ipmi_main.c from open.c and in the change a bug
was introduced where the PICMG Get Device Locator command would not
be run unless the user explicitly set my_addr to 0 with the -m command.

The more sensible thing to do is to run this unless the user explictly
overrides it with the -m option.

Commit for Dan Gora
2013-04-08 17:46:17 +00:00
3687a6cbb8 ID: 3608762 - 'lib/ipm_hpmfwup.c' - Fixed help messages for hpm command
Commit cleans up the formatting of help output a bit to fit on an 80 column
screen.

Commit for Dan Gora
2013-04-08 17:36:33 +00:00
627cadaa39 ID: 3608759 - Fix bug in configure.in when cross compiling
The previous test to see if we need pragma pack(1) was failing if we
cross compile because there was no way to run the test.

We now use AC_TRY_COMPILE and add the pragma pack(1) to the test code.
If it compiles, it must be good, so add the define.

Commit for Dan Gora
2013-04-08 17:29:24 +00:00
eb63058bc3 ID: 2871903 - ipmitool user priv incorrectly sets Link Auth
Commit fixes issue in 'user priv' sub-command which turns off LinkAuth whenever
user's privilege is changed. This was caused by not setting apropriate bits.
However, fix leverages Set User Access Command(IPMI spec. v2 PDF, p.320) and
sets 7th bit of 1st byte to 0. This tells BMC not to change IPMI messaging,
LinkAuth and Callback for given user.

As a consequence, ipmitool no longer turns 'IPMI messaging' on by default when
user's privilege is being set. IPMI messaging can be turned on/off via 'channel
setaccess' sub-command.

Reported-by: Kipp Glover
2013-04-08 17:21:38 +00:00
15f1255237 ID: 3610286 - 'lib/ipmi_sdr.c' - ipmi_sdr_print_type - incorrect eval
Commit fixes incorrect evaluation of str2uchar() return value in
ipmi_sdr_print_type(). Prior to this fix, practically no user input was accepted
as a valid one in # ipmitool sdr type HEX_SENSOR_TYPE ;

This bug was introduced by ID#3528368 - 'lib/ipmi_sdr.c' - possible int *flow
2013-04-08 17:04:34 +00:00
2dfa02ba24 Fix "help" command line processing in fru command defect (ID: 3610117)
introduced by the following changes:

ID: 3582307 - 'lib/ipmi_fru.c' - ipmi_fru_main() return codes
ID: 3582310 - 'lib/ipmi_fru.c' - ipmi_fru_main() - misuse of printf()
2013-04-08 13:22:34 +00:00
9d6a201911 ID: 3608758 - 'include/ipmitool/ipmi.h' - add IPMI_NETFN_OEM
Commit adds IPMI_NETFN_OEM code 0x2E for completeness.

Commit for Dan Gora
2013-04-04 11:54:00 +00:00
ad01921281 ID: 3609985 - delloem : Wrong MAC returned when flex addressing is enabled
Commit fixes problem in 'lib/ipmi_delloem.c'. Command % ipmitool delloem mac;
returns wrong MAC when flex addressing is enabled on the blade chassis.

Commit for Krishnaprasad K
2013-04-04 07:27:11 +00:00
d27d2f7ae3 ID: 3016359 - Get SEL Alloc Information is incorrect
The Information given by the command SEL was incorrect in "Get SEL Allocation"
command. According to the specification "byte 10" in response denotes the
"Maximum record size in allocation units". This information is given as "Max
Record Size : " in sel command. However, ipmitool was getting "byte 9" instead
of "byte 10".

Commit for Gokulakannan
2013-04-02 10:37:15 +00:00
26c17eeb91 ID: 3600933 - 'lib/ipmi_sol.c' - use of deprecated bzero()
Commit replaces deprecated bzero() call with memset().

Commit for Ales Ledvinka
2013-03-30 06:37:51 +00:00
fdbef84866 ID: 3609472 - Add the instance to the SOL commands
The SOL protocol supports multiple serial ports using the "instance",
allow this to be passed in to ipmitool.

Commit for Corey Minyard
2013-03-29 21:01:10 +00:00
3a383608dd ID: 3609473 - Add assertion/deassertion to threshold events
The event data and SDRs support assertions and deassertions for threshold events
as well as discrete events. So print out assertion and deassertion on all
events.

Commit for Corey Minyard
2013-03-29 18:45:16 +00:00
66fcf484a4 ID: 3600911 - 'lib/ipmi_fru.c' - fix multiple increments in args to printf
Commit fixes multiple increments in arguments of printf() which leads to
undefined/inconsistent behaviour and results.

Reported-by: Ales Ledvinka
2013-03-29 14:52:59 +00:00
52c07d61f9 ID: 3608149 - ipmitool - set pointer to NULL after free()
Commit is a response(and fix) to double-free bug in 'lib/ipmi_main.c' via
username. Now, pointers should be set to NULL after calling free().

Reported-by: Ales Ledvinka
2013-03-29 14:40:21 +00:00
fd752420ec ID: 3608261 - 'lib/ipmi_delloem.c' - code formatting
Commit changes code formatting in 'lib/ipmi_delloem.c' to be more consistent
with the rest of ipmitool's code. No functional changes are intended.
Clean up isn't perfect, but it's one of steps in long term effort.
2013-03-21 14:07:50 +00:00
7a74ab32a8 ID: 3608022 - 'lib/ipmi_fru.c' - unsigned errors
Commit removes 'size' check from ipmi_fru_get_multirec_from_file() as
an unsigned value can't be less than zero(0).
This error has been introduced by ID#3600911.

Reported-by: Ales Ledvinka
2013-03-21 11:32:09 +00:00
3ea41bda4b ID: 3607981 - 'lib/ipmi_lanp.c' - replace atoi() calls
Commit replaces atoi() calls with str2uchar() ones to eliminate possible int
*flow via user input.
2013-03-21 09:37:57 +00:00
992b42ceee ID: 3607320 - 'lib/ipmi_lanp.c' - possible NULL reference
Commit fixes possible NULL reference in 'lib/ipmi_lanp.c' which is caused by not
checking return value of get_lan_param(), resp. get_lan_param_select(). This
function can return NULL in certain situations.
2013-03-19 19:53:52 +00:00
002c8becf4 REVERT - ID: 3608261 - FReq - 'lib/ipmi_delloem.c' - clean up the code
I'm reverting previous commit. I'm not sure what happened, but there is a huge
difference between what got committed, what came as a diff in e-mail and what
should have been committed in the first place.
2013-03-16 21:15:21 +00:00
6f1bd51f1e ID: 3608261 - FReq - 'lib/ipmi_delloem.c' - clean up the code
Commit removes trailing white spaces and tabs in 'lib/ipmi_delloem.c'.
2013-03-16 20:15:07 +00:00
4719d371b7 ID: 3608007 - 'lib/ipmi_session.c' - typo in error message
Commit fixes typo in error mesage in ipmi_session_main().
2013-03-14 12:41:48 +00:00
ba9a313911 ID: 3600926 - 'lib/ipmi_lanp.c'
Commit replaces condition ``if (p == NULL)'' in get_lan_param_select(). This
condition is never met, because structure is on heap.
Condition is replaced by for() control structure which goes through structure
ipmi_lan_params and checks whether requested LAN parameter is defined in
structure or not.

Reported-by: Ales Ledvinka
2013-03-14 08:38:32 +00:00
4a9af33734 ID: 3528247 - 'lib/ipmi_delloem.c' - fix possible *int flows
Commit fixes possible integer *flows in 'lib/ipmi_delloem.c'. Function
make_int() is removed and replaced with calls to appropriate str2*() function
calls from 'lib/helper.c'.

Reported-by: Duncan Idaho
2013-03-14 05:33:37 +00:00
e320e266b1 ID: 3576212 - 'lib/ipmi_event.c' - better rsp handling
Commit changes handling of response in ipmi_event_fromsensor(). If ccode doesn't
equal to 0, then error message is printed and function returns.

Reported-by: Duncan Idaho
2013-03-14 05:29:50 +00:00
95df7b2499 ID: 3607393 - 'lib/ipmi_event.c' - redundant '\n' in error message
Commit removes redundant '\n' in error message.
2013-03-11 14:09:33 +00:00
665f2f7ee9 revert back to the 1.8.11 default cipher suite of 3, ID: #3571371, #3576112 2013-03-11 13:10:23 +00:00
e99e525a53 ID: 3600911 - 'lib/ipmi_fru.c' - rewrite of ipmi_fru_get_multirec_from_file()
Commit is a rewrite of function ipmi_fru_get_multirec_from_file() in
'lib/ipmi_fru.c'.
Changes:
* argument size is checked; size must be greater than 0
* argument pFileName is checked
* return value of seek() is checked
* error messages are printed on STDERR
* code flow got a re-work
2013-03-08 20:32:07 +00:00
39ad0d62cc ID: 3603419 - 'lib/ipmi_dcmi.c' - waste of resources
Commit moves one #ifdef upwards in the code, so resources are not wasted
pointlessly. There is no need to allocate memory for variables/structs and open
interface, if we're about to quit immediately because LAN+ support is not
enabled.
Error message got changed as well and it gets printed on STDERR where it
belongs!
2013-03-08 06:39:54 +00:00
db56cc3f86 Do not bridge in-band ipmi requests when -m <local_addr> is specified without -t <target_address> on the command line. Prior to this change -m <local_addr> would always attempt to bride the request becaues the default target_address was being set to 0x20 instead of zero. ID: 3605313 2013-03-05 18:49:09 +00:00
108dc8aa0b ID: 3600911 - 'lib/ipmi_fru.c' - retval ipmi_fru_get_adjust_size_from_buffer()
Commit changes return value of ipmi_fru_get_adjust_size_from_buffer() from void
to int in order to determine whether call was successful or wasn't.
ipmi_fru_upg_ekeying() got re-work as well.

Changes to ipmi_fru_get_adjust_size_from_buffer():
* CHUNK_SIZE removed
* code formatting
* return value void -> int

Changes to ipmi_fru_upg_ekeying():
* check whether pFilename is NULL
* check return values of called functions
* re-work code - return early on error instead of nested if()
* added (error) messages
2013-03-05 05:00:32 +00:00
b6c97d8318 compile fix. see previous revision diff and comment for code change reason 2013-02-20 14:35:07 +00:00
fd2ab0b7bb ID: 3600911 - 'lib/ipmi_fru.c' memory leaks
Commit fixes memory leanks in functions ipmi_fru_set_field_string() and
ipmi_fru_set_field_string_rebuild() in 'lib/ipmi_fru.c'.

Note: it seems to me like these for() cycles do nothing.

Reported-by: Ales Ledvinka
2013-02-20 13:14:37 +00:00
8c91abfa19 ID: 3600910 - make ipmi_lcd_get_platform_model_name() to return int
Commit changes function ipmi_lcd_get_platform_model_name() to return integer
instead of void to signal potentional problems/issues.

Reported-by: Ales Ledvinka
2013-02-20 12:17:58 +00:00
4c009309eb ID: 3600928 - 'lib/ipmi_pef.c' handle unrecognized event trigger
Commit adds code to handle unrecognized event trigger in
ipmi_pef_print_event_info().

Reported-by: Ales Ledvinka
2013-02-13 11:46:15 +00:00
ed1865da0a ID: 3600928 - 'lib/ipmi_pef.c' use 'else if ()' instead of 'if ()'
Commit trades 'if ()' for 'else if ()' and removes one pointless 'if ()' since
rsp isn't NULL at this point.
2013-02-13 11:35:21 +00:00
c726a09482 ID: 3600928 - 'lib/ipmi_pef.c' memory leaks
Commit fixes memory leaks in 'lib/ipmi_pef.c'.

Reported-by: Ales Ledvinka
2013-02-13 11:28:58 +00:00
a70de993cf ID: 3600910 - 'lib/ipmi_delloem.c' use 'else if' instead of 'if', use 'rc'
Commit changes are related to ipmi_ldc_set_lock() in 'lib/ipmi_delloem.c':
* use 'else if' instead of 'if' since it's the same given the context and
probably better
* use 'rc' variable, since it's there, rather than 'return'

Note: ipmi_lcd_set_lock() would use some re-write.

Reported-by: Ales Ledvinka
2013-02-12 12:23:11 +00:00
c53a3cbb8e ID: 3600910 - 'lib/ipmi_delloem.c' remove unused variable
Commit removes unused variable 'dte' in ipmi_powermgmt() in
'lib/ipmi_delloem.c'.
2013-02-12 12:15:28 +00:00
69e43dc87f ID: 3600927 - change eval order of input param in ipmi_oem_setup()
Commit changes evaluation order of 'oemtype' which is an input parameter to
ipmi_oem_setup() in 'lib/ipmi_oem.c'. Make the check whether 'oemtype' is NULL
or not one of the first things we do rather than blindly use 'oemtype' in
strncmp() and then check if it isn't NULL. Yes, this is a potential crash
waiting to happen.

Reported-by: Ales Ledvinka
2013-02-12 12:01:32 +00:00
5fa202f7d3 ID: 3600930 - dead code in 'lib/ipmi_sdr.c'
Commit adds comment for dead code in 'lib/ipmi_sdr.c'. This part of code has
been purposefully turned off.
2013-02-07 06:14:56 +00:00
c070fc00d6 ID: 3600930 - 'lib/ipmi_sdr.c' - NULL dereference
Commit fixes NULL dereference in 'lib/ipmi_sdr.c' by checking whether Sensor is
type of 'full' or 'compact'.

Fix by: Jim Mank
Reported by: Ales Ledvinka
2013-02-05 06:57:44 +00:00
bd4f34b035 ID: 3602439 - 'lib/ipmi_sdr.c' - memory leaks
Commit fixes memory leaks in 'lib/ipmi_sdr.c'. This is based on ticket #3600930.

Reported by: Ales Ledvinka
2013-02-05 06:51:43 +00:00
6e87e423eb ID: 3601265 - # ipmitool sensor get; leaks memory
ID: 3601106 - # ipmitool sensor get NACname; output incorrect/inconsistent

After a lengthy discussion with Jim, I'm removing free() of sdr_record_list in
ipmi_sensor_get() as this is freed in 'lib/ipmi_main.c' on/prior to ipmitool's
exit.
2013-01-23 11:24:05 +00:00
37861d60e4 3600962 descriptor leaks 2013-01-18 12:46:52 +00:00
bd5ffa4756 3600914 no more crash on no response. allow more send/recv loops of waiting. 2013-01-18 12:43:19 +00:00
c958de2870 3600929 additional ticket request. 2013-01-18 12:37:27 +00:00
86805c2146 ID: 3601265 - # ipmitool sensor get; leaks memory
Commit fixes memory leak in ipmi_sensor_get() caused by not free()-ing
sdr_record_list.
2013-01-17 15:45:25 +00:00
c97d9d5b85 ID: 3601106 - # ipmitool sensor get NACname; output incorrect/inconsistent
Commit re-works output of # ipmitool sensor get; command. It removes calls to
sensor specific functions with call to ipmi_sdr_print_listentry(). This way,
output is unified with the output of '-v sdr list' and actually has corrent
information. Well, at least errors are gone and no information seems to be
missing.
Commit fixes help and return codes as well.
2013-01-17 14:36:13 +00:00
76ed820e03 ID: 3600908 - 'lib/ipmi_dcmi.c' - crash in ipmi_print_sensor_info(), NULL ref
Commit fixes crash in ipmi_print_sensor_info() in 'lib/ipmi_dcmi.c' due to NULL
reference. 'rec' is correctly checked whether NULL or not, but it's used
immediately despite of the outcome of the NULL test.
Also, ipmi_sdr_print_rawentry() is used instead of specific print function.
2013-01-17 06:54:07 +00:00
091ba2ea58 3600907 defined value for "Chassis may not support Force Identify" 2013-01-16 14:28:39 +00:00
3f53760062 3600929 error keyword 2013-01-16 13:32:41 +00:00
83794843b5 3600921 similar code as hpmfwupg reading negative length from failed ftell 2013-01-16 12:33:13 +00:00
4a12bdebd6 3600922 sizeof of incorrect value, bzero deprecated 2013-01-16 12:29:21 +00:00
8a4139e1b8 3600931 leaks 2013-01-16 12:27:29 +00:00
15d683d86d 3600942 check return code 2013-01-16 12:24:13 +00:00
6eda3b5482 3600946 check for failed bind on send, leaks 2013-01-16 12:20:52 +00:00
6a82e95988 3600960 check the copy of password exists 2013-01-16 12:17:06 +00:00
28f93df807 3600963 leak and failed random future note 2013-01-16 12:15:10 +00:00
3f9b728e57 3600964 leak 2013-01-16 12:12:21 +00:00
9a8a8b7dad 3600965 move the initialization past the null intf check 2013-01-16 12:08:50 +00:00
75d6c72c5d ID: 3595188 - minor leaks via options. revert prev, this cleaner naming, changes by Zdenek Styblik 2013-01-11 11:21:26 +00:00
8882955891 fixes minor leaks on command line argument parsing 2013-01-11 10:57:44 +00:00
22b283b210 ID: 3598203 - 'mc getsysinfo|setsysinfo' needs a bit of re-work
ID: 3597782 - 'lib/ipmi_mc' - sysinfo_param() has two consecutive returns
ID: 3597781 - 'mc getsysinfo|setsysinfo' help has typos

Commit changes/fixes issues described in tickets #3598203, #3597782 and
#3597781.
Typos in help text of 'getsysinfo'/'setsysinfo' got fixed and function
printf_sysinfo_usage() has been created.
Consecutive return in function sysinfo_param() has been removed.
Some code has been re-worked:
* ipmi_getsysinfo() -> ipmi_mc_getsysinfo(),
* ipmi_setsysinfo() -> ipmi_mc_setsysinfo();
* ipmi_sysinfo_main() extended for 'is_set' parameter to signal whether it's
a get/set operation
* return codes changed
* code styling clean-up
* a bit of code clean-up in ipmi_sysinfo_main(), ipmi_mc_getsysinfo(),
ipmi_mc_setsysinfo()
2013-01-09 11:17:42 +00:00
2bb3100395 ID: 3597471 - 'lib/ipmi_mc.c' - needs a bit of re-work - rc, inv. options
Commit fixes 'help' and return codes(help =~ 0, invalid > 1). Indentation of
file as well as some formatting changes were made as well.
2012-12-20 14:25:18 +00:00
5dbb6b69de ID: 3577154 - 'lib/ipmi_mc.c' - return value of 'mc reset'
Commit adds response handling for 'mc reset' commands according to IPMI
specification.

Reported by: Duncan Idaho
2012-12-20 08:53:05 +00:00
791268a61c ID: 3597468 - 'lib/ipmi_mc.c' - print_mc_usage() prints to STDOUT
Commit replaces printf() with lprintf(LOG_NOTICE,...) to print help text on
STDERR as other ipmitool's sub-commands do.
2012-12-20 04:54:44 +00:00
970c5ff8b6 ID: 3597469 - 'mc watchdog off' prints on STDERR, should be STDOUT
Commit fixes/replaces lprintf(LOG_ERR,...) with printf() to print info message
on STDOUT instead of STDERR in 'mc watchdog off'.
2012-12-20 04:41:50 +00:00
4728863d5b ID: 3597470 - 'mc watchdog reset' prints on STDERR, should be STDOUT
Commit fixes/replaces lprintf(LOG_ERR,...) with printf() to print info message
on STDOUT instead of STDERR in 'mc watchdog reset'.
2012-12-20 04:36:06 +00:00
a3d872c73d ID: 3595199 - Add support for # ipmitool sdr <list|elist> help;
Commit adds suppor for # ipmitool sdr <list|elist> help; command.
2012-12-12 13:12:14 +00:00
9b3000e329 'lib/helper.c', 'include/ipmitool/helper.h' - add str2double()
Commit adds function to handle conversion from string to double. Function has
the same concept as other str2*() functions.
2012-12-12 05:39:35 +00:00
bd851bab8f ID: 3594835 - NULL reference possible in str2*() functions
Commit fixes possible NULL reference in str2*() functions in 'lib/helper.c'.
Although it's less likely to happen in ipmitool's daily life, it's still
possible.
Let's make sure it doesn't happen.
2012-12-11 20:59:58 +00:00
b4754b5edb ID: 3592773 - # ipmitool sdr info; prints incorrect info
Commit fixes output printed by # ipmitool sdr info; about 'SDR Repository Alloc
info supported' due to incorrect member name; probably because of copy-paste
error.
2012-12-05 11:02:38 +00:00
99e4ac0399 ID: 3592770 - # ipmitool sdr list|elist INV_INPUT; return code
Commit fixes return code of # ipmitool sdr list|elist; when invalid
input/unknown command is given.
Return code is > 0 now and error message is printed.
2012-12-05 10:39:46 +00:00
6733b66a9c ID: 3592732 - 'lib/ipmi_picmg.c' - printf() misuse
Commit replaces printf() with appropriate lprintf() calls. Some error messages
got changed as well.
2012-12-05 07:22:55 +00:00
daf4c4831f ID: 3528310 - 'lib/ipmi_picmg.c' - NULL reference
Commit fixes reference to rsp which can be NULL if there is no response from
BMC, eg. KCS driver is not loaded.
2012-12-04 19:33:26 +00:00
d2d2f4789d 'lib/helper.c' - clean-up - remove standalone tabs('\t')
Commit removes standalone tabs - code clean-up.
2012-11-26 05:11:16 +00:00
cce3f84896 ID: 3528347 - 'lib/ipmi_raw.c' - possible int *flow
Commit fixes missing return in function is_valid_param() which slipped in code
review.
2012-11-25 05:39:27 +00:00
3018b229b1 ID: 3588726 - % ipmitool sol payload status ...; segfaults on no rsp
Commit fixes segafult in ipmi_sol_payload_access_status in 'lib/ipmi_sol.c' when
no response is received. This is caused by passing NULL to lprintf() as
parameter, resp. accessing response data that aren't there.

Reported by: Ales Ledvinka
2012-11-21 09:07:30 +00:00
fc62075b76 ID: 3582307 - 'lib/ipmi_fru.c' - ipmi_fru_main() return codes
ID: 3582310 - 'lib/ipmi_fru.c' - ipmi_fru_main() - misuse of printf()

Commit is a major re-work of ipmi_fru_main().
* Help print-outs moved into functions.
* Proper return codes on error/help, although some TODOs remain.
* "discovery" 'fru get'
* hopefully less bloat in ipmi_fru_main()
2012-11-17 11:50:24 +00:00
a5384fa12e ID: 3587913 - Command % ipmitool raw help; returns 1
Commit fixes % ipmitool raw help; return code which should be 0.
2012-11-16 19:23:59 +00:00
7973f44304 ID: 3528347 - 'lib/ipmi_raw.c' - possible int *flow
Commit fixes int *flows via user input parameters in 'lib/ipmi_raw.c'.
2012-11-16 14:28:10 +00:00
8d9b434b5a ID: 3577159 - 'lib/ipmi_sdr.c' - uint32_t cast to uint8_t and back
Commit removes pointless(?) and unhandled cast from uint32_t to uint8_t and
back. intf->target_addr is uint32_t, don't try to "squeeze" it into uint8_t
then.

Reported by: Duncan Idaho
2012-11-11 18:59:36 +00:00
5b90f68407 ID: 3528368 - 'lib/ipmi_sdr.c' - possible int *flow
Commit fixes possible int *flow in ipmi_sdr_print_type() in 'lib/ipmi_sdr.c'.
str2uchar() is used instead of strtol() which wasn't being checked for errors.

Reported by: Duncan Idaho
2012-11-11 18:26:36 +00:00
2edc474cef ID: 3586228 - 'lib/ipmi_ekanalyzer.c' - ipmi_ekanalyzer_usage() rework
Commit gets rid of huge array of chars and replaces it with couple lprintf()
functions in 'lib/ipmi_ekanalyzer.c' - ipmi_ekanalyzer_usage()
2012-11-11 18:09:43 +00:00
472d8ab1b3 ID: 3576213 - 'lib/ipmi_fru.c' - unused variable
Commit removes two unused variables, rsp and req, from
ipmi_fru_set_field_string_rebuild() in 'lib/ipmi_fru.c'.

Reported by: Dune Idaho
2012-11-02 06:35:51 +00:00
4af83567b0 ID: 3528271 - 'lib/ipmi_fru.c' - possible *flow via FRUID
Commit fixes *flow via atoi() and not checking strtol() properly. is_fru_id()
wrapper has been added to mitigate code repetition.

Reported by: Dune Idaho
2012-11-02 06:11:06 +00:00
66bdb86f04 ID: 3528388 - 'lib/ipmi_ekanalyzer.c' - a typo in error message
Commit fixes a typo in error message in 'lib/ipmi_ekanalyzer.c'.

Reported by: Dune Idaho
2012-11-01 18:52:11 +00:00
9ef6162f3c ID: 3576211 - 'lib/ipmi_delloem.c' - unused variable
Commit removes unused variables in ipmi_led_get_platform_model_name() in
'lib/ipmi_delloem.c'.

Reported by: Dune Idaho
2012-11-01 18:45:31 +00:00
629a96d9c3 ID: 3576210 - 'lib/ipmi_dcmi.c' - unused variable
Commit removes unused variable in ipmi_dcmi_prnt_oobDiscover() in
'lib/ipmi_dcmi.c'.

Reported by: Dune Idaho
2012-11-01 18:44:05 +00:00
122e11a2e8 ID: 3522731 - 'lib/ipmi_sol.c' - ipmi_get_sol_info() returns always 0
PROPER - Commit fixes ipmi_get_sol_info()'s return value, so (-1) is returned on
error, eg. response is NULL. It doesn't matter whether it is first or last
response, we bail out immediately.
Commit also fixes missing argument to one lprintf() and
indentation(spaces->tabs).

This bug is connected with ``ID: 1835038 - 'lib/ipmi_sol.c' -
ipmi_get_sol_info() returns always 0''.

Reported by: Duncan Idaho
2012-10-22 16:50:34 +00:00
a974ab2c69 REVERT - ID: 3522731 - 'lib/ipmi_sol.c' - ipmi_get_sol_info() returns always 0
I'm reverting to previous revision, because I've realized these
``if (rsp != NULL)'' became redundant.
I'm sorry about that.
2012-10-22 06:09:49 +00:00
f8f6d51fd2 ID: 3522731 - 'lib/ipmi_sol.c' - ipmi_get_sol_info() returns always 0
Commit fixes ipmi_get_sol_info()'s return value, so (-1) is returned on error,
eg. response is NULL. It doesn't matter whether it is first or last response, we
bail out immediately.
Commit also fixes missing argument to one lprintf() and
indentation(spaces->tabs).

This bug is connected with ``ID: 1835038 - 'lib/ipmi_sol.c' -
ipmi_get_sol_info() returns always 0''.

Reported by: Duncan Idaho
2012-10-21 11:46:17 +00:00
8d828f6c72 ID: 3564701 - ipmitool 1.8.12 doesn't build on big endian architectures
ipmitool doesn't build on big endian architectures, because of missing include
of <bswap.h>.

Submitted by: Dan Horak
2012-10-21 04:28:08 +00:00
d54e20c545 ID: 3578022 - 'lib/ipmi_delloem.c' fix typos
This is a patch for building on big endian platforms that fixes the typos
introduced by rev 1.17 of ipmi_delloem.c

Submitted by: Dan Horak
2012-10-21 04:14:38 +00:00
44310bd898 ID: 3578276 - 'lib/ipmi_fru.c' - free() on freed memory possible
ID: 3578275 - 'lib/ipmi_fru.c' - memory leaks

Commit fixes several memory leaks and possible call of free() on memory that has
been already freed.
Despite 'goto' should be avoided as much as possible, its use seemed to be quite
reasonable in this case.
2012-10-20 19:57:17 +00:00
a9f7a7b92e ID: 3578277 - 'lib/ipmi_fru.c' - possible NULL pointer
Commit fixes possible NULL pointer by adding check whether fru_bloc, returned
from build_fru_bloc(), is NULL or not. If it is, print an error message and
return (-1).
2012-10-19 07:01:40 +00:00
d65cccc32a ID: 3577155 - 'lib/ipmi_main.c' - memory leaks
Commit fixes two memory leaks in 'lib/ipmi_main.c'. They were caused by not
freeing memory allocated by strdup() which uses malloc() underneath.

Reported by Duncan Idaho.
2012-10-17 05:03:45 +00:00
131846fb40 ID: 3577766 - configure's knobs and switches don't work
Some of configure's knobs and switches, eg. --disable-intf-open, don't work.
This is caused by poor choice of variable names, resp. using the same variable
names Autoconf is using. And Autoconf doesn't like it, resp. gets confused.

Variable names prefixed with an 'x' in order to make them 'unique'.
2012-10-17 04:45:14 +00:00
c62359bd79 lib/ipmi_fru.c - pointless/wrong cast loop
Commit removes pointless(?) and unhandled cast from uint32_t to uint8_t and
back. intf->target_addr is uint32_t, don't try to "squeeze" it into uint8_t
then.
2012-10-04 07:46:27 +00:00
1e83f7c88a ID: 3568976 - 'sel set time' behaviour is inconsistent
Commit fixes missing '*'. Without it, not only the previous commit breaks more
than it fixes, but it may (eventually) lead to segfault.
2012-10-02 18:55:41 +00:00
4a4b2e3b59 configure.in - remove Solaris+SPARC -> no BMC
Commit removes false presumption there is no BMC driver for SPARC platform in
Solaris. Also, this makes BMC driver default to yes, being built, on Solaris.
2012-09-29 08:51:53 +00:00
c88b139452 configure.in - replace leading spaces with tab
Commit replaces leading spaces with single tabulator in solaris section.
Somebody probably mistaken tabs for the spaces.
No functional change.
2012-09-29 08:33:45 +00:00
6011359cb3 ID: 3571153 - OpenIPMI/ipmievd fails to compile on Solaris
Commit fixes compilation problems on Solaris. These were caused by missing
header file, <sys/ioccom.h>, which defines _IO* macros.
2012-09-28 18:47:01 +00:00
23a5477d6e ID: 3568976 - 'sel set time' behaviour is inconsistent
Commit fixes inconsistent behaviour of 'sel set time' command. This was caused
by random init values of tm structures.
Also, the state of DST should be looked up now.
2012-09-28 17:50:56 +00:00
700ee7d27d Author: Jan Safranek <jsafrane@redhat.com>
Date:   Mon Aug 13 14:35:28 2012 +0200
    Fixed ipmievd start under systemd.

    Systemd init system starts services with parent PID=1. Still, it is expected
    that the daemon forks and exits with nozero exit status, if its initialization
    fails.
2012-09-05 20:46:16 +00:00
2d725c2cd6 ipmitool should document also -b, -B, -l and -T options, which are
currently missing. The description is taken from ipmitool -h output.

Original author: J.H.M. Dassen, rdassen at redhat.com.
2012-09-05 14:22:36 +00:00
5c9addb8c4 Fix offset for LCD_STATUS with new sysinfo interface 2012-08-14 17:54:08 +00:00
c0290ef09a Add support for getsysinfo/setsysinfo commands to ipmi mc
Cleanup Dell OEM code to use new sysinfo interface
2012-08-14 17:32:04 +00:00
6c1e3e2ecc lib/Makefile.am - fix build without LAN interfaces
Signed-off-by: Duncan Idaho <dune.idaho@gmail.com>

Commit fixes case when ipmitool is built without any LAN interface support,
resp. without LAN and LAN+ support. In such case, build would fail because
md5.c and md5.h are not being linked.
Commit adds 'src/plugins/lan/md5.c' and 'src/plugins/lan/md5.c' to
'lib/Makefile.am'.
2012-08-09 20:13:06 +00:00
77d9e49290 added ipmitool/include/ipmi_sdradd.h to the set of files distributed
for ipmitool 1.8.12
2012-08-09 18:41:04 +00:00
0d62e6f6e0 Update version to 1.8.12 2012-08-07 18:59:29 +00:00
f0f9e187c9 Update change log for the 1.8.12 release 2012-08-07 18:51:35 +00:00
89037b5158 Enable compiler warnings and resolve all compiler warning so that
ipmitool compiles and links with no warning or error messages
2012-08-03 17:07:07 +00:00
342e71d577 Updated the Dell OEM decoding for OS Watch dog timer -type 0x23.
Support added for Post Fatal Error or Events of
sensor type 0x0F. This includes the Fatal Errors
generated from BIOS, BIOS POST, CPU and Others.


Signed-off-by: Srinivas Gowda G <Srinivas_G_Gowda@Dell.com>
2012-07-27 17:11:36 +00:00
e196d85e43 Adding support for Dell specific sensors
IDPT memory - 0x2B. Support for status check of
communication channel between BMC/Other Hardware/CPU. Support for
Flex Address and Virtual MAC Support for  Non-Fatal
PCIE error sensor type 0xC2 and Fatal IO Error 0xC3


Signed-off-by: Srinivas Gowda G <Srinivas_G_Gowda@Dell.com>
2012-07-27 17:02:35 +00:00
7528b89b36 Added support for sensor types - Processor related sensor
type 0x07, system incharectorization 0x20, Memory sensor type.


Signed-off-by: Srinivas Gowda G <Srinivas_G_Gowda@Dell.com>
2012-07-27 16:27:55 +00:00
e07a644672 This patch will give more description for SEL which
is generated for Uncorrectable ECC and errors with respect to
each Memory Bank,Card or DIMM. The Sensor type
included in this patch are 0x0C and 0x10.


Signed-off-by: Srinivas Gowda G <Srinivas_G_Gowda@Dell.com>
2012-07-27 16:20:58 +00:00
fbb778c469 Framework for decoding the Dell specific OEM Bytes from
the SEL Record. This OEM Bytes are specific to Dell
Platforms only.

Signed-off-by: Srinivas Gowda G <Srinivas_G_Gowda@Dell.com>
2012-07-27 16:01:31 +00:00
fdc403302d Bug fixes for delloem lan command. This includes the
support for 12G Dell license and 12G LAN Specific command.


Signed-off-by: Srinivas Gowda G <Srinivas_G_Gowda@Dell.com>
2012-07-27 15:49:23 +00:00
3f712fe2fc Dell specific mac sub command is updated to support
the latest 12G Dell servers.
Support for virtual mac is also implemented.


Signed-off-by: Srinivas Gowda G <Srinivas_G_Gowda@Dell.com>
2012-07-27 15:21:55 +00:00
3631bd877c The sensor threshold values were not verified before setting
for example - if the current UNC is set to 10, one can set the UC to a value less than 10.

In this patch the values are first read and validated against the user specified values and then set.

Signed-off-by: Srinivas Gowda G <Srinivas_G_Gowda@Dell.com>
2012-07-27 15:07:11 +00:00
0ef4c3e254 The unified sensor reading code was incorrectly returning and converting
a sensor reading when the reading/state unavailable bit was set.  This
change makes sure a valid readiing is never returned for a sensor marked
reading/state unavailable.
2012-07-23 14:52:57 +00:00
5d960089c9 Support for analog readings in discrete sensors on HP platforms. This was
implemented without an HP oem specific switch by modifying each interface
open routine to read and cache the OEM manufacturer (via the Get Device ID
command) immediately upon open and to reset the cached OEM manufacturer
id to unknown upon interface close.  The cached manufacturer value in the
interface is then be used at run time to implement the manufacturer
specific code.

A non threshold sensor has an analog value if it is defined as having
analog units and it has either valid percentage or modifier units
defined and the manufacturer is IPMI_OEM_HP.   The determination of
whether or not a given sensor has an analog value is contained in a
single function (sdr_sensor_has_analog_reading).

This patch also encapsulates the reading of all sensor values in
ipmitool into a a single ipmitool function, ipmi_sdr_read_sensor_value.
The prior independent sensor reading code paths have been collapsed into
one sensor reading code path.   This encapsulation enabled consistent
validation of all data returned by the IPMI get sensor reading command.
In implementing a single sensor value read function, I resolved the
inconsistencies between what the "sensor" and "sdr" arguments displayed
and  I also resolved numerous cases where uninitialized information in
the IPMI reply from get sensor reading was being interpreted and
incorrectly displayed.
2012-07-10 16:01:09 +00:00
31cb04f155 Fix exit code on '-o list' or '-o help' option
From: Jan Safranek <jsafrane@redhat.com>

'ipmitool -o list' should return zero exit code.
2012-06-05 16:58:13 +00:00
7289f70ec9 delloem commands should not act before parsing command line.
From: Jan Safranek <jsafrane@redhat.com>

e..g 'ipmitool delloem lan help' should *not* check remote system for DELL
OEM commands before listing help. People tend to write scripts on different
machines and listing help is very helpful. In addition, why check for
setled support if only lan support is needed?
2012-06-05 16:56:39 +00:00
4b058899a2 Fix stack overflow in delloem setled
From: Jan Safranek <jsafrane@redhat.com>

The buffer should be bigger to hold the 10 character, which are set later
in the function.
2012-06-05 16:53:09 +00:00
79fdc68950 Fix delloem powermonitor on big-endian platforms.
From: Jan Safranek <jsafrane@redhat.com>

'ipmitool dellem powermonitor' command should convert data from
network-format to the native one, otherwise it shows garbage on ppc/ppc64
platform.
2012-06-05 16:50:18 +00:00
6a18254c9d Add missing RMCP+ auth type strings 2012-06-05 15:55:28 +00:00
2dfaeac27d Don't overwite the iflags bits prior to setting the boot parameters. This
fixes ipmitool so that chassis bootdev bios clear-cmos=yes will actually
clear the bios cmos.
2012-05-31 15:58:00 +00:00
aab226da28 When using the ipmitool fru command, one of the fields displayed is the
Board Mfg Date.  This date is computed by taking the timestamp in the FRU,
which is based off of 1/1/1996 0:0:0 and adding the delta time from
1/1/1970 0:0:0 to 1/1/1996 0:0:0 so that it can be interpreted by Linux time.
This delta time is a hard-coded constant in ipmi_fru.h (secs_from_1970_1996).
This constant is incorrect.  The correct delta from those two dates should be
820454400.  This is resulting in a Board Mfg Date that is actually 1 hour
earlier than what it should be.

commited for Renzo Hayashi
2012-05-30 21:35:17 +00:00
180aaaabbf Fix fru print so that it will display FRU info from satellite controllers.
committed for Michael Winiarski
2012-05-18 17:10:58 +00:00
bf9406249a Document the ipmitool dcmi commands in the ipmitool man page 2012-05-17 15:52:35 +00:00
56828dbaf7 fix indexing corner case 2012-05-10 16:35:33 +00:00
219f67e41a * long lines(= lines longer than 80chars)
* validate user input in 'lib/ipmi_sunoem.c', resp. ipmi_sunoem_main()
* 'sunoem sshkey' would accept undefined actions and exit with RC = 0
* RC > 0 and help will be displayed for unknown commands/actions
* "code bumming" - some conditions seemed to be redundant

commited for Duncan Idaho
2012-05-07 14:09:28 +00:00
62df3e6ea8 Commit handles two things
1] fail when no curses or readline is found, yet
ipmishell is about to be compiled in. ipmishell depends on these two
libraries;
2] add 'ipmishell' line to the % ./configure ; summary output to tell user
whether ipmishell support is enabled or disabled.
Committed for Duncan Idaho
2012-05-02 13:45:37 +00:00
f1fced7ec8 Document that some commands are blocked by OpenIPMI. ID: 2962306 2012-05-02 13:31:34 +00:00
75a7ebf5c7 Amends PICMG's help print out and changes it to ipmitool's way. It
doesn't matter whether printf() outputs at same output as LOG_NOTICE does.
Such
things should be the same for all modules.

Moves argc/help check up in the code, resp. in ipmi_picmg_main(), to
avoid unnecessary query to IPMI dev. It doesn't make sense to query IPMI
device
only to print help and terminate immediately.

Comitted for Duncan Idano
2012-05-02 13:25:04 +00:00
53df70235f Commit removes, resp. moves further in the code, unnecessary query to IPMI
device in ipmi_lanp_main(). It doesn't make sense to query IPMI device only to
show help and terminate immediately.
Commited for Duncan Idaho
2012-05-02 13:17:04 +00:00
8ed8ace59d changes layout of help output of 'user' sub-command. Two note-worthy
things change:
* heading has line of its own
* tabs in command-params replaced by spaces
commited for Duncan Idaho
2012-05-02 13:09:42 +00:00
c08bded0f3 Remove Windows style new-line character
commited for Duncan Idaho
2012-05-02 13:01:33 +00:00
90d40c6d7a Document the -N and -R options per tracker ID: 3489643 2012-05-01 19:44:58 +00:00
7733416d2b Commit limits length of user name and password that can be supplied by user.
Password is limited to 16 bytes, resp. 20 bytes, for LAN, resp. LAN+,
interface. User name is limited to 16 bytes, no interface limitations.

Reference: SF.net ID#3184687, ID#3001519

Changes done by Duncan Idaho
2012-05-01 19:09:19 +00:00
5f11bb25b0 Correct Threshold/Discrete Sensor Display - Patch Tracker ID - 3508759 2012-05-01 16:59:23 +00:00
8de0428bdc Remove unused variables/fix typos
Add ipmi_getsysinfo command
2012-04-30 15:28:56 +00:00
f907245d39 Constrain setting of the username to no greater than 16 characters per the
IPMI specification.   ID 3001519
2012-04-30 12:43:17 +00:00
fbd0c88ae6 Constrain User ID between 1 and 63. ID - 3519225
Fix and testing done by Duncan Idaho
2012-04-27 12:12:56 +00:00
373e4fe28d Use consistent netfn/cmd for getsysinfo command 2012-03-22 17:08:32 +00:00
fdf1176fa0 fix manpage misdocumentation on cipher suite privilige configuration 2012-03-06 01:41:50 +00:00
062bd1f9a4 Fix a proplem when using bridged IPMI commands on the lanplus interface (-I
lanplus with -b -t or -m switches)  resulting in "Close Session command
failure".
2012-02-17 21:49:20 +00:00
6e5043f289 sensor units should handle percentage units - ID: 3014014 2012-02-16 12:55:52 +00:00
83b34749c5 Commit modifies return codes under various circumstances for subcommand LAN.
Return 0 for help. Return <> 0 on error eg. not enough parameters.
2012-02-09 13:51:53 +00:00
403c86e51c Commit fixes wrong evaluation of is_lan_channel() in find_lan_channel()
introduced by yesterday's changes of 'lib/ipmi_lanp.c'.
2012-02-09 12:40:40 +00:00
89759cbdec Commit remedies bug introduced by modifications of ipmi_lanp_main() yesterday.
Fixes wrong evaluation of strncmp() in ipmi_lanp_main().
2012-02-09 12:34:18 +00:00
89243c2929 Feature Requests item #3486218 - remove bloat in 'lib/ipmi_lanp.c'
Commit removes bloat code in ipmi_lan_stats_clear() in 'lib/ipmi_lanp.c' and
replaces duplicate code with call to is_lan_channel().
2012-02-09 12:26:31 +00:00
9d8aa74a54 Feature Requests item #3486218 - remove bloat in 'lib/ipmi_lanp.c'
Commit removes bloat code in ipmi_lan_stats_clear() in 'lib/ipmi_lanp.c' and
replaces duplicate code with call to is_lan_channel().
2012-02-09 12:22:37 +00:00
ad4065a370 List of changes in 'lib/ipmi_lanp.c':
* return value != 0 when no or not enough params given
* replaces strtol() calls with str2uchar() ones
* invalid input checking and error messages for such events
* ipmi_lanp_main() got slight work-over
2012-02-08 15:31:00 +00:00
e230427138 Changes return value of ipmi_lan_stats_get() and ipmi_lan_stats_clear() on
error in 'lib/ipmi_lanp.c'. Changes return value from 0 to (-1).
2012-02-08 14:50:37 +00:00
4a462cd714 Change return type and value of find_lan_channel() in 'lib/ipmi_lanp.c'
Changes return type from int to uint8 since returned value is being assigned
into uint8_t.
Changes return value from (-1) to 0, because of uint8_t. 0 is considered as an
invalid LAN channel anyway, so there is no reason for returning (-1).
2012-02-08 14:42:47 +00:00
29d82210b4 Change return value of ipmi_get_channel_medium() in 'lib/ipmi_channel.c'
Return 0 instead of (-1) since ipmi_get_channel_medium() is supposed to return
uint8_t.
2012-02-08 13:40:51 +00:00
adbdafb535 Fixes ID:3485340 - user input not handled in 'lib/ipmi_user.c'
Replaces strtol() calls with str2uchar() ones and adds error messages, where
neccessary, if invalid input is given.
2012-02-07 13:14:12 +00:00
8a6343ff0d Fixes two problems in 'lib/ipmi_channel.c':
* str2uint() used, but should have been str2uchar()
* can't pass address of bitfield; variable used instead
2012-02-06 20:36:06 +00:00
a1dcd5790a Fixes ID:3485004 - 'lib/ipmi_channel.c' - misuse of strtol()
Replaces calls to strtol() with str2uchar() calls and adds error messages if
invalid input is given.
2012-02-06 15:50:13 +00:00
a2485a3b5e Fixes couple indentation issues in 'lib/ipmi_channel.c'. 2012-02-06 13:38:16 +00:00
bb632de830 Fixes bug ID:3484936 - missing user input validation in 'lib/ipmi_session.c'
It replaces strtol() calls with str2uint() ones and adds error messages if
invalid input is given.
2012-02-06 12:48:09 +00:00
78d7ae8d88 Removes debug printf() left by somebody in 'lib/ipmi_sdr.c' and crapping all
over the regular output.
2012-02-06 11:49:59 +00:00
904cbebce5 Fixes ID:3421347 Sensor list command should use channel field from SDR
Running an "ipmitool sensor list" command on a system where remote sensors are
not on channel 0 results in unexpected behavior. The SDR functions were fixed
in January of 2009 (lib/ipmi_sdr.c, rev 1.86) to use target I2C addresses and
LUNs for non-BMC-owned sensors. Sensors owned by satellite controllers on other
channels were read as if they were on channel 0.

I've fitted patch, posted alongside bug report, to CVS version.
2012-02-06 09:51:58 +00:00
09fc12a929 Fixes silly mistake I made in comparison in functions str2long() and
str2ulong() in 'lib/helper.c'.

Fixes: end_ptr -> *end_ptr
2012-01-26 14:30:53 +00:00
2902784cf3 Fixes possible *flows via user input in 'lib/ipmi_chassis.c' which may(and do)
lead to unpredicted/unwanted behaviour.

Commit replaces use of atoi() with str2NUM() functions and adds error messages
if invalid input supplied.
2012-01-26 12:50:26 +00:00
a9b78ab736 Fixes missing semicolons at the end of the line in 'include/ipmitool/helper.h'. 2012-01-26 10:04:04 +00:00
3d5e378e90 Commit adds input validation for -N(timeout) and -R(retry) parameters. It
changes types of variables 'timeout' and 'retry' to types wich should be passed
to called functions.
2012-01-26 09:22:57 +00:00
d4c2577a16 Commit updates list of functions in 'include/ipmitool/helper.h'.
Adds str2NUM() functions I've added earlier in 'lib/helper.c'.
2012-01-26 09:15:08 +00:00
f681fe89b7 Adds function str2uint() to convert from string to uint32_t with checks for valid input. 2012-01-26 08:22:11 +00:00
ca062647be Adds use of str2NUM() functions for the most of user input parameters in
'lib/main.c'. Error messages added as well.
2012-01-25 15:27:13 +00:00
3423c1d92f 'lib/helper.c' - str2uchar() - renamed arg_long -> arg_ulong 2012-01-25 15:09:49 +00:00
e0b75fba8c Adds function str2uint() to convert string to uint16_t with checks for valid input. 2012-01-25 14:57:12 +00:00
7dd969f2c6 Replaces use of atoi() for parameters d, p and C with str2int() function and
adds range validation for these parameters.
2012-01-25 12:56:36 +00:00
a9c68c76c3 Remove extra new-lines from error messages in 'src/ipmievd.c'. 2012-01-25 12:08:46 +00:00
e29166e4e8 Add input validation for time-out parameter in 'src/ipmievd.c'. 2012-01-25 11:53:41 +00:00
9217312cc4 Fixes missing return for selwatch_wait() in 'src/ipmievd.c'.
Added return 0;''.
2012-01-25 09:12:42 +00:00
fbf75dd075 Adds check whether PID fp was acquired or not. If not, then init logging
facility, print error and exit.
2012-01-25 09:02:59 +00:00
bf1e9952e1 Fixes ignorance of existing PID file which results in PID being overwritten.
Start of the daemon has shifted couple lines bellow, because it doesn't make
sense to start daemon first and check existence of PID file later.
2012-01-24 13:59:58 +00:00
5ed7f6ac0a Fixes CVE-2011-4339 - world writeable PID file
Adds proper umask() before writing PID file.
2012-01-24 13:26:56 +00:00
b6d2f7e302 Commit introduces set of functions to safely convert user input to numbers.
These functions utilize strtol() and strtoul() to convert input and check for
invalid input as well as for *flows.

Functions added: str2long(), str2ulong(), str2int(), str2short(), str2uchar();
2012-01-24 12:14:21 +00:00
bb40822d34 Replace whitespace indentations with tabs in 'lib/helper.c'. 2012-01-21 08:31:09 +00:00
835fe8886c Replace whitespaces with tabs, remove trailing spaces/tabs and other formatting inconsistencies. 2012-01-21 07:19:52 +00:00
55ee48696a Remove hardcoded CR('\r') from 'lib/ipmi_delloem.c'. 2012-01-21 05:38:49 +00:00
fedd6f187f Remove hardcoded CR('\r') from 'lib/ipmi_ekanalyzer.c'. 2012-01-21 05:37:41 +00:00
a6cad674d0 Remove hardcoded CR('\r') from 'lib/ipmi_fru.c'. 2012-01-21 05:36:58 +00:00
c1e46b35cd Remove hardcoded CR('\r') from 'lib/ipmi_fwum.c'. 2012-01-21 05:35:49 +00:00
a65d5add66 Remove hardcoded CR('\r') from 'lib/ipmi_hpmfwupg.c'. 2012-01-21 05:34:33 +00:00
ba6f2fe2a2 Remove hardcoded CR('\r') from 'lib/ipmi_isol.c'. 2012-01-21 05:32:24 +00:00
ebab3919ef Remove hardcoded CR('\r') from 'lib/ipmi_kontronoem.c'. 2012-01-21 05:31:16 +00:00
e6db6a04b5 Remove hardcoded CR('\r') from 'lib/ipmi_main.c'. 2012-01-21 05:29:41 +00:00
fb75f8d8fc Remove hardcoded CR('\r') from 'lib/ipmi_picmg.c'. 2012-01-21 05:28:39 +00:00
9660e90ad2 Remove hardcoded CR('\r') from 'lib/ipmi_sol.c'. 2012-01-21 05:27:14 +00:00
e0ed4351d0 Remove hardcoded CR('\r') from 'lib/ipmi_tsol.c'. 2012-01-21 05:26:23 +00:00
619233e14b Remove hardcoded CR('\r') from 'lib/log.c'. 2012-01-21 05:24:19 +00:00
7c9baca424 Remove hardcoded CR('\r') from 'lib/helper.c'. 2012-01-21 05:23:22 +00:00
c9b53b1b32 Fix possible buffer overflow in buf2str() in 'lib/helper.c'. 2012-01-20 19:19:22 +00:00
54cc84adf2 Fix typo in 'picmg power get help' output. Replaces 'powert' with 'power'. 2012-01-20 18:57:14 +00:00
37d672412d Remove unused variable in 'lib/ipmi_chassis.c' 2012-01-20 18:51:24 +00:00
1b1efca7e2 - Bug in the existing code where it keeps on adding same command/seq pair
- Add timeout / retry to LAN
-- Thanks to Harshad Parbhu --
2011-11-22 13:43:38 +00:00
c9bd5b5b90 - Bug in the existing code where it keeps on adding same command/seq pair
- Add retry / timeout options for LAN
2011-11-22 13:42:36 +00:00
19295a5483 Add new Dell OEM commands and update man page 2011-10-06 16:26:18 +00:00
d06ddcd28b Add Dell OEM network commands 2011-09-21 20:59:04 +00:00
335d444213 - Clarify DCMI get limit activation (add if activate or not).
- Change some string to remove underscore (was looking more like coding style string)
2011-08-26 18:57:18 +00:00
0cbc38746a - Add DCMI module (Data Center Management Interface)
* Module retreive from application DCMITool that is originally based on IPMITool.
* File ipmi_dcmi.c does not have a restrictive license and as per the license on
* the top of the file, the software is provided "AS IS".
2011-06-28 13:50:59 +00:00
348cd98287 - Add support for AMC type 17h record. 2011-05-17 13:20:06 +00:00
eb22beb537 Add support for drive backplane SetLED functionality 2011-04-14 20:23:59 +00:00
019a9de626 Re-adding C3 fix 2011-03-30 19:52:38 +00:00
c5c6315525 Improvement to hpm upgrade during activation. This resolves issue where activation seems to have failed because ipmitool received an unsupported completion code. 2011-03-10 19:01:35 +00:00
7fc4ce6eae Fix in fru edit
It is now possible to edit field 0 of sections
2011-03-08 19:38:03 +00:00
061272f595 - Fixed issues with fru edit.
Allocated memory for fru is cleared.
Added check to prevent copying data from old fru beyond end of allocated memory
Code now keeps track of old and new product section length. Used to determine position of remaining bytes.
2011-03-08 16:17:58 +00:00
fab9a60f71 - Re-enable SDR reading for non-ipmb devices 2011-03-03 13:41:31 +00:00
3e2211dc47 Testing commit as it is failing for some people. 2011-03-01 23:09:12 +00:00
f798f74234 Add skeleton for Dell OEM setled functionality 2010-12-14 06:41:31 +00:00
74e2376bf9 Add build support for Dell OEM commands 2010-11-04 21:04:21 +00:00
2f1773a819 Add files to support Dell OEM IPMI commands 2010-11-04 21:03:08 +00:00
9ab06ee09e - Add possibility to resize FRU strings with command ipmitool fru edit 0 ... 2010-08-23 17:29:40 +00:00
94e47fb2c6 Improvements large packet command code 2010-08-11 17:14:33 +00:00
13bb060366 Fixes for multi-latform support.
Fix for timeouts during firmware rollback. If completion code is C3, wait till timeout has expired before reporting it.
2010-08-11 17:13:21 +00:00
fdf49777b9 Increased variable size of timeouts.
During manual rollback, code now gets target capabilities instead of using a default timeout of 60 seconds.
2010-08-10 15:34:00 +00:00
2a180f8038 Added missing fix for sensors that use event data 2 when using command ipmitool sdr elist 2010-06-17 17:22:33 +00:00
799a0846c2 - Add fix with usage of CFh (duplicate request). Usefull for slow commands 2010-06-17 13:27:05 +00:00
60b62d4f34 Removed display of sensor states that use event data 2 (Cannot determine state since it is only sent to SEL) 2010-06-14 13:36:27 +00:00
31bee2ebff - Change wait duration command sleep to 1 seconds
- In dual stage mode, use target capabilities command instead of file when unavailable
2010-05-13 17:43:55 +00:00
5e0e128eb3 - Add more details about Version Change event (source of firmware update) 2010-05-07 17:26:53 +00:00
d9e5ff1878 Add more details about Version Change event (source of firmware update) 2010-05-07 17:25:49 +00:00
9f52686526 Added sensor raw data in verbose mode. Useful for OEM sensor type. 2010-05-05 14:48:04 +00:00
801e6f1136 Clean up 2010-05-04 14:44:19 +00:00
b97d1b74e2 New FRU get OEM record command 2010-05-04 14:42:14 +00:00
c0e63cefbb - Remove message for unsupported PEF capabilities that return valid CC (80h) 2010-05-03 14:07:36 +00:00
cad476e5b1 Added OEM byte (47) to verbose output 2010-04-30 14:50:12 +00:00
fe43278196 - Add sensor hysteresis (positive & negative) to the following command:
ipmitool sensor -v
2010-04-29 18:45:12 +00:00
c3b8410fcc Fixed malloc for logpriv 2010-04-27 16:56:34 +00:00
58e82be3c4 Changed default cipher suite to 1 instead of 3 for iol20 2010-04-27 16:53:05 +00:00
cf63a9d593 Added firmware auxilliary bytes to hpm outputs 2010-04-27 16:50:43 +00:00
5348236e65 - Fix issue with answer of send command (cmd 34h NetFn 6h). 2010-04-26 15:07:43 +00:00
c4ece9a1eb *** empty log message *** 2010-04-26 15:05:50 +00:00
92cb687630 - Add option to provide a list when filling sdr repository 2010-04-23 20:01:30 +00:00
362bb42cf8 - Add function ipmi_sdr_add_from_list
Give the possibility to fill sdr repository from provided comma separated list.
2010-04-23 20:00:41 +00:00
4b230f13d7 - Fix issue with sequence number. (Speed up transfer) 2010-04-16 13:50:19 +00:00
e1c25a988f - Fix issue with seq number. (Bug causing IOL to be longer) 2010-04-16 13:49:30 +00:00
2902422eeb - Add declaration of function ipmi_kontronoem_set_large_buffer 2010-04-16 13:46:27 +00:00
ca0932532a - Add variable to support BUG buffer (when -z option) is used 2010-04-16 13:45:09 +00:00
ea105cd83b - Add support for BIG Buffer (Use when -z option is used) 2010-04-16 13:41:21 +00:00
c098938a4b - Enable BIG buffer when requested (OEM to speed up HPM upgrade)
- Add -z size option
2010-04-16 13:39:50 +00:00
235f475e60 - Add OEM command to set big buffer size (speed up HPM upgrade) 2010-04-16 13:37:22 +00:00
023a2797b8 - Fix segmentation fault on unrecognize OEM events. 2010-04-08 12:56:53 +00:00
050055e8f0 Fixed a few typos 2010-01-24 21:05:31 +00:00
9a1a15d134 Added packing directive for ARM cross compile with GCC 3.4.5, otherwise the
sdr structures gets padded and the pointer cast result in incorrect alignement
2010-01-22 14:24:49 +00:00
9b56a57890 Added 'sdr fill sensors nosats' support to speed up SDR discovery
Added SDR name display during discovery (with -v)
2010-01-20 15:08:18 +00:00
ab48fc0f55 Added clk getdenied|getall|getgranted support
- improved output format, including name lookup for resource/family etc...
Added initial ' picmg busedresource summary' command support
2010-01-20 15:06:28 +00:00
6878547f27 Restored ability to resize "firmware block" packets.
The size was set to 'ok' on any successful command, even if it was not HPMFWUPG_UPLOAD_FIRMWARE_BLOCK.
Incremented subminor revision
2010-01-20 15:01:03 +00:00
57dc49803e Added PICMG clock e-keying and bused resource control identifiers
Added PICMG major version (ATCA/AMC/uTCA) identifiers
2010-01-20 14:57:37 +00:00
0762cdd324 added PICMG clock e-keying and bused resource control identifiers 2010-01-20 14:56:24 +00:00
cf3dd06818 fixed oem/iana data type to allow 24 bits definition 2010-01-20 14:54:52 +00:00
0dfd0d494a Added dual bridge support (no need for driver support) 2010-01-20 14:53:10 +00:00
e41a6aacb3 Added IPMB dual bridge support (no need for driver support) 2010-01-20 14:52:29 +00:00
50c514e336 Commited
- Update ipmi_fru.h to SMBIOS spec 2.6.1 - ID: 2916398

Credit goes to kppglov
2010-01-18 19:39:52 +00:00
021728965c support sensor bridging in free interface 2009-11-24 23:21:23 +00:00
fae2b40020 applied fix for issue #2865160 (AIX build) 2009-10-02 14:33:38 +00:00
b78f1194c9 applied fix for #2865111 (AIX build) 2009-10-02 14:30:45 +00:00
3083c1dd7a added fix for tracker #2849300 "Incorrect Firmware Revision" 2009-10-02 14:17:11 +00:00
6f0ecadabd added hpm and fwum in man page 2009-09-22 15:34:51 +00:00
ebb60eebee - In function ipmi_sdr_add_record, there is a missing '<' in the calculation of the in progress bit in order to determine when a Partial Add SDR entry is terminated. This cause the IPMI firmware to simply drop the SDR (required by the spec). 2009-07-29 14:49:08 +00:00
a3dd05510a changed SEL timestamp formatting for 'preinit' SEL entries, allowing
the number of seconds to be displayed.
2009-06-15 15:28:01 +00:00
ba83ecd7d3 Fixed AMC point-to-point record parsing in FRU
-Fixed detection of packing support in GCC
 -Added packing support detection magic on all packed structures in project
2009-06-09 16:00:24 +00:00
b23f858ee3 Fixed AMC point-to-point record parsing in FRU
-Fixed detection of packing support in GCC
 -Added packing support detection magic on all packed structures in project
2009-06-09 15:38:09 +00:00
fb0d4e7fc1 correct EOL (unix)
-Fixed detection of packing support in GCC
 -Added packing support detection magic on all packed structures in project
2009-06-09 15:36:13 +00:00
a0673a77b3 avoid reopening the interface when already opened 2009-06-09 15:33:30 +00:00
6d4fccf922 added missing completion code string
added missing OEM strings (Kontron, PICMG)
2009-06-09 15:32:55 +00:00
c30f036391 Integrated Andy Wray's DDR3 SPD parser patch 2009-06-09 15:26:50 +00:00
72d66edc6c Bug fix:Some sensor will wrongfully report '0' as interpreted reading
- Avoid treating '0' raw value as a special case.
2009-06-05 15:02:39 +00:00
8582569149 Bug fix:Some sensor will wrongfully report '0' as interpreted reading
- Avoid treating '0' raw value as a special case.
2009-06-05 14:43:53 +00:00
7cc935f2f1 Fix for Platform Event Message incorrect Generator ID 2009-06-04 20:46:10 +00:00
461ade4994 - Reduce size of sdr_max_write_len to 19 to fit into the recommended 32 bytes limit.
(overall message size)
2009-05-29 19:11:26 +00:00
09adafacd8 - Add new Kontron Product in ipmi_strings for product ID.
- Kontron KTC5520/EATX Server Motherboard with integrated iBMC/KVM/VM
2009-05-29 19:08:52 +00:00
0ea2ba5f14 fixed previous packet resize patch, the IOL session was no longer reopened
after the IPMC upgrade reset
2009-04-21 13:03:02 +00:00
b5fb1221c1 reordered init to allow IPMB address discovery before call to
IPMICTL_SET_MY_ADDRESS_CMD
2009-04-21 13:01:29 +00:00
92a2b12fe1 added picmg_frucontrol_vals 2009-04-21 12:20:46 +00:00
a9c626e67e Jan Safranek man page update for fwum and hpm commands 2009-04-21 01:12:09 +00:00
9e1bf929c2 Fix the case where ipmitool loses the iol connection during the upload
block process.  Once IPMITool was successfully sent the first byte,
    IPMITool will not resize the block size.

Fix the problem when we try to upgrade specific component and the component
     is already updated,

Incremented to version 1.06
2009-04-20 19:09:06 +00:00
dece10b9d6 enhanced PICMG fru control
- Fix the help message for the picmg fru control command.  The command doesn't
support an hex argument
 - Changed output format to interpret the raw data supplied
 - Prints 'ok' on success
2009-04-20 15:33:51 +00:00
ebce6517f5 Added support files for 'ime' operating mode, used to update Intel ME. 2009-04-20 15:09:06 +00:00
ccb0aba6b9 Change device id mask (IPM_DEV_DEVICE_ID_REV_MASK) 0x07 for 0x0F.
As per in IPMI spec V2:

Table 20-2 Get Device Id command byte 3:

[7] 1 = device provides Device SDRs
    0 = device does not provide Device SDRs
[6:4] reserved. Return as 0.
[3:0] Device Revision, binary encoded.

The mask need to be done on 4 bits.
2009-04-20 15:08:44 +00:00
0f1e92a450 Added documentation for 'ime' operating mode, used to update Intel ME. 2009-04-20 15:07:14 +00:00
b1ffd29ee6 fixed segfault for fru edit when "field id" is not supported
avoid ugly hardcoded ASCII code in parser
added user feedback for string substitution(success or failure)
2009-03-18 21:08:25 +00:00
e2b72d82de updated HPM firmware agent to version 1.04
2009-02-11
  - With multi-component HPM file, if one component need to be skipped because
    the component is already up-to-date,  ipmitool sends "Initiate upgrade
    action / Upload for upgrade" anyway.

    If the component needs to be skipped, ipmitool will not send "Initiate
    upgrade action / Upload for upgrade"

  - Incremented version to 1.03

  2009-02-11
  - Fixed side effect introduced by last version, "forced" update didn't
    work anymore
  - Incremented version to 1.04
2009-03-18 20:19:23 +00:00
756c22a866 added identification support for Kontron AT8050 ATCA board 2009-03-18 20:18:00 +00:00
1f0bbcd8dd added SIGINT handler to properly close an opened IOL session when terminated 2009-03-18 20:17:23 +00:00
afbec90dc2 Jan Safranek/Jose Plans patch to add new -Y option to prompt user to enter kgkey 2009-03-16 19:15:17 +00:00
96df77742c Roll to 1.8.11 2009-02-25 20:02:27 +00:00
956b421ef8 - Clean most of the warnings 2009-02-10 20:47:47 +00:00
e427ed4423 Fix some compiler warnings 2009-02-10 19:41:04 +00:00
6c02a74a31 Changelogs, versions preliminary updates to start getting ready for v1.8.11 2009-02-05 22:54:55 +00:00
b16dc1bf5a Fix for Tracker Bug #1642710 - ipmi_kcs_drv being loaded/unloaded for 2.4 kernels instead of the correct driver ipmi_si_drv 2009-02-05 00:39:07 +00:00
3268e0d9c1 Fix for Tracker Bug #1863748 - Garbage sensor threshold values displayed when ipmi_sdr_get_sensor_threshold returns non-0x00 completion code; also, tone down the error mgs displayed when unable to get sensor readings 2009-02-04 22:20:09 +00:00
79ed9ec34e Mirko Klefker 2/3/09 patch to fix a lanplus issue with commands like 'sensor list' without the -t option causing wrong double bridged requests if a sensor is located on another satellite controller 2009-02-04 20:00:18 +00:00
2579bbe542 Fix endian bug in SDR add from file reported in Tracker Bug #2075258 2009-01-31 01:10:18 +00:00
1d927c8c45 Olivier Fourdan <ofourdan@redhat.com> 9/2/08 patch to monitor %used in SEL buffer and log warnings when 80% && 100% full 2009-01-29 21:34:22 +00:00
37cb538e5a Holger Liebig patch (ID #1990560) to get readings from non-linear analog sensors 2009-01-29 20:36:43 +00:00
025f196aec Dmitry Konyshev 1/23/09 sdr-read-fix patch to fix a crash when dumping SDRs in a file and there's an error getting an sdr. Improve algorithm for finding optimal packet size 2009-01-28 19:54:06 +00:00
928da786e5 Dmitry Konyshev 1/23/09 lan-bridging patch to fix a double-bridging crash, issue with bridging multiple concurrent requests, and erroneous handling of raw Send Message 2009-01-28 19:37:44 +00:00
10f4a1a5c5 Bernard Manjou 6/10/08 patch to include I2c address and LUN so sensors are correctly managed; updated by BM for v1.8.10 2009-01-27 01:20:01 +00:00
ca90a4b48b Jan Safranek 1/15/09 sol set parm range checking patch based on Vince Worthington's 8/8/07 patch 2009-01-15 19:54:05 +00:00
c5d1894531 Jan Safranek 1/15/09 patch to fix sol activate options usage string 2009-01-15 18:57:52 +00:00
90244733b4 Jan Safranek 1/14/09 patch to add a new -y option allowing specification of kg keys with non-printable characters 2009-01-14 23:27:46 +00:00
4787c3de81 Kipp Glover's 11/24/08 patch to fix node reporting in GUID; Tracker #2339675 2009-01-14 18:59:21 +00:00
8680d3dc4e Add man page support for new -K kgkey environmental option 2009-01-13 20:32:54 +00:00
be5db2df38 'Skywing' 11/27/08 patch to add an IPMI_KGKEY environmental variable accessible from the command line; I added usage info as well 2009-01-13 19:53:04 +00:00
63eaecf469 Jan Safranek 1/8/09 patch to add support for sol payload status command 2009-01-09 23:22:16 +00:00
b7ae2149e9 Stefan Ott patch for occasional sdr dump segfault #1793076 2009-01-09 22:52:11 +00:00
e807543023 Jan Safranek patch for #216967 10/22/08 to fix crashes when parsing 'sol payload' and 'tsol' commands 2009-01-09 22:28:36 +00:00
a1684a2e0b Roger Mach's 12/11/08 patch to fix lan and lanplus request list entry removal bugs 2009-01-09 21:55:47 +00:00
e31ba93a23 Dmitry Konyshev's 7/23/08 fix for lan driver issue with bridging msgs for IPMI sessions without authentication; allow handling of AMC.0- and uTCA-style bridging 2009-01-08 23:32:39 +00:00
653c9b20d5 Olivier Fourdan's 8/16/08 patch to allow ipmitool sel delete to accept hex list entry numbers 2009-01-08 22:59:11 +00:00
e3abbf667a Dmitry Konyshev's 7/22/08 patch to add IANA support for Pigeon Point 2009-01-08 21:21:22 +00:00
7924e052ca Bernard Manjou 11/13/08 fix for Front Panel Button disable/enable status wrong mask values 2009-01-08 21:07:02 +00:00
264b95cd21 - Fix non-working issue when trying to send a bridge message with Cipher 3
- Change bridge message handling to reuse command ipmi_lan_poll_recv
2008-11-19 16:45:40 +00:00
f8b3d70c13 Fixed "Watchdog Timer Actions" display
- Added mask to avoid wtd_action_string overrun
2008-10-23 17:55:19 +00:00
b1cef77bcf Fixed PICMG (ATCA) extension verification
- BCD encoded value "major" and "minor" fields were reversed
2008-10-23 17:48:33 +00:00
3b08cc6002 Fixed PICMG (ATCA) extension verification
- Added PICMG 2.0 support
  - Added PICMG 2.3 support
2008-10-23 17:43:55 +00:00
1593341ed7 Fixed "Watchdog Timer Use" display
- Added mask to avoid wtd_use_string overrun
2008-10-23 17:13:25 +00:00
35daac42a5 - Fix new GCC compilation issues in regards to Packing 2008-09-29 18:33:32 +00:00
5b8255f671 - Add KEEPALIVE retry defines
- reduce time between each keepalive request
2008-09-29 18:26:16 +00:00
abf77904a0 - Add retries to SOL KeepAlive functionnality 2008-09-29 18:24:02 +00:00
cceb1ff803 - Add OEM SW/FW Record definition 2008-09-29 17:41:44 +00:00
c81563434b - Add support for new PICMG 3.0 R3.0 (March 24, 2008) requirements:
** REQ 3.410: Any IPM Controller may write protect data in the FRU storage
              area and return a "Write protected offset (80h)" Completion
              Code for a command that attempts to change such data.

-- To do so, add a function to build block region in the fru and write
   data using block offset.  If block if found to be write-protected,
   jump over the protected block.

-- Should not change previous behaviour.

-- Have leave the previous functions in comments in reference.

-- Any questions, please send e-mail to jean-michel.audet@ca.kontron.com
2008-09-29 17:13:50 +00:00
185b23a5c4 - Add gendev files for generic device support 2008-09-18 20:08:23 +00:00
6377070275 - Add support to specifically access fru internal use area
(info, print, read, write)
2008-09-18 20:00:42 +00:00
77740c39cc - Add ipmi_gendev.h for support of generic device option 2008-09-18 19:58:49 +00:00
2acce3766c - Add gendev (stands for generic device) support for Eeprom
publish with SDR Type 10h (Gendev).  Eeprom is accessed with
  Master Write-Read IPMI cmd.
2008-09-17 20:02:56 +00:00
86eef09b2f - Add gendev (stands for generic device) support for Eeprom
publish with SDR Type 10h (Gendev).  Eeprom are accessed using
  Master Write-Read IPMI cmd.
2008-09-17 20:00:53 +00:00
09011bb590 - Add gendev (stands for generic device) menu to support Eeprom
publish with SDR Type 10h (Gendev).  Eeprom can be read write with
  Master Write-Read IPMI cmd.
2008-09-17 19:58:57 +00:00
03c5c6a639 Whenever 'total space' if >= 65535, the percentage can't be safely determined.
So avoid printing it
2008-08-13 19:31:35 +00:00
52dc545d2e Rolling version to 1.8.10 2008-08-07 21:51:37 +00:00
4ef4e3c298 Changelog updates in preparation for the roll to 1.8.10 2008-07-19 21:15:02 +00:00
b120e11c3d Bernard Manjou patch to include the BULL IANA number in the IPMI_OEM list 2008-07-19 00:02:28 +00:00
d09e279c79 Move oem_ibm_sel_map back into the rpm builds 2008-07-10 23:33:14 +00:00
1eda5611dd Steffen Grunewald changes to allow Debian packages to be built from CVS 2008-07-09 06:04:46 +00:00
9689fe6199 Bernard Manjou fix for sel and sdr timestamp reporting issues 2008-07-09 05:55:55 +00:00
34dd10feda Bernard Manjou fix for discrete sensor state print routines to address state bits 8-14 2008-07-08 22:37:55 +00:00
c344f2ffe0 Make ipmi_chassis_status non-static as per request from Eric Hall 2008-07-08 22:12:00 +00:00
c23b875c8b Add retries to SOL keepalive attempts; Based on Harshad Prabhu's patch with additional changes made mostly to improve readability 2008-07-03 20:35:27 +00:00
d0155c3917 John D. Blair fix to stop sensor list from reporting a failure due to missing sensors 2008-07-03 20:19:04 +00:00
a2e7888156 Benoit Guillon patch to fix sdr free space reporting 2008-07-03 19:46:44 +00:00
a724a38c42 Fix spelling of IPMI_OEM_FUJITSU_SIEMENS 2008-07-01 00:31:29 +00:00
72831c6d22 Tony Ernst's fix for segfaults occurring with lan set commands 2008-07-01 00:23:43 +00:00
1e8967b1f9 Joshua Neal's fix for the raw i2c wdata buffer being populated incorrectly 2008-07-01 00:11:42 +00:00
bf815d0093 Removed in r1.71; restored by popular demand; try to get valid reading from Sensor Scanning Disabled sensor 2008-06-30 23:14:40 +00:00
c3aefda148 Jim Sievert ipmb sensor reading fix plus fix for strncmp/strcpy bug 2008-06-30 19:47:16 +00:00
1c784e80ec Fix usage string 2008-06-10 22:14:17 +00:00
2793990a94 Fix usage string 2008-06-10 21:55:53 +00:00
1d3a7ff50a Nit fixes: strncmp length fixes, usage info fixes/additions, spelling and white space fixes 2008-06-10 21:48:28 +00:00
b3d5558a40 -Fixed lanplus session re-open when the target becomes unavailable following a fw upgrade activation.
----------------------------------------------------------------------
2008-06-10 17:29:09 +00:00
5cf45e711e Update man page with all the latest functionality changes 2008-06-02 03:24:00 +00:00
3c94523f11 Support for watchdog timer shutoff, reset, and get info 2008-05-06 21:30:20 +00:00
b3563716bd Prudishly fixing comment 2008-05-06 21:09:23 +00:00
1aeaa97475 Adding new IBM OEM SEL messages 2008-05-06 20:58:26 +00:00
4dcfe6d6c8 Decrease request size for DIMM FRU info to 16 bytes at a time; add more JEDEC info 2008-02-09 01:23:20 +00:00
3be848a82a - Reduce buffer length more aggressively when no response from iol.
- Incremented version to 1.02
2008-01-25 18:45:15 +00:00
513dabb395 Fixed HPM firmware activation via IOL
Fake a timeout after IOL session re-open to force get upgrade status retry
 Added retries on 0xD3 completion code
Added a provision for sub minor version, incremented to 1.0.1
2008-01-07 16:12:38 +00:00
6a269e5741 freeipmi 0.6.0 support added;adjust autoconf as needed for changes 2008-01-05 17:50:46 +00:00
d9e561a4cf cleanup (whitespace mess) 2007-12-14 20:57:40 +00:00
6e4a63bdfe fixed type for oemval2str (shouldn't be 16 bits for a 24 bits iana ..) 2007-12-14 20:56:53 +00:00
8aad659697 added product name resolution in 'mc info' 2007-12-14 20:34:56 +00:00
c306d08d7e fixed display format (suppressed TAB from formatted output) 2007-12-14 19:30:12 +00:00
0b9f0d6a35 Added ekanalyzer command line support (PICMG ekeying analyzer module)
-Display point to point physical connectivity between carriers and AMC
 modules
-Display power supply informations between carrier and AMC modules.
-Display only matched results of Ekeying match between an On-Carrier device
and an AMC module or between 2 AMC modules.

Based on binary fru files supplied as parameter
See the updated manpage for details
2007-12-14 19:29:03 +00:00
e6f0e459dd Fixed HPM firmware activation via IOL.
- try to open a new session until activation timeout is reached before
   reporting and error
2007-12-14 19:24:14 +00:00
5e455132c1 small change in amcsetportstate help and verbose mode
- port is now 'portflags' to avoid confusion
2007-12-12 20:25:08 +00:00
107257210d "Untabified" picmg record formatted output strings
Fixed AMC GUID display support (position in buffer was not updated before
entering the loop)
2007-12-12 19:56:51 +00:00
a654ca2683 improved amcportstate operations
- can now run on AMCs as well as carriers
 - output format is more human readable
thanks to Heiko Thiery for his patch
2007-12-12 15:03:17 +00:00
431421c6ff Merged Tim Bell's patch for IANA numbers to vendor name conversion 2007-12-10 21:15:08 +00:00
027fc1139c added resolution of new sensor types 2007-11-07 16:41:44 +00:00
7e9cd85e8d Added null check in to avoid segfault 2007-11-07 16:15:32 +00:00
e8ad5be7fb This patch fixes an infinite loop that was observed with a BMC that has an empty SDR.
- Dan Aloni
2007-11-07 16:00:25 +00:00
86c4e40277 Moved out 'kontron' OEM sensor resolution for other OEMs which could
lead to bad event descriptions
Changed LOG_ERR to LOG_DEBUG and corrected display
2007-11-07 15:55:08 +00:00
b0c04f8577 Added new 'FRU edit' mode (field mode)
fru edit [fruid] field [section] [index] [string]\
This can be used to change serial number information and such, use with care

Cleanup/improved 'oem' edit mode :
 - defaults to PICMG for backward compatibily
 - validates that 'oem' is followed by a 'iana' number

Attempted 'tabify' while integrating patch, hope the indentation will be ok
for others.
2007-10-03 16:09:45 +00:00
8824e41b48 moved out extra ] 2007-10-03 15:51:12 +00:00
270a50c8c5 added missing 'iana' field in FRU edit help 2007-10-03 15:50:22 +00:00
8df490955c Added FRU 'edit' help text for supported modes 2007-10-03 15:20:51 +00:00
de63f9a9d5 added 'fru edit' help text 2007-10-01 14:14:24 +00:00
170c14560c Added new 'fru edit 0' operating mode for OEM records
usage is : oem <iana> <recordid> <format> <args...>
 it currently only supports Kontron's OEM information record type 3
 but can be used to support additionnal record types
2007-10-01 14:06:18 +00:00
d3badb58b2 added 'PICMG' iana number to string conversion support 2007-10-01 13:59:00 +00:00
db735bf685 SPD support:
added additionnal parameters to allow specifying 'channel number' as well
 as maximum 'read size', since some SMI or IPMB channels can't support 64
 bytes.
 this should be fully backward compatible as options are optionnal and a the
 end of the original ones:
    usage: spd <i2cbus> <i2caddr> [channel] [maxread]
2007-09-14 19:50:14 +00:00
7959b894b4 add freeipmi lib 0.5.0 support 2007-09-12 23:35:14 +00:00
71a6dde3f8 - Removed --disable-intf-open-dual-bridge configure option added
recently;
 - Added configure auto-detection if dual bridge support is present in
   OpenIPMI header.
2007-08-29 14:50:13 +00:00
8954fe454b Fix HPM.1 upgrade to apply to only given component when instructed to do so.
Patch submitted by Harshad Prabhu (Harshad.Prabhu at radisys dot com).
Quoting his email:

"Initiate Upgrade Action (HPMFWUPG_UPGRADE_ACTION_UPGRADE) was called
for all components even when single component was given on command line
(hpm upgrade <filename> component <id>). So calling this command only
after we decide whether the component is skipped."
2007-08-29 06:03:23 +00:00
56adf15b23 Add RadiSys Corporation OEM description string 2007-08-29 05:52:16 +00:00
ab18a0e335 Added --disable-intf-open-dual-bridge configure option to disable dual
bridge support in open interface. This extension is not compatible with
FreeBSD OpenIPMI implementation (and with mainline OpenIPMI too, as far
as I can tell).
2007-08-28 09:44:31 +00:00
997ca1fa4d Update with latest changes 2007-08-28 07:16:30 +00:00
b06f6bdbb5 Fix chassis poh command:
- The counter value was always interpreted as hours, the
   minutes-per-count value wasn't regarded.

 - No attention was paid to CPU endianness when reading the 32-bit
   counter value.

Patch submitted by Ingo van Lil (inguin at users dot sourceforge dot net).
Sourceforge patch ID: 1592950
2007-08-28 07:12:13 +00:00
798228cb72 Correct the misplaced recv in ipmi_lan_recv_packet() in lan and lanplus
interfaces.

Patch is submitted by Ferenc Wagner (wferi at niif dot hu). Quoting his
email:

"The rationale is that the following code expects to use the return
value of recv (ie. a byte count) not that of select (the number of file
descriptors). recv should be executed anyway, that's the whole point of
this snippet..."

The original patch is for lan interface but it also applies to lanplus.
2007-08-28 06:16:14 +00:00
a022f1e792 Update manpage with latest isol functionality. 2007-08-28 05:49:50 +00:00
a6e1840e4f Add true "isol" (Intel IPMI 1.5 SOL) functionality, which gives
"isol activate" command.

Patch submitted by Steffen Persvold (sp at scali dot com). Quoting his
email:

"The second patch (ipmitool_isol.patch) is a little more interesting. It
is basically an implementation of true SOL functionality for the "isol"
command on IPMI 1.5. This allows people with Intel based 1.5 controllers
that have the Intel specific SOL implementation (which is close to the
2.0 spec but not quite there) to use the "isol activate" command. This
applies to Dell 1850, 1855, 2850 and sc1425 servers at least (probably
more, but that's what I've tested). There is quite some code duplication
from the lanplus sol version, so at some point "someone" might do some
refactoring and merge the two (only separating what's different) but for
now I thought it was cleanest to do it this way."
2007-08-28 04:35:22 +00:00
86364dec74 Correct IMPI -> IPMI typos all over the source tree.
Patch submitted by Steffen Persvold (sp at scali dot com).
2007-08-28 03:54:12 +00:00
61318c0158 - Add more details for command chassis set boot params 2007-07-27 14:14:22 +00:00
14004d0749 Hello,
Patch submitted by Benoit Guillon [guillon@thalescomputers.fr] 

The patch allows you to fill the SDR repository of a BMC with the built-in 
sensor SDRs of the BMC and of the sensors of the satellite FRUs.

- adding new (partial) SDRs
- clearing the SDR repository (ok, it can be dangerous)
- adding SDRs from a dumped file.

Re.:

ipmitool sdr fill sensors
ipmitool sdr fill file <filename>
2007-07-11 14:27:46 +00:00
ec9cddc21a - The length of the Upload Firmware Block command is shrunk to conform
to the IPMI-defined maximum for non-bridged messages (32 bytes) when 
sent via KCS interface.

- Double bridging via LAN is taken into account when calculating the 
maximum Upload Firmware Block command length.

- Handling of the long response option of the Upload Firmware Block 
command is implemented.

- The Component parameter of the Finish Firmware Upload command is 
changed from component mask to component ID to conform to the HPM.1 
specification.

- The Rollback Override parameter of the Activate Firmware command is 
implemented. The hpm activate command-line parameter is extended with 
optional  "norollback" parameter.

- A bug that prevented from usage of multiple components in a single 
upgrade image is fixed.

- Garbage in output of the component's description property is eliminated.
2007-07-11 14:03:56 +00:00
cedb32d569 - Add double bridge support to LAN plugin (Thanks to Dmitry Konyshev from Pigeon Point)
- Fix an issue when bridging, responses to failed Send Message commands are
  returned to the caller as responses to bridged messages.
2007-07-09 20:10:25 +00:00
9a508d1f19 ** Commit patch submitted by Harshad Prabhu from Radisys **
- Modified the display of upgrading firmware
- By default, if the user has not given any option for upgradem tgeb we skip the components if they have the same firmware version as compared to the image file (.hpm)
- Added a HpmPreupgradeCheck function that will check which components needs to be skipped

Tested OK with Kontron products (patch does not brake previous state)
2007-07-09 19:59:22 +00:00
f6cb3516b3 - Remove ipmi_watchdog.c in the compilation modules
-- watchdog module have been refused by the ipmitool developpers --
2007-07-09 19:19:49 +00:00
fa7a690e26 - Remove watchdog module file.
-- Module refuse by ipmitool developpers --
2007-07-09 19:18:14 +00:00
5f018c9516 Remove all watchdog module
-- Module refuse by ipmitool developpers --
2007-07-09 19:16:05 +00:00
664848112e - Remove include of watchdog.h.
-- The addition of the watchdog module have been refused by the cvs devel --
2007-07-09 19:13:43 +00:00
a703e41949 corrected "autodetection" of maximum packet size based on src/dest addresses
when using IPMB.
make sure file uses UNIX EOL
2007-06-18 12:45:04 +00:00
3938d15098 Updated help to HPM.1 1.0 (component properties id) 2007-06-14 14:06:50 +00:00
76bb61de6c support FreeIPMI 0.4.0 api 2007-06-04 18:03:52 +00:00
0faade4b8a - Add new Kontron OEM command to set the BIOS boot option sequence 2007-05-23 17:53:04 +00:00
4e39200eff Add watchdog command library. 2007-05-23 17:51:28 +00:00
a4676f7b6e Include ipmi_watchdog.c file for watchdog library of commands 2007-05-23 17:50:49 +00:00
3b384a306f - Add a set of watchdog commands 2007-05-23 17:47:32 +00:00
0fcf7acdba - Add support for dual bridge (dual send message) 2007-05-16 20:11:24 +00:00
d04f496c7a - Add auto-detect of local IPMB address when PICMG 2.x extension is supported.
- Get address from Get Adddress Info command.
- Add dual bridge support (dual send message)
2007-05-16 20:10:18 +00:00
a263209bb6 - Add support for dual bridge command (dual send message) 2007-05-16 20:05:17 +00:00
d824af51a9 Add support for dual bridge.
When no dual bridge is used, set the transit_address to local address
2007-05-16 20:02:07 +00:00
e655394a7a - Update to be compliant with new HPM.1 specification 1.0 (Official release)
- First commit that support HPM.1 Rev 1.0
2007-05-09 15:24:16 +00:00
07c3456330 - Fix improper addressing for lan/lanplus 2007-05-02 13:05:07 +00:00
80b8d3b318 - Added dual bridge support 2007-04-26 13:45:00 +00:00
ed84ac0a9b - Added transit_channel and transit_addr variable in structure ipmi_intf 2007-04-26 13:41:21 +00:00
fa7d4b3ec7 - added dual bridged command support (for IOL)
- add transit channel (-B) and transit address (-T) options
2007-04-26 13:38:38 +00:00
f34245e46e - added watchdog command 2007-04-26 13:22:40 +00:00
f8bc5ae591 - added fru control
- added amcportstate set
- added clock commands
- improved led command support
2007-04-26 13:21:49 +00:00
b3d5150acd -added watchdog command 2007-04-26 13:19:33 +00:00
2faf5857c8 - addded fru control
- added amcportstate set
- added clock commands
- improved led command support
2007-04-26 13:16:16 +00:00
f4a6a73184 - added fru parsing address table
- added fru parsing shelf power dist
- added fru parsing shelf activation
- added fru parsing amc current requirement
- added fru parsing amc p2p
- added fru parsing amc carrier info
- added fru parsing clk p2p
- added fru parsing clk config
- enhancement in baord p2p
2007-04-26 13:14:53 +00:00
94865441a1 - added fru parsing address table
- added fru parsing shelf power dist
- added fru parsing shelf activation
- added fru parsing amc current requirement
- added fru parsing amc p2p
- added fru parsing amc carrier info
- added fru parsing clk p2p
- added fru parsing clk config
- enhacement in board p2p
2007-04-26 13:12:22 +00:00
32fbd909b2 fix bad password assertion bug due to rakp2 HMAC not being checked properly 2007-03-29 15:54:20 +00:00
568e75e147 Added ability to interpret PPS shelf manager clia sel dump
using# sel interpret <iana> <file> pps command line argument
Correct "PICMG M7" state event definition macros (changed 6 to 7 )
2007-03-27 16:21:15 +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
d4a64e17f2 update version 2006-01-15 20:46:13 +00:00
e855ba03df update email address to remove sun.com 2006-01-15 20:46:00 +00:00
68cdacb211 update changelog 2006-01-15 20:39:26 +00:00
85643e52a2 byteswap port 2006-01-15 20:25:23 +00:00
776080c88a update manpage with new arguments and tsol command 2006-01-15 20:21:30 +00:00
f0cd89fea6 add missing define 2006-01-15 19:14:04 +00:00
d6e85b8427 updates from sourceforge,
changes to support settable SOL escape char
2006-01-15 06:41:08 +00:00
ed8a467f6d update tyan sol to behave like ipmiv2 sol client 2006-01-15 06:40:37 +00:00
715add8fef fix iana for supermicro, add for tyan 2006-01-14 18:43:43 +00:00
da9252ceba add supermicro oem type 2006-01-13 18:25:10 +00:00
ae1fe95cb1 Cleared set_access structure; contained garbage data 2005-12-09 19:57:48 +00:00
f42f7c701c Add support for bridged message over different channel
Ex.: In an ATCA environment, send a message through the LAN iface
to another blade present in the chassis or to an AMC bay.
Tested:
Lan.c with Kontron AT8001 with Intel CMM shelf manager
Lan.c with Kontron AT8001 with Kontron AMC's
Lanplus.c with Kontron AT8001 with Intel CMM shelf manager
Lanplus.c with Kontron AT8001 with Kontron AMC's
2005-11-28 18:45:37 +00:00
29f43931e4 * Change maximum channel size for 0x0e (current channel) 2005-11-24 16:08:51 +00:00
2ea87e639b * Add command to get and clear UDP/RMCP/IP Statistics 2005-11-24 16:04:37 +00:00
8ec87a396e * Add priv commands to set user privileges 2005-11-23 21:59:23 +00:00
cd7e75a9d5 * Fix req_seq issue with RMCP+ 2005-11-23 21:45:37 +00:00
738cf02694 On all IPMI commands, the structure ipmi_rq must be cleared (memset(&req, 0, sizeof(req)).
This was not done for the 4 commands sent.  This was causing some commands
sent to the KCS interface to have an invalid LUN.
2005-10-28 14:10:48 +00:00
f7519e00eb revert 6-bit ascii size computation 2005-09-29 18:40:04 +00:00
c546582e92 new command for Add SEL Entry on event list from file 2005-09-23 20:08:51 +00:00
22c7f92135 add event direction to output 2005-09-23 20:07:50 +00:00
f449928806 don't print builtin fru header twice 2005-09-09 23:27:11 +00:00
8a0559a651 add top-level "power" command as shortcut to chassis power commands 2005-09-09 23:19:41 +00:00
6cb97e4327 6-bit packed ascii size computation was not correctly handling strings that are not 3-byte aligned 2005-09-09 23:17:55 +00:00
a15d6a31ac - Fix a bug where the retry-count parameters was 'anded' with 0x03 instead of 0x07
See IPMI specification 2.0 rev 1.0 markup june 2004 table 26-5 parameters 4
2005-09-09 17:09:50 +00:00
77275ab616 sel version output is 4-bit bcd in a single byte 2005-09-06 22:43:10 +00:00
32c94e3eae update version to 1.8.4 2005-09-06 22:02:03 +00:00
36e388648d add 'echo' command for use in ipmi scripts 2005-09-06 22:00:45 +00:00
aac4cc9e05 remove constraint on table size, a size of 0 can actually mean just entry 0 is populated 2005-09-06 18:37:38 +00:00
c552839583 forgot to add config.h 2005-09-02 18:12:04 +00:00
9dd625a215 don't print access info for non-lan channels 2005-09-02 17:57:05 +00:00
f50160a9e4 fix portability issues 2005-09-02 17:56:27 +00:00
67a60f1c9d Adjust sel info output 2005-09-01 20:57:09 +00:00
7eeae98fb4 optimize sign extension 2005-08-27 02:26:32 +00:00
ae92538cbb fix formatting issues 2005-08-26 23:00:56 +00:00
558f279597 manufacturer id is lsb first on oem sel records 2005-08-23 20:55:09 +00:00
4e9fb18ef6 eliminate extra noise 2005-08-23 20:51:53 +00:00
dc7c60b7a8 fix segfault when BMC does not support locking 2005-08-23 20:50:15 +00:00
38d0926d9f add Tyan IPMIv1.5 SOL code, contributed by Tyan Computer Corp
it may need some work to fine tune the behavior on actual
hardware but this is the initial raw code contribution.
2005-08-23 19:09:25 +00:00
661a80433e let event specific pef policies continue to print info 2005-08-23 19:05:43 +00:00
a4c5e7bda0 revert email address change that was made 2005-08-23 19:05:14 +00:00
cf40042856 update a few strings 2005-08-23 19:03:24 +00:00
92876549ab add support for enabling/disabling lan alerting for channel; default to enabled 2005-08-23 19:02:50 +00:00
141721d220 increase timeout and limit retries to 1 for raw commands 2005-08-23 19:01:35 +00:00
1e0164c253 allow 'sel time set now' to set sel time to current client time 2005-08-23 18:59:43 +00:00
ecb214d423 add support for configuring lan alerting 2005-08-23 17:59:09 +00:00
1196369aaf let entity id be specified as string 2005-08-22 16:32:24 +00:00
bfe06ebd98 extra argument to function removed 2005-08-22 16:31:31 +00:00
58e4e355f8 fix segfault when raw command returns error 2005-08-18 23:54:27 +00:00
9d762b82a0 Recognize and decipher OEM SEL entries properly 2005-08-17 20:34:21 +00:00
9ad01e6eed fix a few gcc4 compile warnings, lots remaining... 2005-08-11 16:20:36 +00:00
53c97bc5b4 not closing session after chassis power control can be bad for session management on the bmc 2005-08-11 16:18:22 +00:00
6ab2eb972e gcc4 is very picky about signedness and event_type is only 7 bits. not sure if this is gcc bug or not. 2005-08-11 16:10:51 +00:00
e25e0b8e71 Update write_fru_area Api so both upgEkey and fru write works properly
also added some comments. And change some printf to lprintf
 - added soffset(source offset) and doffset(destination) parameters to write_fru_area
2005-07-26 14:40:23 +00:00
cfd7f610cb rename define to be more correct 2005-07-14 23:51:52 +00:00
f9d19aa0c5 fix typo and simplify string 2005-07-14 23:44:33 +00:00
6a90734a67 add sun id 2005-07-14 23:40:25 +00:00
2440c09d50 update sensor type code table 2005-07-14 23:06:45 +00:00
1f597a78e2 prevent segfault on bad SEL data 2005-07-14 21:47:20 +00:00
f4dd419fe6 -Modified read length to fit bridge message (mostly for AMC) 2005-07-14 15:56:04 +00:00
b3472220af make this function a macro 2005-07-14 00:21:26 +00:00
54d6016a31 why was this using pow? 2005-07-13 18:37:30 +00:00
864ac5ad26 Added conditionaly built GetDeviceLocator call when INCLUDE_PICMG_GET_DEVICE_LOCATOR
is defined. It doesn't allow for bridged send messages to reach AMC yet.
2005-07-12 14:49:12 +00:00
17d68a4289 Added Kontron fwum header 2005-07-12 14:47:06 +00:00
907d8b30f5 Added Kontron OEM firmware update commands 2005-07-12 14:43:56 +00:00
c2d9746775 Added Manufacturer name strings to mc info 2005-07-12 14:27:36 +00:00
51a92c0917 Corrected typo 2005-07-12 13:38:51 +00:00
07f4139e70 added selftest support 2005-07-12 13:19:03 +00:00
6514de2b13 added read/write support and PICMG ekey support 2005-07-12 13:15:02 +00:00
89f6d591e0 added GetSelfTestResult defines 2005-07-12 13:13:47 +00:00
f9f0599908 added PICMG netfn\n ran lindent 2005-07-12 13:09:33 +00:00
c792f6e7e1 added SEL event definition for PICMG events 2005-07-12 12:42:02 +00:00
bce51c05f8 Added picmg fru data types 2005-07-12 12:37:23 +00:00
e0912fc6b7 Added initial PICMG command support 2005-07-12 12:36:47 +00:00
2c117c95ea added initial PICMG support
- added command support
 - added PICMG FRU data support
2005-07-12 12:36:00 +00:00
e7140ed0c8 added support for alternate devfs node location 2005-07-12 12:28:09 +00:00
6049aa0fe4 added support for channel and lun command line arguments 2005-07-12 12:25:29 +00:00
96876bb061 added support for built-in sdrs 2005-07-12 12:21:13 +00:00
4d2f9ebdc2 email address for Jon has changed 2005-07-11 20:14:00 +00:00
54dfc91b2b Extended the string list for Entity IDs, per the 2.0 spec's table 43-13. 2005-07-05 16:12:13 +00:00
86d54446e9 fix for freebsd 2005-06-28 21:14:51 +00:00
a7bcb2422e make rhel build i386 arch rpms on opteron when using 'make rpm' 2005-06-28 20:28:40 +00:00
4067bafa57 Added some support for the interpretation of OEM event messages (type 2 SEL
entries with with an event type in the OEM range).  For Newisys OEM SEL
entries, textual message descriptions are retrieved through a Newisys IPMI
OEM command.
include/ipmitool/ipmi_sel.h lib/ipmi_sel.c src/ipmievd.c CVS:
----------------------------------------------------------------------
2005-06-28 20:19:08 +00:00
624392f798 add check for tgetent to fix readline problems on RHEL4 2005-06-28 18:53:37 +00:00
ac2cc29ac0 remove / from string 2005-06-27 22:45:14 +00:00
87540ecf2a don't spin while waiting for 0 bytes in case BMC lies about how much data is in a FRU 2005-06-27 22:23:34 +00:00
6d77f698f2 allow SOL port to be sent in network byte order since some BMCs do this 2005-06-27 22:15:05 +00:00
083e6afc46 fix doc bug 2005-06-27 22:07:04 +00:00
384f9219ba move selftest results to its own command 2005-06-27 22:01:54 +00:00
fef402714f print binary data for i2c transactions 2005-06-25 17:33:35 +00:00
312b564091 A clarification (E347) in the IPMI v2 errata document (mark II) makes it
pretty clear that listing algorithms by cipher suite does not list all
algorithms, but lists supported algothms *grouped* by cipher suite.  Since
both views contain the same information, we will just support one in
ipmitool -- supported algorithms listed by cipher suite view.
2005-06-22 22:12:59 +00:00
a85bd201df work around readline 4.2 bug 2005-06-17 23:14:44 +00:00
e633524d34 fix freebsd compile problem 2005-06-17 23:12:53 +00:00
a892bb499a add configure option for specifying a distro tag for "make rpm" builds 2005-06-16 23:56:32 +00:00
836149f966 update changelog 2005-06-16 23:54:01 +00:00
694f92918f add support for entering netfn as a string for raw commands 2005-06-16 23:48:58 +00:00
1fe48e8a36 fix sdr printing of deassertion events and negative values for min/max 2005-06-16 23:47:15 +00:00
380f330e15 handle 0xcc response without error 2005-06-16 23:46:26 +00:00
fe38fb4e7b fix potential crash in cleanup code 2005-06-16 16:58:11 +00:00
ffd03bc964 two changes:
1. the IPMI spec says sessions are opened at USER level and must
be increased to desired privilege level.  This was not happening
for lanplus connections and causing problems with an OSA stack.

2. the 5ms delay between retries was not happening for SOL packets,
this is causing problems with a different implementation...
2005-06-16 16:53:01 +00:00
f9e30a894c typo 2005-06-16 16:50:28 +00:00
f733bcf2f1 decode cpu/dimm handling in sel if possible 2005-06-15 19:26:55 +00:00
51e906b7c6 Uploaded debian package into the Debian archive. 2005-06-05 09:01:32 +00:00
70cc60d8a4 add self-test results to chassis status output 2005-06-02 22:03:18 +00:00
c2c1204cb1 enable sdrcache on solaris 2005-06-02 22:02:41 +00:00
f87420b587 don't return error when user not supported 2005-06-02 22:01:36 +00:00
33cad9b907 In Get SEL Info, if the BMC returns a date of 0x00000000 of 0xffffffff,
print "Not available" instead of attempting to interpret the date.
2005-05-23 19:07:17 +00:00
b42902f880 Added the readraw and writeraw subcommands. These will allow the user
to save and view binary versions of the SEL.  The readraw subcommand is
being added to aid the Newisys troubleshooting facility, and the writeraw
subcommand is being added for parity.
2005-05-23 18:31:53 +00:00
8e77031a97 Added documentation for the readraw/writeraw subcommands. 2005-05-19 20:55:54 +00:00
b7962d85dc forgot one patch from sourceforge 2005-05-19 01:39:59 +00:00
36fefdabc3 update changelogs for 1.8.2 release 2005-05-18 23:51:18 +00:00
0ad17ece4a minor manpage update 2005-05-18 21:27:04 +00:00
990a9a4b6b fix display of binary encoded fru data 2005-05-18 07:14:15 +00:00
df7d0e6ee6 when caching sdrs from file leave room for trailing null to end description string 2005-05-17 22:55:25 +00:00
0f3c980b49 clear sensor desc before copying 2005-05-17 22:28:36 +00:00
8cfb4c0897 add helper define for max string length, allow default commands to receive options 2005-05-17 21:05:21 +00:00
650f12ab23 *** empty log message *** 2005-05-17 03:41:44 +00:00
fb0cc0187c don't print some event status fields 2005-05-16 23:59:39 +00:00
723b7c0614 export functions for use 2005-05-16 23:59:23 +00:00
bac5e21634 fix csv handling for 'sel elist' command 2005-05-15 17:47:13 +00:00
2ef302401e fix compile warnings with -Wall 2005-05-15 17:42:21 +00:00
cd174d8e73 don't stop looking when sensor is not found 2005-05-15 17:40:20 +00:00
718232945c add csv output support 2005-05-15 17:39:25 +00:00
fa3bb0960b broke fru lookups for 'sel get' command 2005-05-15 06:23:50 +00:00
b8a2890ace update manpage with new command help 2005-05-15 06:18:01 +00:00
5a7385f780 clean up output 2005-05-15 06:12:41 +00:00
9708c8326f add support for generating events based on sensor information 2005-05-15 05:59:36 +00:00
b1cf8c6a2b export function for other use 2005-05-15 05:57:35 +00:00
3af858eecf add 'sdr get' command, add hysteresis to sdr verbose output 2005-05-15 05:56:44 +00:00
f04b6d858f clean up output and shorten blink names 2005-05-15 05:55:09 +00:00
12c19f88ca add structure for PEMs 2005-05-15 04:53:39 +00:00
4385f3c403 *** empty log message *** 2005-05-15 04:52:18 +00:00
f598c42e2e fix str2val() 2005-05-15 04:51:02 +00:00
a567ac9426 fix handling of quotes in shell 2005-05-15 04:50:34 +00:00
2d0c486541 make sdr elist reporting consistent 2005-05-14 04:17:56 +00:00
1a4399a9eb conditional compile of ipmievd can go away 2005-05-14 03:37:29 +00:00
58c0fa890b minor fix for generic sdr display 2005-05-13 23:59:07 +00:00
06147e6a37 warm reset does not necessarily mean lost session 2005-05-13 17:09:27 +00:00
d559b1fa2d add man text for sel save command 2005-05-12 04:53:33 +00:00
bd30ca98db update manpages with help text for new commands 2005-05-12 04:47:51 +00:00
e5a6d23f9c clean up event messages 2005-05-12 04:24:16 +00:00
81aa0855f8 add -S option 2005-05-12 04:23:37 +00:00
281777996b add extended sel list functionality, ability to save SEL to a file 2005-05-12 04:23:07 +00:00
57c49ef9b8 lots of changes to SDR handling 2005-05-12 04:14:26 +00:00
adb40e53a1 add oem commands 2005-05-12 04:13:32 +00:00
db3da49158 break down GUID format 2005-05-12 04:12:40 +00:00
6f9b34313e fix invalid function prototyes 2005-05-11 05:56:47 +00:00
081baa7e24 print PEF actions 2005-05-11 05:55:20 +00:00
bbaf882dd1 add icts oem option 2005-05-11 05:55:05 +00:00
9e4ad72524 fix function prototype 2005-05-11 05:50:13 +00:00
ea0e9ca5fd add __max define 2005-05-11 05:49:41 +00:00
ace510828f add --enable-solaris-opt configure option to enable all command line options on solaris 2005-05-11 05:48:45 +00:00
6cc2c67671 add support for passing cmos clear bit to BIOS 2005-05-11 05:47:53 +00:00
d5d36e1941 add chassis power control vals 2005-05-11 05:46:40 +00:00
b65ec95257 remove unused variables 2005-05-11 05:45:17 +00:00
6b8d9243c2 add missing include 2005-05-11 05:44:53 +00:00
5c2cd09f6a fix function prototypes 2005-05-11 05:44:41 +00:00
e34c7eeb5c uninitialized variable 2005-05-11 05:44:23 +00:00
eb8653f02a add icts oem option, make bmc_rand not print with verbose mode 2005-05-11 04:42:51 +00:00
24a0b44a98 add noanswer flag to open interface 2005-05-11 04:42:06 +00:00
d69b8e8b7f fix typo in manpage 2005-05-03 15:54:47 +00:00
8b68086fdb change IPMI_CHANNEL_MEDIUM_IPMB define to not conflict with openipmi 2005-05-03 15:19:15 +00:00
35c6bb4a9d update manpages 2005-04-29 22:00:35 +00:00
928c500484 * New upstream release.
-  Fix FRU reading for large (>255 bytes) areas.
     -  Overhaul to ipmievd to support SEL polling in addition to OpenIPMI.
     -  Fix LAN parameter segfault when no Ciphers supported by
        BMC. (Closes: #306806)
     -  Fix IPMIv2 support on Intel v2 BMCs (use -o intelplus).
     -  Separate option parsing code from main ipmitool source file.
     -  Add raw I2C support with IPMI Master Read-Write command.
   * Correct the upstream URL in debian/changelog to the current one.
   * Suggest package openipmi. (Closes: #305629)
   * Add debian/watch file to detect new source versions.
2005-04-28 20:51:59 +00:00
2da00b9a47 * New upstream release.
-  Fix FRU reading for large (>255 bytes) areas.
     -  Overhaul to ipmievd to support SEL polling in addition to OpenIPMI.
     -  Fix LAN parameter segfault when no Ciphers supported by
        BMC. (Closes: #306806)
     -  Fix IPMIv2 support on Intel v2 BMCs (use -o intelplus).
     -  Separate option parsing code from main ipmitool source file.
     -  Add raw I2C support with IPMI Master Read-Write command.
   * Correct the upstream URL in debian/changelog to the current one.
   * Suggest package openipmi. (Closes: #305629)
2005-04-28 20:45:28 +00:00
04802db0e0 Correct the upstream URL in debian/changelog to the current one. 2005-04-28 20:43:53 +00:00
85d612fa35 command list missing from shell help 2005-04-28 15:58:46 +00:00
1340786bda fix handling of sel when it is cleared 2005-04-27 22:39:15 +00:00
30eec7d0ac only decode sensor-specific states 2005-04-22 19:53:27 +00:00
5298b1ca71 fix memory leaks, optimize payload allocator to only allocate what is needed instead of max amount 2005-04-22 19:52:01 +00:00
a292d94239 fix handling of sensors that are read correctly 2005-04-22 05:07:17 +00:00
26557547b4 typos 2005-04-21 04:21:50 +00:00
2c2437239d fix chassis power status exit code 2005-04-21 04:13:55 +00:00
7b3fac2071 fix chassis power status command 2005-04-21 03:30:55 +00:00
763abe4889 add sys/poll header for internal openipmi compiles 2005-04-21 01:13:01 +00:00
2a574a3e8b update changelogs for release,
add readme for debian packages that points to howto by Tim Small
2005-04-21 00:08:15 +00:00
f108b55d13 don't display open command for ipmievd when not available 2005-04-20 23:38:16 +00:00
13659fb466 add ipmievd to solaris packages 2005-04-20 23:27:49 +00:00
412798482c fix segfault from stupid error 2005-04-20 23:10:30 +00:00
90448837ec add ability to configure session retry and timeout settings,
add chassis power status command with return value indicating status
2005-04-20 23:04:00 +00:00
fecfc09c8b update version to 1.8.2, ipmievd can now build and work on non-linux systems 2005-04-20 22:49:25 +00:00
820d9e6bb3 massive overhaul to ipmievd to support both openipmi event message buffer and manual SEL polling 2005-04-20 22:48:49 +00:00
251de396a1 ipmi_intf_print takes argument listing supported interfaces 2005-04-20 22:46:52 +00:00
774c74a64c fix fru decoding for large areas, was overflowing 8bit counter 2005-04-20 22:42:11 +00:00
c7c5b2de37 add daemonize function to helper library 2005-04-20 22:40:53 +00:00
762f6fff1c ipmi_intf_print takes optional list of 'supported' interfaces to display 2005-04-20 21:43:02 +00:00
4ea12d4308 add ipmi_main.[ch] to the build system 2005-04-20 21:41:58 +00:00
ce01d13e98 move option parsing and command handling to its own file for reuse 2005-04-20 21:05:45 +00:00
1c4f38bba8 add rawi2c master read/write command 2005-04-20 21:03:33 +00:00
b2c96c3a1f add noanswer flag, and ipmi_cmd structures 2005-04-20 20:52:30 +00:00
4c99a6f676 intelplus mode does not try for highest priv based on algorithms 2005-04-20 20:48:47 +00:00
78049bf3b7 add system firwmware sensor-specific bits, add function to get sensor type based on event code and offset 2005-04-20 20:47:05 +00:00
6052a2b57a add sdr_cache function, fix Get SDR Header to handle cancelled reservation 2005-04-20 20:44:59 +00:00
392454c646 handle parameter out of range error without returning error code, fix segfault when no cipher suites defined 2005-04-20 20:36:01 +00:00
805835ca69 Properly close a session if our set session priv level command failed.
By this time we have activated successfully.
2005-04-08 21:37:33 +00:00
c86c21e734 Added missing val2str(rsp->ccode, completion_code_vals) for format argument. 2005-04-08 19:19:04 +00:00
897b3c5a46 Changelog for 1.8.1-1 debian release. 2005-04-06 23:19:46 +00:00
4e93bf01ed missing checkin seems to have disappeared: up to 1.8.1 2005-04-06 22:44:01 +00:00
9573ee3eed add linux/compile.h for 2.6 compiles 2005-04-06 20:51:02 +00:00
ef4e6f3dad ipmievd installs in /usr/sbin 2005-04-06 20:33:29 +00:00
3d30271e73 prefix with dist_ so they get included with make dist 2005-04-04 22:13:48 +00:00
c39a8026da avoid possible redefine 2005-04-04 01:15:20 +00:00
20a4a2f950 updates to debian builds from Petter Reinholdtsen 2005-04-04 01:09:50 +00:00
55ac08dc49 always remove old device file in case we get new dynamic major assigned from kernel 2005-04-03 22:45:56 +00:00
222 changed files with 87121 additions and 22268 deletions

34
.gitignore vendored Normal file
View File

@ -0,0 +1,34 @@
.deps
.dirstamp
.libs
*.o
*.lo
*.la
*.*~
Makefile
Makefile.in
aclocal.m4
autom4te.cache
compile
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
depcomp
install-sh
ltmain.sh
libtool
missing
stamp-h1
control/ipmitool.spec
control/pkginfo
control/prototype
control/rpmmacros
src/ipmievd
src/ipmitool
lib/ipmi_pen_list.inc.c
cscope.out
tags

37
.travis.yml Normal file
View File

@ -0,0 +1,37 @@
language: C
sudo: enabled
before_script:
- ./bootstrap
addons:
apt:
update: true
packages:
- libssl-dev
homebrew:
packages:
- openssl
matrix:
include:
- os: linux
dist: xenial
addons:
apt:
packages:
- libsystemd-dev
script:
- ./configure --enable-intf-dummy --enable-intf-dbus
- make
- sudo make install
- os: linux
dist: trusty
script:
- ./configure --enable-intf-dummy
- make
- sudo make install
- os: osx
osx_image: xcode10.2
script:
- ./configure --enable-intf-dummy
- make
- sudo make install

View File

@ -2,3 +2,4 @@ Duncan Laurie <duncan@iceblink.org>
Fredrik Öhrn <ohrn@chl.chalmers.se>
Jon Cassorla <jon.cassorla@newisys.com>
Jeremy Ellington <jeremy@jeremye.net>
Petter Reinholdtsen <pere@hungry.com>

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.

970
ChangeLog Normal file
View File

@ -0,0 +1,970 @@
version 1.8.18 2016-10-08
* Add mac2str() and str2mac() to print/parse MAC address
* Change formatting, remove commented-out code in
src/plugins/imb/imbapi.c
* Export find_lan_channel() as global
* Expose _ipmi_get_channel_info()
* Extend buf2str to allow separator
* Fix indentation of #define in src/plugins/imb/imbapi.c
* Fix missing `goto out_free;` when ipmi_parse_hex() returns (-1)
* Fix warning for buf2str argument
* ID 408 - fix sel list last X listing
* ID: 38 - Protocol violating SOL retries when talking to
SIMSO-HTC
* ID: 459 - Fix reading FRU on Artesyn (Emerson) shelf manager,
MF105.
* ID: 464 - ipmievd crash fix in log_event
* ID:230 - check return value of malloc() in lib/ipmi_ekanalyzer.c
* ID:261 - Fix err. output consistency for % ipmitool chassis
INV_PARAM;
* ID:287 - Fix print-out of DDR3 SDRAM Serial Number
* ID:287 - Remove trailing white-spaces from dimm_spd.c
* ID:289 - bmx-snmp-proxy: PEF alerting does not work for
multiple destinations
* ID:312 - BREAKING CHANGE - Re-design of PEF user interface
* ID:312 - Fix bitmask in _ipmi_set_pef_policy_entry()
* ID:335 - Check return value of fseek(), prevent segfault
* ID:335 - Check return value of fseek(), prevent segfault
* ID:355 - Comment out statement without effect in lib/ipmi_sel.c
* ID:355 - Fix 'missing initializer' in struct lan_param
* ID:355 - Fix ``warning: ISO C forbids zero-size array 'data'''
* ID:355 - Fix different pointer type in lib/ipmi_picmg.c
* ID:355 - Fix missing struct initializers in lib/ipmi_firewall.c
* ID:355 - Fix printf format in lib/ipmi_sunoem.c
* ID:355 - Fix printf() related warnings in lib/ipmi_delloem.c
* ID:355 - Fix signedness warnings in lib/ipmi_sdr.c
* ID:355 - Fix statements without effect in lib/ipmi_ekanalyzer.c
* ID:355 - Move section_id from ipmi_fru. to ipmi_fru.c
* ID:355 - Replace DEBUG() macro with lprintf(LOG_DEBUG, ...)
* ID:375 - Add lan6 subcommand to handle IPv6 LAN parameters
* ID:400 - Add support for VITA-specific sensor types and events.
* ID:441 - Add support for HMAC_MD5 and HMAC_SHA256
* ID:443 - Disable USB driver by default on non-Linux systems
* ID:444 - Cleanup of defaults in configure.ac
* ID:445 - Fix of compilation on FreeBSD
* ID:446 - Fix broken firewall reset iterator
* ID:447 - Fix access beyond array limits in serial_terminal
* ID:449 - ipmitool close console session for sol deactivate
command
* ID:451 - Modify the memory ecc error display of SEL for new
supermicro motherboards.
* ID:452 - Add PICMG extension 5.x for PICMG extension check
* ID:454 - Add support for PICMG 3.1 R2.0 Link Types and Link
Classes.
* ID:456 - Unable to disable the VLAN ID using ipmitool
* ID:457 - Display User ID enable/disable status
* ID:463 - Removal of Nokia Siemens Networks
* ID:465 - Supermicro memory ecc Modify the memory ecc error
display of SEL for new supermicro boards.
* Moved ipmi_parse_hex() to helper.c
* Re-work ipmi_mc_get_guid() and turn it into reusable code
* Revert "ID:335 - Check return value of fseek(), prevent
segfault"
* Rewrite code with the notion that Kg is binary data, not string
version 1.8.17 2016-05-01
* Add INSTALL and NEWS, mandated by autoconf
* Added missing ipmi_sel_supermicro.h to template Makefile.am
* Check rsp->data_len in ipmi_sel_get_info()
* Fix "redirecting incorrect #include <sys/poll.h> to <poll.h>"
warning with musl libc
* Fix automake compatibility warnings
* Fix implicit declaration of function
'get_nic_selection_mode_12g' in lib/ipmi_delloem.c
* Fix implicit declaration of function 'ipmi_get_oem' in
src/plugins/imb/imb.c
* Fix implicit declaration of function 'ipmi_get_oem' in
src/plugins/lanplus/lanplus.c
* Fix implicit declaration of function 'ipmi_get_oem' in
src/plugins/open/open.c
* Fix implicit declarations of functions 'HpmfwupgPreUpgradeCheck'
and 'ipmi_intf_get_max_request_data_size' in lib/ipmi_hpmfwupg.c
* Fix implicit declarations of functions
'ipmi_intf_set_max_request_data_size' and
'ipmi_intf_set_max_response_data_size' in lib/hpm2.c
* Fix implicit function declaration of
ipmi_intf_get_max_response_data_size in lib/ipmi_sdr.c
* Fix several implicit declarations of functions in
lib/ipmi_main.c
* Fix several implicit function declarations in lib/ipmi_fru.c
* Fix warning: suggest parentheses around '+' inside '<<'
in lib/ipmi_main.c
* Fix warning: suggest parentheses around arithmetic in operand of
'|' in include/ipmitool/hpm2
* Get rid of old INCLUDES macro, use AM_CPPFLAGS instead.
* ID 440 - Fix 'unknown type name fd_set" error.
* ID 440 - remove obsolete headers from lib/ipmi_sunoem.c
* ID:322 - let 'ekanalyzer frushow' run without a working
IPMI target
* ID:355 - Add #include <strings.h> to lib/ipmi_sel.c
* ID:355 - Add macros and #include and reduce number of warnings
* ID:355 - Change CFLAG -std=c99 to -std=gnu99
* ID:355 - Move Super Micro stuff into dedicated header file
* ID:355 - Remove declared, but not used variables
* ID:404 - Edit FRU information update problem
* ID:405 - Use meaningful Generator ID for "ipmitool sel add"
* ID:407 - Avoid assert on mismatched session ID
* ID:409 - Fix IPv6 socket creation on Windows/Cygwin.
* ID:410 - Disable USB interface for Windows/Cygwin by default.
* ID:410 - Enable/disable USB interface by "auto"
* ID:411 - Fix HPM.2 revision check for R1.1 and subsequent
specification revisions.
* ID:412 - Check errors when setting a user password.
* ID:413 - Print new line chne character when setting user
privilege.
* ID:414 - ekanalyzer frushow fails to show 'Product Info'
correctly
* ID:417 - Fix some typos
* ID:418 - Fix Compiling under Mac OS X
* ID:419 - List dummy.h in Makefile.am, so it gets included in
a release tarball
* ID:421 - Fix memleak for sol output
* ID:423 - Don't assume internal use area is present in ekanalyzer
* ID:424 - Update dimm_spd.c with data from the latest JEDEC List
* ID:425 - Disable USB interface for OS X/darwin
* ID:426 - Fallback to run-time detection of PAGESIZE if
compile-time detection is not supported
* ID:426 - Include sys/socket.h instead of asm/socket.h
* ID:426 - Include wchar.h instead of defining wchar_t ourselves
* ID:427 - Cleanup comment in ipmi_sdr_get_header()
* ID:427 - The first two bytes of dumped raw SDR data is wrong.
* ID:428 - Update IANA numbers / Product Name for IBM and ADLINK
* ID:430 - Change Nokia Siemens Networks to Nokia Solutions
and Networks
* ID:431 - Fix correct interpretation of led states
* ID:437 - sel: Fix "sel time set <time>"
* Make bootstrap script part of dist packages
* Remove #if 0 code aka not-compiled-in
* Remove trailing white-spaces in lib/log.c
* git-ignore autoconf-generated files
version 1.8.16 2015-11-22
* Add _ipmi_get_channel_access() and _ipmi_get_channel_info()
* Add _ipmi_get_user_access() and _ipmi_set_user_access()
* Add _ipmi_get_user_name()
* Add _ipmi_set_channel_access() function
* Add _ipmi_set_user_password() function
* Add limits check in get_cmdline_macaddr()
* Change expression in ipmi_pef_get_info() in order to silence Coverity
* Change expression in ipmi_pef_list_policies() in order to silence Coverity
* Code cleanup in ipmi_user_main()
* Create ask_password() and re-use code
* Delete dead code from ipmi_sunoem_echo() - CID#1261338
* Don't output pidfile before parsing command line arguments
* Don't use tmp variable since it's not necessary in ipmi_user_test()
* Fix 'user help' output
* Fix Assign instead of compare in KfwumGetDeviceInfo() - CID#1149034
* Fix Identical code for different branches in ipmi_tsol_main() -
CID#1261346
* Fix big parameter passed by value in ipmi_sel_oem_match() - CID#1261347
* Fix dead code in ipmi_firewall_reset() - CID#1261342
* Fix eval logic in ipmi_user_priv()
* Fix file descriptor leak in ipmi_exec_main() - CID#1149040
* Fix identical code for diff branches in DellOEM - CID#1261326
* Fix memory leak in get_supermicro_evt_desc()
* Fix memory leak in ipmi_ek_display_board_info_area() - CID#1149051
* Fix missing return in ipmi_kontronoem_main() - CID#1261317
* Fix of previous commit - memset() expects pointer
* Fix out-of-bound-reads in get_supermicro_evt_desc()
* Fix resource leak in fru_area_print_board() - CDI#1149048
* Fix resource leak in fru_area_print_chassis() - CID#1149047
* Fix resource leak in fru_area_print_product() - CID#1149046
* Fix resource leak in ipmi_kontron_set_serial_number() - CID#1149041
* Fix typo vlan->VLAN in ipmi_lan_set_vlan_id() and
ipmi_lan_set_vlan_priority()
* Fix uninitialized struct in ipmi_fru_upg_ekeying() - CID#1149065
* Fix user input validation in Channel and User sub-commands
* Fix wrong size argument in ipmi_sdr_list_cache_fromfile() - CID#1149056
* Fix/remove pointer cast in _ipmi_set_user_access()
* Hook functions in ipmi_user to _ipmi_set_user_password()
* Hook ipmi_get_channel_info() to _ipmi_get_*()
* Hook ipmi_get_channel_medium() to new _ipmi_get_*() functions
* Hook ipmi_lan_set_password() to _ipmi_set_user_password()
* Hook ipmi_print_user_list() and friends to _ipmi_* functions
* Hook ipmi_set_alert_enable() to _ipmi_*()
* Hook ipmi_set_user_access() to _ipmi_set_user_access()
* Hook ipmi_user_priv() to _ipmi_set_user_access()
* ID:307 - Intel I82751 super pass through mode fixup
* ID:355 - Fix compiler warnings for Dummy Interface
* ID:380 - raw commands override retry and timeout values
* ID:319 - Interface safe re-open
* ID:320 - Add VITA 46.11 support
* ID:333 - Set read timeout to 15s in OpenIPMI interface
* ID:336 - ipmitool does not fall back to IPv4 for IPMI v2 / RMCP+ sessions
* ID:343 - Print actual sensor thresholds in 'sensors' comand
* ID:343 - Remove AC_FUNC_MALLOC
* ID:344 - Fix HPM.2 long message support
* ID:345 - Do not do several close session retries when catching SIGINT
* ID:346 - lib/ipmi_sdradd.c ipmi_sdr_read_record has a file descriptor leak
* ID:347 - Incorrect reserved channel number
* ID:348 - Add support for the "System Firmware Version"
* ID:349 - user set password - add option to choose 16/20 byte password
* ID:354 - Replace obsolete u_int with uint32_t in dimm_spd.c
* ID:354 - Replace obsolete u_int[0-9]+_t with standardized types in Free
iface
* ID:354 - forcefully switch to C99 and more strict CFLAGS
* ID:354 - replace/drop caddr_t in IMB
* ID:354 - struct member h_addr has been replaced
* ID:354 - uint8_t >= 0 is always true, don't test it
* ID:355 - Fix Enumeration value not handled in ipmi_get_event_desc()
* ID:355 - Fix ``ISO C forbids omitting the middle term of a ?: expression''
* ID:355 - Fix ``obsolete use of designated initializer with <20>:<3A>'' warning
* ID:355 - Fix comparison of unsigned expression
* ID:355 - Fix compiler warnings
* ID:355 - Fix compiler warnings in dimm_spd.c
* ID:355 - Fix couple compiler warnings in ipmi_lanp.h
* ID:355 - Fix formatting warning in get_cmdline_ipaddr()
* ID:355 - Fix zero-length format string warning in
get_supermicro_evt_desc()
* ID:355 - Remove defined but unused variable in _set_command_enables()
* ID:355 - remove unused variables from ipmi_dcmi.c
* ID:357 - out-of-bound access in DDR4 code ID:356 - DIMM4 Die Count is
unreachable
* ID:357 - out-of-bound access in DDR4 code
* ID:358 - check data length in else branch of ipmi_spd_print()
* ID:361 - Add a OEM IANA information
* ID:363 - Node Manager feature patch.
* ID:363 - fix Coverity issues in NM implementation
* ID:364 - Fix for serial-basic interface bridging
* ID:365 - Fix for ipmitool crash when using serial-terminal interface
* ID:366 - Properly clean LAN and LAN+ interfaces on close
* ID:367 - Fix building of non-bridged LAN interface commands
* ID:368 - Fix handling of bridging-related parameters
* ID:369 - Fix lanplus interface bridging and response matching
* ID:370 - add anonymous union support in CFLAGS for older gcc
* ID:371 - add ericsson oem
* ID:373 - Fix compilation of IMB on Windows
* ID:374 - Check/set LED Duration correctly
* ID:376 - Add means to configure "Bad Password Threshold"
* ID:381 - Script to log installation status as SEL events
* ID:382 - Fix memcpy() params in HpmFwupgActionUploadFirmware()
* ID:383 - Fix compile-time error in src/plugins/lan/lan.c
* ID:384 - Fix compilation under cygwin64
* ID:388 - Fix Error message always printed if BMC does not support VITA
* ID:388 - Handle ccode 0xCC as well in VITA discovery
* ID:388 - Turn all messages into LOG_INFO in VITA discovery
* ID:389 - Add on of Advantech IANA number
* ID:390 - Support for new Communication Interface (USB Medium)
* ID:391 - changing data_len from 17 to 16 according to ipmi spec 22.29,
first byte is completion code
* ID:392 - _ipmi_get_user_name() work-around for some BMCs
* ID:393 - ipmitool man page addition for Node Manager support.
* ID:394 - close fp if isn't NULL and set it NULL afterwards in USB plugin
* ID:394 - plugins/usb: Fix probe for SCSI devices
* ID:395 - Fix fru string without resizing it
* ID:396 - Fixed invalid length check in picmg led cap command.
* ID:397 - Fixed picmg policy set command.
* ID:398 - Fixed channel setaccess command.
* ID:399 - Fixed channel getciphers command.
* ID:401 - Fixed 30 second delay when activating SOL on 'dumb' Intel MACs.
* ID:402 - Misguiding error print-out when using some 'lan' commands.
* Init user_access_t struct in ipmi_user_priv()
* Make user User Privilege Limit is within range
* Node Manager Feature, correct 1268194 missing break.
* Output pidfile only in verbose mode
* Print error message to STDERR in ipmi_channel.c
* Re-work 'channel getaccess' and 'channel setaccess'
* Re-work ccode eval in ipmi_get_channel_medium()
* Remove commented-out code in ipmi_picmg_clk_set() - CID#1261339
* Remove dead code - rsp can't be NULL at this point - CID#1149005
* Remove dead code in fru_area_print_board() - CID#1149001
* Remove dead code in fru_area_print_chassis() - CID#1149000
* Remove dead code in fru_area_print_product() - CID#1148999
* Remove dead(duplicate) code from ipmi_sol_main() - CID#1148996
* Remove get_channel_access_rsp and get_channel_info_rsp structs
* Remove ipmi_user_set_password()
* Remove length checks in get_supermicro_evt_desc()
* Remove redundant user-input conversion from ipmi_sel_delete()
* Remove trailing white-spaces in ipmi_user.c
* Remove trailing white-spaces in ipmi_user.c
* Remove trailing white-spaces in src/plugins/dummy/dummy.c
* Remove unused variable from ipmi_get_channel_cipher_suites()
* Replace deprecated bzero() with memset()
* Replace s6_addr16 with s6_addr since Mac OS X does not have it
* Rewrite ipmi_set_channel_access()
* Split ipmi_user_main() into smaller functions
* ipmi_print_user_summary() to utilize _ipmi_get_user_access()
* ipmitool delloem: ipmitool delloem extension always return success - fix
it
version 1.8.15 2014-11-24
* ID: 340 - ipmitool sol session improperly closes on packet retry
* ID: 277 - support for hostnames longer than 64 chars
* ID: 313 - ipmitool doesn't support hostname long than 64 symbols
* ID: 277 - Minor issue with ipmi_intf_session_set_hostname()
* ID: 247 - 'sensor thresh' help output is wrong
* ID: 324 - conflicting declaration write_fru_area()
* ID: 337 - Add support for 13G Dell PowerEdge
* ID: 325 - DDR4 DIMM Decoding Logic
* ID: 328 - HPM.2 fixes
* ID: 329 - hpm.1 upgrade fixes
* ID: 103 - picmg discover messages should be DEBUG, not INFO
* ID: 331 - Passwords provided in file (-f option) truncated on space
* ID: 318 - ipmi_tsol.c: fix buffer overflow
* ID: 306 - "fru print" command prints the FRU #0 twice
* ID: 305 - HPM.1 deferred activation support fixup
* ID: 317 - ipmi_fwum.c: fix typo
* ID: 315 - buildsystem: configure.in is deprecated
* ID: 316 - Directory debian is outdated
* ID: 103 - 'lib/ipmi_ekanalyzer.c' needs a re-work
* ID: 46 - SEL OEM record corner case
version 1.8.14 2014-05-05
* ID: 299 - openipmi plugin writes zero to wrong byte
* ID: 301 - Add OS/Hypervisor installation status events
* ID: 298 - fix LANplus retry
* ID: 295 - inform user if SOL session disconnected
* ID: 297 - don't print-out SEL entry if ID not present
* ID: 296 - Fix PSD size decoding
* ID: 293 - Use of uninitialized variable in ipmi_main()
* ID: 278 - Error in sol looptest
* ID: 290 - ipmi_sol.c needs a clean-up
* ID: 85 - Supermicro memory ECC error display
* ID: 290 - ipmi_sol.c needs a clean-up
* ID: 286 - Open session retries hit assert in ipmi_lanplus_send_payload
* ID: 285 - Fix SEGV in ipmi_lanplus_open_session
* ID: 284 - Fix SEGV in ipmi_main
* ID: 283 - ipmi_intf_socket_connect fails with IPv4 hosts
* ID: 46 - ipmi_fwum needs some re-work
* ID: 50 - ipmi_hpmfwupg needs a clean up
* ID: 279 - ipmitool sdr list broken
* ID: 44 - dummy interface support - fake-ipmistack project
* ID: 48 - Remove hard-coded FRU inventory access length restriction
* ID: 276 - HPM.1 upgrade combined patch
* ID: 90 - Add options to chassis bootparam set bootflag
* ID: 292 -Properly handle plugin non-zero target adddress with -t
* Numerous Fixes based on running Coverity
* Use TIOCFLUSH if TCFLSH is missing to get the serial plugin building on
Hurd.
* Disable imb and open plugins by default on Hurd. The platform lack
the required kernel support.
* Change serial plugin to only try to disable the IUCLC serial line flag on
platforms supporting it. Fixes build problem on Hurd and FreeBSD.
* PA: 83 - Revised IPv6 patch
* FR: 24 - Exchange OS Name Hostname BMC URL during startup
* ID: 304 - Incorect byteswap in SOL maximum payload
* ID: 303 - Fix build error in HPM.2 code
* ID: 300 - new sunoem functionality
* ID: 144 - Fix 'dcmi power set_limit action <value>'
* ID: 302 - HPM.2 long message support
* ID: 309 - Add new SEL entries for ipmi 2.0 rev 1.1
* ID: 280 - man page cleanup
* ID: 311 - man page update for new sunoem commands
version 1.8.13 2013-09-09
* ID: 3611905 - Direct Serial Basic/Terminal Mode Interface drivers
* ID: 3577766 - configure's knobs and switches don't work
* ID: 3611253 - do not override OS-default values for interfaces
* ID: 65 - Fixes for configure.in for cross compilation
* ID: 3571153 - OpenIPMI/ipmievd fails to compile on Solaris
* numerous ipmitool man page updates
* ID: 3611226 - Bridging support for PICMG Platforms
* Add support for getsysinfo/setsysinfo commands to ipmi mc
* Cleanup Dell OEM code to use new sysinfo interface
* ID: 93 - str-to-int conversion is weak
* ID: 3582307 - ipmi_fru - ipmi_fru_main() return codes
* ID: 3582310 - ipmi_fru - ipmi_fru_main() - misuse of printf()
* ID: 3576213 - ipmi_fru - unused variable
* ID: 3578276 - ipmi_fru - free() on freed memory possible
* ID: 3578275 - ipmi_fru - memory leaks
* ID: 3528271 - ipmi_fru - possible *flow via FRUID
* ID: 3578277 - ipmi_fru - possible NULL pointer
* ID: 3612372 - Recognize Broadcom IANA number and BCM5725 product
* ID: 3608758 - add IPMI_NETFN_OEM
* ID: 143 - Reversed 'channel authcap' capabilities
Fixes reversed IPMIv1.5/2.0 'channel authcap' capabilities
* ID: 3587318 - "dcmi discover" is not DCMI 1.5 compatible
* ID: 3608757 - ipmi_fru - various fixes
* ID: 3598203 - 'mc getsysinfo|setsysinfo' needs a bit of re-work
* ID: 3597782 - ipmi_mc - sysinfo_param() has two consecutive returns
* ID: 3597781 - 'mc getsysinfo|setsysinfo' help has typos
* ID: 3608763 - ipmi_sdr - code cleanup & output display cleanup
* ID: 3610286 - ipmi_sdr - ipmi_sdr_print_type - incorrect eval
* ID: 3600930 - ipmi_sdr - code cleanup
* ID: 3602439 - ipmi_sdr - memory leaks
* ID: 3595199 - ipmi_sdr - Add support for 'ipmitool sdr <list|elist> help'
* ID: 3592773 - 'ipmitool sdr info'; prints incorrect info
* ID: 3592770 - 'ipmitool sdr list|elist INV_INPUT' return code
* ID: 3577159 - ipmi_sdr - uint32_t cast to uint8_t and back
* ID: 3528368 - ipmi_sdr - possible int *flow
* ID: 226 - ipmi_sdradd - typo
* ID: 258 - ipmi_sdradd - error printed on STDOUT
* Fixed ipmievd start under systemd.
* ID: 3608760 - Add bswap.h to ipmi_chassis.c and ipmi_pef.c
* ID: 3564701 - ipmitool 1.8.12 doesn't build on big endian architectures
* ID: 3600907 - defined value for "Chassis may not support Force Identify"
* ID: 256 - ipmitool could crash when IPv6 address is returned
* ID: 211 - 'lib/ipmi_dcmi.c' - typo & error printed on STDOUT
* ID: 3612237 - If DCMI command fails, incorrect completion code is printed
* ID: 3608149 - ipmitool - set pointer to NULL after free()
* ID: 3603419 - DCMI - waste of resources
* ID: 3600908 - DMCI - crash in ipmi_print_sensor_info(), NULL ref
* ID: 3609985 - delloem : Wrong MAC returned when flex addressing is enabled
* ID: 113 - delloem exec file won't handle more than one command
* ID: 28 - delloem - clean up the code
* ID: 3608261 - delloem - code formatting
* ID: 3528247 - delloem - fix possible *int flows
* ID: 3600910 - delloem - code cleanup
* ID: 3576211 - delloem - unused variable
* ID: 3578022 - delloem - fix typos
* ID: 263 - ipmi_ek* - cleanup
* ID: 3308765 - ipmi_ek* - cleanup
* ID: 3586228 - ipmi_ek* - ipmi_ekanalyzer_usage() rework
* ID: 3528388 - ipmi_ek* - a typo in error message
* ID: 3576212 - ipmi_event - better rsp handling
* ID: 3607393 - ipmi_event - redundant '\n' in error message
* ID: 153 - ipmi_firewall - printf() used instead of lprintf()
* ID: 3608003 - ipmi_fru - atol() should be replaced with str2*()
* ID: 3600911 - ipmi_fru - fix multiple increments in args to printf
* ID: 3600914 - no more crash on no response. allow more send/recv loops of waiting.
* ID: 70 - Fixes and updates for ipmitool hpm
* ID: 3528308 - ipmi_hpmfwupg - possible int *flow
* ID: 3608762 - ipmi_hpmfwup - Fixed help messages for hpm command
* ID: 3607981 - ipmi_lanp - replace atoi() calls
* ID: 3607320 - ipmi_lanp - possible NULL reference
* ID: 3600926 - ipmi_lanp - code cleanup
* ID: 3613575 - memory leak - ipmi_password_file_read()
* ID: 3522740 - reading password from file is limited to 16byte passwords
* ID: 3613605 - ipmi_main - call free() on pointer to static data
* ID: 3608761 - ipmi_main - PICMG Get Device Locator was never run
* ID: 3577155 - ipmi_main' - memory leaks
* ID: 239 - typo in 'mc selftest', add details
* ID: 3597471 - ipmi_mc - needs a bit of re-work - rc, inv. options
* ID: 3597468 - ipmi_mc - print_mc_usage() prints to STDOUT
* ID: 3597469 - 'mc watchdog off' prints on STDERR, should be STDOUT
* ID: 3597470 - 'mc watchdog reset' prints on STDERR, should be STDOUT
* ID: 3611254 - OEM handle for Intel 82751 in SPT mode
* ID: 3600927 - change eval order of input param in ipmi_oem_setup()
* ID: 3600928 - ipmi_pef - code cleanup
* ID: 3592732 - ipmi_picmg.c - printf() misuse
* ID: 3528310 - ipmi_picmg.c - NULL reference
* ID: 3528347 - ipmi_raw.c - possible int *flow
* ID: 3587913 - Command % ipmitool raw help; returns 1
* Added code to support sensors on other luns (On behalf of Kontron Germany)
* ID: 3611912 - Add missing newlines when cvs output is specified
* ID: 244 - ipmi_sel - "0.0" displayed for unspecified threshold values
* ID: 3612371 - Typo in impi_sel debug output
* ID: 3016359 - ipmi_sel - Get SEL Alloc Information is incorrect
* ID: 3568976 - 'sel set time' behaviour is inconsistent
* ID: 3528371 - ipmi_sensor - possible int *flow
* ID: 3601265 - 'ipmitool sensor get' leaks memory
* ID: 3601106 - 'ipmitool sensor get NACname' output incorrect/inconsistent
* ID: 3608007 - ipmi_session - typo in error message
* ID: 101 - ipmi_sol - possible int *flow
* ID: 3600933 - ipmi_sol - use of deprecated bzero()
* ID: 3609472 - ipmi_sol - Add the instance to the SOL commands
* ID: 3588726 - 'ipmitool sol payload status ...;'segfaults on no rsp
* ID: 3522731 - ipmi_sol - ipmi_get_sol_info() returns always 0
* ID: 3613042 - add missing Entity IDs
* ID: 3611306 - ipmi_tsol - fix always fail in case of error
* ID: 259 - ipmi_user - memory leak
* ID: 260 - ipmi_user - replace atoi() call
* ID: 2871903 - ipmitool user priv incorrectly sets Link Auth
* ID: 3600960 - check the copy of password exists
* ID: 3609473 - Add assertion/deassertion to threshold events
* ID: 104 - ipmishell - possible int *flow
* ID: 262 - 'set' segfaults when no IPMI inf present
* ID: 257 ipmitool exec segfaults if invalid input given
* ID: 254 - Fix retry of authentication capabilities retrieval
* ID: 3611303 - lan - error check is missing braces
* ID: 253 - Fix lanplus retransmission
* ID: 212 - 'lib/ipmi_dcmi.c' - possible int *flow
* ID: 264 - incorrect array index in get_lan_param_select()
* ID: 269 - Fixes for configure.in for cross compilation
* ID: 267 - Corruption in "lan alert print" output
* ID: 41 - ipmi_sel_interpret() - clean up formatting, indentation
* ID: 242 - Incorrect DCMI Power Reading "IPMI timestamp" interpretation
* ID: 229 - 'lib/ipmi_ekanalyzer.c' - a typo ``Too few argument!''
* ID: 266 - file descriptor leak in ipmi_fwum and ipmi_ekanalyzer
* ID: 99 - 'lib/ipmi_sel.c' - possible int *flow
* ID: 222 - 'lib/ipmi_sdr.c' - a typo 'Not Reading' -> 'No Reading'
* ID: 35 - Script to setup redirection of SNMP to/from BMC
* ID: 273 - Reduce SOL Input buffer size by SOL header size
version 1.8.12 released 2012-08-09
* Added IPMB dual bridge support (no need for driver support)
* Enable compiler warnings and resolve all compiler warning so that
ipmitool compiles and links with no warning or error messages
* add ipmishell line to configure
* fail configure when no curses or readline is found
* support sensor bridging in free interface
* applied fix for issue #2865160 (AIX build)
* Document the ipmitool dcmi commands in the ipmitool man page
* Document that some commands are blocked by OpenIPMI. ID 2962306
* Document the -N and -R options per tracker ID 3489643
* fix manpage misdocumentation on cipher suite privilige configuration
* Add build support for Dell OEM commands
* Add new Dell OEM commands and update man page
* added hpm and fwum in man page
* man page update for fwum and hpm commands
* Added documentation for 'ime' operating mode, used to update Intel ME.
* add new -Y option to prompt user to enter kgkey
* Add DCMI module (Data Center Management Interface)
* fixed oem/iana data type to allow 24 bits definition
* Fixed AMC point-to-point record parsing in FRU
* Fixed detection of packing support in GCC
* Added packing support detection magic on all packed structures
in project
* Dell specific mac sub command is updated to support the latest 12G
Dell servers. Support for virtual mac is also implemented.
* Use consistent netfn/cmd for getsysinfo command
* Add Dell OEM network commands
* Resolve incorect Board Mfg Data due to incorrect date constant
* Update ipmi_fru.h to SMBIOS spec 2.6.1 - ID 2916398
* Support for analog readings in discrete sensors on HP platforms.
* Change device id mask (IPM_DEV_DEVICE_ID_REV_MASK) 0x07 for 0x0F.
As per in IPMI spec V2:
* Added PICMG clock e-keying and bused resource control identifiers
* Added PICMG major version (ATCA/AMC/uTCA) identifiers
* Correct Threshold/Discrete Sensor Display - Patch Tracker ID 3508759
* Sensor units now handle percentage units - ID 3014014
* Fixes ID 3421347 Sensor list command should use channel field from SDR
* Added packing directive for ARM cross compile with GCC 3.4.5,
otherwise the sdr structures gets padded and the pointer cast
result in incorrect alignement
* Added 'sdr fill sensors nosats' support to speed up SDR discovery
* Added SDR name display during discovery (with -v)
* Added support for sensor types - Processor related sensor
type 0x07, system incharectorization 0x20, Memory sensor type.
* Give more description for SEL which is generated for Uncorrectable
ECC and errors with respect to each Memory Bank,Card or DIMM.
The Sensor type supporting this are 0x0C and 0x10.
* Add more details about Version Change event (source of
firmware update)
* enhanced PICMG fru control
* Integrated Andy Wray's DDR3 SPD parser patch
* Adds function str2uint() to convert from string to uint32_t with
checks for valid input.
* Fix possible buffer overflow in buf2str()
* Fixes ID 3485004 - misuse of strtol()
* Replaces calls to strtol() with str2uchar() calls and adds error
messages if invalid input is given.
* Don't overwite the iflags bits prior to setting the boot parameters.
This fixes ipmitool so that
chassis bootdev bios clear-cmos=yes
will correctly clear the bios cmos.
* Clarify DCMI get limit activation (add if activate or not).
* Bug fixes for delloem lan command. This includes the support for 12G
Dell license and 12G LAN Specific command.
* delloem commands should not be executed before parsing command line.
* Fix stack overflow in delloem setled
* Fix delloem powermonitor on big-endian platforms.
* ipmitool delloem powermonitor command should convert data from
network-format to the native one, otherwise it shows garbage
on ppc/ppc64 platform.
* Add ipmi_getsysinfo command
* Add support for drive backplane SetLED functionality
* Fix for Platform Event Message incorrect Generator ID
* Fix fru print so that it will display FRU info from satellite
controllers.
* Add support for AMC type 17h record.
* Fix in fru edit. It is now possible to edit field 0 of sections
* New FRU get OEM record command
* fixed segfault for fru edit when "field id" is not supported and
added user feedback for string substitution(success or failure)
* Improvement to hpm upgrade during activation. This resolves issue
where activation seems to have failed because ipmitool received
an unsupported completion code.
* hpm Fixes for multi-platform support.
* hpm Fix for timeouts during firmware rollback. If completion code
is C3, wait till timeout has expired before reporting it.
* hpm During manual rollback, code now gets target capabilities
instead of using a default timeout of 60 seconds.
* Added firmware auxilliary bytes to hpm outputs
* hpm Add support for BIG Buffer (Use when -z option is used)
* Fix the case where ipmitool loses the iol connection during the upload
block process. Once IPMITool was successfully sent the first
byte, IPMITool will not resize the block size.
* Fix the problem when we try to upgrade specific component and the
component is already updated,
* updated HPM firmware agent to version 1.04
* Fix exit code to return zero on '-o list' or '-o help' option
* limit length of user name and password that can be supplied by user.
Password is limited to 16 bytes, resp. 20 bytes, for LAN, resp.
LAN+, interface. User name is limited to 16 bytes, no interface
limitations. ID 3184687, ID 3001519
* Add retry / timeout options for LAN
* Changed default cipher suite to 1 instead of 3 for iol20
* added fix for tracker ID 2849300 "Incorrect Firmware Revision"
* avoid reopening the interface when already opened
* Remove message for unsupported PEF capabilities that return valid
CC (80h)
* Added OEM byte (47) to verbose output
* Add option to provide a list when filling sdr repository
* SDR discovery speedups
* Added support for Dell specific sensors
* Fix segmentation fault on unrecognize OEM events.
* changed SEL timestamp formatting for 'preinit' SEL entries, allowing
the number of seconds to be displayed.
* Added sensor raw data in verbose mode. Useful for OEM sensor type.
* Add sensor hysteresis (positive & negative) to the following command
ipmitool sensor -v
* Fixes bug ID 3484936 - missing user input validation
* Add missing RMCP+ auth type strings
* Add new Kontron Product in ipmi_strings for product ID. Kontron
KTC5520/EATX Server Motherboard with integrated iBMC/KVM/VM
added identification support for Kontron AT8050 ATCA board
* Constrain setting of the username to no greater than 16 characters
per the IPMI specification. ID 3001519
* Constrain User ID between 1 and 63. ID 3519225
* Fixes ID 3485340 - user input not handled in 'lib/ipmi_user.c'
* Fixes ignorance of existing daemon PID file which results in PID being
overwritten. Adds proper umask() before writing PID file.
* applied fix for ID 2865111 (AIX build)
* Fix a proplem when using bridged IPMI commands on the lanplus
interface (-I lanplus with -b -t or -m switches) resulting in
"Close Session command failure".
* Add fix with usage of CFh (duplicate request). Usefull for
slow commands
* Fix issue with sequence number. (Speed up transfer)
version 1.8.11 released 2009-02-25
* Fix new GCC compilation issues in regards to Packing
* Fix Tracker bug #1642710 - ipmi_kcs_drv being loaded/unloaded
for 2.4 kernel instead of ipmi_si_drv driver module
* New -y option added to allow specification of kg keys with
non-printable characters
* New -K option added to allow kgkey settings via environmental
variable IPMI_KGKEY
* Generic device support added for EEPROM with SDR Type 10h (gendev)
* Fix to lan-bridging for a double-bridging crash and to fix
an issue with bridging multiple concurrent requests and
erroneous handling of raw Send Message
* Lanplus fix for commands like 'sensor list' without the -t option
causing wrong double bridged requests of a sensor is located
on another satellite controller
* Fix lan and lanplus request list entry removal bugs
* Fix non-working issue when trying to send a bridge message with
Cipher 3
* Change bridge message handling to reuse command ipmi_lan_poll_recv
* Added PICMG 2.0 and 2.3 support
* Fix PICMG (ATCA) extension verification and reversal of BCD encoded
values for "major" and "minor" fields
* Add IANA support for Pigeon Point
* Add OEM SW/FW Record identification
* Fix to include I2C and LUN addresses so sensors are correctly managed
* Patch ID 1990560 to get readings from non-linear analog sensors
* Add support for SOL payload status command
* SOL set parameter range checking added
* Fixed SOL activate options usage
* Fixed crashes when parsing 'sol payload' and 'tsol' cmds (#216967)
* Added retries to SOL keepalive
* Fixed wrong mask values for Front Panel disable/enable status
* Add support to access fru internal use area
* Add support for new PICMG 3.0 R3.0 (March 24, 2008) to allow
blocks of data within the FRU storage area to be write
protected.
* Fix node reporting in GUID; Tracker bug #2339675
* Fix watchdog use/action print strings
* Fix endian bug in SDR add from file; Tracker bug #2075258
* Fix crash when dumping SDRs in a file and there's an error
getting an SDR; improve algorithm for optimal packet size
* Fix occasional SDR dump segfault; #1793076
* Allow ipmitool sel delete to accept hex list entry numbers
* Fix SEL total space reporting.
* Fix for garbage sensor threshold values reported when none
returned. Tracker Bug #863748
* ipmievd change to Monitor %used in SEL buffer and log warnings when
the buffer is 80% and 100% full
version 1.8.10 released 2008-08-08
* Added support for BULL IANA number.
* Fixed contrib build so the oem_ibm_sel_map file gets included in
rpm builds again.
* Added support for Debian packages to be built from CVS
* Fix for sdr and sel timestamp reporting issues
* Fix for discrete sensor state print routines to address state
bits 8-14
* Change ipmi_chassis_status() to non-static so it can be used
externally
* Added retries to SOL keepalive
* Fix to stop sensor list command from reporting a failure due
to missing sensor
* Fix bug in sdr free space reporting
* Add support for IANA number to vendor name conversion for many
vendors
* Fix segfault bug in lan set command
* Fix bug in population of raw i2c wdata buffer
* Fix bug in ipmb sensor reading
* Fix misspellings, typos, incorrect strncmp lengths, white space
* Update/fix printed help and usages for many commands
* Add and update support for all commands in ipmitool man page
* Fix for lanplus session re-open when the target becomes unavailable
following a fw upgrade activation
* Add support for watchdog timer shutoff, reset, and get info
* Add support for more ibm systems in oem_ibm_sel_map
* Add more JEDEC support info for DIMMs; decrease request size
for DIMM FRU info to 16 bytes at a time to allow more
DIMM FRUs to respond.
* Fix to change hpmfwupg to version 1.02; fix to reduce hpmfwupg
buffer length more aggressively when no response from iol
* Fix HPM firmware activation via IOL; fake a timeout after IOL
session re-open to force get upgrade status retry;
Added retries on 0xD3 completion code
* Add support for freeipmi 0.6.0; adjust autoconf for changes
* Fix for oemval2str size
* Add support for product name resolution in mc info
* Fix FRU display format
* Added PICMG ekeying analyzer module support (ekanalyzer);
display point to point physical connectivity and power
supply information between carriers and AMC modules;
display matched results of ekeying match between an
on-carrier device and AMC module or between 2 AMC modules
* Fix AMC GUID display support
* Improved amcportstate operations
* Added resolution for new sensor types
* Fix segfault in SOL
* Fix bug that caused infinite loop on BMCs with empty SDRs
* Fix to move out Kontron OEM sensor resolution for other OEMs
which could lead to bad event descriptions
* Add new FRU edit mode thereby allowing serial numbers, etc. to be
changed; improvements to OEM edit mode
* Added SPD support for parms: channel number, max read size
* Add SDR support for adding SDR records from a dumped file,
clearing SDR, adding partial SDR records
* Add updates and fixes to hpmfwupg: upload block size to 32 bytes
for KCS, handle long response option, implement rollback
override, garbage output fix
* Add double bridge lan support , fix bridging issue
* Add HPM support to pre-check which components need to be skipped
* Fix autodetection of maximum packet size when using IPMB
* Add new Kontron OEM command to set the BIOS boot option sequence
* Add support for dual-bridge/ dual send message
* Add auto-detect for local IPMB address using PICMG 2.X extension
* Add support for HPM.1 1.0 specification compliance
* Fix for improper lan/lanplus addressing
* Added transit_channel and transit_addr to ipmi_intf struct
* Fix bad password assertion bug due to rakp2 HMAC not being checked
properly
* Added ability to interpret PPS shelf manager clia sel dump
* Corrected PICMG M7 state event definition macros
* Added FRU parsing enhancements
* Added "isol info", "isol set" and "isol activate" commands
to support Intel IPMI v1.5 SOL functionality. Removed
"isol setup" command.
* Fix bug in ipmi_lan_recv_packet() in lan and lanplus interfaces.
* Fix bug in "chassis poh" command.
* Fix HPM.1 upgrade to apply to only given component when instructed
to do so
* Added configure auto-detection if dual bridge extension
is supported by OpenIPMI
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.
* Add support for appending distro tag to integrated RPM builds.
* Fix LAN parameter printing to handle Invalid Data Field response
without errors.
* Add 5ms delay to IPMIv2 SOL retry packets
* IPMIv2 interface will now correctly set session privilege level
to requested level after session is opened.
version 1.8.2 (released May 18 2005)
* Fix FRU reading for large (>255 bytes) areas.
* Overhaul to ipmievd to support SEL polling in addition to OpenIPMI.
* Fix LAN parameter segfault when no Ciphers supported by BMC.
* Fix IPMIv2 support on Intel v2 BMCs (use -o intelplus).
* Separate option parsing code from main ipmitool source file.
* Add raw I2C support with IPMI Master Read-Write command.
* Add support for new 'sdr elist' extended output format.
* Add support for listing sensors by type with 'sdr type' command.
* Add support for new 'sel elist' extended output format that
cross-references events with sensors.
* Add support for sending dynamically generated platform events
based on existing sensor information.
* New '-S' argument to read local SDR cache created with 'sdr dump'.
* Updated manpage for ipmitool and ipmievd.
version 1.8.1
* ipmievd installs in /usr/sbin
version 1.8.0
* Fix IPMIv2.0 issues
* Fix chassis boot parameter support
* Add support for linear sensors
version 1.7.1
* Update bmc plugin to work with new Solaris bmc driver (new ioctl
for interface detection and new STREAMS message-based interface)
version 1.7.0
* Propogate errors correctly so exit status will be useful
* More consistent display of errors including completion code text
* Errors and debug is send to stderr now
* New "sel get" command that will print details about SEL entry
and corresponding SDR records as well as FRUs via entity association
* Improved event generator, now supports reading events from text file
* New "-o oemtype" option for specifying OEM boards
exsting types are "supermicro" and "intelwv2"
* New PEF subsystem from Tim Murphy at Dell
* New "bmc" plugin for Solaris 10 x86
* Many bugfixes and contributed patches
version 1.6.2
* Support for Supermicro BMC OEM authentication method
version 1.6.1
* Fix minor problem with LAN parameter setting
version 1.6.0
* Add a README file
* Add Solaris x86 interface plugin
* Add support for building Solaris packages
* Fix segfault when doing "sel list" (from Matthew Braithwaite)
* Fix "chassis identify" on some BMCs (from ebrower@sourceforge)
* Add command "bmc info" and related output (from ebrower@sourceforge)
* Add support for IPMIv2 and Serial-over-LAN from Jeremy at Newisys
* Add support for building RPMs as non-root user
* Add new "shell" and "exec" commands
* Lots of other contributed patches
version 1.5.9
* Add ability to get a particular sensor by name
* Add ability to set a particular sensor threshold
* Add support for displaying V2 channel authentication levels
* Add README for rrdtool scripts in contrib directory
* Improve lan interface retry handling
* Support prompting for password or reading from environment
* Move chaninfo command into channel subcommand
* Fix reservation ID handling when two sessions open to BMC
* Fix reading of large FRU data
* Add configure option for changing binary to ipmiadm for Solaris
* Fix compile problem on Solaris 8
version 1.5.8
* Enable static compilation of interfaces
* Fix types to be 64-bit safe
* Fix compilation problems on Solaris
* Fix multiple big-endian problems for Solaris/SPARC
* Fix channel access to save settings to NVRAM
* Set channel privilege limit to ADMIN during "access on"
* Enable gratuitous ARP in bmcautoconf.sh
* Add support for Linux kernel panic messages in SEL output
* Add support for type 3 SDR records
version 1.5.7
* Add IPMIv1.5 eratta fixes
* Additions to FRU printing and FRU multirecords
* Better handling of SDR printing
* Contrib scripts for creating rrdtool graphs
version 1.5.6
* Fix SEL event decoding for generic events
* Handle empty SEL gracefully when doing "sel list"
* Fix sdr handling of sensors that do not return a reading
* Fix for CSV display of sensor readings/units from Fredrik <20>hrn
version 1.5.5
* Add -U option for setting LAN username
* Fix -v usage for plugin interfaces
version 1.5.4
* Put interface plugin API into library
* Fix ipmievd
version 1.5.3
* Add -g option to work with grizzly bmc
version 1.5.2
* Add support for setting gratuitous arp interval
version 1.5.1
* Better SEL support
* Fix display bug in SDR list
version 1.5.0
* More robust UDP packet handling
* Add Intel IMB driver support
* Use autoconf/automake/libtool

386
INSTALL Normal file
View File

@ -0,0 +1,386 @@
Installation Instructions
*************************
Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
Prerequisites
=============
This project requires at least gcc 4.8.1 as it uses some GNU
extensions and some C11 features. For `lanplus` interface the OpenSSL
library and development headers are required. As of April 2019, the
project is tested automatically to build cleanly for the following
64-bit operating systems:
- Ubuntu 14.04 Trusty
- Ubuntu 16.04 Xenial
- MacOS X 10.14 (Xcode 10.2)
Basic Installation
==================
Briefly, the followong shell command should configure, build, and
install this package:
`./bootstrap && ./configure && make && make install`
The following more-detailed instructions are generic; see the
`README' file for instructions specific to this package. Some
packages provide this `INSTALL' file but do not implement all of the
features documented below. The lack of an optional feature in a given
package is not necessarily a bug. More recommendations for GNU
packages can be found in *note Makefile Conventions:
(standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the `make install' phase executed with root
privileges.
5. Optionally, type `make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior `make install' required
root privileges, verifies that the installation completed
correctly.
6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
7. Often, you can also type `make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide `make
distcheck', which can by used by developers to test that all other
targets like `make install' and `make uninstall' work correctly.
This target is generally not run by end users.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'. This
is known as a "VPATH" build.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX', where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the
default for these options is expressed in terms of `${prefix}', so that
specifying just `--prefix' will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to `configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
`make install' command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, `make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
`${prefix}'. Any directories that were specified during `configure',
but not in terms of `${prefix}', must each be overridden at install
time for the entire installation to be relocated. The approach of
makefile variable overrides for each directory variable is required by
the GNU Coding Standards, and ideally causes no recompilation.
However, some platforms have known limitations with the semantics of
shared libraries that end up requiring recompilation when using this
method, particularly noticeable in packages that use GNU Libtool.
The second method involves providing the `DESTDIR' variable. For
example, `make install DESTDIR=/alternate/directory' will prepend
`/alternate/directory' before all installation names. The approach of
`DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of `${prefix}'
at `configure' time.
Optional Features
=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the
execution of `make' will be. For these packages, running `./configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with `make V=1'; while running `./configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with `make V=0'.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX `make' updates targets which have the same time stamps as
their prerequisites, which makes it generally unusable when shipped
generated files such as `configure' are involved. Use GNU `make'
instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
to try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.
On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf limitation. Until the limitation is lifted, you can use
this workaround:
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of all of the options to `configure', and exit.
`--help=short'
`--help=recursive'
Print a summary of the options unique to this package's
`configure', and exit. The `short' variant lists options used
only in the top level, while the `recursive' variant lists options
also present in any nested packages.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
`--no-create'
`-n'
Run the configure checks, but stop before creating any output
files.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

View File

@ -27,17 +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.
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 \
debian/dirs debian/docs debian/rules
EXTRA_DIST = $(DOCLIST) bootstrap
AUTOMAKE_OPTIONS = dist-bzip2
@ -52,8 +46,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 +77,3 @@ rpm: control/ipmitool.spec dist
.PHONY: clean-rpm
clean-rpm:
-rm -rf $(RPMDIR)

0
NEWS Normal file
View File

View File

@ -1,7 +1,7 @@
ipmitool
Duncan Laurie
duncan@iceblink.org
ipmitool-devel@lists.sourceforge.net
Overview
========
@ -24,7 +24,7 @@ Background
==========
I originally wrote ipmitool while between projects and employeed at Sun
Microsystems. Sun had just embarked on a new line of general-purpose x86
servers that inclued an OEM Intel board with an IPMIv1.5 BMC on board.
servers that included an OEM Intel board with an IPMIv1.5 BMC on board.
It started with an idea that remote chassis power control would be a handy
feature for my systems in the lab and from there it grew into a multi-
purpose tool that lots of people found useful. I decided to release it
@ -42,8 +42,8 @@ Requirements
============
Obviously the largest requirement is hardware with a service processor
that supports the IPMI specification. Many x86-based servers are now
comming with IPMI support, check with your preferred hardware vendor
about available prodcuts.
coming with IPMI support, check with your preferred hardware vendor
about available products.
Once you are certain you have the required hardware, you then need to
decide how you want to access the BMC. The most common case involve
@ -126,11 +126,114 @@ hardware will come with a utility (often a DOS bootable CD) for configuring
enabling the LAN interface as well.
In order to support the IPMIv2.0 interface you must have an OpenSSL library
with the required encrytion functions. Recent distributions should have
with the required encryption functions. Recent distributions should have
no problems. The IPMIv1.5 interface will attempt to use OpenSSL for MD5
hash function at compile time but if that is not found it will use an
internal library.
IPMB Dual Bridging in IPMITOOL
-------------------------------
IPMI offers a standard messaging interface.
The following concepts are related to this messaging interface:
Channel type : Communication channel type (SMS/KCS, IPMB, LAN)
Channel number : Channel descriptor
Requester : Address of the requester
Responder : Address of the responder
NetFN : The logical function for the request/response.
Command : The command number
Sequence : An ID identifiying the request/response pair
Message tracking : The ability to match request/response pair.
When a communication is issued through any of the channels, an application
formats a request and expect a response.
Direct Command
--------------
The simplest form of communication is a "direct command" using SMS/KCS
Example:
ipmitool raw 6 4
55 00
This send raw command 4 (selftest) from netfn 6(application) to KCS, the driver
takes care of 'message tracking' and provides the answer.
Hopefully, the application also includes a "human readable" instance of the API:
ipmitool mc selftest
Selftest: passed
Bridged Command
---------------
One slightly more complicated communication mode is the so-called
"bridged command" using IPMB.
Example:
ipmitool -m 0x94 -t 0x9a raw 6 4
55 00
or
ipmitool -m 0x94 -t 0x9a mc selftest
Selftest: passed
This still sends the same command 4 (selftest) from netfn 6(application) to
the target. However, to do so, the command is encapsulated (by the driver) and
sent using the command 0x34 (send message) from netfn 6(application) to KCS.
Then KCS is polled by the driver until a message has been received, then the
driver uses command 0x33 (get message). The driver also tracks the message
and makes sure the response matches the request. Then it decapsultates the
message and gives the response back to the application.
Dual Bridged Command
--------------------
Things get a little more ugly when the application needs to reach a management
controller sitting on an interface (or channel) not directly connected to the
BMC/IPMC. In the case the application must encapsulate its message itself and
request the IPMC to deal with message tracking itself.
Its been working well with IPMITOOL on the LAN interface with:
ipmitool -H <ip> -U <user> -P <password> -B 0 -T 0x8a -m 0x20 -t 0x7a -b 7
mc selftest
However, trying to dual bridge commands locally with :
ipmitool -B 0 -T 0x9a -m 0x94 -t 0x7a -b 7 mc selftest didn't work
(it returned the same data as ipmitool -m 0x20 -t 0x7a -b 7 mc selftest )
The reason was that the "openipmi" interface pluging didn't
encapsulate/decapsulate the message and didn't even detect the intent
to double bridge the request.
./src/ipmitool -B 0 -T 0x8a -m 0x94 -t 0x7a -b 7 mc selftest
-B 0 : transit channel for first bridge level (channel 0: IPMB-0)
-T 0x8a : transit destination address (remote IPMC address)
-m 0x94 : source address (local IPMC address on IPMB-0)
-t 0x7a : remote target (AMC IPMB-L address)
-b 7 : remote channel (channel 7: IPMB-L)
The transit source address (remote IPMC address on remote channel) is
automatically assigned by the remote IPMC.
Payload Size Limit
------------------
Because some commands return a lot of data (fru read/get sdr) and because 2
levels of encapsulation are used, some command will fail.
For instance this works.
ipmitool -H <ip> -U <user> -P <password> -B 0 -T 0x8a -m 0x94 -t 0x7a -b 7
mc selftest
but this does not:
ipmitool -H <ip> -U <user> -P <password> -B 0 -T 0x8a -m 0x94 -t 0x7a -b 7
fru print.
Usage
=====
@ -293,17 +396,16 @@ ipmievd: Memory Sensor 01 - Correctable ECC
Resources
=========
IPMItool homepage
http://ipmitool.sourceforge.net
http://github.com/ipmitool/ipmitool
IPMItool manpage
http://ipmitool.sourceforge.net/manpage.html
IPMItool overview paper from Linux.conf.au 2004
http://ipmitool.sourceforge.net/lca2004_ipmitool.pdf
https://github.com/ipmitool/ipmitool/blob/master/doc/ipmitool.1
Intelligent Platform Management Interface specification
http://www.intel.com/design/servers/ipmi/spec.htm
https://www.intel.com/content/www/us/en/servers/ipmi/ipmi-home.html
OpenIPMI project: Linux IPMI kernel driver and userland library
http://openipmi.sourceforge.net
IPMItool commit archive
https://lists.sourceforge.net/lists/listinfo/ipmitool-cvs

View File

@ -29,13 +29,17 @@
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# You acknowledge that this software is not designed or intended for use
# in the design, construction, operation or maintenance of any nuclear
# facility.
aclocal
libtoolize --automake --copy
case `uname` in
Darwin*)
glibtoolize --automake --copy
;;
*)
libtoolize --automake --copy
;;
esac
autoheader
automake --foreign --add-missing --copy

742
configure.ac Normal file
View File

@ -0,0 +1,742 @@
dnl
dnl autoconf for ipmitool
dnl
m4_define([git_suffix], m4_esyscmd_s(./csv-revision))
AC_INIT([ipmitool], [1.8.18git_suffix])
AC_CONFIG_SRCDIR([src/ipmitool.c])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([foreign])
AM_CONFIG_HEADER(config.h)
AC_PREREQ(2.50)
AC_SUBST(ac_configure_args)
dnl check for requirements
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_CHECK_PROG([RPMBUILD], [rpmbuild], [rpmbuild], [rpm])
AC_CHECK_PROG([SED], [sed], [sed])
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h paths.h])
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/socket.h])
AC_CHECK_HEADERS([sys/byteorder.h byteswap.h])
AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STRTOD
AC_CHECK_FUNCS([alarm gethostbyname getaddrinfo getifaddrs socket select])
AC_CHECK_FUNCS([memmove memset strchr strdup strerror])
AC_CHECK_FUNCS([getpassphrase])
CFLAGS="$CFLAGS -Wall -Wextra -std=gnu11 -pedantic -Wformat -Wformat-nonliteral"
AM_PROG_LIBTOOL
LIBTOOL="$LIBTOOL --silent"
AC_SEARCH_LIBS([gethostbyname], [nsl])
AC_SEARCH_LIBS([getaddrinfo], [nsl])
AC_SEARCH_LIBS([getifaddrs], [nsl])
AC_SEARCH_LIBS([socket], [socket], [],
[AC_CHECK_LIB([nsl], [socket],
[LIBS="$LIBS -lsocket -lnsl"], [], [-lsocket])])
if test "x$prefix" = "xNONE"; then
prefix="$ac_default_prefix"
fi
if test "x$exec_prefix" = "xNONE"; then
exec_prefix="$prefix"
fi
dnl
dnl set default option values
dnl
xenable_all_options=yes
xenable_intf_bmc=no
xenable_intf_dbus=no
xenable_intf_dummy=no
xenable_intf_imb=yes
xenable_intf_lipmi=yes
xenable_intf_open=yes
#xenable_intf_serial=yes
xenable_intf_usb=no
xenable_ipmishell=yes
dnl set some things so we build with GNU tools on Solaris
case "$host_os" in
solaris*)
MAKE=gmake
STRIP=gstrip
LD=gld
AR=gar
# openssl libs are in /usr/sfw/lib on solaris 10
LIBS="$LIBS -R/usr/sfw/lib"
# disable the linux-specific interfaces
xenable_intf_bmc=yes
xenable_intf_imb=no
xenable_intf_open=no
xenable_intf_lipmi=no
xenable_ipmishell=no
xenable_all_options=no
;;
*cygwin*)
# disable the linux and solaris-specific interfaces
xenable_intf_imb=no
xenable_intf_open=no
xenable_intf_lipmi=no
;;
*darwin*|aix*)
# disable the linux and solaris-specific interfaces
xenable_intf_imb=no
xenable_intf_open=no
xenable_intf_lipmi=no
xenable_ipmishell=no
;;
*freebsd*)
xenable_intf_imb=no
xenable_intf_lipmi=no
CFLAGS="$CFLAGS -D__BSD_VISIBLE"
;;
*netbsd*)
xenable_intf_imb=no
xenable_intf_lipmi=no
xenable_intf_open=no
;;
gnu*)
# disable the linux and solaris-specific interfaces on Hurd
xenable_intf_imb=no
xenable_intf_open=no
xenable_intf_usb=yes
;;
esac
AC_SUBST(ARCH, $host_cpu)
AC_SUBST(OS, $host_os)
AC_SUBST(PSTAMP, $host)
AC_SUBST(BASEDIR, $prefix)
dnl allow solaris builds to include all options
AC_ARG_ENABLE([solaris-opt],
[AC_HELP_STRING([--enable-solaris-opt],
[enable all options for Solaris [default=no]])],
[xenable_solaris_opt=$enableval],
[xenable_solaris_opt=no])
if test "x$xenable_all_options" = "xyes" || test "x$xenable_solaris_opt" = "xyes"; then
AC_DEFINE(ENABLE_ALL_OPTIONS, [1], [Define to 1 to enable all command line options.])
fi
dnl Determine anonymous union/structure support in GCC
AC_TRY_COMPILE([
#include <stdio.h>
], [
struct test {
union {
int a;
unsigned int b;
};
} test;
printf("a is %d", test.a);
], ac_need_fms_extension=no, ac_need_fms_extension=yes)
if test "x$ac_need_fms_extension" = "xyes"; then
CFLAGS="$CFLAGS -fms-extensions"
AC_SUBST(CFLAGS)
fi
dnl check for OpenSSL functionality
AC_ARG_ENABLE([internal-md5],
[AC_HELP_STRING([--enable-internal-md5],
[enable internal MD5 library [default=no]])],
[xenable_internal_md5=$enableval],
[xenable_internal_md5=no])
AC_CHECK_LIB([crypto], [EVP_aes_128_cbc],
[if test "x$xenable_internal_md5" != "xyes"; then
have_crypto=yes; LIBS="$LIBS -lcrypto"
fi],
[have_crypto=no], [-lcrypto])
AC_CHECK_LIB([crypto], [EVP_sha256],
[if test "x$xenable_internal_sha256" != "xyes"; then
if test "x$have_crypto" != "xyes"; then
LIBS="$LIBS -lcrypto"
have_sha256=yes
fi
AC_DEFINE(HAVE_CRYPTO_SHA256, [1], [Define to 1 if libcrypto supports SHA256.])
fi],
[], [-lcrypto])
AC_CHECK_LIB([crypto], [MD5_Init],
[if test "x$xenable_internal_md5" != "xyes"; then
if test "x$have_crypto" != "xyes"; then
LIBS="$LIBS -lcrypto"
have_md5=yes
fi
AC_DEFINE(HAVE_CRYPTO_MD5, [1], [Define to 1 if libcrypto supports MD5.])
fi],
[], [-lcrypto])
AC_CHECK_LIB([crypto], [MD2_Init],
[if test "x$xenable_internal_md5" != "xyes"; then
if test "x$have_crypto" != "xyes" && test "x$have_md5" != "xyes"; then
LIBS="$LIBS -lcrypto"
have_md2=yes
fi
AC_DEFINE(HAVE_CRYPTO_MD2, [1], [Define to 1 if libcrypto supports MD2.])
fi],
[], [-lcrypto])
dnl check for libsystemd in case dbus-intf is requested
AC_CHECK_LIB([systemd], [sd_bus_default],
[
LIBS="$LIBS -lsystemd"
have_systemd=yes
],
[ have_systemd=no],[])
dnl enable IPMIv1.5 LAN interface
AC_ARG_ENABLE([intf-lan],
[AC_HELP_STRING([--enable-intf-lan],
[enable IPMIv1.5 LAN interface [default=yes]])],
[xenable_intf_lan=$enableval],
[xenable_intf_lan=yes])
if test "x$xenable_intf_lan" = "xstatic" || test "x$xenable_intf_lan" = "xplugin"; then
xenable_intf_lan=yes
fi
if test "x$xenable_intf_lan" = "xyes"; then
AC_DEFINE(IPMI_INTF_LAN, [1], [Define to 1 to enable LAN IPMIv1.5 interface.])
AC_SUBST(INTF_LAN, [lan])
AC_SUBST(INTF_LAN_LIB, [libintf_lan.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lan/libintf_lan.la"
fi
dnl enable IPMI USB interface
AC_ARG_ENABLE([intf-usb],
[AC_HELP_STRING([--enable-intf-usb],
[enable IPMI USB interface [default=auto]])],
[xenable_intf_usb=$enableval],
[xenable_intf_usb=$xenable_intf_usb])
if test "x$xenable_intf_usb" = "xstatic" || test "x$xenable_intf_usb" = "xplugin"; then
xenable_intf_usb=yes
fi
if test "x$xenable_intf_usb" = "xyes"; then
AC_DEFINE(IPMI_INTF_USB, [1], [Define to 1 to enable USB interface.])
AC_SUBST(INTF_USB, [usb])
AC_SUBST(INTF_USB_LIB, [libintf_usb.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB usb/libintf_usb.la"
fi
dnl enable IPMIv2.0 RMCP+ LAN interface
AC_ARG_ENABLE([intf-lanplus],
[AC_HELP_STRING([--enable-intf-lanplus],
[enable IPMIv2.0 RMCP+ LAN interface [default=auto]])],
[xenable_intf_lanplus=$enableval],
[xenable_intf_lanplus=$have_crypto])
if test "x$xenable_intf_lanplus" = "xstatic" || test "x$xenable_intf_lanplus" = "xplugin"; then
xenable_intf_lanplus=yes
fi
if test "x$xenable_intf_lanplus" != "xno" && test "x$have_crypto" != "xyes"; then
echo "** The lanplus interface requires an SSL library with EVP_aes_128_cbc defined."
xenable_intf_lanplus=no
fi
if test "x$xenable_intf_lanplus" = "xyes"; then
AC_DEFINE(IPMI_INTF_LANPLUS, [1], [Define to 1 to enable LAN+ IPMIv2 interface.])
AC_SUBST(INTF_LANPLUS, [lanplus])
AC_SUBST(INTF_LANPLUS_LIB, [libintf_lanplus.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lanplus/libintf_lanplus.la"
else
xenable_intf_lanplus=no
fi
ORIG_CPPFLAGS=$CPPFLAGS
dnl enable serial interface
AC_ARG_ENABLE([intf-serial],
[AC_HELP_STRING([--enable-intf-serial],
[enable direct Serial Basic/Terminal mode interface [default=yes]])],
[xenable_intf_serial=$enableval], [xenable_intf_serial=yes])
if test "x$enable_intf_serial" = "xstatic" || test "x$enable_intf_serial" = "xplugin"; then
xenable_intf_serial=yes
fi
if test "x$xenable_intf_serial" = "xyes"; then
AC_DEFINE(IPMI_INTF_SERIAL, [1], [Define to 1 to enable serial interface.])
AC_SUBST(INTF_SERIAL, [serial])
AC_SUBST(INTF_SERIAL_LIB, [libintf_serial.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB serial/libintf_serial.la"
else
xenable_intf_serial=no
fi
dnl look for OpenIPMI header files
AC_ARG_WITH([kerneldir],
[AC_HELP_STRING([--with-kerneldir=DIR],
[set kernel include path to DIR])],
[if test "x$with_kerneldir" = "xyes"; then
with_kerneldir="/lib/modules/`uname -r`/build"
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/'`
if test "x$kernelver" = "x2.6"; then
CPPFLAGS="$CPPFLAGS -D__user="
AC_SUBST(CPPFLAGS)
fi
fi])
AH_TEMPLATE([HAVE_LINUX_COMPILER_H], [])
AC_MSG_CHECKING([for linux/compiler.h])
m4_version_prereq([2.68],
[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#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])])],
[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([sys/ioccom.h],
[AC_DEFINE(HAVE_SYS_IOCCOM_H, [1],
[Define to 1 if you have the <sys/ioccom.h> header file.])])
AC_CHECK_HEADER([linux/ipmi.h],
[AC_DEFINE(HAVE_OPENIPMI_H, [1],
[Define to 1 if you have the <linux/ipmi.h> header file.])],
[AC_CHECK_HEADER([sys/ipmi.h],
[AC_DEFINE(HAVE_FREEBSD_IPMI_H, [1],
[Define to 1 if you have the <sys/ipmi.h> header file.])],
[echo "** Unable to find OpenIPMI header files. Using internal version."])])
dnl look for FreeIPMI files
AC_CHECK_LIB(freeipmi, ipmi_open_inband, [have_free=yes], [have_free=no])
if test "x$have_free" != "xyes"; then
AC_CHECK_LIB(freeipmi, ipmi_ctx_open_inband, [have_free=yes], [have_free=no])
fi
AC_ARG_ENABLE([intf-free],
[AC_HELP_STRING([--enable-intf-free],
[enable FreeIPMI IPMI interface [default=auto]])],
[xenable_intf_free=$enableval],
[xenable_intf_free=$have_free])
if test "x$xenable_intf_free" = "xstatic" || test "x$xenable_intf_free" = "xplugin"; then
xenable_intf_free=yes
fi
if test "x$xenable_intf_free" != "xno" && test "x$have_free" != "xyes"; then
echo "** Unable to build FreeIPMI interface support!"
xenable_intf_free=no
fi
if test "x$xenable_intf_free" = "xyes"; then
dnl Determine if you got the right FreeIPMI version
AC_MSG_CHECKING([for libfreeipmi version 0.3.0])
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_0_3_0=yes, ac_free_version_0_3_0=no)
AC_MSG_RESULT($ac_free_version_0_3_0)
AC_MSG_CHECKING([for libfreeipmi version 0.4.0])
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 = NULL;
int rv;
dev = ipmi_device_create();
rv = ipmi_open_inband(dev,
IPMI_DEVICE_KCS,
0,
0,
0,
NULL,
0);
], ac_free_version_0_4_0=yes, ac_free_version_0_4_0=no)
AC_MSG_RESULT($ac_free_version_0_4_0)
AC_MSG_CHECKING([for libfreeipmi version 0.5.0])
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 = NULL;
int rv;
dev = ipmi_device_create();
rv = ipmi_open_inband(dev,
IPMI_DEVICE_KCS,
0,
0,
0,
NULL,
0,
0);
], ac_free_version_0_5_0=yes, ac_free_version_0_5_0=no)
AC_MSG_RESULT($ac_free_version_0_5_0)
AC_MSG_CHECKING([for libfreeipmi version 0.6.0])
AC_TRY_COMPILE([
#include <stdio.h> /* For NULL */
#include <freeipmi/freeipmi.h>
], [
ipmi_ctx_t ctx = NULL;
int rv;
ctx = ipmi_ctx_create();
rv = ipmi_ctx_open_inband(ctx,
IPMI_DEVICE_KCS,
0,
0,
0,
NULL,
0,
0);
], ac_free_version_0_6_0=yes, ac_free_version_0_6_0=no)
AC_MSG_RESULT($ac_free_version_0_6_0)
if test "x$ac_free_version_0_3_0" = "xyes" \
|| test "x$ac_free_version_0_4_0" = "xyes" \
|| test "x$ac_free_version_0_5_0" = "xyes" \
|| test "x$ac_free_version_0_6_0" = "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"
if test "x$ac_free_version_0_3_0" = "xyes"; then
AC_DEFINE(IPMI_INTF_FREE_0_3_0, [1], [Define to 1 for FreeIPMI 0.3.0.])
fi
if test "x$ac_free_version_0_4_0" = "xyes"; then
AC_DEFINE(IPMI_INTF_FREE_0_4_0, [1], [Define to 1 for FreeIPMI 0.4.0.])
fi
if test "x$ac_free_version_0_5_0" = "xyes"; then
AC_DEFINE(IPMI_INTF_FREE_0_5_0, [1], [Define to 1 for FreeIPMI 0.5.0.])
fi
if test "x$ac_free_version_0_6_0" = "xyes"; then
AC_DEFINE(IPMI_INTF_FREE_0_6_0, [1], [Define to 1 for FreeIPMI 0.6.0.])
fi
else
xenable_intf_free=no
fi
AC_CHECK_LIB(freeipmi,
ipmi_cmd_raw_ipmb,
AC_DEFINE(IPMI_INTF_FREE_BRIDGING, [1],
[Define to 1 to enable FreeIPMI Bridging Support.]))
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],
[AC_HELP_STRING([--with-rpm-distro=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],
[enable Linux OpenIPMI interface [default=auto]])],
[xenable_intf_open=$enableval],
[])
if test "x$xenable_intf_open" = "xstatic" || test "x$xenable_intf_open" = "xplugin"; then
xenable_intf_open=yes
fi
if test "x$xenable_intf_open" = "xyes"; then
AC_DEFINE(IPMI_INTF_OPEN, [1], [Define to 1 to enable Linux OpenIPMI interface.])
AC_SUBST(INTF_OPEN, [open])
AC_SUBST(INTF_OPEN_LIB, [libintf_open.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB open/libintf_open.la"
dnl Check for dual bridge support in OpenIPMI
AC_MSG_CHECKING([for OpenIPMI dual bridge support])
have_openipmi_dual_bridge=no
ORIG_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -Isrc/plugins/open -DENABLE_INTF_OPEN_DUAL_BRIDGE"
AC_TRY_COMPILE([
#if defined(HAVE_OPENIPMI_H)
# if defined(HAVE_LINUX_COMPILER_H)
# include <linux/compiler.h>
# endif
# include <linux/ipmi.h>
#elif defined(HAVE_FREEBSD_IPMI_H)
# include <sys/ipmi.h>
#else
# include "open.h"
#endif
], [
struct ipmi_ipmb_addr a;
a.transit_slave_addr = 0;
], [have_openipmi_dual_bridge=yes])
if test x"$have_openipmi_dual_bridge" = x"yes"; then
AC_DEFINE(ENABLE_INTF_OPEN_DUAL_BRIDGE, [1],
[Define to 1 to enable OpenIPMI interface dual bridge support])
fi
CPPFLAGS="$ORIG_CPPFLAGS"
AC_MSG_RESULT([$have_openipmi_dual_bridge])
fi
dnl enable Intel IMB interface
AC_ARG_ENABLE([intf-imb],
[AC_HELP_STRING([--enable-intf-imb],
[enable Intel IMB driver interface [default=auto]])],
[xenable_intf_imb=$enableval],
[])
if test "x$xenable_intf_imb" = "xstatic" || test "x$xenable_intf_imb" = "xplugin"; then
xenable_intf_imb=yes
fi
if test "x$xenable_intf_imb" = "xyes"; then
AC_DEFINE(IPMI_INTF_IMB, [1], [Define to 1 to enable Intel IMB interface.])
AC_SUBST(INTF_IMB, [imb])
AC_SUBST(INTF_IMB_LIB, [libintf_imb.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB imb/libintf_imb.la"
fi
dnl enable Solaris LIPMI interface
AC_CHECK_HEADER([sys/lipmi/lipmi_intf.h], [have_lipmi=yes], [have_lipmi=no])
AC_ARG_ENABLE([intf-lipmi],
[AC_HELP_STRING([--enable-intf-lipmi],
[enable Solaris 9 x86 IPMI interface [default=no]])],
[xenable_intf_lipmi=$enableval],
[])
if test "x$xenable_intf_lipmi" = "xstatic" || test "x$xenable_intf_lipmi" = "xplugin"; then
xenable_intf_lipmi=yes
fi
if test "x$xenable_intf_lipmi" != "xno" && test "x$have_lipmi" != "xyes"; then
echo "** Unable to build Solaris 9 x86 IPMI interface support!"
xenable_intf_lipmi=no
fi
if test "x$xenable_intf_lipmi" = "xyes"; then
AC_DEFINE(IPMI_INTF_LIPMI, [1], [Define to 1 to enable Solaris 9 LIPMI interface.])
AC_SUBST(INTF_LIPMI, [lipmi])
AC_SUBST(INTF_LIPMI_LIB, [libintf_lipmi.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lipmi/libintf_lipmi.la"
fi
dnl enable Solaris BMC interface
AC_ARG_ENABLE([intf-bmc],
[AC_HELP_STRING([--enable-intf-bmc],
[enable Solaris 10 x86 IPMI interface [default=auto]])],
[xenable_intf_bmc=$enableval],
[xenable_intf_bmc=no])
if test "x$xenable_intf_bmc" = "xstatic" || test "x$xenable_intf_bmc" = "xplugin"; then
xenable_intf_bmc=yes
fi
if test "x$xenable_intf_bmc" = "xyes"; then
AC_DEFINE(IPMI_INTF_BMC, [1], [Define to 1 to enable Solaris 10 BMC interface.])
AC_SUBST(INTF_BMC, [bmc])
AC_SUBST(INTF_BMC_LIB, [libintf_bmc.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB bmc/libintf_bmc.la"
fi
dnl enable IPMI dbus interface
AC_ARG_ENABLE([intf-dbus],
[AC_HELP_STRING([--enable-intf-dbus],
[enable IPMI dbus interface [default=no]])],
[xenable_intf_dbus=$enableval],
[xenable_intf_dbus=no])
if test "x$xenable_intf_dbus" != "xno"; then
if test "x$have_systemd" != "xyes"; then
AC_MSG_ERROR([** Unable to find libsystemd required by dbus-intf.])
xenable_intf_dbus=no
fi
fi
if test "x$xenable_intf_dbus" = "xyes"; then
AC_DEFINE(IPMI_INTF_DBUS, [1], [Define to 1 to enable dbus interface.])
AC_SUBST(INTF_DBUS, [dbus])
AC_SUBST(INTF_DBUS_LIB, [libintf_dbus.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB dbus/libintf_dbus.la"
fi
dnl enable Dummy interface for testing
AC_ARG_ENABLE([intf-dummy],
[AC_HELP_STRING([--enable-intf-dummy],
[enable Dummy(test) interface [default=no]])],
[xenable_intf_dummy=$enableval], [xenable_intf_dummy=no])
if test "x$xenable_intf_dummy" = "xyes"; then
AC_DEFINE(IPMI_INTF_DUMMY, [1], [Define to 1 to enable Dummy interface.])
AC_SUBST(INTF_DUMMY, [dummy])
AC_SUBST(INTF_DUMMY_LIB, [libintf_dummy.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB dummy/libintf_dummy.la"
fi
AC_SUBST(IPMITOOL_INTF_LIB)
if test "x$xenable_ipmishell" = "xyes"; then
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
xenable_ipmishell=no
fi
fi
dnl check for readline library to enable ipmi shell
AC_ARG_ENABLE([ipmishell],
[AC_HELP_STRING([--enable-ipmishell],
[enable IPMI shell interface [default=auto]])],
[xenable_ipmishell=$enableval],
[])
if test "x$xenable_ipmishell" = "xyes"; then
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"; then
AC_MSG_ERROR([** Unable to find curses required by ipmishell.])
fi
if test "x$have_readline" != "xyes"; then
AC_MSG_ERROR([** Unable to find readline required by ipmishell.])
fi
AC_DEFINE(HAVE_READLINE, [1], [Define to 1 if readline present.])
fi
dnl Enable -Wall -Werror
AC_ARG_ENABLE([buildcheck],
[AC_HELP_STRING([--enable-buildcheck],
[enable -Wall -Werror for build testing [default=no]])],
[xenable_buildcheck=$enableval],
[xenable_buildcheck=no])
if test "x$xenable_buildcheck" != "xno"; then
CFLAGS="$CFLAGS -Wall -Werror -Wpointer-arith -Wstrict-prototypes"
fi
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]])],
[xenable_file_security=$enableval],
[xenable_file_security=no])
if test "x$xenable_file_security" != "xno"; then
AC_DEFINE(ENABLE_FILE_SECURITY, [1], [Define to 1 for extra file security.])
fi
AC_TRY_COMPILE([],[
#include <stdio.h>
struct packstruct {
unsigned char t0 :5;
unsigned char t1 :5;
unsigned char t2 :5;
unsigned char t3 :5;
unsigned char t4 :4;
} __attribute__ ((packed));
int
main(int argc, char ** argv)
{
if(sizeof(struct packstruct) != 3)
return(1);
else
return(0);
}
],
[],
[AC_DEFINE(HAVE_PRAGMA_PACK,[1],
[Define to 1 if you need to use #pragma pack instead of __attribute__ ((packed))])]
)
dnl if no environment variable is set, set the default value for the default intf
if test "${xenable_intf_open}" = "xyes"; then
DEFAULT_INTF_NO_ENV=open
else dnl macOS does not build open interface, it defaults to lan
DEFAULT_INTF_NO_ENV=lan
fi
dnl allow for a default interface to be set on configure
AC_ARG_VAR(DEFAULT_INTF, [Set the default interface to use (default=${DEFAULT_INTF_NO_ENV})])
dnl set the default value for the default interface environment variable
if test "x${DEFAULT_INTF}" == "x"; then
echo "DEFAULT_INTF not found in environment; setting to ${DEFAULT_INTF_NO_ENV}"
DEFAULT_INTF=${DEFAULT_INTF_NO_ENV}
fi
xdefault_intf_is_enabled="xenable_intf_${DEFAULT_INTF}"
if test "x${!xdefault_intf_is_enabled}" != "xyes"; then
AC_MSG_ERROR([** Cannot set ${DEFAULT_INTF} as default; ${DEFAULT_INTF} is not enabled. :${!xdefault_intf_is_enabled}:])
fi
dnl Generate files for build
AC_CONFIG_FILES([Makefile
doc/Makefile
contrib/Makefile
control/Makefile
control/pkginfo
control/prototype
control/rpmmacros
control/ipmitool.spec
lib/Makefile
include/Makefile
include/ipmitool/Makefile
src/Makefile
src/plugins/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/dbus/Makefile
src/plugins/usb/Makefile
src/plugins/lipmi/Makefile
src/plugins/serial/Makefile
src/plugins/dummy/Makefile])
AC_OUTPUT
AC_MSG_RESULT([])
AC_MSG_RESULT([ipmitool $VERSION])
AC_MSG_RESULT([])
AC_MSG_RESULT([Interfaces (default=$DEFAULT_INTF)])
AC_MSG_RESULT([ lan : $xenable_intf_lan])
AC_MSG_RESULT([ lanplus : $xenable_intf_lanplus])
AC_MSG_RESULT([ open : $xenable_intf_open])
AC_MSG_RESULT([ free : $xenable_intf_free])
AC_MSG_RESULT([ imb : $xenable_intf_imb])
AC_MSG_RESULT([ bmc : $xenable_intf_bmc])
AC_MSG_RESULT([ dbus : $xenable_intf_dbus])
AC_MSG_RESULT([ usb : $xenable_intf_usb])
AC_MSG_RESULT([ lipmi : $xenable_intf_lipmi])
AC_MSG_RESULT([ serial : $xenable_intf_serial])
AC_MSG_RESULT([ dummy : $xenable_intf_dummy])
AC_MSG_RESULT([])
AC_MSG_RESULT([Extra tools])
AC_MSG_RESULT([ ipmievd : yes])
AC_MSG_RESULT([ ipmishell : $xenable_ipmishell])
AC_MSG_RESULT([])

View File

@ -27,14 +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
dist_pkgdata_DATA = bmclanconf README \
ipmi.init.basic ipmi.init.redhat \
collect_data.sh create_rrds.sh create_webpage_compact.sh create_webpage.sh
dist_pkgdata_DATA = oem_ibm_sel_map
EXTRA_DIST = README \
bmclanconf ipmi.init.basic ipmi.init.redhat \
exchange-bmc-os-info.init.redhat exchange-bmc-os-info.service.redhat \
exchange-bmc-os-info.sysconf log_bmc.sh\
ipmievd.init.redhat ipmievd.init.suse ipmievd.init.debian \
collect_data.sh create_rrds.sh create_webpage_compact.sh create_webpage.sh \
bmc-snmp-proxy bmc-snmp-proxy.service bmc-snmp-proxy.sysconf

403
contrib/bmc-snmp-proxy Normal file
View File

@ -0,0 +1,403 @@
#!/bin/sh
#############################################################################
#
# bmc-snmp-proxy: Set SNMP proxy to BMC (Baseboard Management Controller)
#
# version: 0.62
#
# Authors: Charles Rose <charles_rose@dell.com>
# Jordan Hargrave <jordan_hargrave@dell.com>
#
# Description: Script to set snmp proxy to the BMC for certain OID
# See here for details:
# https://fedoraproject.org/wiki/Features/AgentFreeManagement
#
# Assumptions: This script will work only when /etc/snmp/ is writable.
#
#############################################################################
# GLOBALS
#############################################################################
SYSCONF_DIR="/etc/sysconfig"
CONFIG="${SYSCONF_DIR}/bmc-snmp-proxy"
SNMPD_BMC_CONF_DIR="/etc/snmp/bmc"
SNMPD_BMC_CONF="${SNMPD_BMC_CONF_DIR}/snmpd.local.conf"
TRAPD_BMC_CONF="${SNMPD_BMC_CONF_DIR}/snmptrapd.local.conf"
TRAPD_CONF="/etc/snmp/snmptrapd.conf"
LOCKFILE="/var/lock/subsys/bmc-snmp-proxy"
BMC_INFO="/var/run/bmc-info"
IPMITOOL=`which ipmitool`
#Default config
BMC_COMMUNITY="public"
BMC_OID=".1.3.6.1.4.1.674.10892.2" # Dell iDRAC
TRAP_FORWARD="no"
RELOAD_SERVICES="yes"
#############################################################################
#TODO: Use inotify and daemonize when $BMC_INFO changes
# source config
[ -r ${CONFIG} ] && . ${CONFIG}
. gettext.sh
SCRIPT_NAME=$(basename $0)
RETVAL=0
# Check if bmc-info created by exchange-bmc-os-info
bmc_info_exists()
{
if [ -r "${BMC_INFO}" ]; then
. ${BMC_INFO}
else
RETVAL=2
fi
return $RETVAL
}
check_snmp()
{
if [ ! -d /etc/snmp ] || [ ! -x /usr/sbin/snmpd ]; then
RETVAL=12
fi
return $RETVAL
}
#############################################################################
# configure SNMP proxy
#############################################################################
write_snmp_conf()
{
# SNMPv3 security: bmcview, bmc_ctx, bmc_sec, bmc_grp, bmc_cmty
printf "###############################################\n"
printf "# Automatically created by %s #\n" "${SCRIPT_NAME}"
printf "###############################################\n"
printf "#view bmcview included %s 80\n" "${BMC_OID}"
printf "#com2sec -Cn bmc_ctx bmc_sec default bmc_cmty\n"
printf "#group bmc_grp v1 bmc_sec\n"
printf "#access bmc_grp bmc_ctx any noauth exact bmcview none none\n"
printf "#proxy -Cn bmc_ctx -v 1 %s\n" "${PROXY_TOKEN}"
printf "proxy -v 1 %s\n" "${PROXY_TOKEN}"
printf "###############################################\n"
}
valid_ip()
{
#Thanks to mkyong.com
octet="([01]?[[:digit:]][[:digit:]]?|2[0-4][[:digit:]]|25[0-5])"
printf -- "%s" "${1}"| grep -Eq \
"^${octet}\\.${octet}\\.${octet}\\.${octet}$"
return $?
}
check_vars()
{
[ -z ${BMC_COMMUNITY} ] && BMC_COMMUNITY="public"
[ -z ${BMC_OID} ] && return 1
if [ -n "${BMC_IPv4}" ] && valid_ip ${BMC_IPv4}; then
return 0
else
return 1
fi
}
set_snmp_proxy()
{
if check_vars; then
PROXY_TOKEN="-c ${BMC_COMMUNITY} ${BMC_IPv4} ${BMC_OID}"
if [ -d ${SNMPD_BMC_CONF_DIR} ]; then
write_snmp_conf > ${SNMPD_BMC_CONF} || RETVAL=4
fi
else
RETVAL=3
fi
}
set_snmpd_conf_path()
{
if [ ! -d ${SNMPD_BMC_CONF_DIR} ]; then
mkdir ${SNMPD_BMC_CONF_DIR} || RETVAL=7
fi
# We need SNMPCONFPATH set for both snmpd and snmptrapd
for sysconf in ${SYSCONF_DIR}/snmp*d;
do
if ! grep -q "^SNMPCONFPATH.*${SNMPD_BMC_CONF_DIR}" \
"${sysconf}" > /dev/null 2>&1; then
printf "SNMPCONFPATH=/etc/snmp:%s\n" \
"${SNMPD_BMC_CONF_DIR}" >> ${sysconf} || \
RETVAL=7
fi
done
return $RETVAL
}
disable_snmp_proxy()
{
if [ -f ${SNMPD_BMC_CONF} ]; then
rm -f ${SNMPD_BMC_CONF} || RETVAL=5
fi
}
#############################################################################
# Trap Forwarding
#############################################################################
pick_alert_dest()
{
test_ip="$1"
# We have 4 IPv4 and 4 IPv6 alert dest. We will set IPv4 for now.
for ALERT_DEST in `seq 1 4`
do
temp_ip=$(${IPMITOOL} lan alert print ${CHANNEL} ${ALERT_DEST}\
2>/dev/null| sed -n "s#^Alert IP Address.*: ##p")
[ "${temp_ip}" = "${test_ip}" ] && return 0
done
return 1
}
set_alert_dest_ip()
{
${IPMITOOL} lan alert set ${CHANNEL} ${ALERT_DEST} ipaddr ${1} \
retry 4 type pet >/dev/null 2>&1 || RETVAL=8
}
config_bmc_alert_dest()
{
# call with enable|disable
# Pick the first active LAN channel
for CHANNEL in `seq 1 14`
do
[ $(${IPMITOOL} -I open channel info ${CHANNEL} 2>/dev/null \
| grep -q "802\.3") ] || break
done
# If TRAPD_IP is already set as an alert dest,
if pick_alert_dest "${TRAPD_IP}"; then
# disable: reset it if we are called with disable
[ "${1}" = "disable" ] && \
set_alert_dest_ip "0.0.0.0"
# else, find the next free alert dest,
elif pick_alert_dest "0.0.0.0"; then
[ "${1}" = "disable" ] && \
return $RETVAL
# set: the TRAPD_IP
set_alert_dest_ip "${TRAPD_IP}"
else
# No free alert destinations
RETVAL=9
fi
return $RETVAL
}
set_ipmi_pef()
{
# Needs ipmitool-1.8.13 + patches
${IPMITOOL} pef policy set ${ALERT_DEST} "${1}" >/dev/null 2>&1 || \
RETVAL=10
}
get_host_ip()
{
# Get host's IP that the BMC can reach. This is at best a hack.
IFACE=$(/usr/sbin/ip -o -f inet address |awk '!/: lo/ {print $2}')
for dev in ${IFACE}
do
temp_ping=$(ping -c 1 -I ${dev} ${BMC_IPv4})
[ $? -ne 0 ] && continue
printf -- "%s" "$temp_ping"| awk 'NR==1{print $5}' && break
done
}
config_bmc_alert()
{
# Do two things
# Set/Reset TRAP IP in BMC
# Enable/Disable PEF alerting in BMC for TRAP
# Get Host's IP that the BMC can send traps to
TRAPD_IP=$(get_host_ip)
# Set Host's IP as the alert destination in the BMC
valid_ip ${TRAPD_IP} && config_bmc_alert_dest "${ACTION}"
# Enable/Disable alerting on the LAN channel
[ $RETVAL -eq 0 ] && set_ipmi_pef "${ACTION}"
return $RETVAL
}
write_trapd_conf()
{
printf "###############################################\n"
printf "# Automatically created by %s #\n" "${SCRIPT_NAME}"
printf "forward default %s\n" "${FORWARD_HOST}"
printf "###############################################\n"
}
config_trapd()
{
# Proceed only if snmptrapd is available on the system
if [ -f ${TRAPD_CONF} ]; then
write_trapd_conf > ${TRAPD_BMC_CONF} || RETVAL=11
else
RETVAL=11
fi
}
trap_sink_exists()
{
# TODO: We only set the first match. We should be able to set
# multiple
FORWARD_HOST=$(awk '/^trap.*sink/{print $2}; /^informsink/{print $2}' \
/etc/snmp/snmpd*conf | head -1)
if [ -z "${FORWARD_HOST}" ]; then
# there is no trapsink setup.
return 1
else
return 0
fi
}
# Forward SNMP traps from the BMC to trapsink.
trap_forward()
{
NO_TRAP=0
ACTION=${1} # enable or disable
if [ "${ACTION}" = "enable" ]; then
# Get trapd config,
if trap_sink_exists; then
config_bmc_alert && config_trapd
else
# exit silently if there is no sink
NO_TRAP=1
fi
else
if [ -f ${TRAPD_BMC_CONF} ]; then
rm -f ${TRAPD_BMC_CONF} >/dev/null 2>&1
config_bmc_alert
else
NO_TRAP=1
fi
fi
}
#############################################################################
service_reload()
{
#TODO: do this in systemd
if [ ${RETVAL} -eq 0 ] && [ "${RELOAD_SERVICES}" = "yes" ]; then
service $1 reload
[ $? -ne 0 ] && RETVAL=6
fi
}
#############################################################################
start()
{
if bmc_info_exists && check_snmp; then
touch ${LOCKFILE}
set_snmpd_conf_path && set_snmp_proxy
[ $RETVAL -eq 0 ] && service_reload snmpd
if [ "${TRAP_FORWARD}" = "yes" ]; then
trap_forward "enable"
[ $RETVAL -eq 0 ] && [ $NO_TRAP -eq 0 ] && \
service_reload snmptrapd
fi
fi
}
#############################################################################
stop()
{
[ ! -f ${LOCKFILE} ] && return
if bmc_info_exists && check_snmp; then
disable_snmp_proxy
[ $RETVAL -eq 0 ] && service_reload snmpd
if [ "${TRAP_FORWARD}" = "yes" ]; then
trap_forward "disable"
[ $RETVAL -eq 0 ] && [ $NO_TRAP -eq 0 ] && \
service_reload snmptrapd
fi
rm -f ${LOCKFILE}
fi
}
#############################################################################
status()
{
eval_gettext "${SCRIPT_NAME}: snmp proxy to BMC is "
# Checking for lockfile is better.
#if grep -q "^proxy" "${SNMPD_BMC_CONF}" > /dev/null 2>&1 ; then
if [ -f ${LOCKFILE} ]; then
eval_gettext "set"
else
eval_gettext "not set"
fi
echo
RETVAL=0
}
#############################################################################
usage()
{
eval_gettext "Usage: $0 {start|stop|status}"; echo 1>&2
RETVAL=1
}
#############################################################################
# MAIN
#############################################################################
case "$1" in
start) start ;;
stop) stop ;;
status) status ;;
*) usage ;;
esac
case "$RETVAL" in
0|1) ;;
2) eval_gettext "${SCRIPT_NAME}: failed to read ${BMC_INFO} " 1>&2 ;;
3) eval_gettext "${SCRIPT_NAME}: failed to get proxy config." 1>&2 ;;
4) eval_gettext "${SCRIPT_NAME}: failed to set ${SNMPD_BMC_CONF}." 1>&2 ;;
5) eval_gettext "${SCRIPT_NAME}: failed to disable snmp proxy." 1>&2 ;;
6) eval_gettext "${SCRIPT_NAME}: failed to reload snmpd." 1>&2 ;;
7) eval_gettext "${SCRIPT_NAME}: failed to set snmpd config." 1>&2 ;;
8) eval_gettext "${SCRIPT_NAME}: failed to set IPMI alert dest." 1>&2 ;;
9) eval_gettext "${SCRIPT_NAME}: no free IPMI alert dest." 1>&2 ;;
10) eval_gettext "${SCRIPT_NAME}: failed to set IPMI PEF." 1>&2 ;;
11) eval_gettext "${SCRIPT_NAME}: failed to write snmptrapd.conf." 1>&2 ;;
12) eval_gettext "${SCRIPT_NAME}: snmpd not found." 1>&2 ;;
*) eval_gettext "${SCRIPT_NAME}: unknown error." 1>&2 ;;
esac
if [ ${RETVAL} -gt 1 ]; then
eval_gettext " Return code: ${RETVAL}"; echo
fi
exit ${RETVAL}
#############################################################################
# end of file
#############################################################################

View File

@ -0,0 +1,18 @@
[Unit]
Description=Setup SNMP proxy to BMC
After=exchange-bmc-os-info.service
Requires=exchange-bmc-os-info.service
PartOf=exchange-bmc-os-info.service
ConditionPathExists=/var/run/bmc-info
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/libexec/bmc-snmp-proxy start
ExecStop=/usr/libexec/bmc-snmp-proxy stop
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,48 @@
# bmc-snmp-proxy
#
# Config file to control SNMP redirection between
# the OS and Service Processor/Baseboard Management Controller (BMC)
#
# bmc-snnmp-proxy helps redirect certain SNMP requests (to this host)
# destined to the Service Processor. We will need the Service Processor's
# SNMP community string and the OID of the Service Processor's SNMP agent.
#
# For redirecting Traps from the Service Processor to the trap sink
# configured in the host (this system), we will have to set
# TRAP_FORWARD below.
#
# See here for details
# https://fedoraproject.org/wiki/Features/AgentFreeManagement
### Configure SNMP proxy to BMC/Service Processor ###
### Service Processor/BMC SNMP Community String.
# Name: BMC_COMMUNITY
# Description: Set community string of the Service Processor (BMC)'s
# SNMP agent.
# Default: public
#
BMC_COMMUNITY="public"
### OEM Specific OID of Service Processor
# Name: BMC_OID
# Description: SNMP OID that we would like to redirect to the Service
# Processor (BMC). This can be unique to each OEM.
# Default: ".1.3.6.1.4.1.674.10892.2"
BMC_OID=".1.3.6.1.4.1.674.10892.2" # Dell iDRAC
### Forward Traps from the Service Processor to trap sink
# Name: TRAP_FORWARD
# Description: Enabling this will allow traps from the Service Processor
# to be directed to this system and configure snmptrapd
# Note: This option will have no effect if trap sink on the system is
# not configured
# Default: "no"
TRAP_FORWARD="yes"
### Reload snmpd and snmptrapd
# Name: RELOAD_SERVICES
# Description: Reload snmpd and snmptrapd after making changes to their config
# files.
# Default: "yes"
RELOAD_SERVICES="yes"

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,326 @@
#!/bin/sh
#############################################################################
#
# exchange-bmc-os-info: Set OS and BMC (Baseboard Management Controller)
# parameters during system startup.
#
# version: 0.72
#
# Authors: Charles Rose <charles_rose@dell.com>
# Jordan Hargrave <jordan_hargrave@dell.com>
#
# Description: Script to set OS information in the BMC; fetch BMC IP/URL
# and set in the OS for use by other scripts/user.
#
# BMC IP and URL are made available in /var/run/bmc-info
#
# Example to launch BMC web-interface:
# # . /var/run/bmc-info
# # xdg-open $BMC_URL
#
# See here for details:
# https://fedoraproject.org/wiki/Features/AgentFreeManagement
#
# OEM Specific: OEM specific ipmi commands go in:
# 'oem_set_os_version' and 'oem_get_bmc_url'
#############################################################################
#
# chkconfig: 345 99 00
# description: Set OS name, hostname in BMC; make BMC IP/URL available in OS
# processname: exchange-bmc-os-info
# config: /etc/sysconfig/exchange-bmc-os-info
#
### BEGIN INIT INFO
# Provides: exchange-bmc-os-info
# Required-Start: ipmi
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
#############################################################################
# GLOBALS
#############################################################################
CONFIGFILE=/etc/sysconfig/exchange-bmc-os-info
IPMI_TOOL=/usr/bin/ipmitool
BMC_INFO=/var/run/bmc-info
# BMC Manufacturer ID used in 'oem_set_os_version' and 'oem_get_bmc_url'
DELL="674"
#OTHER_OEM="123"
# Defaults for ${CONFIGFILE}
SET_OS_INFO="yes"
RESET_OS_INFO="no"
SET_BMC_INFO="yes"
# getsysinfo and setsysinfo commands
IPMI_SET_SYSINFO="${IPMI_TOOL} mc setsysinfo"
IPMI_GET_SYSINFO="${IPMI_TOOL} mc getsysinfo"
#############################################################################
SCRIPT_NAME=$(basename $0)
# source config
[ -r ${CONFIGFILE} ] && . ${CONFIGFILE}
RETVAL=0
if [ -f /bin/gettext.sh ]; then
GETTEXT=1
. /bin/gettext.sh
OUTPUT="eval_gettext"
else
GETTEXT=0
OUTPUT="echo"
fi
#############################################################################
# Get Vendor ID of BMC for use in 'oem_set_os_version' and 'oem_get_bmc_url'
#
get_bmc_vendor_id()
{
BMC_VENDOR=$(${IPMI_TOOL} mc info 2>/dev/null | \
sed -n "s#^Manufacturer ID.*: ##p")
[ -z "${BMC_VENDOR}" ] && RETVAL=4
}
check_ipmitool()
{
if [ -x ${IPMI_TOOL} ]; then
# v1.8.12 plus patches are required for set/getsysinfo support
# http://sourceforge.net/mailarchive/message.php?msg_id=29647222
[ ! ${IPMI_GET_SYSINFO} >/dev/null 2>&1 ] && \
RETVAL=3
else
RETVAL=2
fi
}
bmc_exists()
{
check_ipmitool
[ $RETVAL -eq 0 ] && get_bmc_vendor_id
return $RETVAL
}
#############################################################################
get_os_info()
{
OS_HOSTNAME=$(hostname)
KERNEL_VERSION=$(uname -r -m)
if [ -e /etc/lsb-release ] ; then
. /etc/lsb-release
NAME=${DISTRIB_ID}
VERSION="${DISTRIB_RELEASE} ${DISTRIB_CODENAME}"
fi
# we prefer systemd's /etc/os-release over other sources
[ -e /etc/os-release ] && . /etc/os-release
OS_NAME=${NAME}
OS_VERSION="${VERSION} kernel ${KERNEL_VERSION}"
}
oem_set_os_version()
{
# OS Version setting is not standard yet
# we need per vendor oem commands
case "${BMC_VENDOR}" in
$DELL) ${IPMI_SET_SYSINFO} delloem_os_version \
"${OS_VERSION}" > /dev/null 2>&1
return $?
;;
# Add OEM specific commands.
# Example:
# $OTHER_OEM) ${IPMI_SET_SYSINFO} otheroem_os_version \
# "${OS_VERSION}" > /dev/null 2>&1
# return $?
# ;;
*) return 0
;;
esac
}
set_os_info()
{
# Set and reset OS info in the BMC
if [ "$1" = "reset" ]; then
OS_NAME=""
OS_HOSTNAME=""
OS_VERSION=""
fi
${IPMI_SET_SYSINFO} os_name "${OS_NAME}" >/dev/null 2>&1 \
|| RETVAL=6
${IPMI_SET_SYSINFO} primary_os_name "${OS_NAME}" >/dev/null 2>&1 \
|| RETVAL=6
${IPMI_SET_SYSINFO} system_name "${OS_HOSTNAME}" >/dev/null 2>&1 \
|| RETVAL=6
oem_set_os_version || RETVAL=6
}
#############################################################################
valid_url()
{
url="(https?|http)://[a-z0-9-]+(\.[a-z0-9-]+)+([/?].*)?"
printf -- "%s" "${TMP_URL}"| grep -Eq "^${url}"
return $?
}
oem_get_bmc_url()
{
# BMC URL is not standard yet
# we need per vendor oem commands
case "$BMC_VENDOR" in
$DELL) TMP_URL=$(${IPMI_GET_SYSINFO} delloem_url 2> /dev/null)
;;
# Add OEM specific commands
# Example:
# $OTHER_OEM)
# TMP_URL=$(${IPMI_GET_SYSINFO} otheroem_url 2> /dev/null)
# ;;
*) TMP_URL="" ;;
esac
valid_url && BMC_URL=${TMP_URL} || BMC_URL=""
}
valid_ip()
{
#Thanks to mkyong.com
octet="([01]?[[:digit:]][[:digit:]]?|2[0-4][[:digit:]]|25[0-5])"
printf -- "%s" "${TMP_IPv4}"| grep -Eq "^${octet}\\.${octet}\\.${octet}\\.${octet}$"
return $?
}
get_bmc_ip()
{
#Thanks to http://ingvar.blog.redpill-linpro.com
for CHANNEL in `seq 1 14`
do
[ $(${IPMI_TOOL} lan print ${CHANNEL} 2>/dev/null \
| grep -q "^Set") ] || break
done
# Get BMC_IPv4 and BMC_URL from BMC
TMP_IPv4=$(${IPMI_TOOL} lan print ${CHANNEL} 2>/dev/null \
| sed -n "s#^IP Address .*: ##p")
valid_ip && BMC_IPv4=${TMP_IPv4} || BMC_IPv4=""
}
get_bmc_info()
{
get_bmc_ip
if [ -z "${BMC_IPv4}" ] || [ "${BMC_IPv4}" = "0.0.0.0" ]; then
BMC_IPv4=""
RETVAL=5
else
# URL makes sense only if there is an IP
oem_get_bmc_url
fi
}
set_bmc_info()
{
if [ ! $(touch "${BMC_INFO}" && chmod 600 "${BMC_INFO}") ]; then
printf "BMC_IPv4=%s\n" "${BMC_IPv4}" > "${BMC_INFO}"
[ -n "${BMC_URL}" ] && \
printf "BMC_URL=%s\n" "${BMC_URL}" >> "${BMC_INFO}"
else
RETVAL=5
fi
}
unset_bmc_info()
{
[ -f ${BMC_INFO} ] && rm -f ${BMC_INFO} > /dev/null 2>&1
}
#############################################################################
start()
{
if bmc_exists; then
[ "${SET_OS_INFO}" = "yes" ] && \
get_os_info && set_os_info
if [ "${SET_BMC_INFO}" = "yes" ]; then
get_bmc_info
if [ ${RETVAL} -eq 0 ]; then
set_bmc_info
fi
fi
fi
}
#############################################################################
stop()
{
if bmc_exists; then
# reset OS info while system reboots
# aids with debugging OS boot-up issues
if [ "${RESET_OS_INFO}" = "yes" ]; then
set_os_info reset
fi
unset_bmc_info
fi
}
#############################################################################
restart()
{
stop
[ $RETVAL -eq 0 ] && start
}
#############################################################################
status()
{
[ -r ${BMC_INFO} ] && \
grep -q "BMC_IPv4" "${BMC_INFO}" >/dev/null 1>&2 && \
BMC_STATUS="ok" || BMC_STATUS="inactive"
${OUTPUT} "${SCRIPT_NAME}: ${BMC_STATUS}" 1>&2
[ ${GETTEXT} -eq 1 ] && echo
}
#############################################################################
usage()
{
${OUTPUT} "Usage: ${SCRIPT_NAME} {start|stop|restart|status}" 1>&2
[ ${GETTEXT} -eq 1 ] && echo
RETVAL=1
}
#############################################################################
# MAIN
#############################################################################
case "$1" in
start) start ;;
stop) stop ;;
restart) restart ;;
status) status ;;
*) usage ;;
esac
case "$RETVAL" in
0|1) ;;
2) ${OUTPUT} "${SCRIPT_NAME}: ipmitool(1) not found." 1>&2 ;;
3) ${OUTPUT} "${SCRIPT_NAME}: this version of ipmitool does not support getsysinfo." 1>&2 ;;
4) ${OUTPUT} "${SCRIPT_NAME}: failed to communicate with BMC." 1>&2 ;;
5) ${OUTPUT} "${SCRIPT_NAME}: failed to set OS information in BMC." 1>&2 ;;
6) ${OUTPUT} "${SCRIPT_NAME}: failed to get BMC information." 1>&2 ;;
*) ${OUTPUT} "${SCRIPT_NAME}: unexpected error." 1>&2 ;;
esac
if [ ${RETVAL} -gt 1 ]; then
${OUTPUT} " Return code: ${RETVAL}" 1>&2
[ ${GETTEXT} -eq 1 ] && echo
fi
exit ${RETVAL}
#############################################################################
# end of file
#############################################################################

View File

@ -0,0 +1,14 @@
[Unit]
Description=Exchange Information between BMC and OS
After=network.target
AssertFileIsExecutable=/usr/bin/ipmitool
AssertPathExistsGlob=/dev/ipmi*
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/libexec/exchange-bmc-os-info start
ExecStop=/usr/libexec/exchange-bmc-os-info stop
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,26 @@
# exchange-bmc-os-info
#
# Config file to control Exchange of information between
# the OS and Service Processor/Baseboard Management Controller (BMC)
#
# See here for details
# https://fedoraproject.org/wiki/Features/AgentFreeManagement
### Set OS Info in BMC/Service Processor ###
# Name: SET_OS_INFO
# Description: Set OS Name, Version and Hostname in the Service Processor (BMC)
# Default: yes
SET_OS_INFO="yes"
### Reset OS Info in BMC/Service Processor ###
# Name: RESET_OS_INFO
# Description: Reset OS Name, Version and Hostname in the Service Processor (BMC).
# Useful when the OS Name/Hostname should be empty on reboot
# Default: no
RESET_OS_INFO="no"
### Set BMC/Service Processor Info in OS ###
# Name; SET_BMC_INFO
# Description: Set IP Address and URL of Service Processor/BMC in /run/bmc-info
# Default: yes
SET_BMC_INFO="yes"

View File

@ -5,7 +5,7 @@ echo "Setting up OpenIPMI driver..."
# load the ipmi modules
modprobe ipmi_msghandler
modprobe ipmi_devintf
if ! modprobe ipmi_kcs_drv ; then
if ! modprobe ipmi_si_drv ; then
modprobe ipmi_si # try new module name
fi

View File

@ -38,7 +38,7 @@ start() {
# module if that fails.
if ! /sbin/modprobe ipmi_si >/dev/null 2>&1
then
/sbin/modprobe ipmi_kcs_drv || RETVAL=1
/sbin/modprobe ipmi_si_drv || RETVAL=1
fi
fi
@ -48,6 +48,12 @@ start() {
# this failure.
grep -q ipmidev /proc/devices || RETVAL=1
# remove old device file always
# in case ipmi gets assigned new dynamic major number from kernel
if [ -c /dev/ipmi0 ]; then
rm -f /dev/ipmi0
fi
# Check if the device file exists and create if not.
if [ ! -c /dev/ipmi0 ] && [ $RETVAL -eq 0 ]
then
@ -167,7 +173,7 @@ remove () {
then
# Try removing both 2.4 and 2.6 modules.
/sbin/rmmod ipmi_si 2>/dev/null
/sbin/rmmod ipmi_kcs_drv 2>/dev/null
/sbin/rmmod ipmi_si_drv 2>/dev/null
/sbin/rmmod ipmi_devintf
/sbin/rmmod ipmi_msghandler
else

92
contrib/ipmievd.init.debian Executable file
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

87
contrib/ipmievd.init.redhat Executable file
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 $?

212
contrib/ipmievd.init.suse Executable file
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

88
contrib/log_bmc.sh Normal file
View File

@ -0,0 +1,88 @@
#!/bin/sh
#############################################################################
#
# log_bmc.sh: Add SEL entries to indicate OS Boot/Install status.
#
# version: 0.1
#
# Authors: Charles Rose <charles_rose@dell.com>
# Jordan Hargrave <jordan_hargrave@dell.com>
#
# Description: Script to log OS boot/install status to the BMC. Primarily
# meant for use in automated installs and start up scripts.
# Will provide administrators with OS boot/install status in
# BMC and aid with debugging.
#
# Example usage:
# # ./log_bmc.sh inst_start
# # ipmitool sel list
# b | 05/07/2014 | 12:07:32 | OS Boot | Installation started
#
# See here for details:
# https://fedoraproject.org/wiki/Features/AgentFreeManagement
#
#############################################################################
IPMI_CMD="/usr/bin/ipmitool"
#############################################################################
# SEL Event types from ipmi_sel.h
OS_STOP="0x20"
OS_BOOT="0x1f"
# SEL Event data from ipmi_sel.h
GRACEFUL_SHUTDOWN="0x03" # OS Stop/Shutdown: Installation started
BOOT_COMPLETED="0x01" # OS Boot: Installation started
INSTALL_STARTED="0x07" # OS Boot: Installation started
INSTALL_COMPLETED="0x08" # OS Boot: Installation completed
INSTALL_ABORTED="0x09" # OS Boot: Installation aborted
INSTALL_FAILED="0x0a" # OS Boot: Installation failed
##########################################################################
# check for ipmi functionality.
check_ipmi()
{
# ensures presence of ipmitool and /dev/ipmi*
${IPMI_CMD} mc info > /dev/null 2>&1
[ $? -ne 0 ] && RETVAL=2
}
# Write out the events to SEL
ipmi_sel_add()
{
# Refer ipmitool(1) event for details on format.
printf "0x04 %s 0x00 0x6f %s 0x00 0x00" ${type} ${status} > \
${tmpfile} && \
${IPMI_CMD} sel add ${tmpfile} > /dev/null 2>&1
[ $? -ne 0 ] && RETVAL=3
}
### Main
# Most of the status is for this event type
tmpfile=$(/usr/bin/mktemp)
RETVAL=0
type=${OS_BOOT}
case ${1} in
os_shutdown) type=${OS_STOP}; status=${GRACEFUL_SHUTDOWN} ;;
os_boot) status=${BOOT_COMPLETED} ;;
inst_start) status=${INSTALL_STARTED} ;;
inst_complete) status=${INSTALL_COMPLETED} ;;
inst_abort) status=${INSTALL_ABORTED} ;;
inst_fail) status=${INSTALL_FAILED} ;;
*) RETVAL=1 ;;
esac
[ ${RETVAL} -eq 0 ] && check_ipmi
[ ${RETVAL} -eq 0 ] && ipmi_sel_add ${status}
case ${RETVAL} in
0) ;;
1) printf -- %s\\n "Usage: $0 <os_boot|os_shutdown|inst_start|inst_complete|inst_abort|inst_fail>" ;;
2) printf -- %s\\n "failed to communicate with BMC." ;;
3) printf -- %s\\n "error adding ipmi sel entry." ;;
esac
[ -f ${tmpfile} ] && rm -f ${tmpfile} > /dev/null 2>&1
exit ${RETVAL}
### End

229
contrib/oem_ibm_sel_map Normal file
View File

@ -0,0 +1,229 @@
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x01","0x00","Chassis Number","R","R","0x00","CPU shutdown - Potential cause "triple fault" a software address problem"
"0xC1","XX","XX","XX","XX","XX","XX","XX","0x02","0x01","Chassis Number","Failed Memory Card","Spare Memory Card","0x00","Memory Mirrored Failover Occurred - System running from mirrored memory image"
"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 removed, 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 added, 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","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","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","0x01","0x04","Chassis Number","R","R","R","R","R","R","R","R","R","0x00","Invalid configuration of processor card."
"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","0x02","0x03","0x00","Chassis Number","Memory Card","R","R","R","R","R","R","R","0x00","Memory card enabled"
"0xE0","0x02","0x03","0x01","Chassis Number","Memory Card","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)"
"0xE0","0x02","0x00","0x05","Chassis","Memory Card","Memory DIMM","R","R","R","R","R","R","0x01","DIMM disabled, multi-bit or multi-symbol error"
"0xE0","0x02","0x01","0x00","Chassis","Failed Channel","R","R","R","R","R","R","R","0x01","AMB Failure Detected on Channel X During Last Boot"
"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","BUS_CORRECTABLE: 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","BUS_CORRECTABLE: 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","BUS_CORRECTABLE: 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","BUS_CORRECTABLE: 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","BUS_CORRECTABLE: 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","0x02","0x00","0x00","R","R","R","R","R","R","R","R","R","0x01","Memory sparing event, start 1"
"0xE1","0x02","0x00","0x02","R","R","R","R","R","R","R","R","R","0x01","Memory sparing event, done 1"
"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"
"0xE1","0x05","0x01","0x04","Bus","Device","Function Number","R","R","R","R","R","R","0x00","Link Degrade Event"
"0xE1","0x05","0x01","0x05","R","R","R","R","R","R","R","R","R","0x00","Spurious Memory Event"
"0xE2","0x00","Register ID","R","First Fire Bit (0xFF=N/A)","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","0x03","0x01","0x07","R","R","0x00","Merge Failure - BIOS version is newer than secondary server BIOS"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x08","R","R","0x00","Merge Failure - BIOS version is older than secondary server BIOS"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x09","R","R","0x00","Merge Failure - Primary server booted standalone"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x0A","R","R","0x00","Merge Failure - Communication error occurred with secondary server"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x0B","R","R","0x00","Merge Failure - Timed out waiting for secondary server"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x10","R","R","0x00","Merge Failure - No path through partition"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x11","Expected Chassis Count","R","0x00","Merge Information - Expected chassis count"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x12","Actual Chassis Count","R","0x00","Merge Information - Actual chassis count"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x19","R","R","0x00","Merge Failure - No secondary servers found to merge"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x34","R","R","0x00","Merge Failure - Primary server booted standalone"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x35","R","R","0x00","Merge Failure - Communication error occurred with primary server"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x36","R","R","0x00","Merge Failure - Secondary server booted standalone"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x41","R","R","0x00","Merge Failure - Timeout occurred waiting for primary server"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x46","R","R","0x00","Merge Failure - BIOS version is newer than primary server BIOS"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x47","R","R","0x00","Merge Failure - BIOS version is older than primary server BIOS"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x52","R","R","0x00","Merge Failure - Scalability hardware not detected"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x53","R","R","0x00","Merge Failure - No partition descriptor found"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x54","R","R","0x00","Merge Failure - Error Reading partition descriptor"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x55","R","R","0x00","Merge Failure - Error Reading system UUID"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x56","R","R","0x00","Merge Failure [Byte 13 value]"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x57","R","R","0x00","Merge Failure [Byte 13 value]"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x58","R","R","0x00","Merge Failure [Byte 13 value]"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x59","R","R","0x00","Merge Failure [Byte 13 value]"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x5A","R","R","0x00","Merge Failure [Byte 13 value]"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x5B","R","R","0x00","Merge Failure [Byte 13 value]"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x03","0x01","0x5C","R","R","0x00","Merge Failure [Byte 13 value]"
"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"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x06","0x01","PostVersion","BMCVersion","R","0x00","Incompatible BIOS-BMC Power Executive support"
"0xC0","XX","XX","XX","XX","XX","XX","XX","0x06","0x02","R","R","R","0x00","Boot denied due to power limitations"

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
EXTRA_DIST = pkginfo.in prototype.in ipmitool.spec.in \
rpmrc rpmmacros
EXTRA_DIST = pkginfo.in prototype.in \
ipmitool.spec.in rpmmacros.in rpmrc
dist-hook: pkginfo prototype
dist-hook: pkginfo prototype rpmmacros

404
control/ipmitool.spec.in Normal file
View File

@ -0,0 +1,404 @@
Name: ipmitool
Summary: ipmitool - Utility for IPMI control
Version: @VERSION@
Release: @RPM_RELEASE@%{?_distro:.%{_distro}}
License: BSD
Group: Utilities
Packager: Jim Mankovich <jmank@hp.com>
Source: %{name}-%{version}.tar.gz
Buildroot: /var/tmp/ipmitool-root
%description
This package contains a utility for interfacing with devices that support
the Intelligent Platform Management Interface specification. IPMI is
an open standard for machine health, inventory, and remote power control.
This utility can communicate with IPMI-enabled devices through either a
kernel driver such as OpenIPMI or over the RMCP LAN protocol defined in
the IPMI specification. IPMIv2 adds support for encrypted LAN
communications and remote Serial-over-LAN functionality.
It provides commands for reading the Sensor Data Repository (SDR) and
displaying sensor values, displaying the contents of the System Event
Log (SEL), printing Field Replaceable Unit (FRU) information, reading and
setting LAN configuration, and chassis power control.
%prep
if [ "$RPM_BUILD_ROOT" ] && [ "$RPM_BUILD_ROOT" != "/" ]; then
rm -rf $RPM_BUILD_ROOT
fi
%setup
%build
./configure --with-kerneldir \
--with-rpm-distro=@DISTRO@ \
--prefix=%{_prefix} \
--bindir=%{_bindir} \
--sbindir=%{_sbindir} \
--datadir=%{_datadir} \
--includedir=%{_includedir} \
--libdir=%{_libdir} \
--mandir=%{_mandir} \
--sysconfdir=%{_sysconfdir}
make
%install
make DESTDIR=$RPM_BUILD_ROOT install-strip
%clean
if [ "$RPM_BUILD_ROOT" ] && [ "$RPM_BUILD_ROOT" != "/" ]; then
rm -rf $RPM_BUILD_ROOT
fi
%files
%defattr(755,root,root)
%attr(755,root,root) %{_bindir}/*
%attr(755,root,root) %{_sbindir}/*
%{_datadir}/ipmitool/*
%{_mandir}/man*/*
%doc %{_datadir}/doc/ipmitool
%changelog
* Wed Feb 25 2009 <pere@hungry.com> 1.8.11-1
- Fix new GCC compilation issues in regards to Packing
- Fix Tracker bug #1642710 - ipmi_kcs_drv being loaded/unloaded
for 2.4 kernel instead of ipmi_si_drv driver module
- New -y option added to allow specification of kg keys with
non-printable characters
- New -K option added to allow kgkey settings via environmental
variable IPMI_KGKEY
- Generic device support added for EEPROM with SDR Type 10h (gendev)
- Fix to lan-bridging for a double-bridging crash and to fix
an issue with bridging multiple concurrent requests and
erroneous handling of raw Send Message
- Lanplus fix for commands like 'sensor list' without the -t option
causing wrong double bridged requests of a sensor is located
on another satellite controller
- Fix lan and lanplus request list entry removal bugs
- Fix non-working issue when trying to send a bridge message with
Cipher 3
- Change bridge message handling to reuse command ipmi_lan_poll_recv
- Added PICMG 2.0 and 2.3 support
- Fix PICMG (ATCA) extension verification and reversal of BCD encoded
values for "major" and "minor" fields
- Add IANA support for Pigeon Point
- Add OEM SW/FW Record identification
- Fix to include I2C and LUN addresses so sensors are correctly managed
- Patch ID 1990560 to get readings from non-linear analog sensors
- Add support for SOL payload status command
- SOL set parameter range checking added
- Fixed SOL activate options usage
- Fixed crashes when parsing 'sol payload' and 'tsol' cmds (#216967)
- Added retries to SOL keepalive
- Fixed wrong mask values for Front Panel disable/enable status
- Add support to access fru internal use area
- Add support for new PICMG 3.0 R3.0 (March 24, 2008) to allow
blocks of data within the FRU storage area to be write protected.
- Fix node reporting in GUID; Tracker bug #2339675
- Fix watchdog use/action print strings
- Fix endian bug in SDR add from file; Tracker bug #2075258
- Fix crash when dumping SDRs in a file and there's an error
getting an SDR; improve algorithm for optimal packet size
- Fix occasional SDR dump segfault; #1793076
- Allow ipmitool sel delete to accept hex list entry numbers
- Fix SEL total space reporting.
- Fix for garbage sensor threshold values reported when none
returned. Tracker Bug #863748
- ipmievd change to Monitor %used in SEL buffer and log warnings when
the buffer is 80% and 100% full
* Fri Aug 08 2008 <pere@hungry.com> 1.8.10-1
- Added support for BULL IANA number.
- Fixed contrib build so the oem_ibm_sel_map file gets included in rpm
builds again.
- Added support for Debian packages to be built from CVS
- Fix for sdr and sel timestamp reporting issues
- Fix for discrete sensor state print routines to address state bits 8-14
- Change ipmi_chassis_status() to non-static so it can be used externally
- Added retries to SOL keepalive
- Fix to stop sensor list command from reporting a failure due to missing
sensor
- Fix bug in sdr free space reporting
- Add support for IANA number to vendor name conversion for many vendors
- Fix segfault bug in lan set command
- Fix bug in population of raw i2c wdata buffer
- Fix bug in ipmb sensor reading
- Fix misspellings, typos, incorrect strncmp lengths, white space
- Update/fix printed help and usages for many commands
- Add and update support for all commands in ipmitool man page
- Fix for lanplus session re-open when the target becomes unavailable following
a fw upgrade activation
- Add support for watchdog timer shutoff, reset, and get info
- Add support for more ibm systems in oem_ibm_sel_map
- Add more JEDEC support info for DIMMs; decrease request size for DIMM FRU
info to 16 bytes at a time to allow more DIMM FRUs to respond.
- Fix to change hpmfwupg to version 1.02; fix to reduce hpmfwupg buffer
length more aggressively when no response from iol
- Fix HPM firmware activation via IOL; fake a timeout after IOL session
re-open to force get upgrade status retry; Added retries on 0xD3
completion code
- Add support for freeipmi 0.6.0; adjust autoconf for changes
- Fix for oemval2str size
- Add support for product name resolution in mc info
- Fix FRU display format
- Added PICMG ekeying analyzer module support (ekanalyzer); display point
to point physical connectivity and power supply information between
carriers and AMC modules; display matched results of ekeying match
between an on-carrier device and AMC module or between 2 AMC modules
- Fix AMC GUID display support
- Improved amcportstate operations
- Added resolution for new sensor types
- Fix segfault in SOL
- Fix bug that caused infinite loop on BMCs with empty SDRs
- Fix to move out Kontron OEM sensor resolution for other OEMs which could
lead to bad event descriptions
- Add new FRU edit mode thereby allowing serial numbers, etc. to be changed;
improvements to OEM edit mode
- Added SPD support for parms: channel number, max read size
- Add SDR support for adding SDR records from a dumped file, clearing SDR,
adding partial SDR records
- Add updates and fixes to hpmfwupg: upload block size to 32 bytes for KCS,
handle long response option, implement rollback override, garbage output fix
- Add double bridge lan support , fix bridging issue
- Add HPM support to pre-check which components need to be skipped
- Fix autodetection of maximum packet size when using IPMB
- Add new Kontron OEM command to set the BIOS boot option sequence
- Add support for dual-bridge/ dual send message
- Add auto-detect for local IPMB address using PICMG 2.X extension
- Add support for HPM.1 1.0 specification compliance
- Fix for improper lan/lanplus addressing
- Added transit_channel and transit_addr to ipmi_intf struct
- Fix bad password assertion bug due to rakp2 HMAC not being checked properly
- Added ability to interpret PPS shelf manager clia sel dump
- Corrected PICMG M7 state event definition macros
- Added FRU parsing enhancements
- Added "isol info", "isol set" and "isol activate" commands to support
Intel IPMI v1.5 SOL functionality. Removed "isol setup" command.
- Fix bug in ipmi_lan_recv_packet() in lan and lanplus interfaces.
- Fix bug in "chassis poh" command.
- Fix HPM.1 upgrade to apply to only given component when instructed to do so
- Added configure auto-detection if dual bridge extension is supported
by OpenIPMI
* 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
- 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
* Wed May 18 2005 <duncan@iceblink.org> 1.8.2-1
- Fix FRU reading for large (>255 bytes) areas.
- Overhaul to ipmievd to support SEL polling in addition to OpenIPMI.
- Fix LAN parameter segfault when no Ciphers supported by BMC.
- Fix IPMIv2 support on Intel v2 BMCs (use -o intelplus).
- Separate option parsing code from main ipmitool source file.
- Add raw I2C support with IPMI Master Read-Write command.
- Add support for new 'sdr elist' extended output format.
- Add support for listing sensors by type with 'sdr type' command.
- Add support for new 'sel elist' extended output format that
cross-references events with sensors.
- Add support for sending dynamically generated platform events
based on existing sensor information.
- New '-S' argument to read local SDR cache created with 'sdr dump'.
- Updated manpage for ipmitool and ipmievd.
* Wed Apr 06 2005 <duncan@iceblink.org> 1.8.1-1
- Install ipmievd into /usr/sbin
* Wed Mar 16 2005 <duncan@iceblink.org> 1.8.0-1
- Fix IPMIv2.0 issues
- Fix chassis boot parameter support
- Add support for linear sensors
- Update bmc plugin to work with new Solaris bmc driver (new ioctl
for interface detection and new STREAMS message-based interface)
* Tue Jan 18 2005 <duncan@iceblink.org> 1.7.0-1
- Propogate errors correctly so exit status will be useful
- More consistent display of errors including completion code text
- Errors and debug is send to stderr now
- New "sel get" command that will print details about SEL entry
and corresponding SDR records as well as FRUs via entity association
- Improved event generator, now supports reading events from text file
- New "-o oemtype" option for specifying OEM boards
exsting types are "supermicro" and "intelwv2"
- New PEF subsystem from Tim Murphy at Dell
- New "bmc" plugin for Solaris 10 x86
- Many bugfixes and contributed patches
- Support for Supermicro BMC OEM authentication method
- Fix minor problem with LAN parameter setting
* Wed Aug 18 2004 <duncan@iceblink.org> 1.6.0-1
- Add a README
- Add support for IPMIv2 and Serial-over-LAN from Newisys
- Add Solaris x86 lipmi interface
- Add support for building Solaris packages
- Add support for building RPMs as non-root user
- Fix segfault when doing "sel list" (from Matthew Braithwaite)
- Fix "chassis identify" on some BMCs (from ebrower@sourceforge)
- Add "bmc info" and related output (from ebrower@sourceforge)
- new "shell" and "exec" commands
- lots of other contributed patches
* Sat May 27 2004 <duncan@iceblink.org> 1.5.9-1
- Add ability to get a particular sensor by name
- Add ability to set a particular sensor threshold
- Add support for displaying V2 channel authentication levels
- Add README for rrdtool scripts in contrib directory
- Improve lan interface retry handling
- Support prompting for password or reading from environment
- Move chaninfo command into channel subcommand
- Fix reservation ID handling when two sessions open to BMC
- Fix reading of large FRU data
- Add configure option for changing binary to ipmiadm for Solaris
- Fix compile problem on Solaris 8
* Tue Jan 27 2004 <duncan@iceblink.org> 1.5.8-1
- Enable static compilation of interfaces
- Fix types to be 64-bit safe
- Fix compilation problems on Solaris
- Fix multiple big-endian problems for Solaris/SPARC
- Fix channel access to save settings to NVRAM
- Set channel privilege limit to ADMIN during "access on"
- Enable gratuitous ARP in bmcautoconf.sh
- Add support for Linux kernel panic messages in SEL output
- Add support for type 3 SDR records
* Mon Jan 5 2004 <duncan@iceblink.org> 1.5.7-1
- add IPMIv1.5 eratta fixes
- additions to FRU printing and FRU multirecords
- better handling of SDR printing
- contrib scripts for creating rrdtool graphs
* Thu Dec 4 2003 <duncan@iceblink.org> 1.5.6-1
- Fix SEL event decoding for generic events
- Handle empty SEL gracefully when doing "sel list"
- Fix sdr handling of sensors that do not return a reading
- Fix for CSV display of sensor readings/units from Fredrik <EFBFBD>hrn
* Tue Nov 25 2003 <duncan@iceblink.org> 1.5.5-1
- Add -U option for setting LAN username
- Fix -v usage for plugin interfaces
* Fri Nov 14 2003 <duncan@iceblink.org> 1.5.4-1
- pull interface plugin api into library
- fix ipmievd
* Fri Oct 31 2003 <duncan@iceblink.org> 1.5.3-1
- add -g optin for pedantic ipmi-over-lan communication
* Fri Oct 24 2003 <duncan@iceblink.org> 1.5.2-1
- add gratuitous arp interval setting
* Wed Oct 8 2003 <duncan@iceblink.org> 1.5.1-1
- better SEL support
- fix display bug in SDR list
* Fri Sep 5 2003 <duncan@iceblink.org> 1.5.0-1
- use automake/autoconf/libtool
- dynamic loading interface plugins
* Wed May 28 2003 <duncan@iceblink.org> 1.4.0-1
- make UDP packet handling more robust
- fix imb driver support
* Thu May 22 2003 <duncan@iceblink.org> 1.3-1
- update manpage
- rework of low-level network handling
- add basic imb driver support
* Wed Apr 2 2003 <duncan@iceblink.org> 1.2-1
- change command line option parsing
- support for more chassis commands
* Tue Apr 1 2003 <duncan@iceblink.org> 1.1-1
- minor fixes.
* Sun Mar 30 2003 <duncan@iceblink.org> 1.0-1
- Initial release.

View File

@ -4,7 +4,7 @@ ARCH="@ARCH@"
VERSION="@VERSION@"
CATEGORY="system"
VENDOR="Duncan Laurie"
EMAIL="duncan@sun.com"
EMAIL="duncan@iceblink.org"
PSTAMP="@PSTAMP@"
BASEDIR="@BASEDIR@"
CLASSES="none"

View File

@ -1,7 +1,12 @@
i pkginfo
d none bin ? ? ?
f none bin/@PACKAGE@=../src/@PACKAGE@ 0755 root bin
d none sbin ? ? ?
f none sbin/ipmievd=../src/ipmievd 0755 root bin
d none share ? ? ?
d none share/man ? ? ?
d none share/man/man1 ? ? ?
f none share/man/man1/@PACKAGE@.1=../doc/@PACKAGE@.1 0644 root bin
d none share/man/man8 ? ? ?
f none share/man/man8/ipmievd.8=../doc/ipmievd.8 0644 root bin

View File

@ -6,6 +6,7 @@
%_buildroot %{_topdir}/%{_tmppath}/%{name}-%{version}-root
%_rpmdir %{_topdir}/RPMS
%_srcrpmdir %{_topdir}/SRPMS
%_distro @DISTRO@
%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
%packager duncan@iceblink.org
%packager jmank@hp.com
%distribution Sourceforge Build

View File

@ -1 +1,8 @@
macrofiles: /usr/lib/rpm/macros:/usr/lib/rpm/%{_target}/macros:/etc/rpm/macros.specspo:/etc/rpm/macros:/etc/rpm/%{_target}/macros:%(echo $CONFIGDIR)/rpmmacros
buildarchtranslate: athlon: i386
buildarchtranslate: i686: i386
buildarchtranslate: i586: i386
buildarchtranslate: i486: i386
buildarchtranslate: i386: i386

10
csv-revision Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
git describe --first-parent --tags 2>/dev/null | (
IFS=- read tag rev hash
if [ $? ] && [ -n "$rev" ]; then
echo .$rev.$hash
elif [ -d .git ]; then
echo .0.gsnapshot
fi
)

View File

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

231
doc/ipmievd.8 Normal file
View File

@ -0,0 +1,231 @@
.TH "ipmievd" "8" "" "Duncan Laurie" ""
.SH "NAME"
ipmievd \- IPMI event daemon for sending events to syslog
.SH "SYNOPSIS"
ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-d \fIN\fP\fR|\fB\-v\fR|\fB\-V\fR]
\fB\-I\fR \fIopen\fP <\fIopen\fR | \fIsel\fR> [<\fIoption\fP>]
ipmievd [\fB\-c\fR|\fB\-h\fR|\fB\-v\fR|\fB\-V\fR]
\fB\-I\fR \fIlan\fP \fB\-H\fR <\fIhostname\fP>
[\fB\-p\fR <\fIport\fP>]
[\fB\-U\fR <\fIusername\fP>]
[\fB\-A\fR <\fIauthtype\fP>]
[\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]
\fB\-I\fR \fIlanplus\fP \fB\-H\fR <\fIhostname\fP>
[\fB\-p\fR <\fIport\fP>]
[\fB\-U\fR <\fIusername\fP>]
[\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"
\fBipmievd\fP 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. It is able to run in one of two modes: either using the
Event Message Buffer and asynchronous event notification from the
OpenIPMI kernel driver or actively polling the contents of the
SEL for new events. Upon receipt of an event via either mechanism
it will be logged to syslog with the \fILOG_LOCAL4\fP facility.
It is based on the \fBipmitool\fR utility and shares the same IPMI
interface support and session setup options. Please see the
\fBipmitool\fR manpage for more information on supported IPMI
interfaces.
.SH "OPTIONS"
.TP
\fB\-a\fR
Prompt for the remote server password.
.TP
\fB\-A\fR <\fIauthtype\fP>
Specify an authentication type to use during IPMIv1.5 \fIlan\fP
session activation. Supported types are NONE, PASSWORD, MD2, MD5, or OEM.
.TP
\fB\-c\fR
Present output in CSV (comma separated variable) format.
This is not available with all commands.
.TP
\fB\-C\fR <\fIciphersuite\fP>
The remote server authentication, integrity, and encryption algorithms
to use for IPMIv2 \fIlanplus\fP connections. See table 22\-19 in the
IPMIv2 specification. The default is 3 which specifies RAKP\-HMAC\-SHA1
authentication, HMAC\-SHA1\-96 integrity, and AES\-CBC\-128 encryption algorightms.
.TP
\fB\-E\fR
The remote server password is specified by the environment
variable \fIIPMI_PASSWORD\fP.
.TP
\fB\-f\fR <\fIpassword_file\fP>
Specifies a file containing the remote server password. If this
option is absent, or if password_file is empty, the password
will default to NULL.
.TP
\fB\-h\fR
Get basic usage help from the command line.
.TP
\fB\-H\fR <\fIaddress\fP>
Remote server address, can be IP address or hostname. This
option is required for \fIlan\fP and \fIlanplus\fP interfaces.
.TP
\fB\-I\fR <\fIinterface\fP>
Selects IPMI interface to use. Supported interfaces that are
compiled in are visible in the usage help output.
.TP
\fB\-L\fR <\fIprivlvl\fP>
Force session privilege level. Can be CALLBACK, USER,
OPERATOR, ADMIN. Default is ADMIN.
.TP
\fB\-m\fR <\fIlocal_address\fP>
Set the local IPMB address. The default is 0x20 and there
should be no need to change it for normal operation.
.TP
\fB\-o\fR <\fIoemtype\fP>
Select OEM type to support. This usually involves minor hacks
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
\fB\-P\fR <\fIpassword\fP>
Remote server password is specified on the command line.
If supported it will be obscured in the process list.
\fBNote!\fR Specifying the password as a command line
option is not recommended.
.TP
\fB\-S\fR <\fIsdr_cache_file\fP>
Use local file for remote SDR cache. Using a local SDR cache
can drastically increase performance for commands that require
knowledge of the entire SDR to perform their function.
.TP
\fB\-t\fR <\fItarget_address\fP>
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
multiple times to increase the level of debug output. If given
three times you will get hexdumps of all incoming and
outgoing packets.
.TP
\fB\-V\fR
Display version information.
.LP
If no password method is specified then ipmievd will prompt the
user for a password. If no password is entered at the prompt,
the remote server password will default to NULL.
.SH "COMMANDS"
.TP
\fIhelp\fP
This can be used to get command\-line help. It may also be
placed at the end of commands to get option usage help.
> ipmievd help
.br
Commands:
open Use OpenIPMI for asynchronous notification of events
sel Poll SEL for notification of events
.TP
\fIopen\fP
This command starts ipmievd with the OpenIPMI event watching
mechanism which relies on the Event Message Buffer feature of
IPMI. This requires a properly installed and configured
OpenIPMI driver on Linux and is only valid to be run through
the \fIopen\fP interface. See the \fBipmitool\fR manpage
and associated documentation for more information on setting
up the OpenIPMI driver.
\fBNote\fR: Some BMC do not support the Event Message Buffer
required for this command. Other BMCs claim to support it but
do not actually deliver events to it. If this is the case please
use the \fIsel\fP method.
.RS
.TP
\fIdaemon\fP
Launch process as a daemon and reparent to init process.
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
\fIsel\fP
This command starts ipmievd with the SEL Polling event watching
mechanism. This will poll the SEL periodically to determine if
new events have been logged. This command should work with all
BMCs and is capable of using the LAN interface as well to monitor
a remote system and log its events to a local syslog.
.RS
.TP
\fIdaemon\fP
Launch process as a daemon and reparent to init process.
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.
.RE
.SH "EXAMPLES"
.TP
\fIExample 1\fP: Daemon process watching OpenIPMI for events
> ipmievd \-I open open daemon
.TP
\fIExample 2\fP: Local non\-daemon process checking remote SEL every 30 seconds
> ipmievd \-I lan \-H 1.2.3.4 \-f passfile sel nodaemon timeout=30
.br
Reading Sensors...
.br
Waiting for Events...
.br
.SH "AUTHOR"
Duncan Laurie <duncan@iceblink.org>
.SH "SEE ALSO"
.TP
IPMItool Homepage
http://ipmitool.sourceforge.net
.TP
Intelligent Platform Management Interface Specification
http://www.intel.com/design/servers/ipmi
.TP
OpenIPMI Homepage
http://openipmi.sourceforge.net

3842
doc/ipmitool.1 Normal file

File diff suppressed because it is too large Load Diff

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,17 +27,16 @@
# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
#
# You acknowledge that this software is not designed or intended for use
# in the design, construction, operation or maintenance of any nuclear
# facility.
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 hpm2.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_oem.h ipmi_sdradd.h ipmi_isol.h ipmi_sunoem.h ipmi_picmg.h \
ipmi_fwum.h ipmi_main.h ipmi_tsol.h ipmi_firewall.h \
ipmi_kontronoem.h ipmi_ekanalyzer.h ipmi_gendev.h ipmi_ime.h \
ipmi_delloem.h ipmi_dcmi.h ipmi_vita.h ipmi_sel_supermicro.h \
ipmi_cfgp.h ipmi_lanp6.h ipmi_quantaoem.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

227
include/ipmitool/helper.h Normal file
View File

@ -0,0 +1,227 @@
/*
* 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_HELPER_H
#define IPMI_HELPER_H
#include <sys/types.h>
#include <inttypes.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h> /* For free() */
#include <stdbool.h>
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef tboolean
#define tboolean int
#endif
#ifdef __GNUC__
#define __UNUSED__(x) x __attribute__((unused))
#else
#define __UNUSED__(x) x
#endif
/* IPMI spec. - UID 0 reserved, 63 maximum UID which can be used */
#ifndef IPMI_UID_MIN
# define IPMI_UID_MIN 1
#endif
#ifndef IPMI_UID_MAX
# define IPMI_UID_MAX 63
#endif
struct ipmi_intf;
struct valstr {
uint32_t val;
const char * str;
};
struct oemvalstr {
uint32_t oem;
uint16_t val;
const char * str;
};
const char *
specific_val2str(uint16_t val,
const struct valstr *specific,
const struct valstr *generic);
const char * val2str(uint16_t val, const struct valstr * vs);
const char * oemval2str(uint32_t oem,uint16_t val, const struct oemvalstr * vs);
int str2double(const char * str, double * double_ptr);
int str2long(const char * str, int64_t * lng_ptr);
int str2ulong(const char * str, uint64_t * ulng_ptr);
int str2int(const char * str, int32_t * int_ptr);
int str2uint(const char * str, uint32_t * uint_ptr);
int str2short(const char * str, int16_t * shrt_ptr);
int str2ushort(const char * str, uint16_t * ushrt_ptr);
int str2char(const char * str, int8_t * chr_ptr);
int str2uchar(const char * str, uint8_t * uchr_ptr);
bool args2buf(int argc, char *argv[], uint8_t *out, size_t len);
int eval_ccode(const int ccode);
int is_fru_id(const char *argv_ptr, uint8_t *fru_id_ptr);
int is_ipmi_channel_num(const char *argv_ptr, uint8_t *channel_ptr);
int is_ipmi_user_id(const char *argv_ptr, uint8_t *ipmi_uid_ptr);
int is_ipmi_user_priv_limit(const char *argv_ptr, uint8_t *ipmi_priv_limit_ptr);
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);
uint16_t buf2short(uint8_t * buf);
uint32_t buf2long(uint8_t * buf);
#define BUF2STR_MAXIMUM_OUTPUT_SIZE (3*1024 + 1)
const char * buf2str_extended(const uint8_t *buf, int len, const char *sep);
const char * buf2str(const uint8_t *buf, int len);
int str2mac(const char *arg, uint8_t *buf);
const char * mac2str(const uint8_t *buf);
int ipmi_parse_hex(const char *str, uint8_t *out, int size);
void printbuf(const uint8_t * buf, int len, const char * desc);
uint8_t ipmi_csum(uint8_t * d, int s);
FILE * ipmi_open_file(const char * file, int rw);
void ipmi_start_daemon(struct ipmi_intf *intf);
uint16_t ipmi_get_oem_id(struct ipmi_intf *intf);
#define IS_SET(v, b) ((v) & (1 << (b)))
/**
* Free the memory and clear the pointer.
* @param[in] ptr - a pointer to your pointer to free.
*/
static inline void free_n(void *ptr) {
void **pptr = (void **)ptr;
if (pptr && *pptr) {
free(*pptr);
*pptr = NULL;
}
}
/* le16toh(), hto16le(), et. al. don't exist for Windows or Apple */
/* For portability, let's simply define our own versions here */
/* IPMI is always little-endian */
static inline uint16_t ipmi16toh(void *ipmi16)
{
uint8_t *ipmi = (uint8_t *)ipmi16;
uint16_t h;
h = ipmi[1] << 8; /* MSB */
h |= ipmi[0]; /* LSB */
return h;
}
static inline void htoipmi16(uint16_t h, uint8_t *ipmi)
{
ipmi[0] = h & 0xFF; /* LSB */
ipmi[1] = h >> 8; /* MSB */
}
static inline uint32_t ipmi24toh(void *ipmi24)
{
uint8_t *ipmi = (uint8_t *)ipmi24;
uint32_t h = 0;
h = ipmi[2] << 16; /* MSB */
h |= ipmi[1] << 8;
h |= ipmi[0]; /* LSB */
return h;
}
static inline void htoipmi24(uint32_t h, uint8_t *ipmi)
{
ipmi[0] = h & 0xFF; /* LSB */
ipmi[1] = (h >> 8) & 0xFF;
ipmi[2] = (h >> 16) & 0xFF; /* MSB */
}
static inline uint32_t ipmi32toh(void *ipmi32)
{
uint8_t *ipmi = ipmi32;
uint32_t h;
h = ipmi[3] << 24; /* MSB */
h |= ipmi[2] << 16;
h |= ipmi[1] << 8;
h |= ipmi[0]; /* LSB */
return h;
}
static inline void htoipmi32(uint32_t h, uint8_t *ipmi)
{
ipmi[0] = h & 0xFF; /* LSB */
ipmi[1] = (h >> 8) & 0xFF;
ipmi[2] = (h >> 16) & 0xFF;
ipmi[3] = (h >> 24) & 0xFF; /* MSB */
}
uint8_t *array_byteswap(uint8_t *buffer, size_t length);
uint8_t *array_ntoh(uint8_t *buffer, size_t length);
uint8_t *array_letoh(uint8_t *buffer, size_t length);
#define ipmi_open_file_read(file) ipmi_open_file(file, 0)
#define ipmi_open_file_write(file) ipmi_open_file(file, 1)
#ifndef __min
# define __min(a, b) ((a) < (b) ? (a) : (b))
#endif
#ifndef __max
# define __max(a, b) ((a) > (b) ? (a) : (b))
#endif
#ifndef __minlen
# define __minlen(a, b) ({ int x=strlen(a); int y=strlen(b); (x < y) ? x : y;})
#endif
#ifndef __maxlen
# define __maxlen(a, b) ({ int x=strlen(a); int y=strlen(b); (x > y) ? x : y;})
#endif
#endif /* IPMI_HELPER_H */

91
include/ipmitool/hpm2.h Normal file
View File

@ -0,0 +1,91 @@
/*
* Copyright (c) 2012 Pigeon Point Systems. 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 Pigeon Point Systems nor the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "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.
* PIGEON POINT SYSTEMS ("PPS") 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
* PPS 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 PPS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#include <stdint.h>
#include <ipmitool/ipmi_intf.h>
/* Global HPM.2 defines */
#define HPM2_REVISION 0x01
#define HPM3_REVISION 0x01
#define HPM2_LAN_PARAMS_REV 0x01
#define HPM2_SOL_PARAMS_REV 0x01
#define HPM3_LAN_PARAMS_REV 0x01
/* IPMI defines parameter revision as
* MSN = present revision,
* LSN = oldest revision parameter is
* backward compatible with. */
#define LAN_PARAM_REV(x, y) (((x) << 4) | ((y) & 0xF))
/* HPM.2 capabilities */
#define HPM2_CAPS_SOL_EXTENSION 0x01
#define HPM2_CAPS_PACKET_TRACE 0x02
#define HPM2_CAPS_EXT_MANAGEMENT 0x04
#define HPM2_CAPS_VERSION_SENSOR 0x08
#define HPM2_CAPS_DYNAMIC_SESSIONS 0x10
#if HAVE_PRAGMA_PACK
# pragma pack(push, 1)
#endif
/* HPM.2 LAN attach capabilities */
struct hpm2_lan_attach_capabilities {
uint8_t hpm2_revision_id;
uint16_t lan_channel_mask;
uint8_t hpm2_caps;
uint8_t hpm2_lan_params_start;
uint8_t hpm2_lan_params_rev;
uint8_t hpm2_sol_params_start;
uint8_t hpm2_sol_params_rev;
} ATTRIBUTE_PACKING;
/* HPM.2 LAN channel capabilities */
struct hpm2_lan_channel_capabilities {
uint8_t capabilities;
uint8_t attach_type;
uint8_t bandwidth_class;
uint16_t max_inbound_pld_size;
uint16_t max_outbound_pld_size;
} ATTRIBUTE_PACKING;
#if HAVE_PRAGMA_PACK
# pragma pack(pop)
#endif
/* HPM.2 command assignments */
#define HPM2_GET_LAN_ATTACH_CAPABILITIES 0x3E
extern int hpm2_get_capabilities(struct ipmi_intf * intf,
struct hpm2_lan_attach_capabilities * caps);
extern int hpm2_get_lan_channel_capabilities(struct ipmi_intf * intf,
uint8_t hpm2_lan_params_start,
struct hpm2_lan_channel_capabilities * caps);
extern int hpm2_detect_max_payload_size(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_H
@ -43,8 +39,21 @@
#include <sys/types.h>
#include <netinet/in.h>
#include <ipmitool/helper.h>
#include <ipmitool/ipmi_cc.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#define IPMI_BUF_SIZE 1024
#define IPMI_MAX_MD_SIZE 0x20
#if HAVE_PRAGMA_PACK
#define ATTRIBUTE_PACKING
#else
#define ATTRIBUTE_PACKING __attribute__ ((packed))
#endif
/* From table 13.16 of the IPMI v2 specification */
#define IPMI_PAYLOAD_TYPE_IPMI 0x00
@ -57,13 +66,13 @@
#define IPMI_PAYLOAD_TYPE_RAKP_3 0x14
#define IPMI_PAYLOAD_TYPE_RAKP_4 0x15
extern int verbose;
extern int csv_output;
struct ipmi_rq {
struct {
uint8_t netfn;
uint8_t netfn:6;
uint8_t lun:2;
uint8_t cmd;
uint8_t target_cmd;
uint16_t data_len;
@ -71,50 +80,49 @@ struct ipmi_rq {
} msg;
};
/*
* This is what the sendrcv_v2() function would take as an argument. The common case
* is for payload_type to be IPMI_PAYLOAD_TYPE_IPMI.
*/
struct ipmi_v2_payload {
uint16_t payload_length;
uint8_t payload_type;
uint8_t payload_type;
union {
struct {
uint8_t rq_seq;
struct ipmi_rq * request;
uint8_t rq_seq;
struct ipmi_rq *request;
} ipmi_request;
struct {
uint8_t rs_seq;
struct ipmi_rs * response;
uint8_t rs_seq;
struct ipmi_rs *response;
} ipmi_response;
/* Only used internally by the lanplus interface */
struct {
uint8_t * request;
uint8_t *request;
} open_session_request;
/* Only used internally by the lanplus interface */
struct {
uint8_t * message;
uint8_t *message;
} rakp_1_message;
/* Only used internally by the lanplus interface */
struct {
uint8_t * message;
uint8_t *message;
} rakp_2_message;
/* Only used internally by the lanplus interface */
struct {
uint8_t * message;
uint8_t *message;
} rakp_3_message;
/* Only used internally by the lanplus interface */
struct {
uint8_t * message;
uint8_t *message;
} rakp_4_message;
struct {
@ -123,32 +131,28 @@ struct ipmi_v2_payload {
uint8_t packet_sequence_number;
uint8_t acked_packet_number;
uint8_t accepted_character_count;
uint8_t is_nack; /* bool */
uint8_t assert_ring_wor; /* bool */
uint8_t generate_break; /* bool */
uint8_t deassert_cts; /* bool */
uint8_t deassert_dcd_dsr; /* bool */
uint8_t flush_inbound; /* bool */
uint8_t flush_outbound; /* bool */
uint8_t is_nack; /* bool */
uint8_t assert_ring_wor; /* bool */
uint8_t generate_break; /* bool */
uint8_t deassert_cts; /* bool */
uint8_t deassert_dcd_dsr; /* bool */
uint8_t flush_inbound; /* bool */
uint8_t flush_outbound; /* bool */
} sol_packet;
} payload;
};
struct ipmi_rq_entry {
struct ipmi_rq req;
struct ipmi_intf * intf;
struct ipmi_intf *intf;
uint8_t rq_seq;
uint8_t * msg_data;
uint8_t *msg_data;
int msg_len;
struct ipmi_rq_entry * next;
int bridging_level;
struct ipmi_rq_entry *next;
};
struct ipmi_rs {
uint8_t ccode;
uint8_t data[IPMI_BUF_SIZE];
@ -167,19 +171,18 @@ struct ipmi_rs {
} msg;
struct {
uint8_t authtype;
uint32_t seq;
uint32_t id;
uint8_t bEncrypted; /* IPMI v2 only */
uint8_t bAuthenticated; /* IPMI v2 only */
uint8_t payloadtype; /* IPMI v2 only */
uint8_t authtype;
uint32_t seq;
uint32_t id;
uint8_t bEncrypted; /* IPMI v2 only */
uint8_t bAuthenticated; /* IPMI v2 only */
uint8_t payloadtype; /* IPMI v2 only */
/* This is the total length of the payload or
IPMI message. IPMI v2.0 requires this to
be 2 bytes. Not really used for much. */
uint16_t msglen;
} session;
/*
* A union of the different possible payload meta-data
*/
@ -197,8 +200,8 @@ struct ipmi_rs {
uint8_t message_tag;
uint8_t rakp_return_code;
uint8_t max_priv_level;
uint32_t console_id;
uint32_t bmc_id;
uint32_t console_id;
uint32_t bmc_id;
uint8_t auth_alg;
uint8_t integrity_alg;
uint8_t crypt_alg;
@ -206,45 +209,103 @@ struct ipmi_rs {
struct {
uint8_t message_tag;
uint8_t rakp_return_code;
uint32_t console_id;
uint8_t bmc_rand[16]; /* Random number generated by the BMC */
uint32_t console_id;
uint8_t bmc_rand[16]; /* Random number generated by the BMC */
uint8_t bmc_guid[16];
uint8_t key_exchange_auth_code[20];
uint8_t key_exchange_auth_code[IPMI_MAX_MD_SIZE];
} rakp2_message;
struct {
uint8_t message_tag;
uint8_t rakp_return_code;
uint32_t console_id;
uint8_t integrity_check_value[20];
uint32_t console_id;
uint8_t integrity_check_value[IPMI_MAX_MD_SIZE];
} rakp4_message;
struct {
uint8_t packet_sequence_number;
uint8_t acked_packet_number;
uint8_t accepted_character_count;
uint8_t is_nack; /* bool */
uint8_t transfer_unavailable; /* bool */
uint8_t sol_inactive; /* bool */
uint8_t transmit_overrun; /* bool */
uint8_t break_detected; /* bool */
uint8_t is_nack; /* bool */
uint8_t transfer_unavailable; /* bool */
uint8_t sol_inactive; /* bool */
uint8_t transmit_overrun; /* bool */
uint8_t break_detected; /* bool */
} sol_packet;
} payload;
};
#define IPMI_NETFN_CHASSIS 0x0
#define IPMI_NETFN_BRIDGE 0x2
#define IPMI_NETFN_SE 0x4
#define IPMI_NETFN_APP 0x6
#define IPMI_NETFN_FIRMWARE 0x8
#define IPMI_NETFN_STORAGE 0xa
#define IPMI_NETFN_TRANSPORT 0xc
#define IPMI_NETFN_TRANSPORT 0xc
#define IPMI_NETFN_PICMG 0x2C
#define IPMI_NETFN_DCGRP 0x2C
#define IPMI_NETFN_OEM 0x2E
#define IPMI_NETFN_ISOL 0x34
#define IPMI_NETFN_TSOL 0x30
#define IPMI_BMC_SLAVE_ADDR 0x20
#define IPMI_REMOTE_SWID 0x81
/* These values are IANA numbers */
/************************************************************************
* Add ID String for IANA Enterprise Number of IBM & ADLINK
* https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers
************************************************************************/
typedef enum IPMI_OEM {
IPMI_OEM_UNKNOWN = 0,
IPMI_OEM_DEBUG = 0xFFFFFE, /* Hoping IANA won't hit this soon */
IPMI_OEM_RESERVED = 0x0FFFFF, /* As per IPMI 2.0 specification */
/* 2 for [IBM] */
IPMI_OEM_IBM_2 = 2,
IPMI_OEM_HP = 11,
IPMI_OEM_SUN = 42,
IPMI_OEM_NOKIA = 94,
IPMI_OEM_BULL = 107,
IPMI_OEM_HITACHI_116 = 116,
IPMI_OEM_NEC = 119,
IPMI_OEM_TOSHIBA = 186,
IPMI_OEM_ERICSSON = 193,
IPMI_OEM_INTEL = 343,
IPMI_OEM_TATUNG = 373,
IPMI_OEM_HITACHI_399 = 399,
IPMI_OEM_DELL = 674,
IPMI_OEM_LMC = 2168,
IPMI_OEM_RADISYS = 4337,
IPMI_OEM_BROADCOM = 4413,
/* 4769 for [IBM Corporation] */
IPMI_OEM_IBM_4769 = 4769,
IPMI_OEM_MAGNUM = 5593,
IPMI_OEM_TYAN = 6653,
IPMI_OEM_QUANTA = 7244,
IPMI_OEM_NEWISYS = 9237,
IPMI_OEM_ADVANTECH = 10297,
IPMI_OEM_FUJITSU_SIEMENS = 10368,
IPMI_OEM_AVOCENT = 10418,
IPMI_OEM_PEPPERCON = 10437,
IPMI_OEM_SUPERMICRO = 10876,
IPMI_OEM_OSA = 11102,
IPMI_OEM_GOOGLE = 11129,
IPMI_OEM_PICMG = 12634,
IPMI_OEM_RARITAN = 13742,
IPMI_OEM_KONTRON = 15000,
IPMI_OEM_PPS = 16394,
/* 20301 for [IBM eServer X] */
IPMI_OEM_IBM_20301 = 20301,
IPMI_OEM_AMI = 20974,
/* 24339 for [ADLINK TECHNOLOGY INC.] */
IPMI_OEM_ADLINK_24339 = 24339,
IPMI_OEM_NOKIA_SOLUTIONS_AND_NETWORKS = 28458,
IPMI_OEM_VITA = 33196,
IPMI_OEM_SUPERMICRO_47488 = 47488,
IPMI_OEM_YADRO = 49769,
} IPMI_OEM;
extern const struct valstr completion_code_vals[];
#endif /* IPMI_H */
#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

@ -0,0 +1,197 @@
/*
* Copyright (c) 2016 Pentair Technical Products. All right 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 Pentair Technical Products 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* PENTAIR TECHNICAL SOLUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef IPMI_CFGP_H
#define IPMI_CFGP_H
#include <stdio.h>
/* Forward declarations. */
struct ipmi_cfgp;
struct ipmi_cfgp_ctx;
/*
* Action types.
*/
enum {
/* parse dumped parameter data */
CFGP_PARSE,
/* get parameter from BMC */
CFGP_GET,
/* set parameter to BMC */
CFGP_SET,
/* output parameter data in form that can be parsed back */
CFGP_SAVE,
/* print parameter in user-friendly format */
CFGP_PRINT
};
/*
* Action-specific information.
*/
struct ipmi_cfgp_action {
/* Action type. */
int type;
/* Set selector. */
int set;
/* Block selector. */
int block;
/* No error output needed. */
int quiet;
/* Number of command line arguments (only for parse action). */
int argc;
/* Command line arguments (only for parse action). */
const char **argv;
/* Output file (only for dump/print actions). */
FILE *file;
};
/*
* Access types.
*/
enum {
CFGP_RDWR,
CFGP_RDONLY,
CFGP_WRONLY,
CFGP_RESERVED
};
/*
* Configuration parameter descriptor.
*/
struct ipmi_cfgp {
/* Parameter name. */
const char *name;
/* Parameter format description. */
const char *format;
/* Various parameter traits. */
unsigned int size; /* block size */
unsigned int access:2; /* read-write/read-only/write-only */
unsigned int is_set:1; /* takes non-zero set selectors */
unsigned int first_set:1; /* 1 = 1-based set selector */
unsigned int has_blocks:1; /* takes non-zero block selectors */
unsigned int first_block:1; /* 1 = 1-based block selector */
/* Parameter-specific data. */
int specific;
};
/* Parameter callback. */
typedef int (*ipmi_cfgp_handler_t)(void *priv,
const struct ipmi_cfgp *p, const struct ipmi_cfgp_action *action,
unsigned char *data);
/*
* Parameter selector.
*/
struct ipmi_cfgp_sel {
int param;
int set;
int block;
};
/*
* Configuration parameter data.
*/
struct ipmi_cfgp_data {
struct ipmi_cfgp_data *next;
struct ipmi_cfgp_sel sel;
unsigned char data[];
};
/*
* Configuration parameter operation context.
*/
struct ipmi_cfgp_ctx {
/* Set of parameters. */
const struct ipmi_cfgp *set;
/* Descriptor count. */
int count;
/* Parameter action handler. */
ipmi_cfgp_handler_t handler;
/* ipmitool cmd name */
const char *cmdname;
/* List of parameter values. */
struct ipmi_cfgp_data *v;
/* Private data. */
void *priv;
};
/* Initialize configuration context. */
extern int ipmi_cfgp_init(struct ipmi_cfgp_ctx *ctx,
const struct ipmi_cfgp *set, unsigned int count,
const char *cmdname,
ipmi_cfgp_handler_t handler, void *priv);
/* Uninitialize context, free allocated memory. */
extern int ipmi_cfgp_uninit(struct ipmi_cfgp_ctx *ctx);
/* Print parameter usage. */
void ipmi_cfgp_usage(const struct ipmi_cfgp *set, int count, int write);
/* Parse parameter selector from command line. */
extern int ipmi_cfgp_parse_sel(struct ipmi_cfgp_ctx *ctx,
int argc, const char **argv, struct ipmi_cfgp_sel *sel);
/* Parse parameter data from command line. */
extern int ipmi_cfgp_parse_data(struct ipmi_cfgp_ctx *ctx,
const struct ipmi_cfgp_sel *sel, int argc, const char **argv);
/* Get parameter data from BMC. */
extern int ipmi_cfgp_get(struct ipmi_cfgp_ctx *ctx,
const struct ipmi_cfgp_sel *sel);
/* Set parameter data to BMC. */
extern int ipmi_cfgp_set(struct ipmi_cfgp_ctx *ctx,
const struct ipmi_cfgp_sel *sel);
/* Write parameter data to file. */
extern int ipmi_cfgp_save(struct ipmi_cfgp_ctx *ctx,
const struct ipmi_cfgp_sel *sel, FILE *file);
/* Print parameter data in user-friendly format. */
extern int ipmi_cfgp_print(struct ipmi_cfgp_ctx *ctx,
const struct ipmi_cfgp_sel *sel, FILE *file);
#endif /* IPMI_CFGP_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
@ -41,9 +37,11 @@
# include <config.h>
#endif
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_intf.h>
#define IPMI_GET_CHANNEL_AUTH_CAP 0x38
#define IPMI_SET_CHANNEL_ACCESS 0x40
#define IPMI_GET_CHANNEL_ACCESS 0x41
#define IPMI_GET_CHANNEL_INFO 0x42
#define IPMI_SET_USER_ACCESS 0x43
@ -53,11 +51,84 @@
#define IPMI_SET_USER_PASSWORD 0x47
#define IPMI_GET_CHANNEL_CIPHER_SUITES 0x54
/* These are for channel_info_t.session_support */
#define IPMI_CHANNEL_SESSION_LESS 0x00
#define IPMI_CHANNEL_SESSION_SINGLE 0x40
#define IPMI_CHANNEL_SESSION_MULTI 0x80
#define IPMI_CHANNEL_SESSION_BASED 0xC0
/* (22.24) Get Channel Info */
struct channel_info_t {
uint8_t channel;
uint8_t medium;
uint8_t protocol;
uint8_t session_support;
uint8_t active_sessions;
uint8_t vendor_id[3];
uint8_t aux_info[2];
};
/* (22.23) Get Channel Access */
struct channel_access_t {
uint8_t access_mode;
uint8_t alerting;
uint8_t channel;
uint8_t per_message_auth;
uint8_t privilege_limit;
uint8_t user_level_auth;
};
/*
* The Cipher Suite Record Format from table 22-18 of the IPMI v2.0 spec
*/
enum cipher_suite_format_tag {
STANDARD_CIPHER_SUITE = 0xc0,
OEM_CIPHER_SUITE = 0xc1,
};
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct std_cipher_suite_record_t {
uint8_t start_of_record;
uint8_t cipher_suite_id;
uint8_t auth_alg;
uint8_t integrity_alg;
uint8_t crypt_alg;
} ATTRIBUTE_PACKING;
struct oem_cipher_suite_record_t {
uint8_t start_of_record;
uint8_t cipher_suite_id;
uint8_t iana[3];
uint8_t auth_alg;
uint8_t integrity_alg;
uint8_t crypt_alg;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#define CIPHER_ALG_MASK 0x3f
#define MAX_CIPHER_SUITE_RECORD_OFFSET 0x40
#define MAX_CIPHER_SUITE_DATA_LEN 0x10
#define LIST_ALGORITHMS_BY_CIPHER_SUITE 0x80
/* Below is the theoretical maximum number of cipher suites that could be
* reported by a BMC. That is with the Get Channel Cipher Suites Command, at 16
* bytes at a time and 0x40 requests, it can report 1024 bytes, which is about
* 204 standard records or 128 OEM records. Really, we probably don't need more
* than about 20, which is the full set of standard records plus a few OEM
* records.
*/
#define MAX_CIPHER_SUITE_COUNT (MAX_CIPHER_SUITE_RECORD_OFFSET * \
MAX_CIPHER_SUITE_DATA_LEN / \
sizeof(struct std_cipher_suite_record_t))
/*
* The Get Authentication Capabilities response structure
* From table 22-15 of the IPMI v2.0 spec
*/
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct get_channel_auth_cap_rsp {
uint8_t channel_number;
#if WORDS_BIGENDIAN
@ -88,146 +159,40 @@ struct get_channel_auth_cap_rsp {
#endif
#if WORDS_BIGENDIAN
uint8_t __reserved3 : 6;
uint8_t ipmiv15_support : 1; /* channel supports IPMI v1.5 connections */
uint8_t ipmiv20_support : 1; /* channel supports IPMI v2.0 connections */
uint8_t ipmiv15_support : 1; /* channel supports IPMI v1.5 connections */
#else
uint8_t ipmiv20_support : 1; /* channel supports IPMI v2.0 connections */
uint8_t ipmiv15_support : 1; /* channel supports IPMI v1.5 connections */
uint8_t ipmiv20_support : 1; /* channel supports IPMI v2.0 connections */
uint8_t __reserved3 : 6;
#endif
uint8_t oem_id[3]; /* IANA enterprise number for auth type */
uint8_t oem_aux_data; /* Additional OEM specific data for oem auths */
} __attribute__ ((packed));
/*
* The Get Channel Info response structure
* From table 22-29 of the IPMI v2.0 spec
*/
struct get_channel_info_rsp {
#if WORDS_BIGENDIAN
uint8_t __reserved1 : 4;
uint8_t channel_number : 4; /* channel number */
#else
uint8_t channel_number : 4; /* channel number */
uint8_t __reserved1 : 4;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#if WORDS_BIGENDIAN
uint8_t __reserved2 : 1;
uint8_t channel_medium : 7; /* Channel medium type per table 6-3 */
#else
uint8_t channel_medium : 7; /* Channel medium type per table 6-3 */
uint8_t __reserved2 : 1;
#endif
#if WORDS_BIGENDIAN
uint8_t __reserved3 : 3;
uint8_t channel_protocol : 5; /* Channel protocol per table 6-2 */
#else
uint8_t channel_protocol : 5; /* Channel protocol per table 6-2 */
uint8_t __reserved3 : 3;
#endif
#if WORDS_BIGENDIAN
uint8_t session_support : 2; /* Description of session support */
uint8_t active_sessions : 6; /* Count of active sessions */
#else
uint8_t active_sessions : 6; /* Count of active sessions */
uint8_t session_support : 2; /* Description of session support */
#endif
uint8_t vendor_id[3]; /* For OEM that specified the protocol */
uint8_t aux_info[2]; /* Not used*/
} __attribute__ ((packed));
/*
* The Get Channel Access response structure
* From table 22-28 of the IPMI v2.0 spec
*/
struct get_channel_access_rsp {
#if WORDS_BIGENDIAN
uint8_t __reserved1 : 2;
uint8_t alerting : 1;
uint8_t per_message_auth : 1;
uint8_t user_level_auth : 1;
uint8_t access_mode : 3;
#else
uint8_t access_mode : 3;
uint8_t user_level_auth : 1;
uint8_t per_message_auth : 1;
uint8_t alerting : 1;
uint8_t __reserved1 : 2;
#endif
#if WORDS_BIGENDIAN
uint8_t __reserved2 : 4;
uint8_t channel_priv_limit : 4; /* Channel privilege level limit */
#else
uint8_t channel_priv_limit : 4; /* Channel privilege level limit */
uint8_t __reserved2 : 4;
#endif
} __attribute__ ((packed));
struct get_user_access_rsp {
#if WORDS_BIGENDIAN
uint8_t __reserved1 : 2;
uint8_t max_user_ids : 6;
uint8_t __reserved2 : 2;
uint8_t enabled_user_ids : 6;
uint8_t __reserved3 : 2;
uint8_t fixed_user_ids : 6;
uint8_t __reserved4 : 1;
uint8_t callin_callback : 1;
uint8_t link_auth : 1;
uint8_t ipmi_messaging : 1;
uint8_t privilege_limit : 4;
#else
uint8_t max_user_ids : 6;
uint8_t __reserved1 : 2;
uint8_t enabled_user_ids : 6;
uint8_t __reserved2 : 2;
uint8_t fixed_user_ids : 6;
uint8_t __reserved3 : 2;
uint8_t privilege_limit : 4;
uint8_t ipmi_messaging : 1;
uint8_t link_auth : 1;
uint8_t callin_callback : 1;
uint8_t __reserved4 : 1;
#endif
} __attribute__ ((packed));
struct set_user_access_data {
#if WORDS_BIGENDIAN
uint8_t change_bits : 1;
uint8_t callin_callback : 1;
uint8_t link_auth : 1;
uint8_t ipmi_messaging : 1;
uint8_t channel : 4;
uint8_t __reserved1 : 2;
uint8_t user_id : 6;
uint8_t __reserved2 : 4;
uint8_t privilege_limit : 4;
uint8_t __reserved3 : 4;
uint8_t session_limit : 4;
#else
uint8_t channel : 4;
uint8_t ipmi_messaging : 1;
uint8_t link_auth : 1;
uint8_t callin_callback : 1;
uint8_t change_bits : 1;
uint8_t user_id : 6;
uint8_t __reserved1 : 2;
uint8_t privilege_limit : 4;
uint8_t __reserved2 : 4;
uint8_t session_limit : 4;
uint8_t __reserved3 : 4;
#endif
} __attribute__ ((packed));
int _ipmi_get_channel_access(struct ipmi_intf *intf,
struct channel_access_t *channel_access,
uint8_t get_volatile_settings);
int ipmi_get_channel_cipher_suites(struct ipmi_intf *intf,
const char *payload_type,
uint8_t channel,
struct cipher_suite_info *suites,
size_t *count);
int _ipmi_get_channel_info(struct ipmi_intf *intf,
struct channel_info_t *channel_info);
int _ipmi_set_channel_access(struct ipmi_intf *intf,
struct channel_access_t channel_access,
uint8_t access_option,
uint8_t privilege_option);
uint8_t ipmi_get_channel_medium(struct ipmi_intf * intf, uint8_t channel);
uint8_t ipmi_current_channel_medium(struct ipmi_intf * intf);
int ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv);
int ipmi_get_channel_auth_cap(struct ipmi_intf * intf, uint8_t channel, uint8_t priv);
int ipmi_get_channel_auth_cap(struct ipmi_intf * intf,
uint8_t channel, uint8_t priv);
int ipmi_get_channel_info(struct ipmi_intf * intf, uint8_t channel);
#endif /*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
@ -51,6 +47,9 @@
#define IPMI_CHASSIS_POLICY_PREVIOUS 0x1
#define IPMI_CHASSIS_POLICY_ALWAYS_OFF 0x0
int ipmi_chassis_main(struct ipmi_intf *, int, char **);
int ipmi_chassis_power_status(struct ipmi_intf * intf);
int ipmi_chassis_power_control(struct ipmi_intf * intf, uint8_t ctl);
int ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv);
int ipmi_power_main(struct ipmi_intf * intf, int argc, char ** argv);
#endif /*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
@ -42,9 +38,9 @@
* COMMANDS
*/
#define IPMI_GET_SDR_REPOSITORY_INFO 0x20
#define IMPI_SOL_ACTIVATING 0x20
#define IMPI_SET_SOL_CONFIG_PARAMETERS 0x21
#define IMPI_GET_SOL_CONFIG_PARAMETERS 0x22
#define IPMI_SOL_ACTIVATING 0x20
#define IPMI_SET_SOL_CONFIG_PARAMETERS 0x21
#define IPMI_GET_SOL_CONFIG_PARAMETERS 0x22
#define IPMI_SET_USER_ACCESS 0x43
#define IPMI_GET_USER_ACCESS 0x44
#define IPMI_SET_USER_NAME 0x45
@ -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
@ -82,7 +80,7 @@
#define IPMI_SET_IN_PROGRESS_COMMIT_WRITE 0x02
#define IPMI_CHANNEL_MEDIUM_RESERVED 0x0
#define IPMI_CHANNEL_MEDIUM_IPMB 0x1
#define IPMI_CHANNEL_MEDIUM_IPMB_I2C 0x1
#define IPMI_CHANNEL_MEDIUM_ICMB_1 0x2
#define IPMI_CHANNEL_MEDIUM_ICMB_09 0x3
#define IPMI_CHANNEL_MEDIUM_LAN 0x4
@ -95,18 +93,41 @@
#define IPMI_CHANNEL_MEDIUM_USB_2 0xb
#define IPMI_CHANNEL_MEDIUM_SYSTEM 0xc
#define IPMI_CHASSIS_CTL_POWER_DOWN 0x0
#define IPMI_CHASSIS_CTL_POWER_UP 0x1
#define IPMI_CHASSIS_CTL_POWER_CYCLE 0x2
#define IPMI_CHASSIS_CTL_HARD_RESET 0x3
#define IPMI_CHASSIS_CTL_PULSE_DIAG 0x4
#define IPMI_CHASSIS_CTL_ACPI_SOFT 0x5
#define IPMI_CHASSIS_POLICY_NO_CHANGE 0x3
#define IPMI_CHASSIS_POLICY_ALWAYS_ON 0x2
#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
#define IPMI_AUTH_RAKP_HMAC_MD5 0x02
#define IPMI_AUTH_RAKP_HMAC_SHA256 0x03
/* From table 13-18 of the IPMI v2 specification */
#define IPMI_INTEGRITY_NONE 0x00
#define IPMI_INTEGRITY_HMAC_SHA1_96 0x01
#define IPMI_INTEGRITY_HMAC_MD5_128 0x02
#define IPMI_INTEGRITY_MD5_128 0x03
#define IPMI_INTEGRITY_HMAC_SHA256_128 0x04
/* From table 13-19 of the IPMI v2 specfication */
/* From table 13-19 of the IPMI v2 specification */
#define IPMI_CRYPT_NONE 0x00
#define IPMI_CRYPT_AES_CBC_128 0x01
#define IPMI_CRYPT_XRC4_128 0x02

View File

@ -0,0 +1,270 @@
/*
* Copyright (C) 2008 Intel Corporation.
* All rights reserved
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef IPMI_DCMI_H
#define IPMI_DCMI_H
#include <ipmitool/ipmi.h>
/* DCMI commands per DCMI 1.5 SPEC */
#define IPMI_DCMI 0xDC /* Group Extension Identification */
#define IPMI_DCMI_COMPAT 0x01
#define IPMI_DCMI_GETRED 0x02
#define IPMI_DCMI_GETLMT 0x03
#define IPMI_DCMI_SETLMT 0x04
#define IPMI_DCMI_PWRACT 0x05
#define IPMI_DCMI_GETASSET 0x06
#define IPMI_DCMI_SETASSET 0x08
#define IPMI_DCMI_GETMNGCTRLIDS 0x09
#define IPMI_DCMI_SETMNGCTRLIDS 0x0A
#define IPMI_DCMI_SETTERMALLIMIT 0x0B
#define IPMI_DCMI_GETTERMALLIMIT 0x0C
#define IPMI_DCMI_GETSNSR 0x07
#define IPMI_DCMI_PWRMGT 0x08
#define IPMI_DCMI_GETTEMPRED 0x10
#define IPMI_DCMI_SETCONFPARAM 0x12
#define IPMI_DCMI_GETCONFPARAM 0x13
#define IPMI_DCMI_CONFORM 0x0001
#define IPMI_DCMI_1_1_CONFORM 0x0101
#define IPMI_DCMI_1_5_CONFORM 0x0501
#define DCMI_MAX_BYTE_SIZE 0x10
#define DCMI_MAX_BYTE_TEMP_READ_SIZE 0x08
#define GOOD_PWR_GLIMIT_CCODE(ccode) ((ccode = ((ccode == 0x80) ? 0 : ccode)))
#define GOOD_ASSET_TAG_CCODE(ccode) ((ccode = (((ccode == 0x80) || (ccode == 0x81) || (ccode == 0x82) || (ccode == 0x83)) ? 0 : ccode)))
/* External Node Manager Configuration and Control Commands per spec 2.0 */
#define IPMI_NM_POLICY_CTL 0xC0
#define IPMI_NM_SET_POLICY 0xC1
#define IPMI_NM_GET_POLICY 0xC2
#define IPMI_NM_SET_ALERT_TH 0xC3
#define IPMI_NM_GET_ALERT_TH 0xC4
#define IPMI_NM_SET_SUSPEND 0xC5
#define IPMI_NM_GET_SUSPEND 0xC6
#define IPMI_NM_RESET_STATS 0xC7
#define IPMI_NM_GET_STATS 0xC8
#define IPMI_NM_GET_CAP 0xC9
#define IPMI_NM_GET_VERSION 0xCA
#define IPMI_NM_SET_POWER 0xCB
#define IPMI_NM_SET_ALERT_DS 0xCE
#define IPMI_NM_GET_ALERT_DS 0xCF
#define IPMI_NM_LIMITING 0xF2
/* Node Manager Policy Control Flags */
#define IPMI_NM_GLOBAL_ENABLE 0x01
#define IPMI_NM_DOMAIN_ENABLE 0x02
#define IPMI_NM_PER_POLICY_ENABLE 0x04
/* Node Manager Set Policy Enable */
#define IPMI_NM_POLICY_ENABLE 0x10
/* Node Manager Policy Trigger Codes */
#define IPMI_NM_NO_POLICY_TRIG 0x00
#define IPMI_NM_TEMP_TRIGGER 0x01
#define IPMI_NM_NO_READ_TRIG 0x02
#define IPMI_NM_RESET_TRIGGER 0x03
#define IPMI_NM_BOOT_TRIGGER 0x04
/* Policy Exception Actions flags */
#define IPMI_NM_POLICY_ALERT 0x01
#define IPMI_NM_POLICY_SHUT 0x02
/* Power Correction codes for Policy action */
#define IPMI_NM_PWR_AUTO_CORR 0x00
#define IPMI_NM_PWR_SOFT_CORR 0x01
#define IPMI_NM_PWR_AGGR_CORR 0x02
/* Set Threshold message size */
#define IPMI_NM_SET_THRESH_LEN 12
/* Number of Suspend Periods */
#define IPMI_NM_SUSPEND_PERIOD_MAX 5
struct dcmi_cmd {
uint16_t val;
const char * str;
const char * desc;
};
/* make a struct for the return from the get limit command */
struct power_limit {
uint8_t grp_id; /* first byte: Group Extension ID */
uint16_t reserved_1; /* second and third bytes are reserved */
uint8_t action; /* fourth byte is the exception action */
uint16_t limit; /* fifth through sixth byte are the power limit in watts */
uint32_t correction; /* seventh - 10th bytes are the correction period */
uint16_t reserved_2; /* 11th - 12th are reserved bytes */
uint16_t sample; /* 13th - 14th are sample period time */
} __attribute__ ((packed));
/* make a struct for the return from the reading command */
struct power_reading {
uint8_t grp_id; /* first byte: Group Extension ID */
uint16_t curr_pwr;
uint16_t min_sample;
uint16_t max_sample;
uint16_t avg_pwr;
uint32_t time_stamp; /* time since epoch */
uint32_t sample;
uint8_t state;
} __attribute__ ((packed));
/* make a struct for the return from the capabilities command */
struct capabilities {
uint8_t grp_id; /* first byte: Group Extension ID */
uint16_t conformance;
uint8_t revision;
uint8_t data_byte1;
uint8_t data_byte2;
uint8_t data_byte3;
uint8_t data_byte4;
} __attribute__ ((packed));
/* make a struct for the return from the sensor info command */
struct sensor_info {
uint8_t grp_id; /* first byte: Group Extension ID */
uint8_t i_instances;
uint8_t i_records;
} __attribute__ ((packed));
/* make a struct for the return from the get asset tag command */
struct asset_tag {
uint8_t grp_id; /* first byte: Group Extension ID */
uint8_t length;
const char tag[16];
} __attribute__ ((packed));
/* make a struct for the return from the set asset tag command */
struct set_asset_tag {
uint8_t grp_id; /* first byte: Group Extension ID */
uint8_t length;
const char tag[16];
uint8_t *data;
} __attribute__ ((packed));
/* make a struct for the return from the get thermal limit command */
struct thermal_limit {
uint8_t grp_id; /* first byte: Group Extension ID */
uint8_t exceptionActions;
uint8_t tempLimit;
uint16_t exceptionTime;
} __attribute__ ((packed));
int ipmi_dcmi_main(struct ipmi_intf * intf, int argc, char ** argv);
/* Node Manager discover command */
struct nm_discover {
uint8_t intel_id[3]; /* Always returns 000157 */
uint8_t nm_version;
uint8_t ipmi_version;
uint8_t patch_version;
uint8_t major_rev;
uint8_t minor_rev;
} __attribute__ ((packed));
/* Node Manager get capabilities command */
struct nm_capability {
uint8_t intel_id[3];
uint8_t max_settings;
uint16_t max_value; /* max power/thermal/time after reset */
uint16_t min_value; /* min "" */
uint32_t min_corr; /* min correction time inmillesecs */
uint32_t max_corr;
uint16_t min_stats;
uint16_t max_stats;
uint8_t scope;
} __attribute__ ((packed));
/* Node Manager get statistics command */
struct nm_statistics {
uint8_t intel_id[3];
uint16_t curr_value;
uint16_t min_value;
uint16_t max_value;
uint16_t ave_value;
uint32_t time_stamp;
uint32_t stat_period;
uint8_t id_state;
} __attribute__ ((packed));
/* Node Manager set policy */
struct nm_policy {
uint8_t intel_id[3];
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
uint8_t policy_id;
uint8_t policy_type; /* 0:3 trigger type 4 = action 5:6 correction */
uint8_t policy_exception; /* exception actions */
uint16_t policy_limits;
uint32_t corr_time;
uint16_t trigger_limit;
uint16_t stats_period;
} __attribute__ ((packed));
/* Node Maager get policy */
struct nm_get_policy {
uint8_t intel_id[3];
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
uint8_t policy_type; /* 0:3 trigger type 4 = action 5:6 correction */
uint8_t policy_exception; /* exception actions */
uint16_t policy_limits;
uint32_t corr_time;
uint16_t trigger_limit;
uint16_t stats_period;
} __attribute__ ((packed));
/* Node Manager set alert destination */
struct nm_set_alert {
uint8_t intel_id[3];
uint8_t chan; /* 0:3 BMC chan, 4:6 reserved, bit 7=0 register alert receiver =1 invalidate */
uint8_t dest; /* lan destination */
uint8_t string; /* alert string selector */
} __attribute__ ((packed));
/* Node Manager set alert threshold */
struct nm_thresh {
uint8_t intel_id[3];
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
uint8_t policy_id;
uint8_t count;
uint16_t thresholds[3];
} __attribute__ ((packed));
/* Node Manager suspend period struct */
struct nm_period {
uint8_t start;
uint8_t stop;
uint8_t repeat;
} __attribute__ ((packed));
/* Node Manager set suspend period */
struct nm_suspend {
uint8_t intel_id[3];
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
uint8_t policy_id;
uint8_t count;
struct nm_period period[IPMI_NM_SUSPEND_PERIOD_MAX];
} __attribute__ ((packed));
int ipmi_nm_main(struct ipmi_intf * intf, int argc, char ** argv);
#endif /*IPMI_DCMI_H*/

View File

@ -0,0 +1,370 @@
/****************************************************************************
Copyright (c) 2008, Dell 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:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of Dell Inc nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef IPMI_DELLOEM_H
#define IPMI_DELLOEM_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
#pragma pack(1)
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
/* Dell selector for LCD control - get and set unless specified */
#define IPMI_DELL_LCD_STRING_SELECTOR 0xC1 /* RW get/set the user string */
#define IPMI_DELL_LCD_CONFIG_SELECTOR 0xC2 /* RW set to user/default/none */
#define IPMI_DELL_LCD_GET_CAPS_SELECTOR 0xCF /* RO use when available*/
#define IPMI_DELL_LCD_STRINGEX_SELECTOR 0xD0 /* RW get/set the user string use first when available*/
#define IPMI_DELL_LCD_STATUS_SELECTOR 0xE7 /* LCD string when config set to default.*/
#define IPMI_DELL_PLATFORM_MODEL_NAME_SELECTOR 0xD1 /* LCD string when config set to default.*/
/* Dell defines for picking which string to use */
#define IPMI_DELL_LCD_CONFIG_USER_DEFINED 0x00 /* use string set by user*/
#define IPMI_DELL_LCD_CONFIG_DEFAULT 0x01 /* use platform model name*/
#define IPMI_DELL_LCD_CONFIG_NONE 0x02 /* blank*/
#define IPMI_DELL_LCD_iDRAC_IPV4ADRESS 0x04 /* use string set by user*/
#define IPMI_DELL_LCD_IDRAC_MAC_ADDRESS 0x08 /* use platform model name*/
#define IPMI_DELL_LCD_OS_SYSTEM_NAME 0x10 /* blank*/
#define IPMI_DELL_LCD_SERVICE_TAG 0x20 /* use string set by user*/
#define IPMI_DELL_LCD_iDRAC_IPV6ADRESS 0x40 /* use string set by user*/
#define IPMI_DELL_LCD_AMBEINT_TEMP 0x80 /* use platform model name*/
#define IPMI_DELL_LCD_SYSTEM_WATTS 0x100 /* blank*/
#define IPMI_DELL_LCD_ASSET_TAG 0x200
#define IPMI_DELL_LCD_ERROR_DISP_SEL 0x01 /* use platform model name*/
#define IPMI_DELL_LCD_ERROR_DISP_VERBOSE 0x02 /* blank*/
#define IPMI_DELL_IDRAC_VALIDATOR 0xDD
#define IPMI_DELL_POWER_CAP_STATUS 0xBA
#define IPMI_DELL_AVG_POWER_CONSMP_HST 0xEB
#define IPMI_DELL_PEAK_POWER_CONSMP_HST 0xEC
#define SYSTEM_BOARD_SYSTEM_LEVEL_SENSOR_NUM 0x98
#define IDRAC_11G 1
#define IDRAC_12G 2
#define IDRAC_13G 3
// Return Error code for license
#define LICENSE_NOT_SUPPORTED 0x6F
#define VFL_NOT_LICENSED 0x33
#define btuphr 0x01
#define watt 0x00
#define IPMI_DELL_POWER_CAP 0xEA
#define percent 0x03
/* Not on all Dell servers. If there, use it.*/
typedef struct _tag_ipmi_dell_lcd_caps
{
uint8_t parm_rev; /* 0x11 for IPMI 2.0 */
uint8_t char_set; /* always 1 for printable ASCII 0x20-0x7E */
uint8_t number_lines; /* 0-4, 1 for 9G. 10G tbd */
uint8_t max_chars[4]; /* 62 for triathlon, 0 if not present (glacier) */
/* [0] is max chars for line 1 */
}IPMI_DELL_LCD_CAPS;
#define IPMI_DELL_LCD_STRING_LENGTH_MAX 62 /* Valid for 9G. Glacier ??. */
#define IPMI_DELL_LCD_STRING1_SIZE 14
#define IPMI_DELL_LCD_STRINGN_SIZE 16
/* vFlash subcommands */
#define IPMI_GET_EXT_SD_CARD_INFO 0xA4
typedef struct _tag_ipmi_dell_lcd_string
{
uint8_t parm_rev; /* 0x11 for IPMI 2.0 */
uint8_t data_block_selector; /* 16-byte data block number to access, 0 based.*/
union
{
struct
{
uint8_t encoding : 4; /* 0 is printable ASCII 7-bit */
uint8_t length; /* 0 to max chars from lcd caps */
uint8_t data[IPMI_DELL_LCD_STRING1_SIZE]; /* not zero terminated. */
}selector_0_string;
uint8_t selector_n_data[IPMI_DELL_LCD_STRINGN_SIZE];
}lcd_string;
} __attribute__ ((packed)) IPMI_DELL_LCD_STRING;
/* Only found on servers with more than 1 line. Use if available. */
typedef struct _tag_ipmi_dell_lcd_stringex
{
uint8_t parm_rev; /* 0x11 for IPMI 2.0 */
uint8_t line_number; /* LCD line number 1 to 4 */
uint8_t data_block_selector; /* 16-byte data block number to access, 0 based.*/
union
{
struct
{
uint8_t encoding : 4; /* 0 is printable ASCII 7-bit */
uint8_t length; /* 0 to max chars from lcd caps */
uint8_t data[IPMI_DELL_LCD_STRING1_SIZE]; /* not zero terminated. */
} selector_0_string;
uint8_t selector_n_data[IPMI_DELL_LCD_STRINGN_SIZE];
} lcd_string;
} __attribute__ ((packed)) IPMI_DELL_LCD_STRINGEX;
typedef struct _lcd_status
{
char parametersel;
char vKVM_status;
char lock_status;
char Resv1;
char Resv;
} __attribute__ ((packed)) LCD_STATUS;
typedef struct _lcd_mode
{
uint8_t parametersel;
uint32_t lcdmode;
uint16_t lcdquallifier;
uint32_t capabilites;
uint8_t error_display;
uint8_t Resv;
} __attribute__ ((packed)) LCD_MODE;
#define PARAM_REV_OFFSET (uint8_t)(0x1)
#define VIRTUAL_MAC_OFFSET (uint8_t)(0x1)
#define LOM_MACTYPE_ETHERNET 0
#define LOM_MACTYPE_ISCSI 1
#define LOM_MACTYPE_RESERVED 3
#define LOM_ETHERNET_ENABLED 0
#define LOM_ETHERNET_DISABLED 1
#define LOM_ETHERNET_PLAYINGDEAD 2
#define LOM_ETHERNET_RESERVED 3
#define LOM_ACTIVE 1
#define LOM_INACTIVE 0
#define MACADDRESSLENGH 6
#define MAX_LOM 8
#define EMB_NIC_MAC_ADDRESS_11G (uint8_t)(0xDA)
#define EMB_NIC_MAC_ADDRESS_9G_10G (uint8_t)(0xCB)
#define IMC_IDRAC_10G (uint8_t) (0x08)
#define IMC_CMC (uint8_t) (0x09)
#define IMC_IDRAC_11G_MONOLITHIC (uint8_t) (0x0A)
#define IMC_IDRAC_11G_MODULAR (uint8_t) (0x0B)
#define IMC_UNUSED (uint8_t) (0x0C)
#define IMC_MASER_LITE_BMC (uint8_t) (0x0D)
#define IMC_MASER_LITE_NU (uint8_t) (0x0E)
#define IMC_IDRAC_12G_MONOLITHIC (uint8_t) (0x10)
#define IMC_IDRAC_12G_MODULAR (uint8_t) (0x11)
#define IMC_IDRAC_13G_MONOLITHIC (uint8_t) (0x20)
#define IMC_IDRAC_13G_MODULAR (uint8_t) (0x21)
#define IMC_IDRAC_13G_DCS (uint8_t) (0x22)
typedef struct
{
unsigned int BladSlotNumber : 4;
unsigned int MacType : 2;
unsigned int EthernetStatus : 2;
unsigned int NICNumber : 5;
unsigned int Reserved : 3;
uint8_t MacAddressByte[MACADDRESSLENGH];
} LOMMacAddressType;
typedef struct
{
LOMMacAddressType LOMMacAddress [MAX_LOM];
} EmbeddedNICMacAddressType;
typedef struct
{
uint8_t MacAddressByte[MACADDRESSLENGH];
} MacAddressType;
typedef struct
{
MacAddressType MacAddress [MAX_LOM];
} EmbeddedNICMacAddressType_10G;
#define TRANSPORT_NETFN (uint8_t)(0xc)
#define GET_LAN_PARAM_CMD (uint8_t)(0x02)
#define MAC_ADDR_PARAM (uint8_t)(0x05)
#define LAN_CHANNEL_NUMBER (uint8_t)(0x01)
#define IDRAC_NIC_NUMBER (uint8_t)(0x8)
#define TOTAL_N0_NICS_INDEX (uint8_t)(0x1)
// 12g supported
#define SET_NIC_SELECTION_12G_CMD (uint8_t)(0x28)
#define GET_NIC_SELECTION_12G_CMD (uint8_t)(0x29)
// 11g supported
#define SET_NIC_SELECTION_CMD (uint8_t)(0x24)
#define GET_NIC_SELECTION_CMD (uint8_t)(0x25)
#define GET_ACTIVE_NIC_CMD (uint8_t)(0xc1)
#define POWER_EFFICENCY_CMD (uint8_t)(0xc0)
#define SERVER_POWER_CONSUMPTION_CMD (uint8_t)(0x8F)
#define POWER_SUPPLY_INFO (uint8_t)(0xb0)
#define IPMI_ENTITY_ID_POWER_SUPPLY (uint8_t)(0x0a)
#define SENSOR_STATE_STR_SIZE (uint8_t)(64)
#define SENSOR_NAME_STR_SIZE (uint8_t)(64)
#define GET_PWRMGMT_INFO_CMD (uint8_t)(0x9C)
#define CLEAR_PWRMGMT_INFO_CMD (uint8_t)(0x9D)
#define GET_PWR_HEADROOM_CMD (uint8_t)(0xBB)
#define GET_PWR_CONSUMPTION_CMD (uint8_t)(0xB3)
#define GET_FRONT_PANEL_INFO_CMD (uint8_t)0xb5
typedef struct _ipmi_power_monitor
{
uint32_t cumStartTime;
uint32_t cumReading;
uint32_t maxPeakStartTime;
uint32_t ampPeakTime;
uint16_t ampReading;
uint32_t wattPeakTime;
uint16_t wattReading;
} __attribute__ ((packed)) IPMI_POWER_MONITOR;
#define MAX_POWER_FW_VERSION 8
typedef struct _ipmi_power_supply_infoo
{
/*No param_rev it is not a System Information Command */
uint16_t ratedWatts;
uint16_t ratedAmps;
uint16_t ratedVolts;
uint32_t vendorid;
uint8_t FrimwareVersion[MAX_POWER_FW_VERSION];
uint8_t Powersupplytype;
uint16_t ratedDCWatts;
uint16_t Resv;
} __attribute__ ((packed)) IPMI_POWER_SUPPLY_INFO;
typedef struct ipmi_power_consumption_data
{
uint16_t actualpowerconsumption;
uint16_t powerthreshold;
uint16_t warningthreshold;
uint8_t throttlestate;
uint16_t maxpowerconsumption;
uint16_t throttlepowerconsumption;
uint16_t Resv;
} __attribute__ ((packed)) IPMI_POWER_CONSUMPTION_DATA;
typedef struct ipmi_inst_power_consumption_data
{
uint16_t instanpowerconsumption;
uint16_t instanApms;
uint16_t resv1;
uint8_t resv;
} __attribute__ ((packed)) IPMI_INST_POWER_CONSUMPTION_DATA;
typedef struct _ipmi_avgpower_consump_histroy
{
uint8_t parameterselector;
uint16_t lastminutepower;
uint16_t lasthourpower;
uint16_t lastdaypower;
uint16_t lastweakpower;
} __attribute__ ((packed)) IPMI_AVGPOWER_CONSUMP_HISTORY;
typedef struct _ipmi_power_consump_histroy
{
uint8_t parameterselector;
uint16_t lastminutepower;
uint16_t lasthourpower;
uint16_t lastdaypower;
uint16_t lastweakpower;
uint32_t lastminutepowertime;
uint32_t lasthourpowertime;
uint32_t lastdaypowertime;
uint32_t lastweekpowertime;
} __attribute__ ((packed)) IPMI_POWER_CONSUMP_HISTORY;
typedef struct _ipmi_delloem_power_cap
{
uint8_t parameterselector;
uint16_t PowerCap;
uint8_t unit;
uint16_t MaximumPowerConsmp;
uint16_t MinimumPowerConsmp;
uint16_t totalnumpowersupp;
uint16_t AvailablePower ;
uint16_t SystemThrottling;
uint16_t Resv;
} __attribute__ ((packed)) IPMI_POWER_CAP;
typedef struct _power_headroom
{
uint16_t instheadroom;
uint16_t peakheadroom;
} __attribute__ ((packed)) POWER_HEADROOM;
struct vFlashstr {
uint8_t val;
const char * str;
};
typedef struct ipmi_vFlash_extended_info
{
uint8_t vflashcompcode;
uint8_t sdcardstatus;
uint32_t sdcardsize;
uint32_t sdcardavailsize;
uint8_t bootpartion;
uint8_t Resv;
} __attribute__ ((packed)) IPMI_DELL_SDCARD_INFO;
typedef struct _SensorReadingType
{
uint8_t sensorReading;
uint8_t sensorFlags;
uint16_t sensorState;
}SensorReadingType;
uint16_t compareinputwattage(IPMI_POWER_SUPPLY_INFO* powersupplyinfo, uint16_t inputwattage);
int ipmi_delloem_main(struct ipmi_intf * intf, int argc, char ** argv);
#endif /*IPMI_DELLOEM_H*/

View File

@ -0,0 +1,68 @@
/*
* Copyright (c) 2007 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_EKANALYZER_H
#define IPMI_EKANALYZER_H
#include <inttypes.h>
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_fru.h>
#define RTM_FRU_FILE 0x00
#define A1_AMC_FRU_FILE 0x01
#define A2_AMC_FRU_FILE 0x02
#define A3_AMC_FRU_FILE 0x03
#define A4_AMC_FRU_FILE 0x04
#define B1_AMC_FRU_FILE 0x05
#define B2_AMC_FRU_FILE 0x06
#define B3_AMC_FRU_FILE 0x07
#define B4_AMC_FRU_FILE 0x08
#define ON_CARRIER_FRU_FILE 0x09
#define CONFIG_FILE 0x0A
#define SHELF_MANAGER_FRU_FILE 0x0B
#define MIN_ARGUMENT 0x02
#define RTM_IPMB_L 0x90
#define MAX_FILE_NUMBER 8
/* this voltag is specified in AMC.0 specification Table 3-10 */
#define AMC_VOLTAGE 12 /*volts*/
#define SIZE_OF_GUID 16
#define FRU_RADIAL_IPMB0_LINK_MAPPING 0x15
int ipmi_ekanalyzer_main(struct ipmi_intf *, int, char **);
#endif /* IPMI_EKANALYZER_H */

View File

@ -28,15 +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.
*/
#ifndef IPMI_ENTITY_H
#define IPMI_ENTITY_H
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct entity_id {
uint8_t id; /* physical entity id */
#if WORDS_BIGENDIAN
@ -46,6 +45,9 @@ struct entity_id {
uint8_t instance : 7; /* instance number */
uint8_t logical : 1; /* physical/logical */
#endif
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#endif /* 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
@ -42,6 +38,29 @@
#endif
#include <ipmitool/ipmi.h>
#define EVENT_DIR_ASSERT 0
#define EVENT_DIR_DEASSERT 1
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct platform_event_msg {
uint8_t evm_rev;
uint8_t sensor_type;
uint8_t sensor_num;
#if WORDS_BIGENDIAN
uint8_t event_dir : 1;
uint8_t event_type : 7;
#else
uint8_t event_type : 7;
uint8_t event_dir : 1;
#endif
uint8_t event_data[3];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
int ipmi_event_main(struct ipmi_intf *, int, char **);
#endif /*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 */

627
include/ipmitool/ipmi_fru.h Normal file
View File

@ -0,0 +1,627 @@
/*
* 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_FRU_H
#define IPMI_FRU_H
#include <inttypes.h>
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_sdr.h>
#include <ipmitool/ipmi_time.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#define FRU_END_OF_FIELDS 0xc1
#define GET_FRU_INFO 0x10
#define GET_FRU_DATA 0x11
#define SET_FRU_DATA 0x12
enum {
FRU_CHASSIS_PARTNO,
FRU_CHASSIS_SERIAL,
FRU_BOARD_MANUF,
FRU_BOARD_PRODUCT,
FRU_BOARD_SERIAL,
FRU_BOARD_PARTNO,
FRU_PRODUCT_MANUF,
FRU_PRODUCT_NAME,
FRU_PRODUCT_PARTNO,
FRU_PRODUCT_VERSION,
FRU_PRODUCT_SERIAL,
FRU_PRODUCT_ASSET,
};
struct fru_info {
uint16_t size;
uint8_t access:1;
uint8_t max_read_size;
uint8_t max_write_size;
};
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct fru_header {
uint8_t version;
union {
struct {
uint8_t internal;
uint8_t chassis;
uint8_t board;
uint8_t product;
uint8_t multi;
} offset;
uint8_t offsets[5];
};
uint8_t pad;
uint8_t checksum;
}ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
struct fru_area_chassis {
uint8_t area_ver;
uint8_t type;
uint16_t area_len;
char * part;
char * serial;
};
struct fru_area_board {
uint8_t area_ver;
uint8_t lang;
uint16_t area_len;
uint32_t mfg_date_time;
char * mfg;
char * prod;
char * serial;
char * part;
char * fru;
};
struct fru_area_product {
uint8_t area_ver;
uint8_t lang;
uint16_t area_len;
char * mfg;
char * name;
char * part;
char * version;
char * serial;
char * asset;
char * fru;
};
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct fru_multirec_header {
#define FRU_RECORD_TYPE_POWER_SUPPLY_INFORMATION 0x00
#define FRU_RECORD_TYPE_DC_OUTPUT 0x01
#define FRU_RECORD_TYPE_DC_LOAD 0x02
#define FRU_RECORD_TYPE_MANAGEMENT_ACCESS 0x03
#define FRU_RECORD_TYPE_BASE_COMPATIBILITY 0x04
#define FRU_RECORD_TYPE_EXTENDED_COMPATIBILITY 0x05
#define FRU_RECORD_TYPE_OEM_EXTENSION 0xc0
uint8_t type;
uint8_t format;
uint8_t len;
uint8_t record_checksum;
uint8_t header_checksum;
}ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct fru_multirec_powersupply {
#if WORDS_BIGENDIAN
uint16_t capacity;
#else
uint16_t capacity:12;
uint16_t __reserved1:4;
#endif
uint16_t peak_va;
uint8_t inrush_current;
uint8_t inrush_interval;
uint16_t lowend_input1;
uint16_t highend_input1;
uint16_t lowend_input2;
uint16_t highend_input2;
uint8_t lowend_freq;
uint8_t highend_freq;
uint8_t dropout_tolerance;
#if WORDS_BIGENDIAN
uint8_t __reserved2:3;
uint8_t tach:1;
uint8_t hotswap:1;
uint8_t autoswitch:1;
uint8_t pfc:1;
uint8_t predictive_fail:1;
#else
uint8_t predictive_fail:1;
uint8_t pfc:1;
uint8_t autoswitch:1;
uint8_t hotswap:1;
uint8_t tach:1;
uint8_t __reserved2:3;
#endif
uint16_t peak_cap_ht;
#if WORDS_BIGENDIAN
uint8_t combined_voltage1:4;
uint8_t combined_voltage2:4;
#else
uint8_t combined_voltage2:4;
uint8_t combined_voltage1:4;
#endif
uint16_t combined_capacity;
uint8_t rps_threshold;
}ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct fru_multirec_dcoutput {
#if WORDS_BIGENDIAN
uint8_t standby:1;
uint8_t __reserved:3;
uint8_t output_number:4;
#else
uint8_t output_number:4;
uint8_t __reserved:3;
uint8_t standby:1;
#endif
short nominal_voltage;
short max_neg_dev;
short max_pos_dev;
uint16_t ripple_and_noise;
uint16_t min_current;
uint16_t max_current;
}ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct fru_multirec_dcload {
#if WORDS_BIGENDIAN
uint8_t __reserved:4;
uint8_t output_number:4;
#else
uint8_t output_number:4;
uint8_t __reserved:4;
#endif
short nominal_voltage;
short min_voltage;
short max_voltage;
uint16_t ripple_and_noise;
uint16_t min_current;
uint16_t max_current;
}ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct fru_multirec_oem_header {
unsigned char mfg_id[3];
#define FRU_PICMG_BACKPLANE_P2P 0x04
#define FRU_PICMG_ADDRESS_TABLE 0x10
#define FRU_PICMG_SHELF_POWER_DIST 0x11
#define FRU_PICMG_SHELF_ACTIVATION 0x12
#define FRU_PICMG_SHMC_IP_CONN 0x13
#define FRU_PICMG_BOARD_P2P 0x14
#define FRU_AMC_CURRENT 0x16
#define FRU_AMC_ACTIVATION 0x17
#define FRU_AMC_CARRIER_P2P 0x18
#define FRU_AMC_P2P 0x19
#define FRU_AMC_CARRIER_INFO 0x1a
#define FRU_UTCA_FRU_INFO_TABLE 0x20
#define FRU_UTCA_CARRIER_MNG_IP 0x21
#define FRU_UTCA_CARRIER_INFO 0x22
#define FRU_UTCA_CARRIER_LOCATION 0x23
#define FRU_UTCA_SHMC_IP_LINK 0x24
#define FRU_UTCA_POWER_POLICY 0x25
#define FRU_UTCA_ACTIVATION 0x26
#define FRU_UTCA_PM_CAPABILTY 0x27
#define FRU_UTCA_FAN_GEOGRAPHY 0x28
#define FRU_UTCA_CLOCK_MAPPING 0x29
#define FRU_UTCA_MSG_BRIDGE_POLICY 0x2A
#define FRU_UTCA_OEM_MODULE_DESC 0x2B
#define FRU_PICMG_CLK_CARRIER_P2P 0x2C
#define FRU_PICMG_CLK_CONFIG 0x2D
unsigned char record_id;
unsigned char record_version;
}ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct fru_picmgext_guid {
unsigned char guid[16];
}ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct fru_picmgext_link_desc {
#ifndef WORDS_BIGENDIAN
unsigned int desig_channel:6;
unsigned int desig_if:2;
unsigned int desig_port:4;
#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD 0x32
unsigned int type:8;
unsigned int ext:4;
unsigned int grouping:8;
#else
unsigned int grouping:8;
unsigned int ext:4;
#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD 0x32
unsigned int type:8;
unsigned int desig_port:4;
unsigned int desig_if:2;
unsigned int desig_channel:6;
#endif
}ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#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
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
/* This is used in command, not in FRU */
struct fru_picmgext_amc_link_info {
unsigned char linkInfo[3];
}ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
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_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
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_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
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_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#define FRU_PICMGEXT_OEM_SWFW 0x03
#define OEM_SWFW_NBLOCK_OFFSET 0x05
#define OEM_SWFW_FIELD_START_OFFSET 0x06
#define FRU_PICMGEXT_CHN_DESC_RECORD_SIZE 3
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct fru_picmgext_chn_desc {
#ifndef WORDS_BIGENDIAN
unsigned int remote_slot:8;
unsigned int remote_chn:5;
unsigned int local_chn:5;
unsigned int res:14;
#else
unsigned int res:14;
unsigned int local_chn:5;
unsigned int remote_chn:5;
unsigned int remote_slot:8;
#endif
}ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct fru_picmgext_slot_desc {
unsigned char chan_type;
unsigned char slot_addr;
unsigned char chn_count;
}ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#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
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct fru_picmgext_carrier_activation_record {
unsigned short max_internal_curr;
unsigned char allowance_for_readiness;
unsigned char module_activation_record_count;
}ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct fru_picmgext_activation_record {
unsigned char ibmb_addr;
unsigned char max_module_curr;
unsigned char reserved;
}ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct fru_picmgext_carrier_p2p_record {
unsigned char resource_id;
unsigned char p2p_count;
}ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct fru_picmgext_carrier_p2p_descriptor {
#ifndef WORDS_BIGENDIAN
unsigned char remote_resource_id;
unsigned short remote_port:5;
unsigned short local_port:5;
unsigned short reserved:6;
#else
unsigned short reserved:6;
unsigned short local_port:5;
unsigned short remote_port:5;
unsigned char remote_resource_id;
#endif
}ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct fru_picmgext_amc_p2p_record {
#ifndef WORDS_BIGENDIAN
unsigned char resource_id :4;
unsigned char /* reserved */ :3;
unsigned char record_type :1;
#else
unsigned char record_type :1;
unsigned char /* reserved */ :3;
unsigned char resource_id :4;
#endif
}ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#define FRU_PICMGEXT_AMC_CHANNEL_DESC_RECORD_SIZE 3
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct fru_picmgext_amc_channel_desc_record {
#ifndef WORDS_BIGENDIAN
unsigned int lane0port :5;
unsigned int lane1port :5;
unsigned int lane2port :5;
unsigned int lane3port :5;
unsigned int /* reserved */ :12;
#else
unsigned int /* reserved */ :12;
unsigned int lane3port :5;
unsigned int lane2port :5;
unsigned int lane1port :5;
unsigned int lane0port :5;
#endif
}ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#define FRU_PICMGEXT_AMC_LINK_DESC_RECORD_SIZE 5
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct fru_picmgext_amc_link_desc_record {
#define FRU_PICMGEXT_AMC_LINK_TYPE_PCIE 0x02
#define FRU_PICMGEXT_AMC_LINK_TYPE_PCIE_AS1 0x03
#define FRU_PICMGEXT_AMC_LINK_TYPE_PCIE_AS2 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
#define AMC_LINK_TYPE_EXT_PCIE_G1_NSSC 0x00
#define AMC_LINK_TYPE_EXT_PCIE_G1_SSC 0x01
#define AMC_LINK_TYPE_EXT_PCIE_G2_NSSC 0x02
#define AMC_LINK_TYPE_EXT_PCIE_G2_SSC 0x03
#define AMC_LINK_TYPE_EXT_ETH_1000_BX 0x00
#define AMC_LINK_TYPE_EXT_ETH_10G_XAUI 0x01
#define AMC_LINK_TYPE_EXT_STORAGE_FC 0x00
#define AMC_LINK_TYPE_EXT_STORAGE_SATA 0x01
#define AMC_LINK_TYPE_EXT_STORAGE_SAS 0x02
#ifndef WORDS_BIGENDIAN
unsigned int channel_id :8;
unsigned int port_flag_0 :1;
unsigned int port_flag_1 :1;
unsigned int port_flag_2 :1;
unsigned int port_flag_3 :1;
unsigned int type :8;
unsigned int type_ext :4;
unsigned int group_id :8;
unsigned int asym_match :2;
unsigned int /* reserved */ :30;
#else
unsigned int group_id :8;
unsigned int type_ext :4;
unsigned int type :8;
unsigned int port_flag_3 :1;
unsigned int port_flag_2 :1;
unsigned int port_flag_1 :1;
unsigned int port_flag_0 :1;
unsigned int channel_id :8;
unsigned int /* reserved */ :30;
unsigned int asym_match :2;
#endif
}ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
/* IPMI Return codes for Get FRU Inventory Area and Write FRU Inventory Area */
/* PROTECTED_OFFSET Only expected on write command failures. */
#define IPMI_CC_FRU_WRITE_PROTECTED_OFFSET 0x80
#define IPMI_CC_FRU_DEVICE_BUSY 0x81
/* FRU Board manufacturing date */
#define FRU_BOARD_DATE_UNSPEC 0 /* IPMI FRU Information Storage Definition
v1.0 rev 1.3, Table 11-1 */
static inline time_t ipmi_fru2time_t(void *mfg_date) {
const uint64_t secs_from_1970_1996 = 820454400;
uint32_t fru_ts = ipmi24toh(mfg_date);
time_t ts;
if (FRU_BOARD_DATE_UNSPEC == fru_ts) {
ts = IPMI_TIME_UNSPECIFIED;
}
else {
ts = fru_ts * 60 + secs_from_1970_1996;
}
return ts;
}
typedef struct ipmi_fru_bloc {
struct ipmi_fru_bloc * next;
uint16_t start;
uint16_t size;
uint8_t blocId[32];
} t_ipmi_fru_bloc;
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);
char *get_fru_area_str(uint8_t *data, uint32_t *offset);
#endif /* IPMI_FRU_H */

View File

@ -0,0 +1,243 @@
/*
* 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_KFWUM_H
# define IPMI_KFWUM_H
#include <inttypes.h>
#include <ipmitool/ipmi.h>
/* KFWUM Version */
# define VER_MAJOR 1
# define VER_MINOR 3
/* Minimum size (IPMB/IOL/old protocol) */
# define KFWUM_SMALL_BUFFER 32
/* Maximum size on KCS interface */
# define KFWUM_BIG_BUFFER 32
# define MAX_BUFFER_SIZE 1024*16
/* 3 address + 1 size + 1 checksum + 1 command */
# define KFWUM_OLD_CMD_OVERHEAD 6
/* 1 sequence + 1 size + 1 checksum + 1 command */
# define KFWUM_NEW_CMD_OVERHEAD 4
# define KFWUM_PAGE_SIZE 256
# define FWUM_SAVE_FIRMWARE_NO_RESPONSE_LIMIT 6
# define FWUM_MAX_UPLOAD_RETRY 6
# define TRACE_LOG_CHUNK_COUNT 7
# define TRACE_LOG_CHUNK_SIZE 7
# define TRACE_LOG_ATT_COUNT 3
# define IN_FIRMWARE_INFO_OFFSET_LOCATION 0x5a0
# define IN_FIRMWARE_INFO_SIZE 20
# define IN_FIRMWARE_INFO_OFFSET_FILE_SIZE 0
# define IN_FIRMWARE_INFO_OFFSET_CHECKSUM 4
# define IN_FIRMWARE_INFO_OFFSET_BOARD_ID 6
# define IN_FIRMWARE_INFO_OFFSET_DEVICE_ID 8
# define IN_FIRMWARE_INFO_OFFSET_TABLE_VERSION 9
# define IN_FIRMWARE_INFO_OFFSET_IMPLEMENT_REV 10
# define IN_FIRMWARE_INFO_OFFSET_VER_MAJOROR 11
# define IN_FIRMWARE_INFO_OFFSET_VER_MINORSUB 12
# define IN_FIRMWARE_INFO_OFFSET_SDR_REV 13
# define IN_FIRMWARE_INFO_OFFSET_IANA0 14
# define IN_FIRMWARE_INFO_OFFSET_IANA1 15
# define IN_FIRMWARE_INFO_OFFSET_IANA2 16
# define KWUM_GET_BYTE_AT_OFFSET(pBuffer,os) pBuffer[os]
int ipmi_fwum_main(struct ipmi_intf *, int, char **);
typedef enum eKFWUM_BoardList
{
KFWUM_BOARD_KONTRON_UNKNOWN = 0,
KFWUM_BOARD_KONTRON_5002 = 5002,
} tKFWUM_BoardList;
typedef struct sKFWUM_BoardInfo
{
tKFWUM_BoardList boardId;
IPMI_OEM iana;
} tKFWUM_BoardInfo;
typedef enum eKFWUM_DownloadType
{
KFWUM_DOWNLOAD_TYPE_ADDRESS = 0,
KFWUM_DOWNLOAD_TYPE_SEQUENCE,
} tKFWUM_DownloadType;
typedef enum eKFWUM_DownloadBuffferType
{
KFWUM_SMALL_BUFFER_TYPE = 0,
KFUMW_BIG_BUFFER_TYPE
} tKFWUM_DownloadBuffferType;
typedef struct sKFWUM_InFirmwareInfo
{
unsigned long fileSize;
unsigned short checksum;
unsigned short sumToRemoveFromChecksum;
/* Since the checksum is added in the bin
* after the checksum is calculated, we
* need to remove the each byte value. This
* byte will contain the addition of both bytes
*/
tKFWUM_BoardList boardId;
unsigned char deviceId;
unsigned char tableVers;
unsigned char implRev;
unsigned char versMajor;
unsigned char versMinor;
unsigned char versSubMinor;
unsigned char sdrRev;
IPMI_OEM iana;
} tKFWUM_InFirmwareInfo;
typedef struct sKFWUM_SaveFirmwareInfo
{
tKFWUM_DownloadType downloadType;
unsigned char bufferSize;
unsigned char overheadSize;
} tKFWUM_SaveFirmwareInfo;
/* COMMANDS */
# ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
# endif
struct KfwumGetInfoResp {
unsigned char protocolRevision;
unsigned char controllerDeviceId;
struct {
unsigned char mode:1;
unsigned char seqAdd:1;
unsigned char res : 6;
} byte;
unsigned char firmRev1;
unsigned char firmRev2;
unsigned char numBank;
} ATTRIBUTE_PACKING;
# ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
# endif
# ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
# endif
struct KfwumGetStatusResp {
unsigned char bankState;
unsigned char firmLengthLSB;
unsigned char firmLengthMid;
unsigned char firmLengthMSB;
unsigned char firmRev1;
unsigned char firmRev2;
unsigned char firmRev3;
} ATTRIBUTE_PACKING;
# ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
# endif
# ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
# endif
struct KfwumManualRollbackReq {
unsigned char type;
} ATTRIBUTE_PACKING;
# ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
# endif
# ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
# endif
struct KfwumStartFirmwareDownloadReq {
unsigned char lengthLSB;
unsigned char lengthMid;
unsigned char lengthMSB;
unsigned char paddingLSB;
unsigned char paddingMSB;
unsigned char useSequence;
} ATTRIBUTE_PACKING;
# ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
# endif
# ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
# endif
struct KfwumStartFirmwareDownloadResp {
unsigned char bank;
} ATTRIBUTE_PACKING;
# ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
# endif
# ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
# endif
struct KfwumSaveFirmwareAddressReq
{
unsigned char addressLSB;
unsigned char addressMid;
unsigned char addressMSB;
unsigned char numBytes;
unsigned char txBuf[KFWUM_SMALL_BUFFER-KFWUM_OLD_CMD_OVERHEAD];
} ATTRIBUTE_PACKING;
# ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
# endif
# ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
# endif
struct KfwumSaveFirmwareSequenceReq
{
unsigned char sequenceNumber;
unsigned char txBuf[KFWUM_BIG_BUFFER];
} ATTRIBUTE_PACKING;
# ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
# endif
# ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
# endif
struct KfwumFinishFirmwareDownloadReq {
unsigned char versionMaj;
unsigned char versionMinSub;
unsigned char versionSdr;
unsigned char reserved;
} ATTRIBUTE_PACKING;
# ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
# endif
#endif /* IPMI_KFWUM_H */

View File

@ -0,0 +1,48 @@
/*
* Copyright (c) 2003 Kontron Canada, 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_GENDEV_H
#define IPMI_GENDEV_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <inttypes.h>
#include <math.h>
#include <ipmitool/bswap.h>
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_entity.h>
int ipmi_gendev_main(struct ipmi_intf *, int, char **);
#endif /* IPMI_GENDEV_H */

View File

@ -0,0 +1,809 @@
/*
* 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 **);
/* Agent version */
#define HPMFWUPG_VERSION_MAJOR 1
#define HPMFWUPG_VERSION_MINOR 0
#define HPMFWUPG_VERSION_SUBMINOR 9
/* HPM.1 FIRMWARE UPGRADE COMMANDS (part of PICMG) */
#define HPMFWUPG_GET_TARGET_UPG_CAPABILITIES 0x2E
#define HPMFWUPG_GET_COMPONENT_PROPERTIES 0x2F
#define HPMFWUPG_ABORT_UPGRADE 0x30
#define HPMFWUPG_INITIATE_UPGRADE_ACTION 0x31
#define HPMFWUPG_UPLOAD_FIRMWARE_BLOCK 0x32
#define HPMFWUPG_FINISH_FIRMWARE_UPLOAD 0x33
#define HPMFWUPG_GET_UPGRADE_STATUS 0x34
#define HPMFWUPG_ACTIVATE_FIRMWARE 0x35
#define HPMFWUPG_QUERY_SELFTEST_RESULT 0x36
#define HPMFWUPG_QUERY_ROLLBACK_STATUS 0x37
#define HPMFWUPG_MANUAL_FIRMWARE_ROLLBACK 0x38
/* HPM.1 SPECIFIC COMPLETION CODES */
#define HPMFWUPG_ROLLBACK_COMPLETED 0x00
#define HPMFWUPG_COMMAND_IN_PROGRESS 0x80
#define HPMFWUPG_NOT_SUPPORTED 0x81
#define HPMFWUPG_SIZE_MISMATCH 0x81
#define HPMFWUPG_ROLLBACK_FAILURE 0x81
#define HPMFWUPG_INV_COMP_MASK 0x81
#define HPMFWUPG__ABORT_FAILURE 0x81
#define HPMFWUPG_INV_COMP_ID 0x82
#define HPMFWUPG_INT_CHECKSUM_ERROR 0x82
#define HPMFWUPG_INV_UPLOAD_MODE 0x82
#define HPMFWUPG_ROLLBACK_OVERRIDE 0x82
#define HPMFWUPG_INV_COMP_PROP 0x83
#define HPMFWUPG_FW_MISMATCH 0x83
#define HPMFWUPG_ROLLBACK_DENIED 0x83
/*
* This error code is used as a temporary PATCH to
* the latest Open ipmi driver. This PATCH
* will be removed once a new Open IPMI driver is released.
* (Buggy version = 39)
*/
#define ENABLE_OPENIPMI_V39_PATCH
#ifdef ENABLE_OPENIPMI_V39_PATCH
# define RETRY_COUNT_MAX 3
static int errorCount;
# define HPMFWUPG_IS_RETRYABLE(error) \
((((error==0x83)||(error==0x82)||(error==0x80)) && (errorCount++<RETRY_COUNT_MAX))?TRUE:FALSE)
#else
# define HPMFWUPG_IS_RETRYABLE(error) FALSE
#endif
/* HPM FIRMWARE UPGRADE GENERAL DEFINITIONS */
#define HPMFWUPG_PICMG_IDENTIFIER 0
#define HPMFWUPG_VERSION_SIZE 6
#define HPMFWUPG_DESC_STRING_LENGTH 12
#define HPMFWUPG_DEFAULT_INACCESS_TIMEOUT 60 /* sec */
#define HPMFWUPG_DEFAULT_UPGRADE_TIMEOUT 60 /* sec */
#define HPMFWUPG_MD5_SIGNATURE_LENGTH 16
/* Component IDs */
typedef enum eHpmfwupgComponentId {
HPMFWUPG_COMPONENT_ID_0 = 0,
HPMFWUPG_COMPONENT_ID_1,
HPMFWUPG_COMPONENT_ID_2,
HPMFWUPG_COMPONENT_ID_3,
HPMFWUPG_COMPONENT_ID_4,
HPMFWUPG_COMPONENT_ID_5,
HPMFWUPG_COMPONENT_ID_6,
HPMFWUPG_COMPONENT_ID_7,
HPMFWUPG_COMPONENT_ID_MAX
} tHpmfwupgComponentId;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgComponentBitMask {
union {
unsigned char byte;
struct {
#ifdef WORDS_BIGENDIAN
unsigned char component7 : 1;
unsigned char component6 : 1;
unsigned char component5 : 1;
unsigned char component4 : 1;
unsigned char component3 : 1;
unsigned char component2 : 1;
unsigned char component1 : 1;
unsigned char component0 : 1;
#else
unsigned char component0 : 1;
unsigned char component1 : 1;
unsigned char component2 : 1;
unsigned char component3 : 1;
unsigned char component4 : 1;
unsigned char component5 : 1;
unsigned char component6 : 1;
unsigned char component7 : 1;
#endif
} ATTRIBUTE_PACKING bitField;
} ATTRIBUTE_PACKING ComponentBits;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
static const int HPMFWUPG_SUCCESS = 0;
static const int HPMFWUPG_ERROR = -1;
/* Upload firmware specific error codes */
static const int HPMFWUPG_UPLOAD_BLOCK_LENGTH = 1;
static const int HPMFWUPG_UPLOAD_RETRY = 2;
/* TARGET UPGRADE CAPABILITIES DEFINITIONS */
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetTargetUpgCapabilitiesReq {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetTargetUpgCapabilitiesResp {
unsigned char picmgId;
unsigned char hpmVersion;
union {
unsigned char byte;
struct {
#if WORDS_BIGENDIAN
unsigned char fwUpgUndesirable : 1;
unsigned char autRollbackOverride : 1;
unsigned char ipmcDegradedDurinUpg: 1;
unsigned char deferActivation : 1;
unsigned char servAffectDuringUpg : 1;
unsigned char manualRollback : 1;
unsigned char autRollback : 1;
unsigned char ipmcSelftestCap : 1;
#else
unsigned char ipmcSelftestCap : 1;
unsigned char autRollback : 1;
unsigned char manualRollback : 1;
unsigned char servAffectDuringUpg : 1;
unsigned char deferActivation : 1;
unsigned char ipmcDegradedDurinUpg: 1;
unsigned char autRollbackOverride : 1;
unsigned char fwUpgUndesirable : 1;
#endif
} ATTRIBUTE_PACKING bitField;
} ATTRIBUTE_PACKING GlobalCapabilities;
unsigned char upgradeTimeout;
unsigned char selftestTimeout;
unsigned char rollbackTimeout;
unsigned char inaccessTimeout;
struct HpmfwupgComponentBitMask componentsPresent;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetTargetUpgCapabilitiesCtx {
struct HpmfwupgGetTargetUpgCapabilitiesReq req;
struct HpmfwupgGetTargetUpgCapabilitiesResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* COMPONENT PROPERTIES DEFINITIONS */
typedef enum eHpmfwupgCompPropertiesSelect {
HPMFWUPG_COMP_GEN_PROPERTIES = 0,
HPMFWUPG_COMP_CURRENT_VERSION,
HPMFWUPG_COMP_DESCRIPTION_STRING,
HPMFWUPG_COMP_ROLLBACK_FIRMWARE_VERSION,
HPMFWUPG_COMP_DEFERRED_FIRMWARE_VERSION,
HPMFWUPG_COMP_RESERVED,
HPMFWUPG_COMP_OEM_PROPERTIES = 192
} tHpmfwupgCompPropertiesSelect;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetComponentPropertiesReq {
unsigned char picmgId;
unsigned char componentId;
unsigned char selector;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetGeneralPropResp {
unsigned char picmgId;
union {
unsigned char byte;
struct {
#if WORDS_BIGENDIAN
unsigned char reserved : 2;
unsigned char payloadColdReset : 1;
unsigned char deferredActivation : 1;
unsigned char comparisonSupport : 1;
unsigned char preparationSupport : 1;
unsigned char rollbackBackup : 2;
#else
unsigned char rollbackBackup : 2;
unsigned char preparationSupport : 1;
unsigned char comparisonSupport : 1;
unsigned char deferredActivation : 1;
unsigned char payloadColdReset : 1;
unsigned char reserved : 2;
#endif
} ATTRIBUTE_PACKING bitfield;
} ATTRIBUTE_PACKING GeneralCompProperties;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetCurrentVersionResp {
unsigned char picmgId;
unsigned char currentVersion[HPMFWUPG_VERSION_SIZE];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetDescStringResp {
unsigned char picmgId;
char descString[HPMFWUPG_DESC_STRING_LENGTH];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetRollbackFwVersionResp {
unsigned char picmgId;
unsigned char rollbackFwVersion[HPMFWUPG_VERSION_SIZE];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetDeferredFwVersionResp {
unsigned char picmgId;
unsigned char deferredFwVersion[HPMFWUPG_VERSION_SIZE];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* GetComponentProperties - OEM properties (192) */
#define HPMFWUPG_OEM_LENGTH 4
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetOemProperties {
unsigned char picmgId;
unsigned char oemRspData[HPMFWUPG_OEM_LENGTH];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetComponentPropertiesResp {
union {
struct HpmfwupgGetGeneralPropResp generalPropResp;
struct HpmfwupgGetCurrentVersionResp currentVersionResp;
struct HpmfwupgGetDescStringResp descStringResp;
struct HpmfwupgGetRollbackFwVersionResp rollbackFwVersionResp;
struct HpmfwupgGetDeferredFwVersionResp deferredFwVersionResp;
struct HpmfwupgGetOemProperties oemProperties;
} ATTRIBUTE_PACKING Response;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetComponentPropertiesCtx {
struct HpmfwupgGetComponentPropertiesReq req;
struct HpmfwupgGetComponentPropertiesResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* ABORT UPGRADE DEFINITIONS */
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgAbortUpgradeReq {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgAbortUpgradeResp {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgAbortUpgradeCtx {
struct HpmfwupgAbortUpgradeReq req;
struct HpmfwupgAbortUpgradeResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* UPGRADE ACTIONS DEFINITIONS */
typedef enum eHpmfwupgUpgradeAction {
HPMFWUPG_UPGRADE_ACTION_BACKUP = 0,
HPMFWUPG_UPGRADE_ACTION_PREPARE,
HPMFWUPG_UPGRADE_ACTION_UPGRADE,
HPMFWUPG_UPGRADE_ACTION_COMPARE,
HPMFWUPG_UPGRADE_ACTION_INVALID = 0xff
} tHpmfwupgUpgradeAction;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgInitiateUpgradeActionReq {
unsigned char picmgId;
struct HpmfwupgComponentBitMask componentsMask;
unsigned char upgradeAction;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgInitiateUpgradeActionResp {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgInitiateUpgradeActionCtx {
struct HpmfwupgInitiateUpgradeActionReq req;
struct HpmfwupgInitiateUpgradeActionResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* UPLOAD FIRMWARE BLOCK DEFINITIONS */
#define HPMFWUPG_SEND_DATA_COUNT_KCS 30
#define HPMFWUPG_SEND_DATA_COUNT_LAN 25
#define HPMFWUPG_SEND_DATA_COUNT_IPMB 26
#define HPMFWUPG_SEND_DATA_COUNT_IPMBL 26
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgUploadFirmwareBlockReq {
unsigned char picmgId;
unsigned char blockNumber;
unsigned char data[];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgUploadFirmwareBlockResp {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgUploadFirmwareBlockCtx {
struct HpmfwupgUploadFirmwareBlockReq * req;
struct HpmfwupgUploadFirmwareBlockResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* FINISH FIRMWARE UPLOAD DEFINITIONS */
#define HPMFWUPG_IMAGE_SIZE_BYTE_COUNT 4
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgFinishFirmwareUploadReq {
unsigned char picmgId;
unsigned char componentId;
unsigned char imageLength[HPMFWUPG_IMAGE_SIZE_BYTE_COUNT];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgFinishFirmwareUploadResp {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgFinishFirmwareUploadCtx {
struct HpmfwupgFinishFirmwareUploadReq req;
struct HpmfwupgFinishFirmwareUploadResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* ACTIVATE FW DEFINITIONS */
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgActivateFirmwareReq {
unsigned char picmgId;
unsigned char rollback_override;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgActivateFirmwareResp {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgActivateFirmwareCtx {
struct HpmfwupgActivateFirmwareReq req;
struct HpmfwupgActivateFirmwareResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* GET UPGRADE STATUS DEFINITIONS */
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetUpgradeStatusReq {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetUpgradeStatusResp {
unsigned char picmgId;
unsigned char cmdInProcess;
unsigned char lastCmdCompCode;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgGetUpgradeStatusCtx {
struct HpmfwupgGetUpgradeStatusReq req;
struct HpmfwupgGetUpgradeStatusResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* MANUAL FW ROLLBACK DEFINITIONS */
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgManualFirmwareRollbackReq {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgManualFirmwareRollbackResp {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
struct HpmfwupgManualFirmwareRollbackCtx {
struct HpmfwupgManualFirmwareRollbackReq req;
struct HpmfwupgManualFirmwareRollbackResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* QUERY ROLLBACK STATUS DEFINITIONS */
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgQueryRollbackStatusReq {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgQueryRollbackStatusResp {
unsigned char picmgId;
struct HpmfwupgComponentBitMask rollbackComp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgQueryRollbackStatusCtx {
struct HpmfwupgQueryRollbackStatusReq req;
struct HpmfwupgQueryRollbackStatusResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* QUERY SELF TEST RESULT DEFINITIONS */
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgQuerySelftestResultReq {
unsigned char picmgId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgQuerySelftestResultResp {
unsigned char picmgId;
unsigned char result1;
unsigned char result2;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgQuerySelftestResultCtx {
struct HpmfwupgQuerySelftestResultReq req;
struct HpmfwupgQuerySelftestResultResp resp;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
/* HPM.1 IMAGE DEFINITIONS */
#define HPMFWUPG_HEADER_SIGNATURE_LENGTH 8
#define HPMFWUPG_MANUFATURER_ID_LENGTH 3
#define HPMFWUPG_PRODUCT_ID_LENGTH 2
#define HPMFWUPG_TIME_LENGTH 4
#define HPMFWUPG_TIMEOUT_LENGTH 1
#define HPMFWUPG_COMP_REVISION_LENGTH 2
#define HPMFWUPG_FIRM_REVISION_LENGTH 6
#define HPMFWUPG_IMAGE_HEADER_VERSION 0
#define HPMFWUPG_IMAGE_SIGNATURE "PICMGFWU"
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct HpmfwupgImageHeader {
char signature[HPMFWUPG_HEADER_SIGNATURE_LENGTH];
unsigned char formatVersion;
unsigned char deviceId;
unsigned char manId[HPMFWUPG_MANUFATURER_ID_LENGTH];
unsigned char prodId[HPMFWUPG_PRODUCT_ID_LENGTH];
unsigned char time[HPMFWUPG_TIME_LENGTH];
union {
struct {
#if WORDS_BIGENDIAN
unsigned char imageSelfTest : 1;
unsigned char autRollback : 1;
unsigned char manRollback : 1;
unsigned char servAffected : 1;
unsigned char reserved : 4;
#else
unsigned char reserved : 4;
unsigned char servAffected : 1;
unsigned char manRollback : 1;
unsigned char autRollback : 1;
unsigned char imageSelfTest : 1;
#endif
} ATTRIBUTE_PACKING bitField;
unsigned char byte;
}ATTRIBUTE_PACKING imageCapabilities;
struct HpmfwupgComponentBitMask components;
unsigned char selfTestTimeout;
unsigned char rollbackTimeout;
unsigned char inaccessTimeout;
unsigned char compRevision[HPMFWUPG_COMP_REVISION_LENGTH];
unsigned char firmRevision[HPMFWUPG_FIRM_REVISION_LENGTH];
unsigned short oemDataLength;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#define HPMFWUPG_DESCRIPTION_LENGTH 21
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgActionRecord {
unsigned char actionType;
struct HpmfwupgComponentBitMask components;
unsigned char checksum;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#define HPMFWUPG_FIRMWARE_SIZE_LENGTH 4
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgFirmwareImage {
unsigned char version[HPMFWUPG_FIRM_REVISION_LENGTH];
char desc[HPMFWUPG_DESCRIPTION_LENGTH];
unsigned char length[HPMFWUPG_FIRMWARE_SIZE_LENGTH];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
# pragma pack(1)
#endif
struct HpmfwupgUpgradeCtx {
struct HpmfwupgComponentBitMask compUpdateMask;
unsigned int imageSize;
unsigned char* pImageData;
unsigned char componentId;
struct HpmfwupgGetTargetUpgCapabilitiesResp targetCap;
struct HpmfwupgGetGeneralPropResp genCompProp[HPMFWUPG_COMPONENT_ID_MAX];
struct ipm_devid_rsp devId;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
# pragma pack(0)
#endif
typedef enum eHpmfwupgActionType {
HPMFWUPG_ACTION_BACKUP_COMPONENTS = 0,
HPMFWUPG_ACTION_PREPARE_COMPONENTS,
HPMFWUPG_ACTION_UPLOAD_FIRMWARE,
HPMFWUPG_ACTION_RESERVED = 0xFF
} tHpmfwupgActionType;
/* FUNCTIONS PROTOTYPES */
#define HPMFWUPG_MAJORMINOR_VERSION_SIZE 2
/* Options added for user to check the version and to view both the FILE and
* TARGET Version
*/
#define VIEW_MODE 0x01
#define DEBUG_MODE 0x02
#define FORCE_MODE 0x04
#define COMPARE_MODE 0x08
typedef struct _VERSIONINFO {
unsigned char componentId;
unsigned char targetMajor;
unsigned char targetMinor;
unsigned char targetAux[4];
unsigned char rollbackMajor;
unsigned char rollbackMinor;
unsigned char rollbackAux[4];
unsigned char deferredMajor;
unsigned char deferredMinor;
unsigned char deferredAux[4];
unsigned char imageMajor;
unsigned char imageMinor;
unsigned char imageAux[4];
unsigned char coldResetRequired;
unsigned char rollbackSupported;
unsigned char deferredActivationSupported;
char descString[HPMFWUPG_DESC_STRING_LENGTH + 1];
}VERSIONINFO, *PVERSIONINFO;
VERSIONINFO gVersionInfo[HPMFWUPG_COMPONENT_ID_MAX];
#define TARGET_VER (0x01)
#define ROLLBACK_VER (0x02)
#define IMAGE_VER (0x04)
#endif /* IPMI_KFWUM_H */

View File

@ -1,21 +1,24 @@
/*
* Copyright (c) 2007 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
@ -28,38 +31,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.
*/
#ifndef IPMI_HELPER_H
#define IPMI_HELPER_H
#ifndef IPMI_IME_H
#define IPMI_IME_H
#include <sys/types.h>
#include <inttypes.h>
#include <stdio.h>
#include <ipmitool/ipmi.h>
struct valstr {
uint16_t val;
const char * str;
};
const char * val2str(uint16_t val, const struct valstr * vs);
uint16_t str2val(const char * str, const struct valstr * vs);
uint16_t buf2short(uint8_t * buf);
uint32_t buf2long(uint8_t * buf);
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);
int ipmi_ime_main(struct ipmi_intf *, int, char **);
#define ipmi_open_file_read(file) ipmi_open_file(file, 0)
#define ipmi_open_file_write(file) ipmi_open_file(file, 1)
#ifndef __min
# define __min(a, b) ((a) < (b) ? (a) : (b))
#endif
#endif /* IPMI_HELPER_H */
#endif /* IPMI_IME_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
@ -63,39 +59,81 @@ enum LANPLUS_SESSION_STATE {
#define IPMI_AUTHCODE_BUFFER_SIZE 20
#define IPMI_SIK_BUFFER_SIZE 20
#define IPMI_SIK_BUFFER_SIZE IPMI_MAX_MD_SIZE
#define IPMI_KG_BUFFER_SIZE 21 /* key plus null byte */
struct ipmi_session {
uint8_t hostname[64];
uint8_t username[16];
uint8_t authcode[IPMI_AUTHCODE_BUFFER_SIZE + 1];
uint8_t challenge[16];
uint8_t authtype;
enum cipher_suite_ids {
IPMI_LANPLUS_CIPHER_SUITE_0 = 0,
IPMI_LANPLUS_CIPHER_SUITE_1 = 1,
IPMI_LANPLUS_CIPHER_SUITE_2 = 2,
IPMI_LANPLUS_CIPHER_SUITE_3 = 3,
IPMI_LANPLUS_CIPHER_SUITE_4 = 4,
IPMI_LANPLUS_CIPHER_SUITE_5 = 5,
IPMI_LANPLUS_CIPHER_SUITE_6 = 6,
IPMI_LANPLUS_CIPHER_SUITE_7 = 7,
IPMI_LANPLUS_CIPHER_SUITE_8 = 8,
IPMI_LANPLUS_CIPHER_SUITE_9 = 9,
IPMI_LANPLUS_CIPHER_SUITE_10 = 10,
IPMI_LANPLUS_CIPHER_SUITE_11 = 11,
IPMI_LANPLUS_CIPHER_SUITE_12 = 12,
IPMI_LANPLUS_CIPHER_SUITE_13 = 13,
IPMI_LANPLUS_CIPHER_SUITE_14 = 14,
#ifdef HAVE_CRYPTO_SHA256
IPMI_LANPLUS_CIPHER_SUITE_15 = 15,
IPMI_LANPLUS_CIPHER_SUITE_16 = 16,
IPMI_LANPLUS_CIPHER_SUITE_17 = 17,
#endif /* HAVE_CRYPTO_SHA256 */
IPMI_LANPLUS_CIPHER_SUITE_RESERVED = 0xff,
};
struct cipher_suite_info {
enum cipher_suite_ids cipher_suite_id;
uint8_t auth_alg;
uint8_t integrity_alg;
uint8_t crypt_alg;
uint32_t iana;
};
struct ipmi_session_params {
char * hostname;
uint8_t username[17];
uint8_t authcode_set[IPMI_AUTHCODE_BUFFER_SIZE + 1];
uint8_t authtype_set;
uint8_t privlvl;
enum cipher_suite_ids cipher_suite_id;
char sol_escape_char;
int password;
int port;
int retry;
uint32_t timeout;
uint8_t kg[IPMI_KG_BUFFER_SIZE]; /* BMC key */
uint8_t lookupbit;
};
#define IPMI_AUTHSTATUS_PER_MSG_DISABLED 0x10
#define IPMI_AUTHSTATUS_PER_USER_DISABLED 0x08
#define IPMI_AUTHSTATUS_NONNULL_USERS_ENABLED 0x04
#define IPMI_AUTHSTATUS_NULL_USERS_ENABLED 0x02
#define IPMI_AUTHSTATUS_ANONYMOUS_USERS_ENABLED 0x01
uint8_t authstatus;
uint8_t authextra;
uint8_t privlvl;
uint8_t cipher_suite_id;
int password;
int port;
int active;
struct ipmi_session {
int active;
uint32_t session_id;
uint32_t in_seq;
uint32_t out_seq;
uint8_t authcode[IPMI_AUTHCODE_BUFFER_SIZE + 1];
uint8_t challenge[16];
uint8_t authtype;
uint8_t authstatus;
uint8_t authextra;
uint32_t timeout;
struct sockaddr_in addr;
struct sockaddr_storage addr;
socklen_t addrlen;
/*
* This struct holds state data specific to IMPI v2 / RMCP+ sessions
* This struct holds state data specific to IPMI v2 / RMCP+ sessions
*/
struct {
enum LANPLUS_SESSION_STATE session_state;
@ -113,7 +151,7 @@ struct ipmi_session {
uint32_t bmc_id;
/*
* Values required for RAKP mesages
* Values required for RAKP messages
*/
/* Random number generated byt the console */
@ -125,10 +163,13 @@ struct ipmi_session {
uint8_t requested_role; /* As sent in the RAKP 1 message */
uint8_t rakp2_return_code;
uint8_t sik[IPMI_SIK_BUFFER_SIZE]; /* Session integrity key */
uint8_t kg[IPMI_KG_BUFFER_SIZE]; /* BMC key */
uint8_t k1[20]; /* Used for Integrity checking? */
uint8_t k2[20]; /* First 16 bytes used for AES */
uint8_t sik[IPMI_SIK_BUFFER_SIZE]; /* Session integrity key */
uint8_t sik_len; /* Session Integrity key length */
uint8_t kg[IPMI_KG_BUFFER_SIZE]; /* BMC key */
uint8_t k1[IPMI_MAX_MD_SIZE]; /* Used for Integrity checking? */
uint8_t k1_len; /* K1 key length */
uint8_t k2[IPMI_MAX_MD_SIZE]; /* First 16 bytes used for AES */
uint8_t k2_len; /* K2 key length */
} v2_data;
@ -148,38 +189,80 @@ struct ipmi_session {
} sol_data;
};
struct ipmi_cmd {
int (*func)(struct ipmi_intf * intf, int argc, char ** argv);
const char * name;
const char * desc;
};
struct ipmi_intf_support {
const char * name;
int supported;
};
struct ipmi_intf {
char name[16];
char desc[128];
char *devfile;
int fd;
int opened;
int abort;
int noanswer;
int picmg_avail;
int vita_avail;
IPMI_OEM manufacturer_id;
int ai_family;
struct ipmi_session_params ssn_params;
struct ipmi_session * session;
struct ipmi_oem_handle * oem;
struct ipmi_cmd * cmdlist;
uint8_t target_ipmb_addr;
uint32_t my_addr;
uint32_t target_addr;
uint8_t target_lun;
uint8_t target_channel;
uint32_t transit_addr;
uint8_t transit_channel;
uint16_t max_request_data_size;
uint16_t max_response_data_size;
uint8_t devnum;
int (*setup)(struct ipmi_intf * intf);
int (*open)(struct ipmi_intf * intf);
void (*close)(struct ipmi_intf * intf);
struct ipmi_rs *(*sendrecv)(struct ipmi_intf * intf, struct ipmi_rq * req);
int (*sendrsp)(struct ipmi_intf * intf, struct ipmi_rs * rsp);
struct ipmi_rs *(*recv_sol)(struct ipmi_intf * intf);
struct ipmi_rs *(*send_sol)(struct ipmi_intf * intf, struct ipmi_v2_payload * payload);
int (*keepalive)(struct ipmi_intf * intf);
int (*set_my_addr)(struct ipmi_intf * intf, uint8_t addr);
void (*set_max_request_data_size)(struct ipmi_intf * intf, uint16_t size);
void (*set_max_response_data_size)(struct ipmi_intf * intf, uint16_t size);
};
struct ipmi_intf * ipmi_intf_load(char * name);
void ipmi_intf_print(void);
void ipmi_intf_print(struct ipmi_intf_support * intflist);
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_cipher_suite_id(struct ipmi_intf * intf, uint8_t cipher_suite_id);
void ipmi_intf_session_set_lookupbit(struct ipmi_intf * intf, uint8_t lookupbit);
#ifdef IPMI_INTF_LANPLUS
void ipmi_intf_session_set_cipher_suite_id(struct ipmi_intf * intf,
enum cipher_suite_ids cipher_suite_id);
#endif /* IPMI_INTF_LANPLUS */
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, const uint8_t *kgkey);
void ipmi_intf_session_set_port(struct ipmi_intf * intf, int port);
void ipmi_intf_session_set_authtype(struct ipmi_intf * intf, uint8_t authtype);
void ipmi_intf_session_set_timeout(struct ipmi_intf * intf, uint32_t timeout);
void ipmi_intf_session_set_retry(struct ipmi_intf * intf, int retry);
void ipmi_intf_session_cleanup(struct ipmi_intf *intf);
void ipmi_cleanup(struct ipmi_intf * intf);
#if defined(IPMI_INTF_LAN) || defined (IPMI_INTF_LANPLUS)
int ipmi_intf_socket_connect(struct ipmi_intf * intf);
#endif
#endif /* IPMI_INTF_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_ISOL_H
@ -45,15 +41,16 @@
#define ISOL_ENABLE_PARAM 0x01
#define ISOL_AUTHENTICATION_PARAM 0x02
#define ISOL_ENABLE_FLAG 0x01
#define ISOL_PRIVILEGE_LEVEL_USER 0x02
#define ISOL_BAUD_RATE_PARAM 0x05
#define ISOL_BAUD_RATE_9600 0x06
#define ISOL_BAUD_RATE_19200 0x07
#define ISOL_BAUD_RATE_38400 0x08
#define ISOL_BAUD_RATE_57600 0x09
#define ISOL_BAUD_RATE_115200 0x0A
#define ISOL_PREFERRED_BAUD_RATE 0x07
#define ISOL_PREFERRED_BAUD_RATE 0x07
struct isol_config_parameters {
uint8_t enabled;
uint8_t privilege_level;
uint8_t bit_rate;
};
int ipmi_isol_main(struct ipmi_intf *, int, char **);

View File

@ -0,0 +1,46 @@
/*
* 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 **);
int ipmi_kontronoem_set_large_buffer(struct ipmi_intf *, unsigned char size);
#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
@ -46,7 +42,7 @@
# define IPMI_LAN_SUSPEND_ARP_GRAT (1)
#define IPMI_LAN_GET_STAT 0x04
#define IPMI_CHANNEL_NUMBER_MAX 0xd
#define IPMI_CHANNEL_NUMBER_MAX 0xe
#define IPMI_LANP_TIMEOUT 3
#define IPMI_LANP_RETRIES 10
@ -54,6 +50,13 @@
#define IPMI_LANP_WRITE_LOCK 1
#define IPMI_LANP_WRITE_COMMIT 2
#define IPMI_LANP_VLAN_ID_MAX 4094
#define IPMI_LANP_VLAN_ID_MIN 1
#define IPMI_LANP_VLAN_DISABLE 0 /* ID 0 = VLAN is disabled for the channel */
#define IPMI_LANP_IS_VLAN_VALID(x) \
((x) >= IPMI_LANP_VLAN_ID_MIN && (x) <= IPMI_LANP_VLAN_ID_MAX)
enum {
IPMI_LANP_SET_IN_PROGRESS,
IPMI_LANP_AUTH_TYPE,
@ -80,6 +83,39 @@ enum {
IPMI_LANP_RMCP_CIPHER_SUPPORT,
IPMI_LANP_RMCP_CIPHERS,
IPMI_LANP_RMCP_PRIV_LEVELS,
IPMI_LANP_VLAN_TAGS,
IPMI_LANP_BAD_PASS_THRESH,
IPMI_LANP_IP6_SUPPORT=50,
IPMI_LANP_IP6_ENABLES,
IPMI_LANP_IP6_TRAFFIC_CLASS,
IPMI_LANP_IP6_STATIC_HOPS,
IPMI_LANP_IP6_FLOW_LABEL,
IPMI_LANP_IP6_STATUS,
IPMI_LANP_IP6_STATIC_ADDR,
IPMI_LANP_IP6_STATIC_DUID_STG,
IPMI_LANP_IP6_STATIC_DUID,
IPMI_LANP_IP6_DYNAMIC_ADDR,
IPMI_LANP_IP6_DYNAMIC_DUID_STG,
IPMI_LANP_IP6_DYNAMIC_DUID,
IPMI_LANP_IP6_DHCP6_CFG_SUP,
IPMI_LANP_IP6_DHCP6_CFG,
IPMI_LANP_IP6_ROUTER_CFG,
IPMI_LANP_IP6_STATIC_RTR1_ADDR,
IPMI_LANP_IP6_STATIC_RTR1_MAC,
IPMI_LANP_IP6_STATIC_RTR1_PFX_LEN,
IPMI_LANP_IP6_STATIC_RTR1_PFX,
IPMI_LANP_IP6_STATIC_RTR2_ADDR,
IPMI_LANP_IP6_STATIC_RTR2_MAC,
IPMI_LANP_IP6_STATIC_RTR2_PFX_LEN,
IPMI_LANP_IP6_STATIC_RTR2_PFX,
IPMI_LANP_IP6_NUM_DYNAMIC_RTRS,
IPMI_LANP_IP6_DYNAMIC_RTR_ADDR,
IPMI_LANP_IP6_DYNAMIC_RTR_MAC,
IPMI_LANP_IP6_DYNAMIC_RTR_PFX_LEN,
IPMI_LANP_IP6_DYNAMIC_RTR_PFX,
IPMI_LANP_IP6_DYNAMIC_HOPS,
IPMI_LANP_IP6_NDSLAAC_CFG_SUP,
IPMI_LANP_IP6_NDSLAAC_CFG,
IPMI_LANP_OEM_ALERT_STRING=96,
IPMI_LANP_ALERT_RETRY=97,
IPMI_LANP_UTC_OFFSET=98,
@ -89,48 +125,8 @@ enum {
IPMI_LANP_CHAN_ACCESS_MODE=201,
};
static struct lan_param {
int cmd;
int size;
char desc[24];
uint8_t * data;
int data_len;
} ipmi_lan_params[] __attribute__((unused)) = {
{ IPMI_LANP_SET_IN_PROGRESS, 1, "Set in Progress" },
{ IPMI_LANP_AUTH_TYPE, 1, "Auth Type Support" },
{ IPMI_LANP_AUTH_TYPE_ENABLE, 5, "Auth Type Enable" },
{ IPMI_LANP_IP_ADDR, 4, "IP Address" },
{ IPMI_LANP_IP_ADDR_SRC, 1, "IP Address Source" },
{ IPMI_LANP_MAC_ADDR, 6, "MAC Address" }, /* 5 */
{ IPMI_LANP_SUBNET_MASK, 4, "Subnet Mask" },
{ IPMI_LANP_IP_HEADER, 3, "IP Header" },
{ IPMI_LANP_PRI_RMCP_PORT, 2, "Primary RMCP Port" },
{ IPMI_LANP_SEC_RMCP_PORT, 2, "Secondary RMCP Port" },
{ IPMI_LANP_BMC_ARP, 1, "BMC ARP Control" }, /* 10 */
{ IPMI_LANP_GRAT_ARP, 1, "Gratituous ARP Intrvl" },
{ IPMI_LANP_DEF_GATEWAY_IP, 4, "Default Gateway IP" },
{ IPMI_LANP_DEF_GATEWAY_MAC, 6, "Default Gateway MAC" },
{ IPMI_LANP_BAK_GATEWAY_IP, 4, "Backup Gateway IP" },
{ IPMI_LANP_BAK_GATEWAY_MAC, 6, "Backup Gateway MAC" }, /* 15 */
{ IPMI_LANP_SNMP_STRING, 18, "SNMP Community String" },
{ IPMI_LANP_NUM_DEST, 1, "Number of Destinations"},
{ IPMI_LANP_DEST_TYPE, 4, "Destination Type" },
{ IPMI_LANP_DEST_ADDR, 13, "Destination Addresses" },
{ IPMI_LANP_VLAN_ID, 2, "802.1q VLAN ID" }, /* 20 */
{ IPMI_LANP_VLAN_PRIORITY, 1, "802.1q VLAN Priority" },
{ IPMI_LANP_RMCP_CIPHER_SUPPORT,1, "RMCP+ Cipher Suite Count" },
{ IPMI_LANP_RMCP_CIPHERS, 16, "RMCP+ Cipher Suites" },
{ IPMI_LANP_RMCP_PRIV_LEVELS, 9, "Cipher Suite Priv Max" },
{ IPMI_LANP_OEM_ALERT_STRING, 28, "OEM Alert String" }, /* 25 */
{ IPMI_LANP_ALERT_RETRY, 1, "Alert Retry Algorithm" },
{ IPMI_LANP_UTC_OFFSET, 3, "UTC Offset" },
{ IPMI_LANP_DHCP_SERVER_IP, 4, "DHCP Server IP" },
{ IPMI_LANP_DHCP_SERVER_MAC, 6, "DHDP Server MAC" },
{ IPMI_LANP_DHCP_ENABLE, 1, "DHCP Enable" }, /* 30 */
{ IPMI_LANP_CHAN_ACCESS_MODE, 2, "Channel Access Mode" },
{ -1 }
};
int ipmi_lanp_main(struct ipmi_intf *, int, char **);
uint8_t find_lan_channel(struct ipmi_intf *intf, uint8_t start);
#endif /*IPMI_LANP_H*/

View File

@ -0,0 +1,54 @@
/*
* Copyright (c) 2016 Pentair Technical Products. All right 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 Pentair Technical Products 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* PENTAIR TECHNICAL SOLUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef IPMI_LANP6_H
#define IPMI_LANP6_H
#include <ipmitool/ipmi_intf.h>
/*
* LAN configuration parameter.
*/
struct ipmi_lanp {
int selector;
const char *name;
int size;
};
/*
* Private data for LAN configuration.
*/
struct ipmi_lanp_priv {
struct ipmi_intf *intf;
int channel;
};
#endif /* IPMI_LANP6_H */

View File

@ -0,0 +1,42 @@
/*
* 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_MAIN_H
#define IPMI_MAIN_H
#include <ipmitool/ipmi_intf.h>
int ipmi_main(int argc, char ** argv, struct ipmi_cmd * cmdlist, struct ipmi_intf_support * intflist);
void ipmi_cmd_print(struct ipmi_cmd * cmdlist);
int ipmi_cmd_run(struct ipmi_intf * intf, char * name, int argc, char ** argv);
#endif /* IPMI_MAIN_H */

329
include/ipmitool/ipmi_mc.h Normal file
View File

@ -0,0 +1,329 @@
/*
* 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_MC_H
#define IPMI_MC_H
#include <stdbool.h>
#include <ipmitool/ipmi.h>
#include <ipmitool/helper.h>
#include <ipmitool/ipmi_strings.h>
#define OEM_MFG_STRING(oem) val2str(IPM_DEV_MANUFACTURER_ID(oem),\
ipmi_oem_info)
#define OEM_PROD_STRING(oem, p) oemval2str(IPM_DEV_MANUFACTURER_ID(oem),\
ipmi16toh(p),\
ipmi_oem_product_info)
#define BMC_GET_DEVICE_ID 0x01
#define BMC_COLD_RESET 0x02
#define BMC_WARM_RESET 0x03
#define BMC_GET_SELF_TEST 0x04
#define BMC_RESET_WATCHDOG_TIMER 0x22
#define BMC_SET_WATCHDOG_TIMER 0x24
#define BMC_GET_WATCHDOG_TIMER 0x25
#define BMC_SET_GLOBAL_ENABLES 0x2e
#define BMC_GET_GLOBAL_ENABLES 0x2f
#define BMC_GET_GUID 0x37
int ipmi_mc_main(struct ipmi_intf *, int, char **);
/*
* Response data from IPM Get Device ID Command (IPMI rev 1.5, section 17.1)
* The following really apply to any IPM device, not just BMCs...
*/
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct ipm_devid_rsp {
uint8_t device_id;
uint8_t device_revision;
uint8_t fw_rev1;
uint8_t fw_rev2;
uint8_t ipmi_version;
uint8_t adtl_device_support;
uint8_t manufacturer_id[3];
uint8_t product_id[2];
uint8_t aux_fw_rev[4];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#define IPM_DEV_DEVICE_ID_SDR_MASK (0x80) /* 1 = provides SDRs */
#define IPM_DEV_DEVICE_ID_REV_MASK (0x0F) /* BCD-enoded */
#define IPM_DEV_FWREV1_AVAIL_MASK (0x80) /* 0 = normal operation */
#define IPM_DEV_FWREV1_MAJOR_MASK (0x3f) /* Major rev, BCD-encoded */
#define IPM_DEV_IPMI_VER_MAJOR_MASK (0x0F) /* Major rev, BCD-encoded */
#define IPM_DEV_IPMI_VER_MINOR_MASK (0xF0) /* Minor rev, BCD-encoded */
#define IPM_DEV_IPMI_VER_MINOR_SHIFT (4) /* Minor rev shift */
#define IPM_DEV_IPMI_VERSION_MAJOR(x) \
(x & IPM_DEV_IPMI_VER_MAJOR_MASK)
#define IPM_DEV_IPMI_VERSION_MINOR(x) \
((x & IPM_DEV_IPMI_VER_MINOR_MASK) >> IPM_DEV_IPMI_VER_MINOR_SHIFT)
#define IPM_DEV_MANUFACTURER_ID_RESERVED 0x0FFFFF
#define IPM_DEV_MANUFACTURER_ID(x) ipmi24toh(x)
#define IPM_DEV_ADTL_SUPPORT_BITS (8)
/* There are lots of BMC implementations that don't follow the IPMI
* specification for GUID encoding. Some send data encoded as in
* RFC4122, some follow SMBIOS specification. We support all users
* of those buggy implementations here.
*
* Most implementations like AMI MegaRAC do it the SMBIOS way.
* This is the legacy behavior we don't want to break yet.
* That's why the last real mode is GUID_SMBIOS. If automatic
* detection finds more than one possible candidate, and
* GUID_SMBIOS is one of them, then it will take precedence.
*
* For the same reason GUID_IPMI is right before GUID_SMBIOS.
* If both RFC4122 and IPMI encodings have a valid version
* field, then IPMI takes precedence.
*/
typedef enum {
/* Real modes, in reverse precedence order */
GUID_RFC4122,
GUID_IPMI,
GUID_SMBIOS,
GUID_REAL_MODES, /* Real mode count*/
/* Pseudo modes start here */
GUID_AUTO = GUID_REAL_MODES, /* Automatically detect mode */
GUID_DUMP, /* Just dump the data */
GUID_TOTAL_MODES
} ipmi_guid_mode_t;
#define GUID_NODE_SZ 6
#define GUID_VER_MASK 0x0F
#define GUID_VER_SHIFT 12
#define GUID_VERSION(t_hi) (((t_hi) >> GUID_VER_SHIFT) & GUID_VER_MASK)
#define GUID_TIME_HI(t_hi) ((t_hi) & ~(GUID_VER_MASK << GUID_VER_SHIFT))
typedef enum {
GUID_VERSION_UNKNOWN = 0, /* Not valid according to any specification */
/* The following are according to IPMI/SMBIOS/RFC4122 */
GUID_VERSION_TIME, /* Time-based, recommended for IPMI */
GUID_VERSION_DCE, /* DCE Security with POSIX UIDs, not for IPMI */
GUID_VERSION_MD5, /* Name-based, using MD5 */
GUID_VERSION_RND, /* Randomly generated */
GUID_VERSION_SHA1, /* Name-based, using SHA-1 */
GUID_VERSION_MAX = GUID_VERSION_SHA1, /* The maximum supported version */
GUID_VERSION_COUNT /* The number of supported versions */
} guid_version_t;
static inline bool is_guid_version_valid(guid_version_t ver)
{
return (ver > GUID_VERSION_UNKNOWN) && (ver <= GUID_VERSION_MAX);
}
/* The structure follows IPMI v2.0, rev 1.1
* See section 20.8 */
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
typedef struct {
uint8_t node[GUID_NODE_SZ]; /* Byte 0 is LSB */
union {
struct {
uint8_t clock_seq_low; /* clock sequence low field */
uint8_t clock_seq_hi_and_rsvd;/* clock sequence high field */
};
uint16_t clock_seq_and_rsvd;
};
uint16_t time_hi_and_version; /* timestamp high field and version number */
uint16_t time_mid; /* timestamp middle field */
uint32_t time_low; /* timestamp low field */
} ATTRIBUTE_PACKING ipmi_guid_t;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
/* The structure follows RFC4122 (section 4.1.2)
* and SMBIOS v3.0.0 (section 7.2.1) */
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
typedef struct {
uint32_t time_low; /* timestamp low field */
uint16_t time_mid; /* timestamp middle field */
uint16_t time_hi_and_version; /* timestamp high field and version number */
union {
struct {
uint8_t clock_seq_hi_and_rsvd;/* clock sequence high field */
uint8_t clock_seq_low; /* clock sequence low field */
};
uint16_t clock_seq_and_rsvd;
};
uint8_t node[GUID_NODE_SZ]; /* Byte 0 is MSB */
} ATTRIBUTE_PACKING rfc_guid_t;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
/* Parsed GUID structure */
typedef struct {
uint8_t node[GUID_NODE_SZ]; /* MSB first */
/* These are architecture-specific for easy output with printf() */
uint16_t clock_seq_and_rsvd;
uint64_t time_hi_and_version;
uint64_t time_mid;
uint64_t time_low;
/* These are the parsed values */
time_t time;
ipmi_guid_mode_t mode;
guid_version_t ver; /* Version from time_hi_and_version, if valid */
} parsed_guid_t;
parsed_guid_t ipmi_parse_guid(void *guid, ipmi_guid_mode_t guid_mode);
int _ipmi_mc_get_guid(struct ipmi_intf *intf, ipmi_guid_t *guid);
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct ipm_selftest_rsp {
unsigned char code;
unsigned char test;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#define IPM_SFT_CODE_OK 0x55
#define IPM_SFT_CODE_NOT_IMPLEMENTED 0x56
#define IPM_SFT_CODE_DEV_CORRUPTED 0x57
#define IPM_SFT_CODE_FATAL_ERROR 0x58
#define IPM_SFT_CODE_RESERVED 0xff
#define IPM_SELFTEST_SEL_ERROR 0x80
#define IPM_SELFTEST_SDR_ERROR 0x40
#define IPM_SELFTEST_FRU_ERROR 0x20
#define IPM_SELFTEST_IPMB_ERROR 0x10
#define IPM_SELFTEST_SDRR_EMPTY 0x08
#define IPM_SELFTEST_INTERNAL_USE 0x04
#define IPM_SELFTEST_FW_BOOTBLOCK 0x02
#define IPM_SELFTEST_FW_CORRUPTED 0x01
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct ipm_get_watchdog_rsp {
unsigned char use;
unsigned char intr_action;
unsigned char pre_timeout;
unsigned char exp_flags;
union {
struct {
unsigned char initial_countdown_lsb;
unsigned char initial_countdown_msb;
};
uint16_t init_cnt_le;
};
union {
struct {
unsigned char present_countdown_lsb;
unsigned char present_countdown_msb;
};
uint16_t pres_cnt_le;
};
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#define IPM_WATCHDOG_RESET_ERROR 0x80
#define IPM_WATCHDOG_BIOS_FRB2 0x01
#define IPM_WATCHDOG_BIOS_POST 0x02
#define IPM_WATCHDOG_OS_LOAD 0x03
#define IPM_WATCHDOG_SMS_OS 0x04
#define IPM_WATCHDOG_OEM 0x05
#define IPM_WATCHDOG_NO_ACTION 0x00
#define IPM_WATCHDOG_HARD_RESET 0x01
#define IPM_WATCHDOG_POWER_DOWN 0x02
#define IPM_WATCHDOG_POWER_CYCLE 0x03
#define IPM_WATCHDOG_CLEAR_OEM 0x20
#define IPM_WATCHDOG_CLEAR_SMS_OS 0x10
#define IPM_WATCHDOG_CLEAR_OS_LOAD 0x08
#define IPM_WATCHDOG_CLEAR_BIOS_POST 0x04
#define IPM_WATCHDOG_CLEAR_BIOS_FRB2 0x02
/* Use */
#define IPMI_WDT_USE_NOLOG_SHIFT 7
#define IPMI_WDT_USE_DONTSTOP_SHIFT 6 /* For 'set' */
#define IPMI_WDT_USE_RUNNING_SHIFT 6 /* For 'get' */
#define IPMI_WDT_USE_SHIFT 0
#define IPMI_WDT_USE_MASK 0x07
/* Pre-timeout interrupt type */
#define IPMI_WDT_INTR_SHIFT 4
#define IPMI_WDT_INTR_MASK 0x07 /* Apply to the intr value, not to the data byte */
/* Action */
#define IPMI_WDT_ACTION_SHIFT 0
#define IPMI_WDT_ACTION_MASK 0x07
#define IPMI_WDT_GET(b, s) (((b) >> (IPMI_WDT_##s##_SHIFT)) & (IPMI_WDT_##s##_MASK))
#define IS_WDT_BIT(b, s) IS_SET((b), IPMI_WDT_##s##_SHIFT)
/* IPMI 2.0 command for system information*/
#define IPMI_SET_SYS_INFO 0x58
#define IPMI_GET_SYS_INFO 0x59
#define IPMI_SYSINFO_SET0_SIZE 14
#define IPMI_SYSINFO_SETN_SIZE 16
/* System Information "Parameter selector" values: */
#define IPMI_SYSINFO_SET_STATE 0x00
#define IPMI_SYSINFO_SYSTEM_FW_VERSION 0x01
#define IPMI_SYSINFO_HOSTNAME 0x02
#define IPMI_SYSINFO_PRIMARY_OS_NAME 0x03
#define IPMI_SYSINFO_OS_NAME 0x04
#define IPMI_SYSINFO_DELL_OS_VERSION 0xe4
#define IPMI_SYSINFO_DELL_URL 0xde
#define IPMI_SYSINFO_DELL_IPV6_COUNT 0xe6
#define IPMI_SYSINFO_DELL_IPV6_DESTADDR 0xf0
int ipmi_mc_getsysinfo(struct ipmi_intf * intf, int param, int block, int set,
int len, void *buffer);
int ipmi_mc_setsysinfo(struct ipmi_intf * intf, int len, void *buffer);
#endif /*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
@ -44,7 +40,7 @@
struct pef_capabilities { /* "get pef capabilities" response */
uint8_t version;
uint8_t actions; /* mapped by PEF_ACTION_xxx */
uint8_t tblsize;
uint8_t event_filter_count;
};
typedef enum {
@ -54,6 +50,9 @@ typedef enum {
P_ABLE,
} flg_e;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_table_entry {
#define PEF_CONFIG_ENABLED 0x80
#define PEF_CONFIG_PRECONFIGURED 0x40
@ -94,7 +93,10 @@ struct pef_table_entry {
uint8_t event_data_3_AND_mask;
uint8_t event_data_3_compare_1;
uint8_t event_data_3_compare_2;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
struct desc_map { /* maps a description to a value/mask */
const char *desc;
@ -109,228 +111,14 @@ struct bit_desc_map { /* description text container */
struct desc_map desc_maps[128];
};
static struct bit_desc_map
pef_b2s_actions __attribute__((unused)) = {
BIT_DESC_MAP_ALL,
{ {"Alert", PEF_ACTION_ALERT},
{"Power-off", PEF_ACTION_POWER_DOWN},
{"Reset", PEF_ACTION_RESET},
{"Power-cycle", PEF_ACTION_POWER_CYCLE},
{"OEM-defined", PEF_ACTION_OEM},
{"Diagnostic-interrupt", PEF_ACTION_DIAGNOSTIC_INTERRUPT},
{NULL}
} };
static struct bit_desc_map
pef_b2s_severities __attribute__((unused)) = {
BIT_DESC_MAP_ANY,
{ {"Non-recoverable", PEF_SEVERITY_NON_RECOVERABLE},
{"Critical", PEF_SEVERITY_CRITICAL},
{"Warning", PEF_SEVERITY_WARNING},
{"OK", PEF_SEVERITY_OK},
{"Information", PEF_SEVERITY_INFORMATION},
{"Monitor", PEF_SEVERITY_MONITOR},
{NULL}
} };
static struct bit_desc_map
pef_b2s_sensortypes __attribute__((unused)) = {
BIT_DESC_MAP_LIST,
{ {"Any", 255},
{"Temperature", 1},
{"Voltage", 2},
{"Current", 3},
{"Fan", 4},
{"Chassis Intrusion", 5},
{"Platform security breach", 6},
{"Processor", 7},
{"Power supply", 8},
{"Power Unit", 9},
{"Cooling device", 10},
{"Other (units-based)", 11},
{"Memory", 12},
{"Drive Slot", 13},
{"POST memory resize", 14},
{"POST error", 15},
{"Logging disabled", 16},
{"Watchdog 1", 17},
{"System event", 18},
{"Critical Interrupt", 19},
{"Button", 20},
{"Module/board", 21},
{"uController/coprocessor", 22},
{"Add-in card", 23},
{"Chassis", 24},
{"Chipset", 25},
{"Other (FRU)", 26},
{"Cable/interconnect", 27},
{"Terminator", 28},
{"System boot", 29},
{"Boot error", 30},
{"OS boot", 31},
{"OS critical stop", 32},
{"Slot/connector", 33},
{"ACPI power state", 34},
{"Watchdog 2", 35},
{"Platform alert", 36},
{"Entity presence", 37},
{"Monitor ASIC/IC", 38},
{"LAN", 39},
{"Management subsytem health",40},
{"Battery", 41},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_1 = {
BIT_DESC_MAP_LIST,
{ {"<LNC", 0}, /* '<' : getting worse */
{">LNC", 1}, /* '>' : getting better */
{"<LC", 2},
{">LC", 3},
{"<LNR", 4},
{">LNR", 5},
{">UNC", 6},
{"<UNC", 7},
{">UC", 8},
{"<UC", 9},
{">UNR", 10},
{"<UNR", 11},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_2 = {
BIT_DESC_MAP_LIST,
{ {"transition to idle", 0},
{"transition to active", 1},
{"transition to busy", 2},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_3 = {
BIT_DESC_MAP_LIST,
{ {"state deasserted", 0},
{"state asserted", 1},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_4 = {
BIT_DESC_MAP_LIST,
{ {"predictive failure deasserted", 0},
{"predictive failure asserted", 1},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_5 = {
BIT_DESC_MAP_LIST,
{ {"limit not exceeded", 0},
{"limit exceeded", 1},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_6 = {
BIT_DESC_MAP_LIST,
{ {"performance met", 0},
{"performance lags", 1},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_7 = {
BIT_DESC_MAP_LIST,
{ {"ok", 0},
{"<warn", 1}, /* '<' : getting worse */
{"<fail", 2},
{"<dead", 3},
{">warn", 4}, /* '>' : getting better */
{">fail", 5},
{"dead", 6},
{"monitor", 7},
{"informational", 8},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_8 = {
BIT_DESC_MAP_LIST,
{ {"device removed/absent", 0},
{"device inserted/present", 1},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_9 = {
BIT_DESC_MAP_LIST,
{ {"device disabled", 0},
{"device enabled", 1},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_10 = {
BIT_DESC_MAP_LIST,
{ {"transition to running", 0},
{"transition to in test", 1},
{"transition to power off", 2},
{"transition to online", 3},
{"transition to offline", 4},
{"transition to off duty", 5},
{"transition to degraded", 6},
{"transition to power save", 7},
{"install error", 8},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_11 = {
BIT_DESC_MAP_LIST,
{ {"fully redundant", 0},
{"redundancy lost", 1},
{"redundancy degraded", 2},
{"<non-redundant/sufficient", 3}, /* '<' : getting worse */
{">non-redundant/sufficient", 4}, /* '>' : getting better */
{"non-redundant/insufficient", 5},
{"<redundancy degraded", 6},
{">redundancy degraded", 7},
{NULL}
} };
static struct bit_desc_map
pef_b2s_gentype_12 = {
BIT_DESC_MAP_LIST,
{ {"D0 power state", 0},
{"D1 power state", 1},
{"D2 power state", 2},
{"D3 power state", 3},
{NULL}
} };
static struct bit_desc_map *
pef_b2s_generic_ER[] __attribute__((unused)) = {
&pef_b2s_gentype_1,
&pef_b2s_gentype_2,
&pef_b2s_gentype_3,
&pef_b2s_gentype_4,
&pef_b2s_gentype_5,
&pef_b2s_gentype_6,
&pef_b2s_gentype_7,
&pef_b2s_gentype_8,
&pef_b2s_gentype_9,
&pef_b2s_gentype_10,
&pef_b2s_gentype_11,
&pef_b2s_gentype_12,
};
#define PEF_B2S_GENERIC_ER_ENTRIES \
(sizeof(pef_b2s_generic_ER) / sizeof(pef_b2s_generic_ER[0]))
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_policy_entry {
#define PEF_POLICY_ID_MASK 0xf0
#define PEF_POLICY_ID_SHIFT 4
#define PEF_POLICY_DISABLED 0xF7
#define PEF_POLICY_ENABLED 0x08
#define PEF_POLICY_FLAGS_MASK 0x07
#define PEF_POLICY_FLAGS_MATCH_ALWAYS 0
@ -345,49 +133,15 @@ struct pef_policy_entry {
uint8_t chan_dest;
#define PEF_POLICY_EVENT_SPECIFIC 0x80
uint8_t alert_string_key;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
static struct bit_desc_map
pef_b2s_policies __attribute__((unused)) = {
BIT_DESC_MAP_LIST,
{ {"Match-always", PEF_POLICY_FLAGS_MATCH_ALWAYS},
{"Try-next-entry", PEF_POLICY_FLAGS_PREV_OK_SKIP},
{"Try-next-set", PEF_POLICY_FLAGS_PREV_OK_NEXT_POLICY_SET},
{"Try-next-channel", PEF_POLICY_FLAGS_PREV_OK_NEXT_CHANNEL_IN_SET},
{"Try-next-destination", PEF_POLICY_FLAGS_PREV_OK_NEXT_DESTINATION_IN_SET},
{NULL}
} };
static struct bit_desc_map
pef_b2s_ch_medium __attribute__((unused)) = {
#define PEF_CH_MEDIUM_TYPE_IPMB 1
#define PEF_CH_MEDIUM_TYPE_ICMB_10 2
#define PEF_CH_MEDIUM_TYPE_ICMB_09 3
#define PEF_CH_MEDIUM_TYPE_LAN 4
#define PEF_CH_MEDIUM_TYPE_SERIAL 5
#define PEF_CH_MEDIUM_TYPE_XLAN 6
#define PEF_CH_MEDIUM_TYPE_PCI_SMBUS 7
#define PEF_CH_MEDIUM_TYPE_SMBUS_V1X 8
#define PEF_CH_MEDIUM_TYPE_SMBUS_V2X 9
#define PEF_CH_MEDIUM_TYPE_USB_V1X 10
#define PEF_CH_MEDIUM_TYPE_USB_V2X 11
#define PEF_CH_MEDIUM_TYPE_SYSTEM 12
BIT_DESC_MAP_LIST,
{ {"IPMB (I2C)", PEF_CH_MEDIUM_TYPE_IPMB},
{"ICMB v1.0", PEF_CH_MEDIUM_TYPE_ICMB_10},
{"ICMB v0.9", PEF_CH_MEDIUM_TYPE_ICMB_09},
{"802.3 LAN", PEF_CH_MEDIUM_TYPE_LAN},
{"Serial/Modem (RS-232)", PEF_CH_MEDIUM_TYPE_SERIAL},
{"Other LAN", PEF_CH_MEDIUM_TYPE_XLAN},
{"PCI SMBus", PEF_CH_MEDIUM_TYPE_PCI_SMBUS},
{"SMBus v1.0/1.1", PEF_CH_MEDIUM_TYPE_SMBUS_V1X},
{"SMBus v2.0", PEF_CH_MEDIUM_TYPE_SMBUS_V2X},
{"USB 1.x", PEF_CH_MEDIUM_TYPE_USB_V1X},
{"USB 2.x", PEF_CH_MEDIUM_TYPE_USB_V2X},
{"System I/F (KCS,SMIC,BT)", PEF_CH_MEDIUM_TYPE_SYSTEM},
{NULL}
} };
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_cfgparm_selector {
#define PEF_CFGPARM_ID_REVISION_ONLY_MASK 0x80
#define PEF_CFGPARM_ID_SET_IN_PROGRESS 0
@ -407,32 +161,41 @@ struct pef_cfgparm_selector {
uint8_t id;
uint8_t set;
uint8_t block;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_cfgparm_set_in_progress {
#define PEF_SET_IN_PROGRESS_COMMIT_WRITE 0x02
#define PEF_SET_IN_PROGRESS 0x01
uint8_t data1;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_cfgparm_control {
#define PEF_CONTROL_ENABLE_ALERT_STARTUP_DELAY 0x08
#define PEF_CONTROL_ENABLE_STARTUP_DELAY 0x04
#define PEF_CONTROL_ENABLE_EVENT_MESSAGES 0x02
#define PEF_CONTROL_ENABLE 0x01
uint8_t data1;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
static struct bit_desc_map
pef_b2s_control __attribute__((unused)) = {
BIT_DESC_MAP_ALL,
{ {"PEF", PEF_CONTROL_ENABLE},
{"PEF event messages", PEF_CONTROL_ENABLE_EVENT_MESSAGES},
{"PEF startup delay", PEF_CONTROL_ENABLE_STARTUP_DELAY},
{"Alert startup delay", PEF_CONTROL_ENABLE_ALERT_STARTUP_DELAY},
{NULL}
} };
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_cfgparm_action {
#define PEF_ACTION_ENABLE_DIAGNOSTIC_INTERRUPT 0x20
#define PEF_ACTION_ENABLE_OEM 0x10
@ -441,54 +204,116 @@ struct pef_cfgparm_action {
#define PEF_ACTION_ENABLE_POWER_DOWN 0x02
#define PEF_ACTION_ENABLE_ALERT 0x01
uint8_t data1;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_cfgparm_startup_delay {
uint8_t data1;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_cfgparm_alert_startup_delay {
uint8_t data1;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_cfgparm_filter_table_size {
#define PEF_FILTER_TABLE_SIZE_MASK 0x7f
uint8_t data1;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_cfgparm_filter_table_entry {
#define PEF_FILTER_TABLE_ID_MASK 0x7f
# define PEF_FILTER_DISABLED 0x7F
# define PEF_FILTER_ENABLED 0x80
# define PEF_FILTER_TABLE_ID_MASK 0x7F
uint8_t data1;
struct pef_table_entry entry;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_cfgparm_filter_table_data_1 {
uint8_t data1;
uint8_t data2;
} __attribute__ ((packed));
uint8_t id;
uint8_t cfg;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_cfgparm_policy_table_size {
#define PEF_POLICY_TABLE_SIZE_MASK 0x7f
uint8_t data1;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_cfgparm_policy_table_entry {
#define PEF_POLICY_TABLE_ID_MASK 0x7f
uint8_t data1;
struct pef_policy_entry entry;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_cfgparm_system_guid {
#define PEF_SYSTEM_GUID_USED_IN_PET 0x01
uint8_t data1;
uint8_t guid[16];
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_cfgparm_alert_string_table_size {
#define PEF_ALERT_STRING_TABLE_SIZE_MASK 0x7f
uint8_t data1;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_cfgparm_alert_string_keys {
#define PEF_ALERT_STRING_ID_MASK 0x7f
uint8_t data1;
@ -496,16 +321,27 @@ struct pef_cfgparm_alert_string_keys {
uint8_t data2;
#define PEF_ALERT_STRING_SET_ID_MASK 0x7f
uint8_t data3;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_cfgparm_alert_string_table_entry {
uint8_t id;
uint8_t blockno;
uint8_t block[16];
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
/* PEF - LAN */
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_lan_cfgparm_selector {
#define PEF_LAN_CFGPARM_CH_REVISION_ONLY_MASK 0x80
#define PEF_LAN_CFGPARM_CH_MASK 0x0f
@ -517,13 +353,25 @@ struct pef_lan_cfgparm_selector {
uint8_t id;
uint8_t set;
uint8_t block;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_lan_cfgparm_dest_size {
#define PEF_LAN_DEST_TABLE_SIZE_MASK 0x0f
uint8_t data1;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_lan_cfgparm_dest_type {
#define PEF_LAN_DEST_TYPE_ID_MASK 0x0f
uint8_t dest;
@ -536,18 +384,15 @@ struct pef_lan_cfgparm_dest_type {
uint8_t alert_timeout;
#define PEF_LAN_RETRIES_MASK 0x07
uint8_t retries;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
static struct bit_desc_map
pef_b2s_lan_desttype __attribute__((unused)) = {
BIT_DESC_MAP_LIST,
{ {"Acknowledged", PEF_LAN_DEST_TYPE_ACK},
{"PET", PEF_LAN_DEST_TYPE_PET},
{"OEM 1", PEF_LAN_DEST_TYPE_OEM_1},
{"OEM 2", PEF_LAN_DEST_TYPE_OEM_2},
{NULL}
} };
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_lan_cfgparm_dest_info {
#define PEF_LAN_DEST_MASK 0x0f
uint8_t dest;
@ -559,10 +404,15 @@ struct pef_lan_cfgparm_dest_info {
uint8_t gateway;
uint8_t ip[4];
uint8_t mac[6];
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
/* PEF - Serial/PPP */
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_serial_cfgparm_selector {
#define PEF_SERIAL_CFGPARM_CH_REVISION_ONLY_MASK 0x80
#define PEF_SERIAL_CFGPARM_CH_MASK 0x0f
@ -577,13 +427,25 @@ struct pef_serial_cfgparm_selector {
uint8_t id;
uint8_t set;
uint8_t block;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_serial_cfgparm_dest_size {
#define PEF_SERIAL_DEST_TABLE_SIZE_MASK 0x0f
uint8_t data1;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_serial_cfgparm_dest_info {
#define PEF_SERIAL_DEST_MASK 0x0f
uint8_t dest;
@ -612,46 +474,64 @@ struct pef_serial_cfgparm_dest_info {
#define PEF_SERIAL_CALLBACK_IPADDR_ID_SHIFT 4
#define PEF_SERIAL_CALLBACK_ACCT_ID_MASK 0xf0
uint8_t data5;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
static struct bit_desc_map
pef_b2s_serial_desttype __attribute__((unused)) = {
BIT_DESC_MAP_LIST,
{ {"Acknowledged", PEF_SERIAL_DEST_TYPE_ACK},
{"TAP page", PEF_SERIAL_DEST_TYPE_TAP},
{"PPP PET", PEF_SERIAL_DEST_TYPE_PPP},
{"Basic callback", PEF_SERIAL_DEST_TYPE_BASIC_CALLBACK},
{"PPP callback", PEF_SERIAL_DEST_TYPE_PPP_CALLBACK},
{"OEM 1", PEF_SERIAL_DEST_TYPE_OEM_1},
{"OEM 2", PEF_SERIAL_DEST_TYPE_OEM_2},
{NULL}
} };
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_serial_cfgparm_dial_string_count {
#define PEF_SERIAL_DIAL_STRING_COUNT_MASK 0x0f
uint8_t data1;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_serial_cfgparm_dial_string {
#define PEF_SERIAL_DIAL_STRING_MASK 0x0f
uint8_t data1;
uint8_t data2;
uint8_t data3;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_serial_cfgparm_tap_acct_count {
#define PEF_SERIAL_TAP_ACCT_COUNT_MASK 0x0f
uint8_t data1;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_serial_cfgparm_tap_acct_info {
uint8_t data1;
#define PEF_SERIAL_TAP_ACCT_INFO_DIAL_STRING_ID_MASK 0xf0
#define PEF_SERIAL_TAP_ACCT_INFO_DIAL_STRING_ID_SHIFT 4
#define PEF_SERIAL_TAP_ACCT_INFO_SVC_SETTINGS_ID_MASK 0x0f
uint8_t data2;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct pef_serial_cfgparm_tap_svc_settings {
uint8_t data1;
#define PEF_SERIAL_TAP_CONFIRMATION_ACK_AFTER_ETX 0x0
@ -662,16 +542,11 @@ struct pef_serial_cfgparm_tap_svc_settings {
uint8_t escape_mask[4];
uint8_t timeout_parms[3];
uint8_t retry_parms[2];
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
static struct bit_desc_map
pef_b2s_tap_svc_confirm __attribute__((unused)) = {
BIT_DESC_MAP_LIST,
{ {"ACK", PEF_SERIAL_TAP_CONFIRMATION_ACK_AFTER_ETX},
{"211+ACK", PEF_SERIAL_TAP_CONFIRMATION_211_ACK_AFTER_ETX},
{"{211|213}+ACK", PEF_SERIAL_TAP_CONFIRMATION_21X_ACK_AFTER_ETX},
{NULL}
} };
#if 0 /* FYI : config parm groupings */
struct pef_config_parms { /* PEF */
@ -689,7 +564,7 @@ BIT_DESC_MAP_LIST,
struct pef_cfgparm_alert_string_table_size;
struct pef_cfgparm_alert_string_keys;
struct pef_cfgparm_alert_string_table_entry;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
struct pef_lan_config_parms { /* LAN */
struct pef_lan_cfgparm_set_in_progress;
@ -712,7 +587,7 @@ BIT_DESC_MAP_LIST,
struct pef_lan_cfgparm_destination_count;
struct pef_lan_cfgparm_destination_type;
struct pef_lan_cfgparm_destination_ipaddr;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
struct pef_serial_config_parms { /* Serial/PPP */
struct pef_serial_cfgparm_set_in_progress;
@ -764,10 +639,11 @@ BIT_DESC_MAP_LIST,
struct pef_serial_cfgparm_ppp_udp_proxy_xmit_bufsize;
struct pef_serial_cfgparm_ppp_udp_proxy_recv_bufsize;
struct pef_serial_cfgparm_ppp_remote_console_ipaddr;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#endif
#define IPMI_CMD_GET_PEF_CAPABILITIES 0x10
#define IPMI_CMD_SET_PEF_CONFIG_PARMS 0x12
#define IPMI_CMD_GET_PEF_CONFIG_PARMS 0x13
#define IPMI_CMD_GET_LAST_PROCESSED_EVT_ID 0x15
#define IPMI_CMD_GET_SYSTEM_GUID 0x37
@ -775,6 +651,13 @@ BIT_DESC_MAP_LIST,
#define IPMI_CMD_LAN_GET_CONFIG 0x02
#define IPMI_CMD_SERIAL_GET_CONFIG 0x11
struct pef_cfgparm_set_policy_table_entry
{
uint8_t param_selector;
uint8_t policy_id;
struct pef_policy_entry entry;
} ATTRIBUTE_PACKING;
const char * ipmi_pef_bit_desc(struct bit_desc_map * map, uint32_t val);
void ipmi_pef_print_flags(struct bit_desc_map * map, flg_e type, uint32_t val);
void ipmi_pef_print_dec(const char * text, uint32_t val);

View File

@ -0,0 +1,124 @@
/*
(C) Kontron
*/
#ifndef _IPMI_PICMG_H_
#define _IPMI_PICMG_H_
#include <ipmitool/ipmi.h>
/* PICMG version */
#define PICMG_CPCI_MAJOR_VERSION 1
#define PICMG_ATCA_MAJOR_VERSION 2
#define PICMG_AMC_MAJOR_VERSION 4
#define PICMG_UTCA_MAJOR_VERSION 5
/* 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
/* AMC.0 R2.0 commands */
#define PICMG_AMC_SET_CLK_STATE_CMD 0x2C
#define PICMG_AMC_GET_CLK_STATE_CMD 0x2D
/* 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
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct picmg_set_fru_activation_cmd {
unsigned char picmg_id; /* always 0*/
unsigned char fru_id; /* threshold setting mask */
unsigned char fru_state; /* fru activation/deactivation */
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
typedef enum picmg_busres_board_cmd_types {
PICMG_BUSRES_BOARD_CMD_QUERY =0,
PICMG_BUSRES_BOARD_CMD_RELEASE,
PICMG_BUSRES_BOARD_CMD_FORCE,
PICMG_BUSRES_BOARD_CMD_BUS_FREE
} t_picmg_busres_board_cmd_types ;
typedef enum picmg_busres_shmc_cmd_types {
PICMG_BUSRES_SHMC_CMD_REQUEST =0,
PICMG_BUSRES_SHMC_CMD_RELINQUISH,
PICMG_BUSRES_SHMC_CMD_NOTIFY
} t_picmg_busres_shmc_cmd_types ;
typedef enum picmg_busres_resource_id {
PICMG_BUSRES_METAL_TEST_BUS_1=0,
PICMG_BUSRES_METAL_TEST_BUS_2,
PICMG_BUSRES_SYNC_CLOCK_GROUP_1,
PICMG_BUSRES_SYNC_CLOCK_GROUP_2,
PICMG_BUSRES_SYNC_CLOCK_GROUP_3
} t_picmg_busres_resource_id;
const char *picmg_led_color_str(int color);
struct sAmcPortState {
#ifndef WORDS_BIGENDIAN
unsigned short lane0 : 1;
unsigned short lane1 : 1;
unsigned short lane2 : 1;
unsigned short lane3 : 1;
unsigned short type : 8;
unsigned short type_ext : 4;
unsigned char group_id : 8;
#else
unsigned char group_id : 8;
unsigned short type_ext : 4;
unsigned short type : 8;
unsigned short lane3 : 1;
unsigned short lane2 : 1;
unsigned short lane1 : 1;
unsigned short lane0 : 1;
#endif
unsigned char state;
};
int ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv);
uint8_t picmg_discover(struct ipmi_intf *intf);
uint8_t ipmi_picmg_ipmb_address(struct ipmi_intf *intf);
#endif

View File

@ -0,0 +1,55 @@
/*
* Copyright (c) 2018 Quanta Computer 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 Quanta Computer 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.
* Quanta Computer Inc. 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
* Quanta Computer Inc. 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_QUANTAOEM_H
#define IPMI_QUANTAOEM_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_sdr.h>
#define OEM_QCT_NETFN 0x36
#define OEM_QCT_GET_INFO 0x65
typedef enum
{
OEM_QCT_PLATFORM_UNKNOWN = 0,
OEM_QCT_PLATFORM_GRANTLEY,
OEM_QCT_PLATFORM_PURLEY
} qct_platform_t;
qct_platform_t oem_qct_get_platform_id(struct ipmi_intf *intf);
char *oem_qct_get_evt_desc(struct ipmi_intf *intf, struct sel_event_record *rec);
#endif /*IPMI_QUANTAOEM_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_RAW_H
@ -40,5 +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 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 */

930
include/ipmitool/ipmi_sdr.h Normal file
View File

@ -0,0 +1,930 @@
/*
* 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_SDR_H
#define IPMI_SDR_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdbool.h>
#include <inttypes.h>
#include <math.h>
#include <ipmitool/bswap.h>
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_entity.h>
int ipmi_sdr_main(struct ipmi_intf *, int, char **);
#define tos32(val, bits) ((val & ((1<<((bits)-1)))) ? (-((val) & (1<<((bits)-1))) | (val)) : (val))
#if WORDS_BIGENDIAN
# define __TO_TOL(mtol) (uint16_t)(mtol & 0x3f)
# define __TO_M(mtol) (int16_t)(tos32((((mtol & 0xff00) >> 8) | ((mtol & 0xc0) << 2)), 10))
# define __TO_B(bacc) (int32_t)(tos32((((bacc & 0xff000000) >> 24) | ((bacc & 0xc00000) >> 14)), 10))
# define __TO_ACC(bacc) (uint32_t)(((bacc & 0x3f0000) >> 16) | ((bacc & 0xf000) >> 6))
# define __TO_ACC_EXP(bacc) (uint32_t)((bacc & 0xc00) >> 10)
# define __TO_R_EXP(bacc) (int32_t)(tos32(((bacc & 0xf0) >> 4), 4))
# define __TO_B_EXP(bacc) (int32_t)(tos32((bacc & 0xf), 4))
#else
# define __TO_TOL(mtol) (uint16_t)(BSWAP_16(mtol) & 0x3f)
# define __TO_M(mtol) (int16_t)(tos32((((BSWAP_16(mtol) & 0xff00) >> 8) | ((BSWAP_16(mtol) & 0xc0) << 2)), 10))
# define __TO_B(bacc) (int32_t)(tos32((((BSWAP_32(bacc) & 0xff000000) >> 24) | \
((BSWAP_32(bacc) & 0xc00000) >> 14)), 10))
# define __TO_ACC(bacc) (uint32_t)(((BSWAP_32(bacc) & 0x3f0000) >> 16) | ((BSWAP_32(bacc) & 0xf000) >> 6))
# define __TO_ACC_EXP(bacc) (uint32_t)((BSWAP_32(bacc) & 0xc00) >> 10)
# define __TO_R_EXP(bacc) (int32_t)(tos32(((BSWAP_32(bacc) & 0xf0) >> 4), 4))
# define __TO_B_EXP(bacc) (int32_t)(tos32((BSWAP_32(bacc) & 0xf), 4))
#endif
enum {
ANALOG_SENSOR,
DISCRETE_SENSOR,
};
#define READING_UNAVAILABLE 0x20
#define SCANNING_DISABLED 0x40
#define EVENT_MSG_DISABLED 0x80
#define IS_READING_UNAVAILABLE(val) ((val) & READING_UNAVAILABLE)
#define IS_SCANNING_DISABLED(val) (!((val) & SCANNING_DISABLED))
#define IS_EVENT_MSG_DISABLED(val) (!((val) & EVENT_MSG_DISABLED))
#define GET_SDR_REPO_INFO 0x20
#define GET_SDR_ALLOC_INFO 0x21
#define SDR_SENSOR_STAT_LO_NC (1<<0)
#define SDR_SENSOR_STAT_LO_CR (1<<1)
#define SDR_SENSOR_STAT_LO_NR (1<<2)
#define SDR_SENSOR_STAT_HI_NC (1<<3)
#define SDR_SENSOR_STAT_HI_CR (1<<4)
#define SDR_SENSOR_STAT_HI_NR (1<<5)
#define GET_DEVICE_SDR_INFO 0x20
#define GET_DEVICE_SDR 0x21
#define GET_SENSOR_FACTORS 0x23
#define GET_SENSOR_FACTORS 0x23
#define SET_SENSOR_HYSTERESIS 0x24
#define GET_SENSOR_HYSTERESIS 0x25
#define SET_SENSOR_THRESHOLDS 0x26
#define GET_SENSOR_THRESHOLDS 0x27
#define SET_SENSOR_EVENT_ENABLE 0x28
#define GET_SENSOR_EVENT_ENABLE 0x29
#define GET_SENSOR_EVENT_STATUS 0x2b
#define GET_SENSOR_READING 0x2d
#define GET_SENSOR_TYPE 0x2f
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct sdr_repo_info_rs {
uint8_t version; /* SDR version (51h) */
uint16_t count; /* number of records */
uint16_t free; /* free space in SDR */
uint32_t add_stamp; /* last add timestamp */
uint32_t erase_stamp; /* last del timestamp */
uint8_t op_support; /* supported operations */
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
/* builtin (device) sdrs support */
struct sdr_device_info_rs {
unsigned char count; /* number of records */
unsigned char flags; /* flags */
unsigned char popChangeInd[3]; /* free space in SDR */
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
#define GET_SDR_RESERVE_REPO 0x22
struct sdr_reserve_repo_rs {
uint16_t reserve_id; /* reservation ID */
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
#define GET_SDR 0x23
struct sdr_get_rq {
uint16_t reserve_id; /* reservation ID */
uint16_t id; /* record ID */
uint8_t offset; /* offset into SDR */
#define GET_SDR_ENTIRE_RECORD 0xff
uint8_t length; /* length to read */
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct sdr_get_rs {
uint16_t next; /* next record id */
uint16_t id; /* record ID */
uint8_t version; /* SDR version (51h) */
#define SDR_RECORD_TYPE_FULL_SENSOR 0x01
#define SDR_RECORD_TYPE_COMPACT_SENSOR 0x02
#define SDR_RECORD_TYPE_EVENTONLY_SENSOR 0x03
#define SDR_RECORD_TYPE_ENTITY_ASSOC 0x08
#define SDR_RECORD_TYPE_DEVICE_ENTITY_ASSOC 0x09
#define SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR 0x10
#define SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR 0x11
#define SDR_RECORD_TYPE_MC_DEVICE_LOCATOR 0x12
#define SDR_RECORD_TYPE_MC_CONFIRMATION 0x13
#define SDR_RECORD_TYPE_BMC_MSG_CHANNEL_INFO 0x14
#define SDR_RECORD_TYPE_OEM 0xc0
uint8_t type; /* record type */
uint8_t length; /* remaining record bytes */
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct sdr_record_mask {
union {
struct {
uint16_t assert_event; /* assertion event mask */
uint16_t deassert_event; /* de-assertion event mask */
uint16_t read; /* discrete reading mask */
} ATTRIBUTE_PACKING discrete;
struct {
#if WORDS_BIGENDIAN
uint16_t reserved:1;
uint16_t status_lnr:1;
uint16_t status_lcr:1;
uint16_t status_lnc:1;
uint16_t assert_unr_high:1;
uint16_t assert_unr_low:1;
uint16_t assert_ucr_high:1;
uint16_t assert_ucr_low:1;
uint16_t assert_unc_high:1;
uint16_t assert_unc_low:1;
uint16_t assert_lnr_high:1;
uint16_t assert_lnr_low:1;
uint16_t assert_lcr_high:1;
uint16_t assert_lcr_low:1;
uint16_t assert_lnc_high:1;
uint16_t assert_lnc_low:1;
#else
uint16_t assert_lnc_low:1;
uint16_t assert_lnc_high:1;
uint16_t assert_lcr_low:1;
uint16_t assert_lcr_high:1;
uint16_t assert_lnr_low:1;
uint16_t assert_lnr_high:1;
uint16_t assert_unc_low:1;
uint16_t assert_unc_high:1;
uint16_t assert_ucr_low:1;
uint16_t assert_ucr_high:1;
uint16_t assert_unr_low:1;
uint16_t assert_unr_high:1;
uint16_t status_lnc:1;
uint16_t status_lcr:1;
uint16_t status_lnr:1;
uint16_t reserved:1;
#endif
#if WORDS_BIGENDIAN
uint16_t reserved_2:1;
uint16_t status_unr:1;
uint16_t status_ucr:1;
uint16_t status_unc:1;
uint16_t deassert_unr_high:1;
uint16_t deassert_unr_low:1;
uint16_t deassert_ucr_high:1;
uint16_t deassert_ucr_low:1;
uint16_t deassert_unc_high:1;
uint16_t deassert_unc_low:1;
uint16_t deassert_lnr_high:1;
uint16_t deassert_lnr_low:1;
uint16_t deassert_lcr_high:1;
uint16_t deassert_lcr_low:1;
uint16_t deassert_lnc_high:1;
uint16_t deassert_lnc_low:1;
#else
uint16_t deassert_lnc_low:1;
uint16_t deassert_lnc_high:1;
uint16_t deassert_lcr_low:1;
uint16_t deassert_lcr_high:1;
uint16_t deassert_lnr_low:1;
uint16_t deassert_lnr_high:1;
uint16_t deassert_unc_low:1;
uint16_t deassert_unc_high:1;
uint16_t deassert_ucr_low:1;
uint16_t deassert_ucr_high:1;
uint16_t deassert_unr_low:1;
uint16_t deassert_unr_high:1;
uint16_t status_unc:1;
uint16_t status_ucr:1;
uint16_t status_unr:1;
uint16_t reserved_2:1;
#endif
union {
struct {
#if WORDS_BIGENDIAN /* settable threshold mask */
uint16_t reserved:2;
uint16_t unr:1;
uint16_t ucr:1;
uint16_t unc:1;
uint16_t lnr:1;
uint16_t lcr:1;
uint16_t lnc:1;
/* padding lower 8 bits */
uint16_t readable:8;
#else
uint16_t readable:8;
uint16_t lnc:1;
uint16_t lcr:1;
uint16_t lnr:1;
uint16_t unc:1;
uint16_t ucr:1;
uint16_t unr:1;
uint16_t reserved:2;
#endif
} ATTRIBUTE_PACKING 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
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
} ATTRIBUTE_PACKING read;
} ATTRIBUTE_PACKING;
} ATTRIBUTE_PACKING threshold;
} ATTRIBUTE_PACKING type;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct sdr_record_common_sensor {
struct {
uint8_t owner_id;
#if WORDS_BIGENDIAN
uint8_t channel:4; /* channel number */
uint8_t __reserved:2;
uint8_t lun:2; /* sensor owner lun */
#else
uint8_t lun:2; /* sensor owner lun */
uint8_t __reserved:2;
uint8_t channel:4; /* channel number */
#endif
uint8_t sensor_num; /* unique sensor number */
} ATTRIBUTE_PACKING keys;
struct entity_id entity;
struct {
struct {
#if WORDS_BIGENDIAN
uint8_t __reserved:1;
uint8_t scanning:1;
uint8_t events:1;
uint8_t thresholds:1;
uint8_t hysteresis:1;
uint8_t type:1;
uint8_t event_gen:1;
uint8_t sensor_scan:1;
#else
uint8_t sensor_scan:1;
uint8_t event_gen:1;
uint8_t type:1;
uint8_t hysteresis:1;
uint8_t thresholds:1;
uint8_t events:1;
uint8_t scanning:1;
uint8_t __reserved:1;
#endif
} ATTRIBUTE_PACKING init;
struct {
#if WORDS_BIGENDIAN
uint8_t ignore:1;
uint8_t rearm:1;
uint8_t hysteresis:2;
uint8_t threshold:2;
uint8_t event_msg:2;
#else
uint8_t event_msg:2;
uint8_t threshold:2;
uint8_t hysteresis:2;
uint8_t rearm:1;
uint8_t ignore:1;
#endif
} ATTRIBUTE_PACKING capabilities;
uint8_t type;
} ATTRIBUTE_PACKING sensor;
uint8_t event_type; /* event/reading type code */
struct sdr_record_mask mask;
/* IPMI 2.0, Table 43-1, byte 21[7:6] Analog (numeric) Data Format */
#define SDR_UNIT_FMT_UNSIGNED 0 /* unsigned */
#define SDR_UNIT_FMT_1S_COMPL 1 /* 1's complement (signed) */
#define SDR_UNIT_FMT_2S_COMPL 2 /* 2's complement (signed) */
#define SDR_UNIT_FMT_NA 3 /* does not return analog (numeric) reading */
/* IPMI 2.0, Table 43-1, byte 21[5:3] Rate */
#define SDR_UNIT_RATE_NONE 0 /* none */
#define SDR_UNIT_RATE_MICROSEC 1 /* per us */
#define SDR_UNIT_RATE_MILLISEC 2 /* per ms */
#define SDR_UNIT_RATE_SEC 3 /* per s */
#define SDR_UNIT_RATE_MIN 4 /* per min */
#define SDR_UNIT_RATE_HR 5 /* per hour */
#define SDR_UNIT_RATE_DAY 6 /* per day */
#define SDR_UNIT_RATE_RSVD 7 /* reserved */
/* IPMI 2.0, Table 43-1, byte 21[2:1] Modifier Unit */
#define SDR_UNIT_MOD_NONE 0 /* none */
#define SDR_UNIT_MOD_DIV 1 /* Basic Unit / Modifier Unit */
#define SDR_UNIT_MOD_MUL 2 /* Basic Unit * Mofifier Unit */
#define SDR_UNIT_MOD_RSVD 3 /* Reserved */
/* IPMI 2.0, Table 43-1, byte 21[0] Percentage */
#define SDR_UNIT_PCT_NO 0
#define SDR_UNIT_PCT_YES 1
struct {
#if WORDS_BIGENDIAN
uint8_t analog:2;
uint8_t rate:3;
uint8_t modifier:2;
uint8_t pct:1;
#else
uint8_t pct:1;
uint8_t modifier:2;
uint8_t rate:3;
uint8_t analog:2;
#endif
struct {
uint8_t base; /* Base unit type code per IPMI 2.0 Table 43-15 */
uint8_t modifier; /* Modifier unit type code per Table 43-15 */
} ATTRIBUTE_PACKING type;
} ATTRIBUTE_PACKING unit;
} ATTRIBUTE_PACKING;
/* SDR Record Common Sensor header macros */
#define IS_THRESHOLD_SENSOR(s) ((s)->event_type == 1)
#define UNITS_ARE_DISCRETE(s) ((s)->unit.analog == 3)
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct sdr_record_compact_sensor {
struct sdr_record_common_sensor cmn;
struct {
#if WORDS_BIGENDIAN
uint8_t __reserved:2;
uint8_t mod_type:2;
uint8_t count:4;
#else
uint8_t count:4;
uint8_t mod_type:2;
uint8_t __reserved:2;
#endif
#if WORDS_BIGENDIAN
uint8_t entity_inst:1;
uint8_t mod_offset:7;
#else
uint8_t mod_offset:7;
uint8_t entity_inst:1;
#endif
} ATTRIBUTE_PACKING share;
struct {
struct {
uint8_t positive;
uint8_t negative;
} ATTRIBUTE_PACKING hysteresis;
} ATTRIBUTE_PACKING threshold;
uint8_t __reserved[3];
uint8_t oem; /* reserved for OEM use */
uint8_t id_code; /* sensor ID string type/length code */
uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct sdr_record_eventonly_sensor {
struct {
uint8_t owner_id;
#if WORDS_BIGENDIAN
uint8_t channel:4; /* channel number */
uint8_t fru_owner:2; /* fru device owner lun */
uint8_t lun:2; /* sensor owner lun */
#else
uint8_t lun:2; /* sensor owner lun */
uint8_t fru_owner:2; /* fru device owner lun */
uint8_t channel:4; /* channel number */
#endif
uint8_t sensor_num; /* unique sensor number */
} ATTRIBUTE_PACKING keys;
struct entity_id entity;
uint8_t sensor_type; /* sensor type */
uint8_t event_type; /* event/reading type code */
struct {
#if WORDS_BIGENDIAN
uint8_t __reserved:2;
uint8_t mod_type:2;
uint8_t count:4;
#else
uint8_t count:4;
uint8_t mod_type:2;
uint8_t __reserved:2;
#endif
#if WORDS_BIGENDIAN
uint8_t entity_inst:1;
uint8_t mod_offset:7;
#else
uint8_t mod_offset:7;
uint8_t entity_inst:1;
#endif
} ATTRIBUTE_PACKING share;
uint8_t __reserved;
uint8_t oem; /* reserved for OEM use */
uint8_t id_code; /* sensor ID string type/length code */
uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct sdr_record_full_sensor {
struct sdr_record_common_sensor cmn;
#define SDR_SENSOR_L_LINEAR 0x00
#define SDR_SENSOR_L_LN 0x01
#define SDR_SENSOR_L_LOG10 0x02
#define SDR_SENSOR_L_LOG2 0x03
#define SDR_SENSOR_L_E 0x04
#define SDR_SENSOR_L_EXP10 0x05
#define SDR_SENSOR_L_EXP2 0x06
#define SDR_SENSOR_L_1_X 0x07
#define SDR_SENSOR_L_SQR 0x08
#define SDR_SENSOR_L_CUBE 0x09
#define SDR_SENSOR_L_SQRT 0x0a
#define SDR_SENSOR_L_CUBERT 0x0b
#define SDR_SENSOR_L_NONLINEAR 0x70
uint8_t linearization; /* 70h=non linear, 71h-7Fh=non linear, OEM */
uint16_t mtol; /* M, tolerance */
uint32_t bacc; /* accuracy, B, Bexp, Rexp */
struct {
#if WORDS_BIGENDIAN
uint8_t __reserved:5;
uint8_t normal_min:1; /* normal min field specified */
uint8_t normal_max:1; /* normal max field specified */
uint8_t nominal_read:1; /* nominal reading field specified */
#else
uint8_t nominal_read:1; /* nominal reading field specified */
uint8_t normal_max:1; /* normal max field specified */
uint8_t normal_min:1; /* normal min field specified */
uint8_t __reserved:5;
#endif
} ATTRIBUTE_PACKING analog_flag;
uint8_t nominal_read; /* nominal reading, raw value */
uint8_t normal_max; /* normal maximum, raw value */
uint8_t normal_min; /* normal minimum, raw value */
uint8_t sensor_max; /* sensor maximum, raw value */
uint8_t sensor_min; /* sensor minimum, raw value */
struct {
struct {
uint8_t non_recover;
uint8_t critical;
uint8_t non_critical;
} ATTRIBUTE_PACKING upper;
struct {
uint8_t non_recover;
uint8_t critical;
uint8_t non_critical;
} ATTRIBUTE_PACKING lower;
struct {
uint8_t positive;
uint8_t negative;
} ATTRIBUTE_PACKING hysteresis;
} ATTRIBUTE_PACKING threshold;
uint8_t __reserved[2];
uint8_t oem; /* reserved for OEM use */
uint8_t id_code; /* sensor ID string type/length code */
uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct sdr_record_mc_locator {
uint8_t dev_slave_addr;
#if WORDS_BIGENDIAN
uint8_t __reserved2:4;
uint8_t channel_num:4;
#else
uint8_t channel_num:4;
uint8_t __reserved2:4;
#endif
#if WORDS_BIGENDIAN
uint8_t pwr_state_notif:3;
uint8_t __reserved3:1;
uint8_t global_init:4;
#else
uint8_t global_init:4;
uint8_t __reserved3:1;
uint8_t pwr_state_notif:3;
#endif
uint8_t dev_support;
uint8_t __reserved4[3];
struct entity_id entity;
uint8_t oem;
uint8_t id_code;
uint8_t id_string[16];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
struct sdr_record_fru_locator {
uint8_t dev_slave_addr;
uint8_t device_id;
#if WORDS_BIGENDIAN
uint8_t logical:1;
uint8_t __reserved2:2;
uint8_t lun:2;
uint8_t bus:3;
#else
uint8_t bus:3;
uint8_t lun:2;
uint8_t __reserved2:2;
uint8_t logical:1;
#endif
#if WORDS_BIGENDIAN
uint8_t channel_num:4;
uint8_t __reserved3:4;
#else
uint8_t __reserved3:4;
uint8_t channel_num:4;
#endif
uint8_t __reserved4;
uint8_t dev_type;
uint8_t dev_type_modifier;
struct entity_id entity;
uint8_t oem;
uint8_t id_code;
uint8_t id_string[16];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct sdr_record_generic_locator {
uint8_t dev_access_addr;
uint8_t dev_slave_addr;
#if WORDS_BIGENDIAN
uint8_t channel_num:3;
uint8_t lun:2;
uint8_t bus:3;
#else
uint8_t bus:3;
uint8_t lun:2;
uint8_t channel_num:3;
#endif
#if WORDS_BIGENDIAN
uint8_t addr_span:3;
uint8_t __reserved1:5;
#else
uint8_t __reserved1:5;
uint8_t addr_span:3;
#endif
uint8_t __reserved2;
uint8_t dev_type;
uint8_t dev_type_modifier;
struct entity_id entity;
uint8_t oem;
uint8_t id_code;
uint8_t id_string[16];
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct sdr_record_entity_assoc {
struct entity_id entity; /* container entity ID and instance */
struct {
#if WORDS_BIGENDIAN
uint8_t isrange:1;
uint8_t islinked:1;
uint8_t isaccessable:1;
uint8_t __reserved:5;
#else
uint8_t __reserved:5;
uint8_t isaccessable:1;
uint8_t islinked:1;
uint8_t isrange:1;
#endif
} flags;
uint8_t entity_id_1; /* entity ID 1 | range 1 entity */
uint8_t entity_inst_1; /* entity inst 1 | range 1 first instance */
uint8_t entity_id_2; /* entity ID 2 | range 1 entity */
uint8_t entity_inst_2; /* entity inst 2 | range 1 last instance */
uint8_t entity_id_3; /* entity ID 3 | range 2 entity */
uint8_t entity_inst_3; /* entity inst 3 | range 2 first instance */
uint8_t entity_id_4; /* entity ID 4 | range 2 entity */
uint8_t entity_inst_4; /* entity inst 4 | range 2 last instance */
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
struct sdr_record_oem {
uint8_t *data;
int data_len;
};
/*
* The Get SDR Repository Info response structure
* From table 33-3 of the IPMI v2.0 spec
*/
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct get_sdr_repository_info_rsp {
uint8_t sdr_version;
uint8_t record_count_lsb;
uint8_t record_count_msb;
uint8_t free_space[2];
uint8_t most_recent_addition_timestamp[4];
uint8_t most_recent_erase_timestamp[4];
#if WORDS_BIGENDIAN
uint8_t overflow_flag:1;
uint8_t modal_update_support:2;
uint8_t __reserved1:1;
uint8_t delete_sdr_supported:1;
uint8_t partial_add_sdr_supported:1;
uint8_t reserve_sdr_repository_supported:1;
uint8_t get_sdr_repository_allo_info_supported:1;
#else
uint8_t get_sdr_repository_allo_info_supported:1;
uint8_t reserve_sdr_repository_supported:1;
uint8_t partial_add_sdr_supported:1;
uint8_t delete_sdr_supported:1;
uint8_t __reserved1:1;
uint8_t modal_update_support:2;
uint8_t overflow_flag:1;
#endif
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
struct ipmi_sdr_iterator {
uint16_t reservation;
int total;
int next;
int use_built_in;
};
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
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_common_sensor *common;
struct sdr_record_full_sensor *full;
struct sdr_record_compact_sensor *compact;
struct sdr_record_eventonly_sensor *eventonly;
struct sdr_record_generic_locator *genloc;
struct sdr_record_fru_locator *fruloc;
struct sdr_record_mc_locator *mcloc;
struct sdr_record_entity_assoc *entassoc;
struct sdr_record_oem *oem;
} ATTRIBUTE_PACKING record;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
#define SENSOR_TYPE_MAX 0x2C
struct sensor_reading {
char s_id[17]; /* name of the sensor */
struct sdr_record_full_sensor *full;
struct sdr_record_compact_sensor *compact;
uint8_t s_reading_valid; /* read value valididity */
uint8_t s_scanning_disabled; /* read of value disabled */
uint8_t s_reading_unavailable; /* read value unavailable */
uint8_t s_reading; /* value which was read */
uint8_t s_data2; /* data2 value read */
uint8_t s_data3; /* data3 value read */
uint8_t s_has_analog_value; /* sensor has analog value */
double s_a_val; /* read value converted to analog */
char s_a_str[16]; /* analog value as a string */
const char *s_a_units; /* analog value units string */
};
/*
* Determine if bridging is necessary to address a sensor at the given
* address (_addr) and (_chan) via the interface (_intf).
*
* If the sensor is being addressed on channel zero, it resides on
* IPMB-0. If the interface target IPMB-0 address is exactly the same as
* the sensor address then the sensor resides on the target IPMB-0
* so we don't need extra levels of bridging to address the sensor.
* Or
* If the sensor target address and channel match the interface target address
* and channel then there is no extra levels of bridging required.
*
* Note:
* The target IPMB-0 address is the address of the SDR repository that was
* accessed using the user specified bridging command line arguments.
* Access to any sensor on the target IPMB-0 can be addressed using the
* target address and transit address in the interface.
*/
#define BRIDGE_TO_SENSOR(_intf, _addr, _chan) \
( !((_chan == 0 && _intf->target_ipmb_addr && \
_intf->target_ipmb_addr == _addr) || \
(_addr == _intf->target_addr && _chan == _intf->target_channel)) )
struct ipmi_sdr_iterator *ipmi_sdr_start(struct ipmi_intf *intf,
int use_builtin);
struct sdr_get_rs *ipmi_sdr_get_next_header(struct ipmi_intf *intf,
struct ipmi_sdr_iterator *i);
uint8_t *ipmi_sdr_get_record(struct ipmi_intf *intf, struct sdr_get_rs *header,
struct ipmi_sdr_iterator *i);
void ipmi_sdr_end(struct ipmi_sdr_iterator *i);
int ipmi_sdr_print_sdr(struct ipmi_intf *intf, uint8_t type);
int ipmi_sdr_print_name_from_rawentry(uint16_t id, uint8_t type,uint8_t * raw);
int ipmi_sdr_print_rawentry(struct ipmi_intf *intf, uint8_t type, uint8_t * raw,
int len);
int ipmi_sdr_print_listentry(struct ipmi_intf *intf,
struct sdr_record_list *entry);
void ipmi_sdr_print_sensor_hysteresis(struct sdr_record_common_sensor *sensor,
struct sdr_record_full_sensor *full,
uint8_t hysteresis_value,
const char *hdrstr);
const char *ipmi_sdr_get_unit_string(bool pct, uint8_t type,
uint8_t base, uint8_t modifier);
struct sensor_reading *
ipmi_sdr_read_sensor_value(struct ipmi_intf *intf,
struct sdr_record_common_sensor *sensor,
uint8_t sdr_record_type, int precision);
const char *ipmi_sdr_get_thresh_status(struct sensor_reading *sr,
const char *invalidstr);
const char *ipmi_sdr_get_status(int, const char *, uint8_t stat);
double sdr_convert_sensor_tolerance(struct sdr_record_full_sensor *sensor,
uint8_t val);
double sdr_convert_sensor_reading(struct sdr_record_full_sensor *sensor,
uint8_t val);
double sdr_convert_sensor_hysterisis(struct sdr_record_full_sensor *sensor,
uint8_t val);
uint8_t sdr_convert_sensor_value_to_raw(struct sdr_record_full_sensor *sensor,
double val);
struct ipmi_rs *ipmi_sdr_get_sensor_reading(struct ipmi_intf *intf,
uint8_t sensor);
struct ipmi_rs *ipmi_sdr_get_sensor_reading_ipmb(struct ipmi_intf *intf,
uint8_t sensor,
uint8_t target,
uint8_t lun,
uint8_t channel);
struct ipmi_rs *ipmi_sdr_get_sensor_thresholds(struct ipmi_intf *intf,
uint8_t sensor,
uint8_t target, uint8_t lun, uint8_t channel);
struct ipmi_rs *ipmi_sdr_get_sensor_hysteresis(struct ipmi_intf *intf,
uint8_t sensor,
uint8_t target, uint8_t lun, uint8_t channel);
int ipmi_sdr_get_reservation(struct ipmi_intf *intf, int use_builtin,
uint16_t * reserve_id);
int ipmi_sdr_print_sensor_eventonly(struct ipmi_intf *intf,
struct sdr_record_eventonly_sensor *sensor);
int ipmi_sdr_print_sensor_generic_locator(struct sdr_record_generic_locator *fru);
int ipmi_sdr_print_sensor_fru_locator(struct sdr_record_fru_locator *fru);
int ipmi_sdr_print_sensor_mc_locator(struct sdr_record_mc_locator *mc);
struct sdr_record_list *ipmi_sdr_find_sdr_byentity(struct ipmi_intf *intf,
struct entity_id *entity);
struct sdr_record_list *ipmi_sdr_find_sdr_bynumtype(struct ipmi_intf *intf,
uint16_t gen_id, uint8_t num, uint8_t type);
struct sdr_record_list *ipmi_sdr_find_sdr_bysensortype(struct ipmi_intf *intf,
uint8_t type);
struct sdr_record_list *ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf,
char *id);
struct sdr_record_list *ipmi_sdr_find_sdr_bytype(struct ipmi_intf *intf,
uint8_t type);
int ipmi_sdr_list_cache(struct ipmi_intf *intf);
int ipmi_sdr_list_cache_fromfile(const char *ifile);
void ipmi_sdr_list_empty(void);
int ipmi_sdr_print_info(struct ipmi_intf *intf);
void ipmi_sdr_print_discrete_state(struct ipmi_intf *intf,
const char *desc, uint8_t sensor_type,
uint8_t event_type, uint8_t state1,
uint8_t state2);
void ipmi_sdr_print_discrete_state_mini(struct ipmi_intf *intf,
const char *header, const char *separator,
uint8_t sensor_type, uint8_t event_type,
uint8_t state1, uint8_t state2);
int ipmi_sdr_print_sensor_event_status(struct ipmi_intf *intf,
uint8_t sensor_num, uint8_t sensor_type,
uint8_t event_type, int numeric_fmt,
uint8_t target, uint8_t lun, uint8_t channel);
int ipmi_sdr_print_sensor_event_enable(struct ipmi_intf *intf,
uint8_t sensor_num, uint8_t sensor_type,
uint8_t event_type, int numeric_fmt,
uint8_t target, uint8_t lun, uint8_t channel);
#endif /* IPMI_SDR_H */

View File

@ -0,0 +1,46 @@
/*
* 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_SDRADD_H
#define IPMI_SDRADD_H
/*
* Methods to add SDRs to repository from built-in sensors or files
*/
int
ipmi_sdr_add_from_sensors(struct ipmi_intf *intf, int maxslot);
int
ipmi_sdr_add_from_file(struct ipmi_intf *intf, const char *ifile);
int
ipmi_sdr_add_from_list(struct ipmi_intf *intf, const char *rangeList);
#endif /* IPMI_SDRADD_H */

691
include/ipmitool/ipmi_sel.h Normal file
View File

@ -0,0 +1,691 @@
/*
* 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_SEL_H
#define IPMI_SEL_H
#include <inttypes.h>
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_sdr.h>
#define IPMI_CMD_GET_SEL_INFO 0x40
#define IPMI_CMD_GET_SEL_ALLOC_INFO 0x41
#define IPMI_CMD_RESERVE_SEL 0x42
#define IPMI_CMD_GET_SEL_ENTRY 0x43
#define IPMI_CMD_ADD_SEL_ENTRY 0x44
#define IPMI_CMD_PARTIAL_ADD_SEL_ENTRY 0x45
#define IPMI_CMD_DELETE_SEL_ENTRY 0x46
#define IPMI_CMD_CLEAR_SEL 0x47
#define IPMI_CMD_GET_SEL_TIME 0x48
#define IPMI_CMD_SET_SEL_TIME 0x49
#define IPMI_CMD_GET_AUX_LOG_STATUS 0x5A
#define IPMI_CMD_SET_AUX_LOG_STATUS 0x5B
enum {
IPMI_EVENT_CLASS_DISCRETE,
IPMI_EVENT_CLASS_DIGITAL,
IPMI_EVENT_CLASS_THRESHOLD,
IPMI_EVENT_CLASS_OEM,
};
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct sel_get_rq {
uint16_t reserve_id;
uint16_t record_id;
uint8_t offset;
uint8_t length;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
struct standard_spec_sel_rec{
uint32_t timestamp;
uint16_t gen_id;
uint8_t evm_rev;
uint8_t sensor_type;
uint8_t sensor_num;
#if WORDS_BIGENDIAN
uint8_t event_dir : 1;
uint8_t event_type : 7;
#else
uint8_t event_type : 7;
uint8_t event_dir : 1;
#endif
#define DATA_BYTE2_SPECIFIED_MASK 0xc0 /* event_data[0] bit mask */
#define DATA_BYTE3_SPECIFIED_MASK 0x30 /* event_data[0] bit mask */
#define EVENT_OFFSET_MASK 0x0f /* event_data[0] bit mask */
uint8_t event_data[3];
};
/* Dell Specific MACRO's */
#define OEM_CODE_IN_BYTE2 0x80 /* Dell specific OEM Byte in Byte 2 Mask */
#define OEM_CODE_IN_BYTE3 0x20 /* Dell specific OEM Byte in Byte 3 Mask */
/* MASK MACROS */
#define MASK_LOWER_NIBBLE 0x0F
#define MASK_HIGHER_NIBBLE 0xF0
/*Senosr type Macro's */
#define SENSOR_TYPE_MEMORY 0x0C
#define SENSOR_TYPE_CRIT_INTR 0x13
#define SENSOR_TYPE_EVT_LOG 0x10
#define SENSOR_TYPE_SYS_EVENT 0x12
#define SENSOR_TYPE_PROCESSOR 0x07
#define SENSOR_TYPE_OEM_SEC_EVENT 0xC1
#define SENSOR_TYPE_VER_CHANGE 0x2B
#define SENSOR_TYPE_FRM_PROG 0x0F
#define SENSOR_TYPE_WTDOG 0x23
#define SENSOR_TYPE_OEM_NFATAL_ERROR 0xC2
#define SENSOR_TYPE_OEM_FATAL_ERROR 0xC3
#define SENSOR_TYPE_TXT_CMD_ERROR 0x20
#define SENSOR_TYPE_SUPERMICRO_OEM 0xD0
/* End of Macro for DELL Specific */
#define SEL_OEM_TS_DATA_LEN 6
#define SEL_OEM_NOTS_DATA_LEN 13
struct oem_ts_spec_sel_rec{
uint32_t timestamp;
uint8_t manf_id[3];
uint8_t oem_defined[SEL_OEM_TS_DATA_LEN];
};
struct oem_nots_spec_sel_rec{
uint8_t oem_defined[SEL_OEM_NOTS_DATA_LEN];
};
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct sel_event_record {
uint16_t record_id;
uint8_t record_type;
union{
struct standard_spec_sel_rec standard_type;
struct oem_ts_spec_sel_rec oem_ts_type;
struct oem_nots_spec_sel_rec oem_nots_type;
} sel_type;
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
struct ipmi_event_sensor_types {
uint8_t code;
uint8_t offset;
#define ALL_OFFSETS_SPECIFIED 0xff
uint8_t data;
const char * desc;
};
static const struct ipmi_event_sensor_types generic_event_types[] = {
/* Threshold Based States */
{ 0x01, 0x00, 0xff, "Lower Non-critical going low " },
{ 0x01, 0x01, 0xff, "Lower Non-critical going high" },
{ 0x01, 0x02, 0xff, "Lower Critical going low " },
{ 0x01, 0x03, 0xff, "Lower Critical going high" },
{ 0x01, 0x04, 0xff, "Lower Non-recoverable going low " },
{ 0x01, 0x05, 0xff, "Lower Non-recoverable going high" },
{ 0x01, 0x06, 0xff, "Upper Non-critical going low " },
{ 0x01, 0x07, 0xff, "Upper Non-critical going high" },
{ 0x01, 0x08, 0xff, "Upper Critical going low " },
{ 0x01, 0x09, 0xff, "Upper Critical going high" },
{ 0x01, 0x0a, 0xff, "Upper Non-recoverable going low " },
{ 0x01, 0x0b, 0xff, "Upper Non-recoverable going high" },
/* DMI-based "usage state" States */
{ 0x02, 0x00, 0xff, "Transition to Idle" },
{ 0x02, 0x01, 0xff, "Transition to Active" },
{ 0x02, 0x02, 0xff, "Transition to Busy" },
/* Digital-Discrete Event States */
{ 0x03, 0x00, 0xff, "State Deasserted" },
{ 0x03, 0x01, 0xff, "State Asserted" },
{ 0x04, 0x00, 0xff, "Predictive Failure Deasserted" },
{ 0x04, 0x01, 0xff, "Predictive Failure Asserted" },
{ 0x05, 0x00, 0xff, "Limit Not Exceeded" },
{ 0x05, 0x01, 0xff, "Limit Exceeded" },
{ 0x06, 0x00, 0xff, "Performance Met" },
{ 0x06, 0x01, 0xff, "Performance Lags" },
/* Severity Event States */
{ 0x07, 0x00, 0xff, "Transition to OK" },
{ 0x07, 0x01, 0xff, "Transition to Non-critical from OK" },
{ 0x07, 0x02, 0xff, "Transition to Critical from less severe" },
{ 0x07, 0x03, 0xff, "Transition to Non-recoverable from less severe" },
{ 0x07, 0x04, 0xff, "Transition to Non-critical from more severe" },
{ 0x07, 0x05, 0xff, "Transition to Critical from Non-recoverable" },
{ 0x07, 0x06, 0xff, "Transition to Non-recoverable" },
{ 0x07, 0x07, 0xff, "Monitor" },
{ 0x07, 0x08, 0xff, "Informational" },
/* Availability Status States */
{ 0x08, 0x00, 0xff, "Device Absent" },
{ 0x08, 0x01, 0xff, "Device Present" },
{ 0x09, 0x00, 0xff, "Device Disabled" },
{ 0x09, 0x01, 0xff, "Device Enabled" },
{ 0x0a, 0x00, 0xff, "Transition to Running" },
{ 0x0a, 0x01, 0xff, "Transition to In Test" },
{ 0x0a, 0x02, 0xff, "Transition to Power Off" },
{ 0x0a, 0x03, 0xff, "Transition to On Line" },
{ 0x0a, 0x04, 0xff, "Transition to Off Line" },
{ 0x0a, 0x05, 0xff, "Transition to Off Duty" },
{ 0x0a, 0x06, 0xff, "Transition to Degraded" },
{ 0x0a, 0x07, 0xff, "Transition to Power Save" },
{ 0x0a, 0x08, 0xff, "Install Error" },
/* Redundancy States */
{ 0x0b, 0x00, 0xff, "Fully Redundant" },
{ 0x0b, 0x01, 0xff, "Redundancy Lost" },
{ 0x0b, 0x02, 0xff, "Redundancy Degraded" },
{ 0x0b, 0x03, 0xff, "Non-Redundant: Sufficient from Redundant" },
{ 0x0b, 0x04, 0xff, "Non-Redundant: Sufficient from Insufficient" },
{ 0x0b, 0x05, 0xff, "Non-Redundant: Insufficient Resources" },
{ 0x0b, 0x06, 0xff, "Redundancy Degraded from Fully Redundant" },
{ 0x0b, 0x07, 0xff, "Redundancy Degraded from Non-Redundant" },
/* ACPI Device Power States */
{ 0x0c, 0x00, 0xff, "D0 Power State" },
{ 0x0c, 0x01, 0xff, "D1 Power State" },
{ 0x0c, 0x02, 0xff, "D2 Power State" },
{ 0x0c, 0x03, 0xff, "D3 Power State" },
/* END */
{ 0x00, 0x00, 0xff, NULL },
};
static const struct ipmi_event_sensor_types sensor_specific_event_types[] = {
/* Physical Security */
{ 0x05, 0x00, 0xff, "General Chassis intrusion" },
{ 0x05, 0x01, 0xff, "Drive Bay intrusion" },
{ 0x05, 0x02, 0xff, "I/O Card area intrusion" },
{ 0x05, 0x03, 0xff, "Processor area intrusion" },
{ 0x05, 0x04, 0xff, "System unplugged from LAN" },
{ 0x05, 0x05, 0xff, "Unauthorized dock" },
{ 0x05, 0x06, 0xff, "FAN area intrusion" },
/* Platform Security */
{ 0x06, 0x00, 0xff, "Front Panel Lockout violation attempted" },
{ 0x06, 0x01, 0xff, "Pre-boot password violation - user password" },
{ 0x06, 0x02, 0xff, "Pre-boot password violation - setup password" },
{ 0x06, 0x03, 0xff, "Pre-boot password violation - network boot password" },
{ 0x06, 0x04, 0xff, "Other pre-boot password violation" },
{ 0x06, 0x05, 0xff, "Out-of-band access password violation" },
/* Processor */
{ 0x07, 0x00, 0xff, "IERR" },
{ 0x07, 0x01, 0xff, "Thermal Trip" },
{ 0x07, 0x02, 0xff, "FRB1/BIST failure" },
{ 0x07, 0x03, 0xff, "FRB2/Hang in POST failure" },
{ 0x07, 0x04, 0xff, "FRB3/Processor startup/init failure" },
{ 0x07, 0x05, 0xff, "Configuration Error" },
{ 0x07, 0x06, 0xff, "SM BIOS Uncorrectable CPU-complex Error" },
{ 0x07, 0x07, 0xff, "Presence detected" },
{ 0x07, 0x08, 0xff, "Disabled" },
{ 0x07, 0x09, 0xff, "Terminator presence detected" },
{ 0x07, 0x0a, 0xff, "Throttled" },
{ 0x07, 0x0b, 0xff, "Uncorrectable machine check exception" },
{ 0x07, 0x0c, 0xff, "Correctable machine check error" },
/* Power Supply */
{ 0x08, 0x00, 0xff, "Presence detected" },
{ 0x08, 0x01, 0xff, "Failure detected" },
{ 0x08, 0x02, 0xff, "Predictive failure" },
{ 0x08, 0x03, 0xff, "Power Supply AC lost" },
{ 0x08, 0x04, 0xff, "AC lost or out-of-range" },
{ 0x08, 0x05, 0xff, "AC out-of-range, but present" },
{ 0x08, 0x06, 0x00, "Config Error: Vendor Mismatch" },
{ 0x08, 0x06, 0x01, "Config Error: Revision Mismatch" },
{ 0x08, 0x06, 0x02, "Config Error: Processor Missing" },
{ 0x08, 0x06, 0x03, "Config Error: Power Supply Rating Mismatch" },
{ 0x08, 0x06, 0x04, "Config Error: Voltage Rating Mismatch" },
{ 0x08, 0x06, 0xff, "Config Error" },
{ 0x08, 0x06, 0xff, "Power Supply Inactive" },
/* Power Unit */
{ 0x09, 0x00, 0xff, "Power off/down" },
{ 0x09, 0x01, 0xff, "Power cycle" },
{ 0x09, 0x02, 0xff, "240VA power down" },
{ 0x09, 0x03, 0xff, "Interlock power down" },
{ 0x09, 0x04, 0xff, "AC lost" },
{ 0x09, 0x05, 0xff, "Soft-power control failure" },
{ 0x09, 0x06, 0xff, "Failure detected" },
{ 0x09, 0x07, 0xff, "Predictive failure" },
/* Memory */
{ 0x0c, 0x00, 0xff, "Correctable ECC" },
{ 0x0c, 0x01, 0xff, "Uncorrectable ECC" },
{ 0x0c, 0x02, 0xff, "Parity" },
{ 0x0c, 0x03, 0xff, "Memory Scrub Failed" },
{ 0x0c, 0x04, 0xff, "Memory Device Disabled" },
{ 0x0c, 0x05, 0xff, "Correctable ECC logging limit reached" },
{ 0x0c, 0x06, 0xff, "Presence Detected" },
{ 0x0c, 0x07, 0xff, "Configuration Error" },
{ 0x0c, 0x08, 0xff, "Spare" },
{ 0x0c, 0x09, 0xff, "Throttled" },
{ 0x0c, 0x0a, 0xff, "Critical Overtemperature" },
/* Drive Slot */
{ 0x0d, 0x00, 0xff, "Drive Present" },
{ 0x0d, 0x01, 0xff, "Drive Fault" },
{ 0x0d, 0x02, 0xff, "Predictive Failure" },
{ 0x0d, 0x03, 0xff, "Hot Spare" },
{ 0x0d, 0x04, 0xff, "Parity Check In Progress" },
{ 0x0d, 0x05, 0xff, "In Critical Array" },
{ 0x0d, 0x06, 0xff, "In Failed Array" },
{ 0x0d, 0x07, 0xff, "Rebuild In Progress" },
{ 0x0d, 0x08, 0xff, "Rebuild Aborted" },
/* System Firmware Error */
{ 0x0f, 0x00, 0x00, "Unspecified" },
{ 0x0f, 0x00, 0x01, "No system memory installed" },
{ 0x0f, 0x00, 0x02, "No usable system memory" },
{ 0x0f, 0x00, 0x03, "Unrecoverable IDE device failure" },
{ 0x0f, 0x00, 0x04, "Unrecoverable system-board failure" },
{ 0x0f, 0x00, 0x05, "Unrecoverable diskette failure" },
{ 0x0f, 0x00, 0x06, "Unrecoverable hard-disk controller failure" },
{ 0x0f, 0x00, 0x07, "Unrecoverable PS/2 or USB keyboard failure" },
{ 0x0f, 0x00, 0x08, "Removable boot media not found" },
{ 0x0f, 0x00, 0x09, "Unrecoverable video controller failure" },
{ 0x0f, 0x00, 0x0a, "No video device selected" },
{ 0x0f, 0x00, 0x0b, "BIOS corruption detected" },
{ 0x0f, 0x00, 0x0c, "CPU voltage mismatch" },
{ 0x0f, 0x00, 0x0d, "CPU speed mismatch failure" },
{ 0x0f, 0x00, 0xff, "Unknown Error" },
/* System Firmware Hang */
{ 0x0f, 0x01, 0x00, "Unspecified" },
{ 0x0f, 0x01, 0x01, "Memory initialization" },
{ 0x0f, 0x01, 0x02, "Hard-disk initialization" },
{ 0x0f, 0x01, 0x03, "Secondary CPU Initialization" },
{ 0x0f, 0x01, 0x04, "User authentication" },
{ 0x0f, 0x01, 0x05, "User-initiated system setup" },
{ 0x0f, 0x01, 0x06, "USB resource configuration" },
{ 0x0f, 0x01, 0x07, "PCI resource configuration" },
{ 0x0f, 0x01, 0x08, "Option ROM initialization" },
{ 0x0f, 0x01, 0x09, "Video initialization" },
{ 0x0f, 0x01, 0x0a, "Cache initialization" },
{ 0x0f, 0x01, 0x0b, "SMBus initialization" },
{ 0x0f, 0x01, 0x0c, "Keyboard controller initialization" },
{ 0x0f, 0x01, 0x0d, "Management controller initialization" },
{ 0x0f, 0x01, 0x0e, "Docking station attachment" },
{ 0x0f, 0x01, 0x0f, "Enabling docking station" },
{ 0x0f, 0x01, 0x10, "Docking station ejection" },
{ 0x0f, 0x01, 0x11, "Disabling docking station" },
{ 0x0f, 0x01, 0x12, "Calling operating system wake-up vector" },
{ 0x0f, 0x01, 0x13, "System boot initiated" },
{ 0x0f, 0x01, 0x14, "Motherboard initialization" },
{ 0x0f, 0x01, 0x15, "reserved" },
{ 0x0f, 0x01, 0x16, "Floppy initialization" },
{ 0x0f, 0x01, 0x17, "Keyboard test" },
{ 0x0f, 0x01, 0x18, "Pointing device test" },
{ 0x0f, 0x01, 0x19, "Primary CPU initialization" },
{ 0x0f, 0x01, 0xff, "Unknown Hang" },
/* System Firmware Progress */
{ 0x0f, 0x02, 0x00, "Unspecified" },
{ 0x0f, 0x02, 0x01, "Memory initialization" },
{ 0x0f, 0x02, 0x02, "Hard-disk initialization" },
{ 0x0f, 0x02, 0x03, "Secondary CPU Initialization" },
{ 0x0f, 0x02, 0x04, "User authentication" },
{ 0x0f, 0x02, 0x05, "User-initiated system setup" },
{ 0x0f, 0x02, 0x06, "USB resource configuration" },
{ 0x0f, 0x02, 0x07, "PCI resource configuration" },
{ 0x0f, 0x02, 0x08, "Option ROM initialization" },
{ 0x0f, 0x02, 0x09, "Video initialization" },
{ 0x0f, 0x02, 0x0a, "Cache initialization" },
{ 0x0f, 0x02, 0x0b, "SMBus initialization" },
{ 0x0f, 0x02, 0x0c, "Keyboard controller initialization" },
{ 0x0f, 0x02, 0x0d, "Management controller initialization" },
{ 0x0f, 0x02, 0x0e, "Docking station attachment" },
{ 0x0f, 0x02, 0x0f, "Enabling docking station" },
{ 0x0f, 0x02, 0x10, "Docking station ejection" },
{ 0x0f, 0x02, 0x11, "Disabling docking station" },
{ 0x0f, 0x02, 0x12, "Calling operating system wake-up vector" },
{ 0x0f, 0x02, 0x13, "System boot initiated" },
{ 0x0f, 0x02, 0x14, "Motherboard initialization" },
{ 0x0f, 0x02, 0x15, "reserved" },
{ 0x0f, 0x02, 0x16, "Floppy initialization" },
{ 0x0f, 0x02, 0x17, "Keyboard test" },
{ 0x0f, 0x02, 0x18, "Pointing device test" },
{ 0x0f, 0x02, 0x19, "Primary CPU initialization" },
{ 0x0f, 0x02, 0xff, "Unknown Progress" },
/* Event Logging Disabled */
{ 0x10, 0x00, 0xff, "Correctable memory error logging disabled" },
{ 0x10, 0x01, 0xff, "Event logging disabled" },
{ 0x10, 0x02, 0xff, "Log area reset/cleared" },
{ 0x10, 0x03, 0xff, "All event logging disabled" },
{ 0x10, 0x04, 0xff, "Log full" },
{ 0x10, 0x05, 0xff, "Log almost full" },
/* Watchdog 1 */
{ 0x11, 0x00, 0xff, "BIOS Reset" },
{ 0x11, 0x01, 0xff, "OS Reset" },
{ 0x11, 0x02, 0xff, "OS Shut Down" },
{ 0x11, 0x03, 0xff, "OS Power Down" },
{ 0x11, 0x04, 0xff, "OS Power Cycle" },
{ 0x11, 0x05, 0xff, "OS NMI/Diag Interrupt" },
{ 0x11, 0x06, 0xff, "OS Expired" },
{ 0x11, 0x07, 0xff, "OS pre-timeout Interrupt" },
/* System Event */
{ 0x12, 0x00, 0xff, "System Reconfigured" },
{ 0x12, 0x01, 0xff, "OEM System boot event" },
{ 0x12, 0x02, 0xff, "Undetermined system hardware failure" },
{ 0x12, 0x03, 0xff, "Entry added to auxiliary log" },
{ 0x12, 0x04, 0xff, "PEF Action" },
{ 0x12, 0x05, 0xff, "Timestamp Clock Sync" },
/* Critical Interrupt */
{ 0x13, 0x00, 0xff, "NMI/Diag Interrupt" },
{ 0x13, 0x01, 0xff, "Bus Timeout" },
{ 0x13, 0x02, 0xff, "I/O Channel check NMI" },
{ 0x13, 0x03, 0xff, "Software NMI" },
{ 0x13, 0x04, 0xff, "PCI PERR" },
{ 0x13, 0x05, 0xff, "PCI SERR" },
{ 0x13, 0x06, 0xff, "EISA failsafe timeout" },
{ 0x13, 0x07, 0xff, "Bus Correctable error" },
{ 0x13, 0x08, 0xff, "Bus Uncorrectable error" },
{ 0x13, 0x09, 0xff, "Fatal NMI" },
{ 0x13, 0x0a, 0xff, "Bus Fatal Error" },
{ 0x13, 0x0b, 0xff, "Bus Degraded" },
/* Button */
{ 0x14, 0x00, 0xff, "Power Button pressed" },
{ 0x14, 0x01, 0xff, "Sleep Button pressed" },
{ 0x14, 0x02, 0xff, "Reset Button pressed" },
{ 0x14, 0x03, 0xff, "FRU Latch" },
{ 0x14, 0x04, 0xff, "FRU Service" },
/* Chip Set */
{ 0x19, 0x00, 0xff, "Soft Power Control Failure" },
{ 0x19, 0x01, 0xff, "Thermal Trip" },
/* Cable/Interconnect */
{ 0x1b, 0x00, 0xff, "Connected" },
{ 0x1b, 0x01, 0xff, "Config Error" },
/* System Boot Initiated */
{ 0x1d, 0x00, 0xff, "Initiated by power up" },
{ 0x1d, 0x01, 0xff, "Initiated by hard reset" },
{ 0x1d, 0x02, 0xff, "Initiated by warm reset" },
{ 0x1d, 0x03, 0xff, "User requested PXE boot" },
{ 0x1d, 0x04, 0xff, "Automatic boot to diagnostic" },
{ 0x1d, 0x05, 0xff, "OS initiated hard reset" },
{ 0x1d, 0x06, 0xff, "OS initiated warm reset" },
{ 0x1d, 0x07, 0xff, "System Restart" },
/* Boot Error */
{ 0x1e, 0x00, 0xff, "No bootable media" },
{ 0x1e, 0x01, 0xff, "Non-bootable disk in drive" },
{ 0x1e, 0x02, 0xff, "PXE server not found" },
{ 0x1e, 0x03, 0xff, "Invalid boot sector" },
{ 0x1e, 0x04, 0xff, "Timeout waiting for selection" },
/* OS Boot */
{ 0x1f, 0x00, 0xff, "A: boot completed" },
{ 0x1f, 0x01, 0xff, "C: boot completed" },
{ 0x1f, 0x02, 0xff, "PXE boot completed" },
{ 0x1f, 0x03, 0xff, "Diagnostic boot completed" },
{ 0x1f, 0x04, 0xff, "CD-ROM boot completed" },
{ 0x1f, 0x05, 0xff, "ROM boot completed" },
{ 0x1f, 0x06, 0xff, "boot completed - device not specified" },
{ 0x1f, 0x07, 0xff, "Installation started" },
{ 0x1f, 0x08, 0xff, "Installation completed" },
{ 0x1f, 0x09, 0xff, "Installation aborted" },
{ 0x1f, 0x0a, 0xff, "Installation failed" },
/* OS Stop/Shutdown */
{ 0x20, 0x00, 0xff, "Error during system startup" },
{ 0x20, 0x01, 0xff, "Run-time critical stop" },
{ 0x20, 0x02, 0xff, "OS graceful stop" },
{ 0x20, 0x03, 0xff, "OS graceful shutdown" },
{ 0x20, 0x04, 0xff, "PEF initiated soft shutdown" },
{ 0x20, 0x05, 0xff, "Agent not responding" },
/* Slot/Connector */
{ 0x21, 0x00, 0xff, "Fault Status" },
{ 0x21, 0x01, 0xff, "Identify Status" },
{ 0x21, 0x02, 0xff, "Device Installed" },
{ 0x21, 0x03, 0xff, "Ready for Device Installation" },
{ 0x21, 0x04, 0xff, "Ready for Device Removal" },
{ 0x21, 0x05, 0xff, "Slot Power is Off" },
{ 0x21, 0x06, 0xff, "Device Removal Request" },
{ 0x21, 0x07, 0xff, "Interlock" },
{ 0x21, 0x08, 0xff, "Slot is Disabled" },
{ 0x21, 0x09, 0xff, "Spare Device" },
/* System ACPI Power State */
{ 0x22, 0x00, 0xff, "S0/G0: working" },
{ 0x22, 0x01, 0xff, "S1: sleeping with system hw & processor context maintained" },
{ 0x22, 0x02, 0xff, "S2: sleeping, processor context lost" },
{ 0x22, 0x03, 0xff, "S3: sleeping, processor & hw context lost, memory retained" },
{ 0x22, 0x04, 0xff, "S4: non-volatile sleep/suspend-to-disk" },
{ 0x22, 0x05, 0xff, "S5/G2: soft-off" },
{ 0x22, 0x06, 0xff, "S4/S5: soft-off" },
{ 0x22, 0x07, 0xff, "G3: mechanical off" },
{ 0x22, 0x08, 0xff, "Sleeping in S1/S2/S3 state" },
{ 0x22, 0x09, 0xff, "G1: sleeping" },
{ 0x22, 0x0a, 0xff, "S5: entered by override" },
{ 0x22, 0x0b, 0xff, "Legacy ON state" },
{ 0x22, 0x0c, 0xff, "Legacy OFF state" },
{ 0x22, 0x0e, 0xff, "Unknown" },
/* Watchdog 2 */
{ 0x23, 0x00, 0xff, "Timer expired" },
{ 0x23, 0x01, 0xff, "Hard reset" },
{ 0x23, 0x02, 0xff, "Power down" },
{ 0x23, 0x03, 0xff, "Power cycle" },
{ 0x23, 0x04, 0xff, "reserved" },
{ 0x23, 0x05, 0xff, "reserved" },
{ 0x23, 0x06, 0xff, "reserved" },
{ 0x23, 0x07, 0xff, "reserved" },
{ 0x23, 0x08, 0xff, "Timer interrupt" },
/* Platform Alert */
{ 0x24, 0x00, 0xff, "Platform generated page" },
{ 0x24, 0x01, 0xff, "Platform generated LAN alert" },
{ 0x24, 0x02, 0xff, "Platform Event Trap generated" },
{ 0x24, 0x03, 0xff, "Platform generated SNMP trap, OEM format" },
/* Entity Presence */
{ 0x25, 0x00, 0xff, "Present" },
{ 0x25, 0x01, 0xff, "Absent" },
{ 0x25, 0x02, 0xff, "Disabled" },
/* LAN */
{ 0x27, 0x00, 0xff, "Heartbeat Lost" },
{ 0x27, 0x01, 0xff, "Heartbeat" },
/* Management Subsystem Health */
{ 0x28, 0x00, 0xff, "Sensor access degraded or unavailable" },
{ 0x28, 0x01, 0xff, "Controller access degraded or unavailable" },
{ 0x28, 0x02, 0xff, "Management controller off-line" },
{ 0x28, 0x03, 0xff, "Management controller unavailable" },
{ 0x28, 0x04, 0xff, "Sensor failure" },
{ 0x28, 0x05, 0xff, "FRU failure" },
/* Battery */
{ 0x29, 0x00, 0xff, "Low" },
{ 0x29, 0x01, 0xff, "Failed" },
{ 0x29, 0x02, 0xff, "Presence Detected" },
/* Version Change */
{ 0x2b, 0x00, 0xff, "Hardware change detected" },
{ 0x2b, 0x01, 0x00, "Firmware or software change detected" },
{ 0x2b, 0x01, 0x01, "Firmware or software change detected, Mngmt Ctrl Dev Id" },
{ 0x2b, 0x01, 0x02, "Firmware or software change detected, Mngmt Ctrl Firm Rev" },
{ 0x2b, 0x01, 0x03, "Firmware or software change detected, Mngmt Ctrl Dev Rev" },
{ 0x2b, 0x01, 0x04, "Firmware or software change detected, Mngmt Ctrl Manuf Id" },
{ 0x2b, 0x01, 0x05, "Firmware or software change detected, Mngmt Ctrl IPMI Vers" },
{ 0x2b, 0x01, 0x06, "Firmware or software change detected, Mngmt Ctrl Aux Firm Id" },
{ 0x2b, 0x01, 0x07, "Firmware or software change detected, Mngmt Ctrl Firm Boot Block" },
{ 0x2b, 0x01, 0x08, "Firmware or software change detected, Mngmt Ctrl Other" },
{ 0x2b, 0x01, 0x09, "Firmware or software change detected, BIOS/EFI change" },
{ 0x2b, 0x01, 0x0A, "Firmware or software change detected, SMBIOS change" },
{ 0x2b, 0x01, 0x0B, "Firmware or software change detected, O/S change" },
{ 0x2b, 0x01, 0x0C, "Firmware or software change detected, O/S loader change" },
{ 0x2b, 0x01, 0x0D, "Firmware or software change detected, Service Diag change" },
{ 0x2b, 0x01, 0x0E, "Firmware or software change detected, Mngmt SW agent change" },
{ 0x2b, 0x01, 0x0F, "Firmware or software change detected, Mngmt SW App change" },
{ 0x2b, 0x01, 0x10, "Firmware or software change detected, Mngmt SW Middle" },
{ 0x2b, 0x01, 0x11, "Firmware or software change detected, Prog HW Change (FPGA)" },
{ 0x2b, 0x01, 0x12, "Firmware or software change detected, board/FRU module change" },
{ 0x2b, 0x01, 0x13, "Firmware or software change detected, board/FRU component change" },
{ 0x2b, 0x01, 0x14, "Firmware or software change detected, board/FRU replace equ ver" },
{ 0x2b, 0x01, 0x15, "Firmware or software change detected, board/FRU replace new ver" },
{ 0x2b, 0x01, 0x16, "Firmware or software change detected, board/FRU replace old ver" },
{ 0x2b, 0x01, 0x17, "Firmware or software change detected, board/FRU HW conf change" },
{ 0x2b, 0x02, 0xff, "Hardware incompatibility detected" },
{ 0x2b, 0x03, 0xff, "Firmware or software incompatibility detected" },
{ 0x2b, 0x04, 0xff, "Invalid or unsupported hardware version" },
{ 0x2b, 0x05, 0xff, "Invalid or unsupported firmware or software version" },
{ 0x2b, 0x06, 0xff, "Hardware change success" },
{ 0x2b, 0x07, 0x00, "Firmware or software change success" },
{ 0x2b, 0x07, 0x01, "Firmware or software change success, Mngmt Ctrl Dev Id" },
{ 0x2b, 0x07, 0x02, "Firmware or software change success, Mngmt Ctrl Firm Rev" },
{ 0x2b, 0x07, 0x03, "Firmware or software change success, Mngmt Ctrl Dev Rev" },
{ 0x2b, 0x07, 0x04, "Firmware or software change success, Mngmt Ctrl Manuf Id" },
{ 0x2b, 0x07, 0x05, "Firmware or software change success, Mngmt Ctrl IPMI Vers" },
{ 0x2b, 0x07, 0x06, "Firmware or software change success, Mngmt Ctrl Aux Firm Id" },
{ 0x2b, 0x07, 0x07, "Firmware or software change success, Mngmt Ctrl Firm Boot Block" },
{ 0x2b, 0x07, 0x08, "Firmware or software change success, Mngmt Ctrl Other" },
{ 0x2b, 0x07, 0x09, "Firmware or software change success, BIOS/EFI change" },
{ 0x2b, 0x07, 0x0A, "Firmware or software change success, SMBIOS change" },
{ 0x2b, 0x07, 0x0B, "Firmware or software change success, O/S change" },
{ 0x2b, 0x07, 0x0C, "Firmware or software change success, O/S loader change" },
{ 0x2b, 0x07, 0x0D, "Firmware or software change success, Service Diag change" },
{ 0x2b, 0x07, 0x0E, "Firmware or software change success, Mngmt SW agent change" },
{ 0x2b, 0x07, 0x0F, "Firmware or software change success, Mngmt SW App change" },
{ 0x2b, 0x07, 0x10, "Firmware or software change success, Mngmt SW Middle" },
{ 0x2b, 0x07, 0x11, "Firmware or software change success, Prog HW Change (FPGA)" },
{ 0x2b, 0x07, 0x12, "Firmware or software change success, board/FRU module change" },
{ 0x2b, 0x07, 0x13, "Firmware or software change success, board/FRU component change" },
{ 0x2b, 0x07, 0x14, "Firmware or software change success, board/FRU replace equ ver" },
{ 0x2b, 0x07, 0x15, "Firmware or software change success, board/FRU replace new ver" },
{ 0x2b, 0x07, 0x16, "Firmware or software change success, board/FRU replace old ver" },
{ 0x2b, 0x07, 0x17, "Firmware or software change success, board/FRU HW conf change" },
/* FRU State */
{ 0x2c, 0x00, 0xff, "Not Installed" },
{ 0x2c, 0x01, 0xff, "Inactive" },
{ 0x2c, 0x02, 0xff, "Activation Requested" },
{ 0x2c, 0x03, 0xff, "Activation in Progress" },
{ 0x2c, 0x04, 0xff, "Active" },
{ 0x2c, 0x05, 0xff, "Deactivation Requested" },
{ 0x2c, 0x06, 0xff, "Deactivation in Progress" },
{ 0x2c, 0x07, 0xff, "Communication lost" },
/* PICMG FRU Hot Swap */
{ 0xF0, 0x00, 0xFF, "Transition to M0" },
{ 0xF0, 0x01, 0xFF, "Transition to M1" },
{ 0xF0, 0x02, 0xFF, "Transition to M2" },
{ 0xF0, 0x03, 0xFF, "Transition to M3" },
{ 0xF0, 0x04, 0xFF, "Transition to M4" },
{ 0xF0, 0x05, 0xFF, "Transition to M5" },
{ 0xF0, 0x06, 0xFF, "Transition to M6" },
{ 0xF0, 0x07, 0xFF, "Transition to M7" },
/* PICMG IPMB Physical Link */
{ 0xF1, 0x00, 0xff, "IPMB-A disabled, IPMB-B disabled" },
{ 0xF1, 0x01, 0xff, "IPMB-A enabled, IPMB-B disabled" },
{ 0xF1, 0x02, 0xff, "IPMB-A disabled, IPMB-B enabled" },
{ 0xF1, 0x03, 0xff, "IPMB-A enabled, IPMB-B enabled" },
/* PICMG Module Hot Swap */
{ 0xF2, 0x00, 0xff, "Module Handle Closed" },
{ 0xF2, 0x01, 0xff, "Module Handle Opened" },
{ 0xF2, 0x02, 0xff, "Quiesced" },
{ 0x00, 0x00, 0xff, NULL },
};
static const struct ipmi_event_sensor_types vita_sensor_event_types[] = {
/* VITA FRU State */
{ 0xF0, 0x00, 0xFF, "Transition to M0" },
{ 0xF0, 0x01, 0xFF, "Transition to M1" },
{ 0xF0, 0x04, 0xFF, "Transition to M4" },
{ 0xF0, 0x05, 0xFF, "Transition to M5" },
{ 0xF0, 0x06, 0xFF, "Transition to M6" },
{ 0xF0, 0x07, 0xFF, "Transition to M7" },
/* VITA System IPMB Link */
{ 0xF1, 0x00, 0xFF, "IPMB-A disabled, IPMB-B disabled" },
{ 0xF1, 0x01, 0xFF, "IPMB-A enabled, IPMB-B disabled" },
{ 0xF1, 0x02, 0xFF, "IPMB-A disabled, IPMB-B enabled" },
{ 0xF1, 0x03, 0xFF, "IPMB-A enabled, IPMB-B enabled" },
/* VITA FRU Temperature */
{ 0xF3, 0x00, 0xff, "At or below Lower Non-critical" },
{ 0xF3, 0x01, 0xff, "At or below Lower Critical" },
{ 0xF3, 0x02, 0xff, "At or below Lower Non-recoverable" },
{ 0xF3, 0x03, 0xff, "At or above Upper Non-critical" },
{ 0xF3, 0x04, 0xff, "At or above Upper Critical" },
{ 0xF3, 0x05, 0xff, "At or above Upper Non-recoverable" },
{ 0x00, 0x00, 0xff, NULL }
};
static const struct ipmi_event_sensor_types oem_kontron_event_types[] = {
/* Board Reset(cPCI) */
{ 0xC1, 0x00, 0xff, "Push Button" },
{ 0xC1, 0x01, 0xff, "Bridge Reset" },
{ 0xC1, 0x02, 0xff, "Backplane" },
{ 0xC1, 0x03, 0xff, "Hotswap Fault" },
{ 0xC1, 0x04, 0xff, "Hotswap Healty" },
{ 0xC1, 0x05, 0xff, "Unknown" },
{ 0xC1, 0x06, 0xff, "ITP" },
{ 0xC1, 0x07, 0xff, "Hardware Watchdog" },
{ 0xC1, 0x08, 0xff, "Software Reset" },
/* IPMB-L Link State, based on PICMG IPMB-0 Link state sensor */
{ 0xC3, 0x02, 0xff, "IPMB L Disabled" },
{ 0xC3, 0x03, 0xff, "IPMB L Enabled" },
/* Board Reset */
{ 0xC4, 0x00, 0xff, "Push Button" },
{ 0xC4, 0x01, 0xff, "Hardware Power Failure" },
{ 0xC4, 0x02, 0xff, "Unknown" },
{ 0xC4, 0x03, 0xff, "Hardware Watchdog" },
{ 0xC4, 0x04, 0xff, "Soft Reset" },
{ 0xC4, 0x05, 0xff, "Warm Reset" },
{ 0xC4, 0x06, 0xff, "Cold Reset" },
{ 0xC4, 0x07, 0xff, "IPMI Command" },
{ 0xC4, 0x08, 0xff, "Setup Reset (Save CMOS)" },
{ 0xC4, 0x09, 0xff, "Power Up Reset" },
/* POST Value */
{ 0xC6, 0x0E, 0xff, "Post Error (see data2)" },
/* FWUM Status */
{ 0xC7, 0x00, 0xff, "First Boot After Upgrade" },
{ 0xC7, 0x01, 0xff, "First Boot After Rollback(error)" },
{ 0xC7, 0x02, 0xff, "First Boot After Errors (watchdog)" },
{ 0xC7, 0x03, 0xff, "First Boot After Manual Rollback" },
{ 0xC7, 0x08, 0xff, "Firmware Watchdog Bite, reset occurred" },
/* Switch Mngt Software Status */
{ 0xC8, 0x00, 0xff, "Not Loaded" },
{ 0xC8, 0x01, 0xff, "Initializing" },
{ 0xC8, 0x02, 0xff, "Ready" },
{ 0xC8, 0x03, 0xff, "Failure (see data2)" },
/* Diagnostic Status */
{ 0xC9, 0x00, 0xff, "Started" },
{ 0xC9, 0x01, 0xff, "Pass" },
{ 0xC9, 0x02, 0xff, "Fail" },
{ 0xCA, 0x00, 0xff, "In progress"},
{ 0xCA, 0x01, 0xff, "Success"},
{ 0xCA, 0x02, 0xff, "Failure"},
/* FRU Over Current */
{ 0xCB, 0x00, 0xff, "Asserted"},
{ 0xCB, 0x01, 0xff, "Deasserted"},
/* FRU Sensor Error */
{ 0xCC, 0x00, 0xff, "Asserted"},
{ 0xCC, 0x01, 0xff, "Deasserted"},
/* FRU Power Denied */
{ 0xCD, 0x00, 0xff, "Asserted"},
{ 0xCD, 0x01, 0xff, "Deasserted"},
/* Reset */
{ 0xCF, 0x00, 0xff, "Asserted"},
{ 0xCF, 0x01, 0xff, "Deasserted"},
/* END */
{ 0x00, 0x00, 0xff, NULL },
};
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);
void ipmi_sel_print_extended_entry(struct ipmi_intf * intf, struct sel_event_record * evt);
void ipmi_sel_print_extended_entry_verbose(struct ipmi_intf * intf, struct sel_event_record * evt);
void ipmi_get_event_desc(struct ipmi_intf * intf, struct sel_event_record * rec, char ** desc);
const char * ipmi_get_sensor_type(struct ipmi_intf *intf, uint8_t code);
uint16_t ipmi_sel_get_std_entry(struct ipmi_intf * intf, uint16_t id, struct sel_event_record * evt);
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);
const struct ipmi_event_sensor_types *
ipmi_get_first_event_sensor_type(struct ipmi_intf *intf, uint8_t sensor_type, uint8_t event_type);
const struct ipmi_event_sensor_types *
ipmi_get_next_event_sensor_type(const struct ipmi_event_sensor_types *evt);
#endif /* IPMI_SEL_H */

View File

@ -0,0 +1,155 @@
/*
* 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_SEL_SUPERMICRO_H
# define IPMI_SEL_SUPERMICRO_H
static uint16_t supermicro_x11[] = {
0x0958, 0x0955, 0x0953, 0x0952, 0x0941, 0x093A, 0x0939, 0x0938, 0x0937, 0x0930, 0x0927, 0x091D,
0x091C, 0x0917, 0x090D, 0x0909, 0x0907, 0x0901, 0x089F, 0x089C, 0x089B, 0x089A, 0x0898, 0x0896,
0x0895, 0x0894, 0x0891, 0x0890, 0x0888, 0x0886, 0x0885, 0x0884, 0xFFFF
};
static uint16_t supermicro_b11[] = {
0xFFFF
};
static uint16_t supermicro_b2[] = {
0x0951, 0x094E, 0x0931, 0x092E, 0x092A, 0x0928, 0x0908, 0xFFFF
};
static uint16_t supermicro_x10OBi[] = {
0x0923, 0xFFFF
};
static uint16_t supermicro_x10QRH[] = {
0x0872, 0xFFFF
};
static uint16_t supermicro_x10QBL[] = {
0x0853, 0xFFFF
};
static uint16_t supermicro_brickland[] = {
0x0726, 0x083A, 0xFFFF
};
static uint16_t supermicro_x9dal[] = {
0x0635, 0xFFFF
};
static uint16_t supermicro_x9db[] = {
0x0733, 0x0722, 0x0703, 0x0721, 0x0716, 0x0637, 0xFFFF
};
static uint16_t supermicro_x9sb[] = {
0x0651, 0xFFFF
};
static uint16_t supermicro_x9[] = {
0x0635, 0x0733, 0x0722, 0x0703, 0x0721, 0x0716, 0x0637, 0x0651, 0xFFFF
};
static uint16_t supermicro_romely[] = {
0x0841, 0x0732, 0x0731, 0x0730, 0x0727, 0x0725, 0x0724, 0x0723, 0x0720, 0x0718, 0x0717, 0x0715,
0x0713, 0x0711, 0x070E, 0x070A, 0x0709, 0x0708, 0x0706, 0x0705, 0x0704, 0x0702, 0x0701, 0x0700,
0x066F, 0x066E, 0x066D, 0x0669, 0x0667, 0x0666, 0x0665, 0x0664, 0x0662, 0x0660, 0x0636, 0x0630,
0x062F, 0x062C, 0x0628, 0x0626, 0x0827, 0x070F, 0x0707, 0x0840, 0x0729, 0x0719, 0x0712, 0x070D,
0x066C, 0x066A, 0x0625, 0x0714, 0x0710, 0x070C, 0x070B, 0x0668, 0x0663, 0x0661, 0x062B, 0x062A,
0x0629, 0x093E, 0x0932, 0x092D, 0x092B, 0x0924, 0x0922, 0x0921, 0x091E, 0x0919, 0x0916, 0x089D,
0x0899, 0x0893, 0x0892, 0x0882, 0x0881, 0x0880, 0x087F, 0x087D, 0x0879, 0x0877, 0x086F, 0x086E,
0x086D, 0x086C, 0x086B, 0x085C, 0x085B, 0x084B, 0x0865, 0x0864, 0x0860, 0x0859, 0x0858, 0x0857,
0x0854, 0x0852, 0x0845, 0x0844, 0x0843, 0x0842, 0x083B, 0x0838, 0x0837, 0x0836, 0x0835, 0x0834,
0x0833, 0x0832, 0x0831, 0x0830, 0x0826, 0x0825, 0x0824, 0x0822, 0x0821, 0x0819, 0x0818, 0x0817,
0x0816, 0x0815, 0x0814, 0x0728, 0x0813, 0x0812, 0x0810, 0x0807, 0x0806, 0x0805, 0x0804, 0x0803,
0x0802, 0x0801, 0x0889, 0x0861, 0x083E, 0x0846, 0x0946, 0x0950, 0xFFFF
};
static uint16_t supermicro_b8[] = {
0x000A, 0x061c, 0x0620, 0x0101, 0x061f, 0x0612, 0x061e, 0xFFFF
};
static uint16_t supermicro_h8[] = {
0xa111, 0x0408, 0x0811, 0x1411, 0x0911, 0x1211, 0x1011, 0xcd11, 0x1111, 0xbe11, 0xce11, 0xbd11,
0xbc11, 0xa911, 0xaa11, 0xcb11, 0xad11, 0xa811, 0xac11, 0xaf11, 0xa511, 0xa011, 0x1611, 0x2511,
0xbf11, 0x1511, 0x2211, 0x2411, 0x1911, 0xab11, 0xd011, 0xae11, 0xca11, 0x0409, 0xa211, 0xa311,
0x1311, 0xba11, 0xa711, 0xd111, 0x1711, 0xcf11, 0x2011, 0x1811, 0xFFFF
};
static uint16_t supermicro_p8[] = {
0x5980, 0x6280, 0x6480, 0x7380, 0x7480, 0x0933, 0x094F, 0xFFFF
};
static uint16_t supermicro_x8[] = {
0xa880, 0x0403, 0x0100, 0x0601, 0x0001, 0x0404, 0x0606, 0x0608, 0x0632, 0x0400, 0x0401, 0x0006,
0x040a, 0xf280, 0x060f, 0x0609, 0x0008, 0x0613, 0x061b, 0x0007, 0x0600, 0x060c, 0x060d, 0x0614,
0x0003, 0x040b, 0x0621, 0x0610, 0x0638, 0xf380, 0x060b, 0x040d, 0x0605, 0x062d, 0x060e, 0x061a,
0xf580, 0x062e, 0x0009, 0xFFFF
};
static uint16_t supermicro_X8[] = {
0x000A, 0x061c, 0x0620, 0x0101, 0x061f, 0x0612, 0x061e, 0xa111, 0x0408, 0x0811, 0x1411, 0x0911,
0x1211, 0x1011, 0xcd11, 0x1111, 0xbe11, 0xce11, 0xbd11, 0xbc11, 0xa911, 0xaa11, 0xcb11, 0xad11,
0xa811, 0xac11, 0xaf11, 0xa511, 0xa011, 0x1611, 0x2511, 0xbf11, 0x1511, 0x2211, 0x2411, 0x1911,
0xab11, 0xd011, 0xae11, 0xca11, 0x0409, 0xa211, 0xa311, 0x1311, 0xba11, 0xa711, 0xd111, 0x1711,
0xcf11, 0x2011, 0x1811, 0x5980, 0x6280, 0x6480, 0x7380, 0x7480, 0x0933, 0x094F, 0xa880, 0x0403,
0x0100, 0x0601, 0x0001, 0x0404, 0x0606, 0x0608, 0x0632, 0x0400, 0x0401, 0x0006, 0x040a, 0xf280,
0x060f, 0x0609, 0x0008, 0x0613, 0x061b, 0x0007, 0x0600, 0x060c, 0x060d, 0x0614, 0x0003, 0x040b,
0x0621, 0x0610, 0x0638, 0xf380, 0x060b, 0x040d, 0x0605, 0x062d, 0x060e, 0x061a, 0xf580, 0x062e,
0x0009, 0xFFFF
};
static uint16_t supermicro_older[] = {
0x8080, 0x8180, 0x8280, 0x8480, 0x8580, 0x8680, 0x8780, 0x8880, 0x8980, 0x9080, 0x9180, 0x9280,
0x9380, 0x9480, 0x9580, 0x9680, 0x9780, 0xA080, 0x9880, 0x9980, 0xB080, 0xB180, 0xB280, 0xB380,
0xB480, 0xA280, 0xB580, 0xB680, 0xA580, 0xB780, 0xD180, 0xA380, 0xA480, 0xD680, 0xBA80, 0xD280,
0x2111, 0xD380, 0xBC80, 0xBD80, 0xBE80, 0xC080, 0xC180, 0xAA80, 0xBE80, 0xBF80, 0xAB80, 0xD480,
0xD580, 0xAF80, 0xAE80, 0xC280, 0xAC80, 0xD080, 0xDA80, 0xDB80, 0xDC80, 0xDD80, 0xA680, 0xDE80,
0xAA80, 0xDF80, 0xBB80, 0xA780, 0xF080, 0xF180, 0xB880, 0xC380, 0xB780, 0x2311, 0xA980, 0xF480,
0xB980, 0x0002, 0xba80, 0x0602, 0x0603, 0x0604, 0x0607, 0x0410, 0xA611, 0x060A, 0x0611, 0xBB11,
0x061D, 0x0622, 0x0623, 0x0624, 0x0627, 0x0631, 0x0633, 0x0634, 0x0690, 0x0691, 0x0640, 0x0641,
0x0642, 0x066B, 0x0743, 0x0644, 0x0645, 0x0645, 0x0646, 0x0647, 0x0648, 0x0647, 0x0650, 0x0652,
0x0653, 0x0654, 0x0655, 0x0808, 0x0809, 0x0656, 0x0657, 0x0658, 0x0659, 0x0820, 0x0820, 0x0734,
0x0823, 0x0828, 0x0829, 0x0839, 0x083C, 0x083D, 0x083F, 0x0847, 0x0848, 0x0849, 0x0850, 0x0851,
0x0855, 0x0856, 0x0862, 0x0863, 0x0866, 0x0867, 0x0868, 0x0869, 0x084A, 0x084C, 0x084D, 0x084F,
0x085A, 0x085D, 0x085E, 0x085F, 0x086A, 0x0870, 0x0873, 0x0874, 0x0875, 0x0876, 0x0878, 0x087A,
0x087B, 0x087C, 0x087E, 0x0883, 0x0887, 0x088A, 0x088B, 0x088C, 0x088D, 0x088E, 0x088F, 0x0897,
0x089E, 0x0902, 0x0903, 0x0904, 0x0905, 0x0906, 0x090A, 0x090B, 0x090C, 0x090E, 0x090F, 0x0910,
0x0912, 0x0913, 0x0914, 0x0915, 0x0918, 0x091A, 0x091B, 0x091F, 0x0920, 0x0925, 0x0926, 0x0929,
0x092C, 0x092F, 0x0934, 0x0935, 0x0936, 0x093B, 0x093C, 0x093D, 0x093F, 0x0940, 0x0942, 0x0943,
0x0944, 0x0945, 0x0947, 0x0948, 0x0949, 0x094A, 0x094B, 0x094C, 0x094D, 0x094E, 0x0954, 0x0956,
0x0957, 0x0959, 0xFFFF
};
#endif /* IPMI_SEL_SUPERMICRO_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
@ -42,13 +38,6 @@
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_sdr.h>
/* ipmi sensor commands */
#define GET_SENSOR_READING 0x2d
#define GET_SENSOR_FACTORS 0x23
#define SET_SENSOR_THRESHOLDS 0x26
#define GET_SENSOR_THRESHOLDS 0x27
#define GET_SENSOR_TYPE 0x2f
/* threshold specification bits for analog sensors for get sensor threshold command
* and set sensor threshold command
*/
@ -76,6 +65,9 @@
#define STATE_13_ASSERTED 0x20
#define STATE_14_ASSERTED 0x40
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct sensor_set_thresh_rq {
uint8_t sensor_num; /* sensor # */
uint8_t set_mask; /* threshold setting mask */
@ -85,11 +77,13 @@ struct sensor_set_thresh_rq {
uint8_t upper_non_crit; /* new upper non critical threshold*/
uint8_t upper_crit; /* new upper critical threshold*/
uint8_t upper_non_recov; /* new upper non recoverable threshold*/
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#endif
int ipmi_sensor_main(struct ipmi_intf *, int, char **);
int ipmi_sensor_print_full(struct ipmi_intf *, struct sdr_record_full_sensor *);
int ipmi_sensor_print_compact(struct ipmi_intf *, struct sdr_record_compact_sensor *);
int ipmi_sensor_print_fc(struct ipmi_intf *, struct sdr_record_common_sensor *, uint8_t);
int ipmi_sensor_get_sensor_reading_factors( struct ipmi_intf * intf, struct sdr_record_full_sensor * sensor, uint8_t reading);
#endif /* 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
@ -47,6 +43,9 @@
/*
* From table 22.25 of the IPMIv2 specification
*/
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
struct get_session_info_rsp
{
uint8_t session_handle;
@ -120,7 +119,10 @@ struct get_session_info_rsp
uint16_t console_port; /* LSBF */
} modem_data;
} channel_data;
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef HAVE_PRAGMA_PACK
#pragma pack(0)
#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_SOL_H
@ -39,6 +35,9 @@
#include <ipmitool/ipmi.h>
#define SOL_ESCAPE_CHARACTER_DEFAULT '~'
#define SOL_KEEPALIVE_TIMEOUT 15
#define SOL_KEEPALIVE_RETRIES 3
#define IPMI_SOL_SERIAL_ALERT_MASK_SUCCEED 0x08
#define IPMI_SOL_SERIAL_ALERT_MASK_DEFERRED 0x04
@ -65,22 +64,44 @@ struct sol_config_parameters {
/*
* The ACTIVATE PAYLOAD command reponse structure
* The ACTIVATE PAYLOAD command response structure
* From table 24-2 of the IPMI v2.0 spec
*/
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct activate_payload_rsp {
uint8_t auxiliary_data[4];
uint8_t inbound_payload_size[2]; /* LS byte first */
uint8_t outbound_payload_size[2]; /* LS byte first */
uint8_t payload_udp_port[2]; /* LS byte first */
uint8_t payload_vlan_number[2]; /* LS byte first */
} __attribute__ ((packed));
} ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
/*
* Small function to validate that user-supplied SOL
* configuration parameter values we store in uint8_t
* data type falls within valid range. With minval
* and maxval parameters we can use the same function
* to validate parameters that have different ranges
* of values.
*
* function will return -1 if value is not valid, or
* will return 0 if valid.
*/
int ipmi_sol_set_param_isvalid_uint8_t(const char *strval,
const char *name,
uint8_t minval,
uint8_t maxval,
uint8_t *out_value);
int ipmi_sol_main(struct ipmi_intf *, int, char **);
int ipmi_get_sol_info(struct ipmi_intf * intf,
uint8_t channel,
struct sol_config_parameters * params);
int ipmi_get_sol_info(struct ipmi_intf *intf,
uint8_t channel,
struct sol_config_parameters *params);
#endif /* IPMI_SOL_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_STRINGS_H
@ -39,21 +35,43 @@
#include <ipmitool/helper.h>
#define CC_STRING(cc) val2str(cc, completion_code_vals)
extern const struct valstr completion_code_vals[];
extern const struct valstr entity_id_vals[];
extern const struct valstr entity_device_type_vals[];
extern const struct valstr ipmi_netfn_vals[];
extern const struct valstr ipmi_channel_activity_type_vals[];
extern const struct valstr ipmi_privlvl_vals[];
extern const struct valstr impi_bit_rate_vals[];
extern const struct valstr ipmi_bit_rate_vals[];
extern const struct valstr ipmi_set_in_progress_vals[];
extern const struct valstr ipmi_authtype_session_vals[];
extern const struct valstr ipmi_authtype_vals[];
extern const struct valstr ipmi_channel_protocol_vals[];
extern const struct valstr ipmi_channel_medium_vals[];
extern const struct valstr ipmi_chassis_power_control_vals[];
extern const struct valstr ipmi_auth_algorithms[];
extern const struct valstr ipmi_integrity_algorithms[];
extern const struct valstr ipmi_encryption_algorithms[];
extern const struct valstr ipmi_oem_info[];
extern const struct valstr ipmi_user_enable_status_vals[];
extern const struct valstr picmg_frucontrol_vals[];
extern const struct valstr picmg_clk_family_vals[];
extern const struct oemvalstr picmg_clk_accuracy_vals[];
extern const struct oemvalstr picmg_clk_resource_vals[];
extern const struct oemvalstr picmg_clk_id_vals[];
extern const struct valstr picmg_busres_id_vals[];
extern const struct valstr picmg_busres_board_cmd_vals[];
extern const struct valstr picmg_busres_shmc_cmd_vals[];
extern const struct oemvalstr picmg_busres_board_status_vals[];
extern const struct oemvalstr picmg_busres_shmc_status_vals[];
/* these are similar, expect that the lookup takes the IANA number
as first parameter */
extern const struct oemvalstr ipmi_oem_product_info[];
extern const char *ipmi_generic_sensor_type_vals[];
extern const struct oemvalstr ipmi_oem_sensor_type_vals[];
#endif /*IPMI_STRINGS_H*/

View File

@ -0,0 +1,73 @@
/*
* Copyright (c) 2009, 2014, Oracle and/or its affiliates. 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_SUNOEM_H
#define IPMI_SUNOEM_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_sdr.h>
#define IPMI_NETFN_SUNOEM 0x2e
#define IPMI_SUNOEM_SET_SSH_KEY 0x01
#define IPMI_SUNOEM_DEL_SSH_KEY 0x02
#define IPMI_SUNOEM_GET_HEALTH_STATUS 0x10
#define IPMI_SUNOEM_CLI 0x19
#define IPMI_SUNOEM_SET_FAN_SPEED 0x20
#define IPMI_SUNOEM_LED_GET 0x21
#define IPMI_SUNOEM_LED_SET 0x22
#define IPMI_SUNOEM_ECHO 0x23
#define IPMI_SUNOEM_VERSION 0x24
#define IPMI_SUNOEM_NACNAME 0x29
#define IPMI_SUNOEM_GETVAL 0x2A
#define IPMI_SUNOEM_SETVAL 0x2C
#define IPMI_SUNOEM_SENSOR_SET 0x3A
#define IPMI_SUNOEM_SET_FAN_MODE 0x41
#define IPMI_SUNOEM_CORE_TUNNEL 0x44
/*
* Error codes of sunoem functions
*/
typedef enum {
SUNOEM_EC_SUCCESS = 0,
SUNOEM_EC_INVALID_ARG = 1,
SUNOEM_EC_BMC_NOT_RESPONDING = 2,
SUNOEM_EC_BMC_CCODE_NONZERO = 3
} sunoem_ec_t;
int ipmi_sunoem_main(struct ipmi_intf *, int, char **);
#endif /*IPMI_SUNOEM_H*/

View File

@ -0,0 +1,93 @@
/*
* Copyright (c) 2018 Alexander Amelkin. 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 the copyright holder, nor the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "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.
* THE COPYRIGHT HOLDER 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
* THE COPYRIGHT HOLDER 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 THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGES.
*/
#ifndef IPMI_TIME_H
#define IPMI_TIME_H
#include <time.h>
#include <stdbool.h>
extern bool time_in_utc;
/* Special values according to IPMI v2.0, rev. 1.1, section 37.1 */
#define IPMI_TIME_UNSPECIFIED 0xFFFFFFFFu
#define IPMI_TIME_INIT_DONE 0x20000000u
#define SECONDS_A_DAY (24 * 60 * 60)
/*
* Check whether the timestamp is in seconds since Epoch or since
* the system startup.
*/
static inline bool ipmi_timestamp_is_special(time_t ts)
{
return (ts < IPMI_TIME_INIT_DONE);
}
/*
* Check whether the timestamp is valid at all
*/
static inline bool ipmi_timestamp_is_valid(time_t ts)
{
return (ts != IPMI_TIME_UNSPECIFIED);
}
/*
* Just 26 characters are required for asctime_r(), plus timezone info.
* However just to be safe locale-wise and assuming that in no locale
* the date/time string exceeds the 'standard' legacy terminal width,
* the buffer size is set here to 80.
*/
#define IPMI_ASCTIME_SZ 80
typedef char ipmi_datebuf_t[IPMI_ASCTIME_SZ];
/*
* These are ipmitool-specific versions that take
* in account the command line options
*/
char *ipmi_asctime_r(time_t stamp, ipmi_datebuf_t outbuf);
size_t ipmi_strftime(char *s, size_t max, const char *format, time_t stamp)
__attribute__((format(strftime, 3, 0)));
/* These return pointers to static arrays and aren't thread safe */
char *ipmi_timestamp_fmt(uint32_t stamp, const char *fmt)
__attribute__((format(strftime, 2, 0)));
char *ipmi_timestamp_string(uint32_t stamp); /* Day Mon DD HH:MM:SS YYYY ZZZ */
char *ipmi_timestamp_numeric(uint32_t stamp); /* MM/DD/YYYY HH:MM:SS ZZZ */
char *ipmi_timestamp_date(uint32_t stamp); /* MM/DD/YYYY ZZZ */
char *ipmi_timestamp_time(uint32_t stamp); /* HH:MM:SS ZZZ */
/* Subtract the UTC offset from local time_t */
time_t ipmi_localtime2utc(time_t local);
#endif

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2005 Tyan Computer Corp. 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_TSOL_H
#define IPMI_TSOL_H
#include <ipmitool/ipmi.h>
#define IPMI_TSOL_CMD_SENDKEY 0x03
#define IPMI_TSOL_CMD_START 0x06
#define IPMI_TSOL_CMD_STOP 0x02
#define IPMI_TSOL_DEF_PORT 6230
int ipmi_tsol_main(struct ipmi_intf *, int, char **);
#endif /* 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
@ -42,52 +38,49 @@
#endif
#include <ipmitool/ipmi.h>
#define IPMI_PASSWORD_DISABLE_USER 0x00
#define IPMI_PASSWORD_ENABLE_USER 0x01
#define IPMI_PASSWORD_SET_PASSWORD 0x02
#define IPMI_PASSWORD_TEST_PASSWORD 0x03
/*
* The GET USER ACCESS response from table 22-32 of the IMPI v2.0 spec
*/
struct user_access_rsp {
#if WORDS_BIGENDIAN
uint8_t __reserved1 : 2;
uint8_t maximum_ids : 6;
#else
uint8_t maximum_ids : 6;
uint8_t __reserved1 : 2;
#endif
#define IPMI_USER_ENABLE_UNSPECIFIED 0x00
#define IPMI_USER_ENABLE_ENABLED 0x40
#define IPMI_USER_ENABLE_DISABLED 0x80
#define IPMI_USER_ENABLE_RESERVED 0xC0
#if WORDS_BIGENDIAN
uint8_t __reserved2 : 2;
uint8_t enabled_user_count : 6;
#else
uint8_t enabled_user_count : 6;
uint8_t __reserved2 : 2;
#endif
#if WORDS_BIGENDIAN
uint8_t __reserved3 : 2;
uint8_t fixed_name_count : 6;
#else
uint8_t fixed_name_count : 6;
uint8_t __reserved3 : 2;
#endif
#if WORDS_BIGENDIAN
uint8_t __reserved4 : 1;
uint8_t no_callin_access : 1;
uint8_t link_auth_access : 1;
uint8_t ipmi_messaging_access : 1;
uint8_t channel_privilege_limit : 4;
#else
uint8_t channel_privilege_limit : 4;
uint8_t ipmi_messaging_access : 1;
uint8_t link_auth_access : 1;
uint8_t no_callin_access : 1;
uint8_t __reserved4 : 1;
#endif
} __attribute__ ((packed));
#define IPMI_UID_MASK 0x3F /* The user_id is 6-bit and is usually in bits [5:0] */
#define IPMI_UID(id) ((id) & IPMI_UID_MASK)
/* (22.27) Get and (22.26) Set User Access */
struct user_access_t {
uint8_t callin_callback;
uint8_t channel;
uint8_t enabled_user_ids;
uint8_t enable_status;
uint8_t fixed_user_ids;
uint8_t ipmi_messaging;
uint8_t link_auth;
uint8_t max_user_ids;
uint8_t privilege_limit;
uint8_t session_limit;
uint8_t user_id;
};
/* (22.29) Get User Name */
struct user_name_t {
uint8_t user_id;
uint8_t user_name[17];
};
int ipmi_user_main(struct ipmi_intf *, int, char **);
int _ipmi_get_user_access(struct ipmi_intf *intf,
struct user_access_t *user_access_rsp);
int _ipmi_get_user_name(struct ipmi_intf *intf, struct user_name_t *user_name);
int _ipmi_set_user_access(struct ipmi_intf *intf,
struct user_access_t *user_access_req,
uint8_t change_priv_limit_only);
int _ipmi_set_user_password(struct ipmi_intf *intf,
uint8_t user_id, uint8_t operation,
const char *password, uint8_t is_twenty_byte);
#endif /* IPMI_USER_H */

View File

@ -0,0 +1,49 @@
/*
* Copyright (c) Pigeon Point Systems. All right reserved
*/
#ifndef _IPMI_VITA_H_
#define _IPMI_VITA_H_
/* VITA 46.11 commands */
#define VITA_GET_VSO_CAPABILITIES_CMD 0x00
#define VITA_FRU_CONTROL_CMD 0x04
#define VITA_GET_FRU_LED_PROPERTIES_CMD 0x05
#define VITA_GET_LED_COLOR_CAPABILITIES_CMD 0x06
#define VITA_SET_FRU_LED_STATE_CMD 0x07
#define VITA_GET_FRU_LED_STATE_CMD 0x08
#define VITA_SET_FRU_STATE_POLICY_BITS_CMD 0x0A
#define VITA_GET_FRU_STATE_POLICY_BITS_CMD 0x0B
#define VITA_SET_FRU_ACTIVATION_CMD 0x0C
#define VITA_GET_FRU_ADDRESS_INFO_CMD 0x40
/* VITA 46.11 site types */
#define VITA_FRONT_VPX_MODULE 0x00
#define VITA_POWER_ENTRY 0x01
#define VITA_CHASSIS_FRU 0x02
#define VITA_DEDICATED_CHMC 0x03
#define VITA_FAN_TRAY 0x04
#define VITA_FAN_TRAY_FILTER 0x05
#define VITA_ALARM_PANEL 0x06
#define VITA_XMC 0x07
#define VITA_VPX_RTM 0x09
#define VITA_FRONT_VME_MODULE 0x0A
#define VITA_FRONT_VXS_MODULE 0x0B
#define VITA_POWER_SUPPLY 0x0C
#define VITA_FRONT_VITA62_MODULE 0x0D
#define VITA_71_MODULE 0x0E
#define VITA_FMC 0x0F
#define GROUP_EXT_VITA 0x03
extern uint8_t
vita_discover(struct ipmi_intf *intf);
extern uint8_t
ipmi_vita_ipmb_address(struct ipmi_intf *intf);
extern int
ipmi_vita_main(struct ipmi_intf * intf, int argc, char ** argv);
#endif /* _IPMI_VITA_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

@ -1,99 +0,0 @@
version 1.8.0
* Fix IPMIv2.0 issues
* Fix chassis boot parameter support
* Add support for linear sensors
version 1.7.1
* Update bmc plugin to work with new Solaris bmc driver (new ioctl
for interface detection and new STREAMS message-based interface)
version 1.7.0
* Propogate errors correctly so exit status will be useful
* More consistent display of errors including completion code text
* Errors and debug is send to stderr now
* New "sel get" command that will print details about SEL entry
and corresponding SDR records as well as FRUs via entity association
* Improved event generator, now supports reading events from text file
* New "-o oemtype" option for specifying OEM boards
exsting types are "supermicro" and "intelwv2"
* New PEF subsystem from Tim Murphy at Dell
* New "bmc" plugin for Solaris 10 x86
* Many bugfixes and contributed patches
version 1.6.2
* Support for Supermicro BMC OEM authentication method
version 1.6.1
* Fix minor problem with LAN parameter setting
version 1.6.0
* Add a README file
* Add Solaris x86 interface plugin
* Add support for building Solaris packages
* Fix segfault when doing "sel list" (from Matthew Braithwaite)
* Fix "chassis identify" on some BMCs (from ebrower@sourceforge)
* Add command "bmc info" and related output (from ebrower@sourceforge)
* Add support for IPMIv2 and Serial-over-LAN from Jeremy at Newisys
* Add support for building RPMs as non-root user
* Add new "shell" and "exec" commands
* Lots of other contributed patches
version 1.5.9
* Add ability to get a particular sensor by name
* Add ability to set a particular sensor threshold
* Add support for displaying V2 channel authentication levels
* Add README for rrdtool scripts in contrib directory
* Improve lan interface retry handling
* Support prompting for password or reading from environment
* Move chaninfo command into channel subcommand
* Fix reservation ID handling when two sessions open to BMC
* Fix reading of large FRU data
* Add configure option for changing binary to ipmiadm for Solaris
* Fix compile problem on Solaris 8
version 1.5.8
* Enable static compilation of interfaces
* Fix types to be 64-bit safe
* Fix compilation problems on Solaris
* Fix multiple big-endian problems for Solaris/SPARC
* Fix channel access to save settings to NVRAM
* Set channel privilege limit to ADMIN during "access on"
* Enable gratuitous ARP in bmcautoconf.sh
* Add support for Linux kernel panic messages in SEL output
* Add support for type 3 SDR records
version 1.5.7
* Add IPMIv1.5 eratta fixes
* Additions to FRU printing and FRU multirecords
* Better handling of SDR printing
* Contrib scripts for creating rrdtool graphs
version 1.5.6
* Fix SEL event decoding for generic events
* Handle empty SEL gracefully when doing "sel list"
* Fix sdr handling of sensors that do not return a reading
* Fix for CSV display of sensor readings/units from Fredrik <20>hrn
version 1.5.5
* Add -U option for setting LAN username
* Fix -v usage for plugin interfaces
version 1.5.4
* Put interface plugin API into library
* Fix ipmievd
version 1.5.3
* Add -g option to work with grizzly bmc
version 1.5.2
* Add support for setting gratuitous arp interval
version 1.5.1
* Better SEL support
* Fix display bug in SDR list
version 1.5.0
* More robust UDP packet handling
* Add Intel IMB driver support
* Use autoconf/automake/libtool

View File

@ -1,323 +0,0 @@
dnl
dnl autoconf for ipmitool
dnl
AC_INIT([src/ipmitool.c])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([ipmitool], [1.8.0])
AM_CONFIG_HEADER(config.h)
AC_CONFIG_SRCDIR([src/ipmitool.c])
AC_PREREQ(2.50)
AC_SUBST(ac_configure_args)
dnl check for requirements
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
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])
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/socket.h])
AC_CHECK_HEADERS([sys/byteorder.h byteswap.h])
AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN
AC_FUNC_MALLOC
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STRTOD
AC_CHECK_FUNCS([alarm gethostbyname socket select])
AC_CHECK_FUNCS([memmove memset strchr strdup strerror])
AC_CHECK_FUNCS([getpassphrase])
CFLAGS="$CFLAGS -fno-strict-aliasing"
AM_PROG_LIBTOOL
LIBTOOL="$LIBTOOL --silent"
AC_SEARCH_LIBS([gethostbyname], [nsl])
AC_SEARCH_LIBS([socket], [socket], [],
[AC_CHECK_LIB([nsl], [socket],
[LIBS="$LIBS -lsocket -lnsl"], [], [-lsocket])])
if test "x$prefix" = "xNONE"; then
prefix="$ac_default_prefix"
fi
if test "x$exec_prefix" = "xNONE"; then
exec_prefix="$prefix"
fi
dnl set some things so we build with GNU tools on Solaris
case "$host_os" in
solaris*)
MAKE=gmake
STRIP=gstrip
LD=gld
AR=gar
# openssl libs are in /usr/sfw/lib on solaris 10
LIBS="$LIBS -R/usr/sfw/lib"
# disable the linux-specific interfaces
# and bmc on SPARC (there is no bmc driver for SPARC)
if [[ `mach -p` = sparc ]]; then
enable_intf_bmc=no
else
enable_intf_bmc=yes
fi
enable_intf_imb=no
enable_intf_open=no
enable_ipmievd=no
enable_ipmishell=no
;;
*cygwin*)
# disable the linux and solaris-specific interfaces
enable_intf_imb=no
enable_intf_open=no
enable_intf_lipmi=no
enable_intf_bmc=no
enable_ipmievd=no
enable_ipmishell=no
;;
*darwin*)
# disable the linux and solaris-specific interfaces
enable_intf_imb=no
enable_intf_open=no
enable_intf_lipmi=no
enable_intf_bmc=no
enable_ipmived=no
enable_ipmishell=no
;;
esac
AC_SUBST(ARCH, $host_cpu)
AC_SUBST(OS, $host_os)
AC_SUBST(PSTAMP, $host)
AC_SUBST(BASEDIR, $prefix)
dnl check for OpenSSL functionality
AC_ARG_ENABLE([internal-md5],
[AC_HELP_STRING([--enable-internal-md5],
[enable internal MD5 library [default=no]])],
[], [enable_internal_md5=no])
AC_CHECK_LIB([crypto], [EVP_aes_128_cbc],
[if test "x$enable_internal_md5" != "xyes"; then
have_crypto=yes; LIBS="$LIBS -lcrypto"
fi], [have_crypto=no], [-lcrypto])
AC_CHECK_LIB([crypto], [MD5_Init],
[if test "x$enable_internal_md5" != "xyes"; then
if test "x$have_crypto" != "xyes"; then
LIBS="$LIBS -lcrypto"
have_md5=yes
fi
AC_DEFINE(HAVE_CRYPTO_MD5, [1], [Define to 1 if libcrypto supports MD5.])
fi], [], [-lcrypto])
AC_CHECK_LIB([crypto], [MD2_Init],
[if test "x$enable_internal_md5" != "xyes"; then
if test "x$have_crypto" != "xyes" && test "x$have_md5" != "xyes"; then
LIBS="$LIBS -lcrypto"
have_md2=yes
fi
AC_DEFINE(HAVE_CRYPTO_MD2, [1], [Define to 1 if libcrypto supports MD2.])
fi], [], [-lcrypto])
dnl enable IPMIv1.5 LAN interface
AC_ARG_ENABLE([intf-lan],
[AC_HELP_STRING([--enable-intf-lan],
[enable IPMIv1.5 LAN interface [default=yes]])],
[], [enable_intf_lan=yes])
if test "x$enable_intf_lan" = "xstatic" || test "x$enable_intf_lan" = "xplugin"; then
enable_intf_lan=yes
fi
if test "x$enable_intf_lan" = "xyes"; then
AC_DEFINE(IPMI_INTF_LAN, [1], [Define to 1 to enable LAN IPMIv1.5 interface.])
AC_SUBST(INTF_LAN, [lan])
AC_SUBST(INTF_LAN_LIB, [libintf_lan.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lan/libintf_lan.la"
fi
dnl enable IPMIv2.0 RMCP+ LAN interface
AC_ARG_ENABLE([intf-lanplus],
[AC_HELP_STRING([--enable-intf-lanplus],
[enable IPMIv2.0 RMCP+ LAN interface [default=auto]])],
[if test "x$enable_intf_lanplus" != "xno" && test "x$have_crypto" != "xyes"; then
echo "** The lanplus interface requires an SSL library with EVP_aes_128_cbc defined."
enable_intf_lanplus=no
fi],
[enable_intf_lanplus=$have_crypto])
if test "x$enable_intf_lanplus" = "xstatic" || test "x$enable_intf_lanplus" = "xplugin"; then
enable_intf_lanplus=yes
fi
if test "x$enable_intf_lanplus" = "xyes"; then
AC_DEFINE(IPMI_INTF_LANPLUS, [1], [Define to 1 to enable LAN+ IPMIv2 interface.])
AC_SUBST(INTF_LANPLUS, [lanplus])
AC_SUBST(INTF_LANPLUS_LIB, [libintf_lanplus.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lanplus/libintf_lanplus.la"
else
enable_intf_lanplus=no
fi
dnl look for OpenIPMI header files
AC_ARG_WITH([kerneldir],
[AC_HELP_STRING([--with-kerneldir=DIR],
[set kernel include path to DIR])],
[if test "x$with_kerneldir" = "xyes"; then
with_kerneldir="/lib/modules/`uname -r`/build"
fi
CFLAGS="$CFLAGS -I ${with_kerneldir}/include"
AC_SUBST(CFLAGS)
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/'`
if test "x$kernelver" = "x2.6"; then
CPPFLAGS="$CPPFLAGS -D__user="
AC_SUBST(CPPFLAGS)
fi
fi])
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."])
dnl enable Linux OpenIPMI interface
AC_ARG_ENABLE([intf-open],
[AC_HELP_STRING([--enable-intf-open],
[enable Linux OpenIPMI interface [default=auto]])],
[], [enable_intf_open=yes])
if test "x$enable_intf_open" = "xstatic" || test "x$enable_intf_open" = "xplugin"; then
enable_intf_open=yes
fi
if test "x$enable_intf_open" = "xyes"; then
AC_DEFINE(IPMI_INTF_OPEN, [1], [Define to 1 to enable Linux OpenIPMI interface.])
AC_SUBST(INTF_OPEN, [open])
AC_SUBST(INTF_OPEN_LIB, [libintf_open.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB open/libintf_open.la"
fi
dnl enable Intel IMB interface
AC_ARG_ENABLE([intf-imb],
[AC_HELP_STRING([--enable-intf-imb],
[enable Intel IMB driver interface [default=auto]])],
[], [enable_intf_imb=yes])
if test "x$enable_intf_imb" = "xstatic" || test "x$enable_intf_imb" = "xplugin"; then
enable_intf_imb=yes
fi
if test "x$enable_intf_imb" = "xyes"; then
AC_DEFINE(IPMI_INTF_IMB, [1], [Define to 1 to enable Intel IMB interface.])
AC_SUBST(INTF_IMB, [imb])
AC_SUBST(INTF_IMB_LIB, [libintf_imb.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB imb/libintf_imb.la"
fi
dnl enable Solaris LIPMI interface
AC_CHECK_HEADER([sys/lipmi/lipmi_intf.h], [have_lipmi=yes], [have_lipmi=no])
AC_ARG_ENABLE([intf-lipmi],
[AC_HELP_STRING([--enable-intf-lipmi],
[enable Solaris 9 x86 IPMI interface [default=no]])],
[if test "x$enable_intf_lipmi" != "xno" && test "x$have_lipmi" != "xyes"; then
echo "** Unable to build Solaris 9 x86 IPMI interface support!"
enable_intf_lipmi=no
fi],
[enable_intf_lipmi=no])
if test "x$enable_intf_lipmi" = "xstatic" || test "x$enable_intf_lipmi" = "xplugin"; then
enable_intf_lipmi=yes
fi
if test "x$enable_intf_lipmi" = "xyes"; then
AC_DEFINE(IPMI_INTF_LIPMI, [1], [Define to 1 to enable Solaris 9 LIPMI interface.])
AC_SUBST(INTF_LIPMI, [lipmi])
AC_SUBST(INTF_LIPMI_LIB, [libintf_lipmi.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB lipmi/libintf_lipmi.la"
fi
dnl enable Solaris BMC interface
AC_ARG_ENABLE([intf-bmc],
[AC_HELP_STRING([--enable-intf-bmc],
[enable Solaris 10 x86 IPMI interface [default=auto]])],,
[enable_intf_bmc=no])
if test "x$enable_intf_bmc" = "xstatic" || test "x$enable_intf_bmc" = "xplugin"; then
enable_intf_bmc=yes
fi
if test "x$enable_intf_bmc" = "xyes"; then
AC_DEFINE(IPMI_INTF_BMC, [1], [Define to 1 to enable Solaris 10 BMC interface.])
AC_SUBST(INTF_BMC, [bmc])
AC_SUBST(INTF_BMC_LIB, [libintf_bmc.la])
IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB bmc/libintf_bmc.la"
fi
AC_SUBST(IPMITOOL_INTF_LIB)
dnl check for readline library to enable ipmi shell
AC_ARG_ENABLE([ipmishell],
[AC_HELP_STRING([--enable-ipmishell],
[enable IPMI shell interface [default=yes]])],
[], [enable_ipmishell=yes])
if test "x$enable_ipmishell" = "xyes"; then
AC_SEARCH_LIBS([readline], [readline], [have_readline=yes])
AC_SEARCH_LIBS([initscr], [curses ncurses], [have_curses=yes])
if test "x$have_curses" = "xyes" && test "x$have_readline" = "xyes"; then
AC_DEFINE(HAVE_READLINE, [1], [Define to 1 if readline present.])
fi
fi
dnl enable IPMI Event Daemon
AC_ARG_ENABLE([ipmievd],
[AC_HELP_STRING([--enable-ipmievd],
[enable IPMI Event daemon [default=auto]])],
[], [enable_ipmievd=yes])
AM_CONDITIONAL(IPMIEVD, [test "x$enable_ipmievd" = "xyes"])
if test "x$enable_ipmievd" = "xyes"; then
AC_SUBST(IPMIEVD_BIN, [ipmievd])
fi
dnl Enable -Wall -Werror
AC_ARG_ENABLE([buildcheck],
[AC_HELP_STRING([--enable-buildcheck],
[enable -Wall -Werror for build testing [default=no]])],
[if test "x$enable_buildcheck" != "xno"; then
CFLAGS="$CFLAGS -Wall -Werror"
fi], [])
AC_SUBST(CFLAGS)
dnl Generate files for build
AC_CONFIG_FILES([Makefile
doc/Makefile
contrib/Makefile
control/Makefile
control/pkginfo
control/prototype
control/ipmitool.spec
lib/Makefile
include/Makefile
include/ipmitool/Makefile
src/Makefile
src/plugins/Makefile
src/plugins/lan/Makefile
src/plugins/lanplus/Makefile
src/plugins/open/Makefile
src/plugins/imb/Makefile
src/plugins/bmc/Makefile
src/plugins/lipmi/Makefile])
AC_OUTPUT
AC_MSG_RESULT([])
AC_MSG_RESULT([ipmitool $VERSION])
AC_MSG_RESULT([])
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([ imb : $enable_intf_imb])
AC_MSG_RESULT([ bmc : $enable_intf_bmc])
AC_MSG_RESULT([ lipmi : $enable_intf_lipmi])
AC_MSG_RESULT([])
AC_MSG_RESULT([Extra tools])
AC_MSG_RESULT([ ipmievd : $enable_ipmievd])
AC_MSG_RESULT([])

View File

@ -1,171 +0,0 @@
Name: ipmitool
Summary: ipmitool - Utility for IPMI control
Version: @VERSION@
Release: 1%{?_distro:.%{_distro}}
Copyright: BSD
Group: Utilities
Packager: Duncan Laurie <duncan@iceblink.org>
Source: ipmitool-@VERSION@.tar.gz
Buildroot: /var/tmp/ipmitool-root
%description
This package contains a utility for interfacing with devices that support
the Intelligent Platform Management Interface specification. IPMI is
an open standard for machine health, inventory, and remote power control.
This utility can communicate with IPMI-enabled devices through either a
kernel driver such as OpenIPMI or over the RMCP LAN protocol defined in
the IPMI specification. IPMIv2 adds support for encrypted LAN
communications and remote Serial-over-LAN functionality.
It provides commands for reading the Sensor Data Repository (SDR) and
displaying sensor values, displaying the contents of the System Event
Log (SEL), printing Field Replaceable Unit (FRU) information, reading and
setting LAN configuration, and chassis power control.
%prep
if [ "$RPM_BUILD_ROOT" ] && [ "$RPM_BUILD_ROOT" != "/" ]; then
rm -rf $RPM_BUILD_ROOT
fi
%setup
%build
./configure --with-kerneldir \
--prefix=%{_prefix} \
--bindir=%{_bindir} \
--datadir=%{_datadir} \
--includedir=%{_includedir} \
--libdir=%{_libdir} \
--mandir=%{_mandir} \
--sysconfdir=%{_sysconfdir}
make
%install
make DESTDIR=$RPM_BUILD_ROOT install-strip
%clean
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}/*
%{_datadir}/ipmitool/*
%doc %{_mandir}/man1/*
%doc %{_datadir}/doc/ipmitool/*
%changelog
* Wed Mar 16 2005 <duncan@iceblink.org> 1.8.0-1
- Fix IPMIv2.0 issues
- Fix chassis boot parameter support
- Add support for linear sensors
- Update bmc plugin to work with new Solaris bmc driver (new ioctl
for interface detection and new STREAMS message-based interface)
* Tue Jan 18 2005 <duncan@iceblink.org> 1.7.0-1
- Propogate errors correctly so exit status will be useful
- More consistent display of errors including completion code text
- Errors and debug is send to stderr now
- New "sel get" command that will print details about SEL entry
and corresponding SDR records as well as FRUs via entity association
- Improved event generator, now supports reading events from text file
- New "-o oemtype" option for specifying OEM boards
exsting types are "supermicro" and "intelwv2"
- New PEF subsystem from Tim Murphy at Dell
- New "bmc" plugin for Solaris 10 x86
- Many bugfixes and contributed patches
- Support for Supermicro BMC OEM authentication method
- Fix minor problem with LAN parameter setting
* Wed Aug 18 2004 <duncan@iceblink.org> 1.6.0-1
- Add a README
- Add support for IPMIv2 and Serial-over-LAN from Newisys
- Add Solaris x86 lipmi interface
- Add support for building Solaris packages
- Add support for building RPMs as non-root user
- Fix segfault when doing "sel list" (from Matthew Braithwaite)
- Fix "chassis identify" on some BMCs (from ebrower@sourceforge)
- Add "bmc info" and related output (from ebrower@sourceforge)
- new "shell" and "exec" commands
- lots of other contributed patches
* Sat May 27 2004 <duncan@iceblink.org> 1.5.9-1
- Add ability to get a particular sensor by name
- Add ability to set a particular sensor threshold
- Add support for displaying V2 channel authentication levels
- Add README for rrdtool scripts in contrib directory
- Improve lan interface retry handling
- Support prompting for password or reading from environment
- Move chaninfo command into channel subcommand
- Fix reservation ID handling when two sessions open to BMC
- Fix reading of large FRU data
- Add configure option for changing binary to ipmiadm for Solaris
- Fix compile problem on Solaris 8
* Tue Jan 27 2004 <duncan@iceblink.org> 1.5.8-1
- Enable static compilation of interfaces
- Fix types to be 64-bit safe
- Fix compilation problems on Solaris
- Fix multiple big-endian problems for Solaris/SPARC
- Fix channel access to save settings to NVRAM
- Set channel privilege limit to ADMIN during "access on"
- Enable gratuitous ARP in bmcautoconf.sh
- Add support for Linux kernel panic messages in SEL output
- Add support for type 3 SDR records
* Mon Jan 5 2004 <duncan@iceblink.org> 1.5.7-1
- add IPMIv1.5 eratta fixes
- additions to FRU printing and FRU multirecords
- better handling of SDR printing
- contrib scripts for creating rrdtool graphs
* Thu Dec 4 2003 <duncan@iceblink.org> 1.5.6-1
- Fix SEL event decoding for generic events
- Handle empty SEL gracefully when doing "sel list"
- Fix sdr handling of sensors that do not return a reading
- Fix for CSV display of sensor readings/units from Fredrik <EFBFBD>hrn
* Tue Nov 25 2003 <duncan@iceblink.org> 1.5.5-1
- Add -U option for setting LAN username
- Fix -v usage for plugin interfaces
* Fri Nov 14 2003 <duncan@iceblink.org> 1.5.4-1
- pull interface plugin api into library
- fix ipmievd
* Fri Oct 31 2003 <duncan@iceblink.org> 1.5.3-1
- add -g optin for pedantic ipmi-over-lan communication
* Fri Oct 24 2003 <duncan@iceblink.org> 1.5.2-1
- add gratuitous arp interval setting
* Wed Oct 8 2003 <duncan@iceblink.org> 1.5.1-1
- better SEL support
- fix display bug in SDR list
* Fri Sep 5 2003 <duncan@iceblink.org> 1.5.0-1
- use automake/autoconf/libtool
- dynamic loading interface plugins
* Wed May 28 2003 <duncan@iceblink.org> 1.4.0-1
- make UDP packet handling more robust
- fix imb driver support
* Thu May 22 2003 <duncan@iceblink.org> 1.3-1
- update manpage
- rework of low-level network handling
- add basic imb driver support
* Wed Apr 2 2003 <duncan@iceblink.org> 1.2-1
- change command line option parsing
- support for more chassis commands
* Tue Apr 1 2003 <duncan@iceblink.org> 1.1-1
- minor fixes.
* Sun Mar 30 2003 <duncan@iceblink.org> 1.0-1
- Initial release.

View File

@ -1,166 +0,0 @@
ipmitool (1.8.0) unstable; urgency=low
* Fix IPMIv2.0 issues
* Fix chassis boot parameter support
* Add support for linear sensors
-- Duncan Laurie <duncan@iceblink.org> Wed, Mar 16 2005 17:08:12 -0700
ipmitool (1.7.1) unstable; urgency=low
* Update bmc plugin to work with new Solaris bmc driver (new ioctl
for interface detection and new STREAMS message-based interface).
-- Seth Goldberg <sethmeisterg@hotmail.com> Mon, Mar 7 2005 18:03:00 -0800
ipmitool (1.7.0) unstable; urgency=low
* Propogate errors correctly so exit status will be useful
* More consistent display of errors including completion code text
* Errors and debug is send to stderr now
* New "sel get" command that will print details about SEL entry
and corresponding SDR records as well as FRUs via entity association
* Improved event generator, now supports reading events from text file
* New "-o oemtype" option for specifying OEM boards
exsting types are "supermicro" and "intelwv2"
* New PEF subsystem
* New "bmc" plugin for Solaris 10 x86
* Many bugfixes and contributed patches
-- Duncan Laurie <duncan@iceblink.org> Fri, Jan 7 2005 19:58:22 -0700
ipmitool (1.6.2) unstable; urgency=low
* Support for Supermicro BMC OEM authentication method
-- Duncan Laurie <duncan@iceblink.org> Mon, 16 Nov 2004 08:20:01 -0700
ipmitool (1.6.1) unstable; urgency=low
* Fix minor problem with LAN parameter setting
-- Duncan Laurie <duncan@iceblink.org> Wed, 29 Sep 2004 11:19:17 -0700
ipmitool (1.6.0) unstable; urgency=low
* Add a README
* Add support for IPMIv2 and Serial-over-LAN from Newisys
* Add Solaris x86 lipmi interface
* Add support for building Solaris packages
* Add support for building RPMs as non-root user
* Fix segfault when doing "sel list" (from Matthew Braithwaite)
* Fix "chassis identify" on some BMCs (from ebrower@sourceforge)
* Add "bmc info" and related output (from ebrower@sourceforge)
* new "shell" and "exec" commands
* lots of other contributed patches
-- Duncan Laurie <duncan@iceblink.org> Thu, 9 Sep 2004 21:39:37 -0700
ipmitool (1.5.9) unstable; urgency=low
* Add ability to get a particular sensor by name
* Add ability to set a particular sensor threshold
* Add support for displaying V2 channel authentication levels
* Add README for rrdtool scripts in contrib directory
* Improve lan interface retry handling
* Support prompting for password or reading from environment
* Move chaninfo command into channel subcommand
* Fix reservation ID handling when two sessions open to BMC
* Fix reading of large FRU data
* Add configure option for changing binary to ipmiadm for Solaris
* Fix compile problem on Solaris 8
-- Duncan Laurie <duncan@sun.com> Sat, 27 Mar 2004 00:11:37 -0700
ipmitool (1.5.8) unstable; urgency=low
* Enable static compilation of interfaces
* Fix types to be 64-bit safe
* Fix compilation problems on Solaris
* Fix multiple big-endian problems for Solaris/SPARC
* Fix channel access to save settings to NVRAM
* Set channel privilege limit to ADMIN during "access on"
* Enable gratuitous ARP in bmcautoconf.sh
* Add support for Linux kernel panic messages in SEL output
* Add support for type 3 SDR records
-- Duncan Laurie <duncan@sun.com> Tue, 27 Jan 2004 16:23:25 -0700
ipmitool (1.5.7) unstable; urgency=low
* add IPMIv1.5 eratta fixes
* additions to FRU printing and FRU multirecords
* better handling of SDR printing
* contrib scripts for creating rrdtool graphs
-- Duncan Laurie <duncan@sun.com> Mon, 5 Jan 2004 17:29:50 -0700
ipmitool (1.5.6) unstable; urgency=low
* Fix SEL event decoding for generic events
* Handle empty SEL gracefully when doing "sel list"
* Fix sdr handling of sensors that do not return a reading
* Fix for CSV display of sensor readings/units from Fredrik <20>hrn
-- Duncan Laurie <duncan@sun.com> Thu, 4 Dec 2003 14:47:19 -0700
ipmitool (1.5.5) unstable; urgency=low
* Add -U option for setting LAN username
* Fix -v usage for plugin interfaces
-- Duncan Laurie <duncan@sun.com> Tue, 25 Nov 2003 15:10:48 -0700
ipmitool (1.5.4) unstable; urgency=low
* Put interface plugin API into library
* Fix ipmievd
-- Duncan Laurie <duncan@sun.com> Fri, 14 Nov 2003 15:16:34 -0700
ipmitool (1.5.3) unstable; urgency=low
* Add -g option to work with grizzly bmc
-- Duncan Laurie <duncan@sun.com> Mon, 3 Nov 2003 18:04:07 -0700
ipmitool (1.5.2) unstable; urgency=low
* add support for setting gratuitous arp interval
-- Duncan Laurie <duncan@sun.com> Fri, 24 Oct 2003 11:00:00 -0700
ipmitool (1.5.1) unstable; urgency=low
* better SEL support
* fix display bug in SDR list
-- Duncan Laurie <duncan@sun.com> Wed, 8 Oct 2003 17:28:51 -0700
ipmitool (1.5.0) unstable; urgency=low
* more robust UDP packet handling
* add Intel IMB driver support
* use autoconf/automake/libtool
-- Duncan Laurie <duncan@sun.com> Fri, 5 Sep 2003 11:57:32 -0700
ipmitool (1.2-1) unstable; urgency=low
* New command line option parsing
* More chassis commands supported
-- Duncan Laurie <duncan@sun.com> Wed, 2 Apr 2003 17:44:17 -0700
ipmitool (1.1-1) unstable; urgency=low
* Minor fixes.
-- Duncan Laurie <duncan@sun.com> Tue, 1 Apr 2003 14:31:10 -0700
ipmitool (1.0-1) unstable; urgency=low
* Initial Release.
-- Duncan Laurie <duncan@sun.com> Sun, 30 Mar 2003 21:30:46 -0700

View File

@ -1,12 +0,0 @@
Source: ipmitool
Section: contrib
Priority: optional
Maintainer: Duncan Laurie <duncan@iceblink.org>
Build-Depends: debhelper (>> 3.0.0)
Standards-Version: 3.5.8
Package: ipmitool
Architecture: i386 amd64
Provides: ipmitool
Description: Utility for IPMI control with kernel driver or LAN interface

View File

@ -1,38 +0,0 @@
ipmitool
Duncan Laurie <duncan@sun.com>
http://www.iceblink.org/ipmitool/
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.

View File

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

View File

@ -1,4 +0,0 @@
README
COPYING
AUTHORS
ChangeLog

View File

@ -1,115 +0,0 @@
#!/usr/bin/make -f
#export DH_VERBOSE=1
export DH_COMPAT=4
export DH_OPTIONS
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
configure: configure-stamp
configure-stamp:
dh_testdir
./configure --prefix=/usr \
--with-kerneldir \
--mandir=/usr/share/man
touch configure-stamp
#Architecture
build: build-arch build-indep
build-arch: build-arch-stamp
build-arch-stamp: configure-stamp
# Add here commands to compile the arch part of the package.
$(MAKE)
build-indep: build-indep-stamp
build-indep-stamp: configure-stamp
# Add here commands to compile the indep part of the package.
#$(MAKE) doc
clean:
dh_testdir
dh_testroot
rm -f build-arch-stamp build-indep-stamp config-stamp
# Add here commands to clean up after the build process.
-$(MAKE) clean
dh_clean
install: install-arch #install-indep
install-indep:
dh_testdir
dh_testroot
dh_clean -k -i
dh_installdirs -i
# Add here commands to install the indep part of the package into
# debian/<package>-doc.
#INSTALLDOC#
# $(MAKE) install-doc DESTDIR=$(CURDIR)/debian/tmp/ipmitool-doc
# dh_movefiles -i
install-arch:
dh_testdir
dh_testroot
dh_clean -k -a
dh_installdirs -a
# Add here commands to install the arch part of the package into
# debian/tmp.
$(MAKE) install DESTDIR=$(CURDIR)/debian/ipmitool
# dh_movefiles -a
# Must not depend on anything. This is to be called by
# binary-arch/binary-multi
# in another 'make' thread.
binary-common:
dh_testdir
dh_testroot
# dh_installdebconf
dh_installdocs
# dh_installexamples
# dh_installmenu
# dh_installemacsen
# dh_installpam
# dh_installinit
# dh_installcron
# dh_installmanpages
# dh_installinfo
# dh_undocumented
# dh_installchangelogs
dh_link
dh_strip
dh_compress
dh_fixperms
# You may want to make some executables suid here.
# dh_suidregister
dh_makeshlibs
dh_installdeb
# dh_perl
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture independant packages using the common target.
binary-indep: build-indep install-indep
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
# Build architecture dependant packages using the common target.
binary-arch: build-arch install-arch
$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
binary: binary-arch #binary-indep
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure

View File

@ -1,550 +0,0 @@
.TH "ipmitool" "1" "" "Duncan Laurie" ""
.SH "NAME"
.LP
ipmitool \- utility for controlling IPMI-enabled devices
.SH "SYNOPSIS"
.LP
ipmitool [\fB\-ghcvV\fR] \fB\-I\fR \fIlan\fP \fB\-H\fR \fIhostname\fP [\fB\-L\fR \fIprivlvl\fP] [\fB\-a\fR|\fB\-E\fR|\fB\-P\fR \fIpassword\fP] <\fIexpression\fP>
.LP
ipmitool [\fB\-ghcvV\fR] \fB\-I\fR \fIlanplus\fP \fB\-H\fR \fIhostname\fP [\fB\-L\fR \fIprivlvl\fP] [\fB\-a\fR|\fB\-E\fR|\fB\-P\fR \fIpassword\fP] <\fIexpression\fP>
.LP
ipmitool [\fB\-ghcvV\fR] \fB\-I\fR \fIopen\fP <\fIexpression\fP>
.SH "DESCRIPTION"
.LP
This program lets you manage Intelligent Platform Management Interface
(IPMI) functions of either the local system, via a kernel device driver,
or a remote system, using IPMI V1.5 . These functions include printing
FRU information, LAN configuration, sensor readings, and remote chassis
power control.
.SH "OPTIONS"
.LP
.TP
\fB\-h\fR
Get basic usage help from the command line.
.TP
\fB\-c\fR
Display output with comma field separator instead of spaces. Not available with all commands.
.TP
\fB\-V\fR
Display version information.
.TP
\fB\-v\fR
Increase verbose output level. This option may be specified multiple times to increase the level of debug output.
.TP
\fB\-I\fR <\fIinterface\fP>
Selects IPMI interface to use. Possible interfaces are \fIlan\fP, \fIlanplus\fP or \fIopen\fP.
.TP
\fB\-H\fR <\fIaddress\fP>
Remote server address, can be IP address or hostname. This option is required for the LAN interface connection.
.TP
\fB\-U\fR <\fIusername\fP>
Remote username, default is NULL user.
.TP
\fB\-L\fR <\fIprivlvl\fP>
Force session privilege level. Can be CALLBACK, USER, OPERATOR, ADMIN. Default is ADMIN.
.TP
\fB\-a\fR
Prompt for the remote server password, 16 character maximum. This is optional for the LAN interface, if a password is not provided the session will not be authenticated.
.TP
\fB\-E\fR
The remote server password is specified by the environment variable \fBIPMI_PASSWORD\fR. This option is intended for shell scripts.
.TP
\fB\-f\fR <\fIfile\fP>
Read remote server password from file.
.TP
\fB\-P\fR <\fIpassword\fP>
Remote server password. \fBNote!\fR Specifying the password as a commandline option is not recommended since it will be visible in the process list.
.SH "EXPRESSIONS"
.LP
.TP
.I help
This can be used to get command-line help on ipmitool commands. It may also be placed at the end of commands to get option usage help.
.RS
.PP
ipmitool -I open help
.br
Commands: bmc, chassis, event, fru, lan, raw, sdr, sel, sensor, sol, userinfo, channel
.LP
.PP
ipmitool -I open chassis help
.br
Chassis Commands: status, power, identify, policy, restart_cause, poh
.LP
.PP
ipmitool -I open chassis power help
.br
Chassis Power Commands: status, on, off, cycle, reset, diag, soft
.LP
.RE
.TP
\fIraw\fP <\fBnetfn\fR> <\fBcmd\fR> [\fBdata\fR]
This will allow you to execute raw IPMI commands. For example to query the POH counter with a raw command:
.RS
.PP
ipmitool -v -I open raw 0x0 0xf
.br
RAW REQ (netfn=0x0 cmd=0xf data_len=0)
.br
RAW RSP (5 bytes)
.br
3c 72 0c 00 00
.LP
.RE
.TP
.I channel
.RS
.TP
\fIauthcap\fP <\fBchannel number\fR> <\fBmax priv\fR>
This command will display information about the authentication capabilities of the selected channel at the specified privelige level.
.RS
.TP
Possible privilege levels are:
.br
1 Callback level
.br
2 User level
.br
3 Operator level
.br
4 Administrator level
.br
5 OEM Proprietary level
.LP
.RE
.TP
\fIinfo\fP [\fBchannel number\fR]
This command will display information about the selected channel. If no channel is given it will display information about the currently used channel:
.RS
.PP
ipmitool -I open chaninfo
.br
Channel 0xf info:
.br
Channel Medium Type : System Interface
.br
Channel Protocol Type : KCS
.br
Session Support : session-less
.br
Active Session Count : 0
.br
Protocol Vendor ID : 7154
.LP
.RE
.TP
\fIuser\fP <\fBchannel number\fR> [\fBuser number\fR]
This command will display information about configured user information on a specific LAN channel. This command will fail on system interfaces.
.RS
.PP
ipmitool -I open channel user 6
.br
Maximum User IDs : 4
.br
Enabled User IDs : 1
.br
Fixed Name User IDs : 1
.br
Access Available : call-in / callback
.br
Link Authentication : disabled
.br
IPMI Messaging : enabled
.LP
.RE
.RE
.TP
.I chassis
.RS
.TP
.I status
This command returns information about the high-level status of the system chassis and main power subsystem.
.TP
.I poh
This command will return the Power-On Hours counter.
.TP
\fIidentify\fP <\fBinterval\fR>
Control the front panel identify light. Default is 15. Use 0 to turn off.
.TP
.I restart_cause
Query the chassis for the cause of the last system restart.
.TP
.I policy
Set the chassis power policy in the event power failure.
.RS
.TP
.I list
Return supported policies.
.TP
.I always-on
Turn on when power is restored.
.TP
.I previous
Returned to previous state when power is restored.
.TP
.I always-off
Stay off after power is restored.
.RE
.TP
.I power
Performs a chassis control command to view and change the power state.
.RS
.TP
.I status
Show current chassis power status.
.TP
.I on
Power up chassis.
.TP
.I off
Power down chassis into soft off (S4/S5 state). WARNING: this command does not initiate a clean shutdown of the operating system prior to powering down the system.
.TP
.I cycle
This command provides a power off interval of at least 1 second. No action should occur if chassis power is in S4/S5 state, but it is recommended to check power state first and only issue a power cycle command if the system power is on or in lower sleep state than S4/S5.
.TP
.I reset
This command will perform a hard reset.
.TP
.I diag
Pulse a version of a diagnostic interrupt (NMI) that goes directly to the processor(s).
.TP
.I soft
Initiate a soft\-shutdown of OS via ACPI by emulating a fatal overtemperature.
.RE
.RE
.TP
.I lan
.RS
.TP
\fIprint\fP <\fBchannel\fR>
Print the current configuration for the given channel.
.TP
\fIset\fP <\fBchannel\fR> <\fBparameter\fR>
Set the given parameter on the given channel. Valid parameters are:
.RS
.TP
\fIipaddr\fP <\fBx.x.x.x\fR>
Set the IP address for this channel.
.TP
\fInetmask\fP <\fBx.x.x.x\fR>
Set the netmask for this channel.
.TP
\fImacaddr\fP <\fBxx:xx:xx:xx:xx:xx\fR>
Set the MAC adddress for this channel.
.TP
\fIdefgw\fP \fIipaddr\fP <\fBx.x.x.x\fR>
Set the default gateway IP address.
.TP
\fIdefgw\fP \fImacaddr\fP <\fBxx:xx:xx:xx:xx:xx\fR>
Set the default gateway MAC address.
.TP
\fIbakgw\fP \fIipaddr\fP <\fBx.x.x.x\fR>
Set the backup gateway IP address.
.TP
\fIbakgw\fP \fImacaddr\fP <\fBxx:xx:xx:xx:xx:xx\fR>
Set the backup gateway MAC address.
.TP
\fIpassword\fP <\fBpass\fR>
Set the null user password.
.TP
\fIsnmp\fP <\fBcommunity string\fR>
Set the SNMP community string.
.TP
\fIuser\fP
Enable user access mode.
.TP
\fIaccess\fP <\fBon|off\fR>
Set LAN channel access mode.
.TP
\fIipsrc\fP <\fBsource\fR>
Set the IP address source:
.br
none = unspecified
.br
static = manually configured static IP address
.br
dhcp = address obtained by BMC running DHCP
.br
bios = address loaded by BIOS or system software
.TP
\fIarp\fP \fIrespond\fP <\fBon|off\fR>
Set BMC generated ARP responses.
.TP
\fIarp\fP \fIgenerate\fP <\fBon|off\fR>
Set BMC generated gratuitous ARPs.
.TP
\fIarp\fP \fIinterval\fP <\fBseconds\fR>
Set BMC generated gratuitous ARP interval.
.TP
\fIauth\fP <\fBlevel,...\fR> <\fBtype,...\fR>
Set the valid authtypes for a given auth level.
.RS
Levels:
.B callback
.B user
.B operator
.B admin
.br
Types:
.B none
.B md2
.B md5
.B key
.RE
.RE
.RE
.TP
.I fru
.RS
.TP
.I print
This command will read all Field Replacable Unit inventory data and extract such information as serial number, part number, asset tags, and short strings describing the chassis, board, or product.
.RE
.TP
.I sdr
.RS
.TP
.I info
This command will query the BMC for information about the SDR.
.TP
.I list
This command will read the SDR and extract sensor information, then query each sensor and print its name, reading, and status.
.RE
.TP
.I pef
.RS
.TP
.I info
This command will query the BMC and print information about the PEF supported features.
.TP
.I status
This command prints the current PEF status (the last SEL entry processed by the BMC, etc).
.TP
.I policy
This command lists the PEF policy table entries. Each policy entry describes an alert destination. A policy set is a collection of table entries. PEF alert actions reference policy sets.
.TP
.I list
This command lists the PEF table entries. Each PEF entry relates a sensor event to an action. When PEF is active, each platform event causes the BMC to scan this table for entries matching the event, and possible actions to be taken. Actions are performed in priority order (higher criticality first).
.RE
.TP
.I sensor
.RS
.TP
.I list
This command will list sensors and thresholds in a wide table format.
.TP
\fIget\fP <\fBid\fR> ... [\fBid\fR]
This command will print info for sensors specified by name.
.TP
\fIthresh\fP <\fBid\fR> <\fBthreshold\fR> <\fBsetting\fR>
This allows you to set a particular sensor threshold value. The sensor is specified by name.
.RS
.TP
Valid thresholds are:
.br
unr Upper Non-Recoverable
.br
ucr Upper Critical
.br
unc Uperr Non-Critical
.br
lnc Lower Non-Critical
.br
lcr Lower Critical
.br
lnr Lower Non-Recoverable
.LP
.RE
.RE
.TP
.I sel
.RS
.TP
.I info
This command will query the BMC for information about the SEL and its contents.
.TP
.I clear
This command will clear the contents of the SEL. It cannot be undone so be careful.
.TP
.I list
This command will list the contents of the SEL.
.RE
.TP
.I session
.RS
.TP
\fIinfo\fP <\fBparameter\fR> [\fBargument\fR]
This command will query the BMC for information about its session capabilities and current sessions. Valid parameters are:
.RS
.TP
\fIactive\fP
Queries the BMC for information about the current session. That is, the session used to execute this command.
.TP
\fIall\fP
Queries the BMC for information about all active sessions
.TP
\fIid\fP <\fBid\fR>
Queries the BMC for information about the session with the specified ID. The ID should be specified in hex.
.TP
\fIhandle\fP <\fBhandle\fR>
Queries the BMC for information about the session with the specified handle. The handle should be specified in hex.
.RE
.RE
.TP
.I sol
.RS
.TP
\fIinfo\fP [\fBchannel\fR]
Retrieve information about the Serial-Over-LAN configuration on the specified channel. If no channel is given, it will display SOL configuration data for the currently used channel.
.RE
.RS
.TP
\fIset\fP <\fBparameter\fR> <\fBvalue\fR> [\fBchannel\fR]
Configure parameters for Serial Over Lan. If no channel is given, it will display SOL configuration data for the currently used channel. Configuration parameter updates are automatically guarded with the updates to the set-in-progress parameter.
.RS
.TP
Valid parameters and values are:
.br
.TP
set-in-progress
set-complete set-in-progress commit-write
.TP
enabled
true false
.TP
force-encryption
true false
.TP
force-authentication
true false
.TP
privilege-level
user operator admin oem
.TP
character-accumulate-level
Decimal number given in 5 milliseconds increments
.TP
character-send-threshold
Decimal number
.TP
retry-count
Decimal number. 0 indicates no retries after packet is transmitted.
.TP
retry-interval
Decimal number in 10 millisend increments. 0 indicates that retries should be sent back to back.
.TP
non-volatile-bit-rate
serial, 19.2, 38.4, 57.6, 115.2. Setting this value to serial indiates that the BMC should use the setting used by the IPMI over serial channel.
.TP
volatile-bit-rate
serial, 19.2, 38.4, 57.6, 115.2. Setting this value to serial indiates that the BMC should use the setting used by the IPMI over serial channel.
.LP
.RE
.RE
.RS
.TP
.I activate
This command causes ipmitool to enter Serial Over LAN mode, and is only available when using the lanplus interface. An RMCP+ connection is made to the BMC, the terminal is set to raw mode, and user input is sent to the serial console on the remote server. On exit, the the SOL payload mode is deactivated and the terminal is reset to its original settings.
.RS
.TP
Special escape sequences are provided to control the SOL session:
~. Terminate connection
.br
~^Z Suspend ipmitool
.br
~B Send break
.br
~~ Send the escape character by typing it twice
.br
~? Print the supported escape sequences
.LP
.RE
.RE
.RS
.TP
.I deactivate
This command deactivates Serial Over LAN mode on the BMC. Exiting Serial Over LAN mode should automatically cause this command to be sent to the BMC, but in the case of an unintentional exit from SOL mode, this command may be necessary to reset the state of the BMC.
.RE
.RE
.SH "OPEN INTERFACE"
.LP
The ipmitool \fIopen\fP interface utilizes the MontaVista OpenIPMI kernel device driver. This driver is present in 2.5.57 and later development kernels and in 2.4.21pre1 and later stable kernels. There are also IPMI driver kernel patches for different versions available from the OpenIPMI homepage.
.LP
The following kernel modules must be loaded in order for ipmitool to work:
.TP
.B ipmi_msghandler
Incoming and outgoing message handler for IPMI interfaces.
.TP
.B ipmi_kcs_drv
An IPMI Keyboard Controler Style (KCS) interface driver for the message handler.
.TP
.B ipmi_devintf
Linux character device interface for the message handler.
.LP
Once they are loaded there will be a dynamic char device entry that must exist at \fB/dev/ipmi0\fR. Usually if this is the first dynamic device it will be major number \fB254\fR and minor number \fB0\fR so you would create the dev entry with:
.LP
.I mknod /dev/ipmi0 c 254 0
.LP
In order to force ipmitool to make use of the OpenIPMI device interface you can specifiy it on the command line:
.PP
ipmitool \-I open <expression>
.SH "LIPMI INTERFACE"
.LP
The ipmitool \fIlipmi\fP interface uses the Solaris x86 IPMI kernel device driver.
.LP
You can tell ipmitool to use the Solaris IPMI driver with the \fB-I\fR option:
.PP
ipmitool \-I lipmi <expression>
.SH "LAN INTERFACE"
.LP
The ipmitool \fIlan\fP interface communicates with the BMC over an Ethernet LAN connection using UDP under IPv4. UDP datagrams are formatted to contain IPMI request/response messages with a IPMI session headers and RMCP headers.
.LP
IPMI\-over\-LAN uses version 1 of the Remote Management Control Protocol (RMCP) to support \fIpre\-OS\fP and \fIOS\-absent\fP management. RMCP is a request\-response protocol delivered using UDP datagrams to port 623.
.LP
The LAN interface is an authenticatiod multi\-session connection; messages delivered to the BMC can (and should) be authenticated with a challenge/response protocol with either straight password/key or MD5 message\-digest algorithm. ipmitool will attempt to connect with administrator privilege level as this is required to perform chassis power functions.
.LP
You can tell ipmitool to use the lan interface with the \fB\-I\fR option:
.PP
ipmitool \-I lan \-H <hostname> [\-U username] [\-P password] <expression>
.LP
A hostname \fBmust\fR be given on the command line in order to use the lan interface with ipmitool. The password field is optional; if you do not provide a password on the command line, ipmitool will attempt to connect without authentication. If you specify a password it will use MD5 authentication if supported by the BMC and straight password/key otherwise.
.SH "LANPLUS INTERFACE"
.LP
Like the \fIlan\fP interface, the \fIlanplus\fP interface communicates with the BMC over an Ethernet LAN connection using UDP under IPv4. The difference is that the \fIlanplus\fP interface uses the RMCP+ protocol as described in the IMPI v2.0 specification. RMCP+ allows for improved authentication and data integrity checks, as well as encryption and the ability to carry multiple types of payloads. Generic Serial Over LAN support requires RMCP+, so the ipmitool \fIsol activate\fP command requires the use of the \fIlanplus\fP interface.
.LP
RMCP+ session establishment uses a protocol call RAKP (Remote Authenticated Key-Exchange Protocol) which allows the negotiation of many options. ipmitool does not yet allow the user to specify the value of every option, defaulting to the most obvious settings, marked as required in the v2.0 specification. Authentication and integrity HMACS are produced with SHA1, and encryption is performed with AES-CBC-128. Role-level logins are not supported. ipmitool must be configured with the appropriate option for the \fIlanplus\fP interface to be available, as it is not enabled by default. This interface currently requires the OpenSSL library.
.LP
You can tell ipmitool to use the lanplus interface with the \fB\-I\fR option:
.PP
ipmitool \-I lanplus \-H <hostname> [\-U username] [\-P password] <expression>
.LP
The options available for the \fIlanplus\fP inteface are identical to those available for the \fIlan\fP inteface.
.SH "FILES"
.TP
.I /dev/ipmi0
This character device file is used by the OpenIPMI kernel driver.
.SH "EXAMPLES"
.LP
If you want to remotely control the power of an IPMI\-over\-LAN enabled system you can use:
.LP
ipmitool \-I lan \-H 192.168.1.1 \-P password chassis power on
.br
Chassis Power Control: Up/On
.LP
ipmitool \-I lan \-H 192.168.1.1 \-P password chassis power status
.br
Chassis Power is on
.SH "AUTHOR"
.LP
Duncan Laurie <duncan@iceblink.org>
.SH "SEE ALSO"
.LP
.TP
IPMItool Homepage
http://ipmitool.sourceforge.net
.TP
Intelligent Platform Management Interface Specification
http://www.intel.com/design/servers/ipmi/spec.htm
.TP
OpenIPMI project (MontaVista IPMI kernel driver)
http://openipmi.sourceforge.net

View File

@ -1,228 +0,0 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
#ifndef IPMI_FRU_H
#define IPMI_FRU_H
#include <inttypes.h>
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_sdr.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#define GET_FRU_INFO 0x10
#define GET_FRU_DATA 0x11
#define SET_FRU_DATA 0x12
enum {
FRU_CHASSIS_PARTNO,
FRU_CHASSIS_SERIAL,
FRU_BOARD_MANUF,
FRU_BOARD_PRODUCT,
FRU_BOARD_SERIAL,
FRU_BOARD_PARTNO,
FRU_PRODUCT_MANUF,
FRU_PRODUCT_NAME,
FRU_PRODUCT_PARTNO,
FRU_PRODUCT_VERSION,
FRU_PRODUCT_SERIAL,
FRU_PRODUCT_ASSET,
};
struct fru_info {
uint16_t size;
uint8_t access : 1;
} __attribute__ ((packed));
struct fru_header {
uint8_t version;
struct {
uint8_t internal;
uint8_t chassis;
uint8_t board;
uint8_t product;
uint8_t multi;
} offset;
uint8_t pad;
uint8_t checksum;
} __attribute__ ((packed));
struct fru_area_chassis {
uint8_t area_ver;
uint8_t type;
uint16_t area_len;
char * part;
char * serial;
};
struct fru_area_board {
uint8_t area_ver;
uint8_t lang;
uint16_t area_len;
uint32_t mfg_date_time;
char * mfg;
char * prod;
char * serial;
char * part;
char * fru;
};
struct fru_area_product {
uint8_t area_ver;
uint8_t lang;
uint16_t area_len;
char * mfg;
char * name;
char * part;
char * version;
char * serial;
char * asset;
char * fru;
};
struct fru_multirec_header {
#define FRU_RECORD_TYPE_POWER_SUPPLY_INFORMATION 0x00
#define FRU_RECORD_TYPE_DC_OUTPUT 0x01
#define FRU_RECORD_TYPE_DC_LOAD 0x02
#define FRU_RECORD_TYPE_MANAGEMENT_ACCESS 0x03
#define FRU_RECORD_TYPE_BASE_COMPATIBILITY 0x04
#define FRU_RECORD_TYPE_EXTENDED_COMPATIBILITY 0x05
uint8_t type;
uint8_t format;
uint8_t len;
uint8_t record_checksum;
uint8_t header_checksum;
} __attribute__ ((packed));
struct fru_multirec_powersupply {
#if WORDS_BIGENDIAN
uint16_t capacity;
#else
uint16_t capacity : 12;
uint16_t __reserved1 : 4;
#endif
uint16_t peak_va;
uint8_t inrush_current;
uint8_t inrush_interval;
uint16_t lowend_input1;
uint16_t highend_input1;
uint16_t lowend_input2;
uint16_t highend_input2;
uint8_t lowend_freq;
uint8_t highend_freq;
uint8_t dropout_tolerance;
#if WORDS_BIGENDIAN
uint8_t __reserved2 : 3;
uint8_t tach : 1;
uint8_t hotswap : 1;
uint8_t autoswitch : 1;
uint8_t pfc : 1;
uint8_t predictive_fail : 1;
#else
uint8_t predictive_fail : 1;
uint8_t pfc : 1;
uint8_t autoswitch : 1;
uint8_t hotswap : 1;
uint8_t tach : 1;
uint8_t __reserved2 : 3;
#endif
uint16_t peak_cap_ht;
#if WORDS_BIGENDIAN
uint8_t combined_voltage1 : 4;
uint8_t combined_voltage2 : 4;
#else
uint8_t combined_voltage2 : 4;
uint8_t combined_voltage1 : 4;
#endif
uint16_t combined_capacity;
uint8_t rps_threshold;
} __attribute__ ((packed));
static const char * combined_voltage_desc[] __attribute__((unused)) = {
"12 V", "-12 V", "5 V", "3.3 V"
};
struct fru_multirec_dcoutput {
#if WORDS_BIGENDIAN
uint8_t standby : 1;
uint8_t __reserved : 3;
uint8_t output_number : 4;
#else
uint8_t output_number : 4;
uint8_t __reserved : 3;
uint8_t standby : 1;
#endif
short nominal_voltage;
short max_neg_dev;
short max_pos_dev;
uint16_t ripple_and_noise;
uint16_t min_current;
uint16_t max_current;
} __attribute__ ((packed));
struct fru_multirec_dcload {
#if WORDS_BIGENDIAN
uint8_t __reserved : 4;
uint8_t output_number : 4;
#else
uint8_t output_number : 4;
uint8_t __reserved : 4;
#endif
short nominal_voltage;
short min_voltage;
short max_voltage;
uint16_t ripple_and_noise;
uint16_t min_current;
uint16_t max_current;
} __attribute__ ((packed));
static const char * chassis_type_desc[] __attribute__((unused)) = {
"Unspecified", "Other", "Unknown",
"Desktop", "Low Profile Desktop", "Pizza Box",
"Mini Tower", "Tower",
"Portable", "LapTop", "Notebook", "Hand Held", "Docking Station",
"All in One", "Sub Notebook", "Space-saving", "Lunch Box",
"Main Server Chassis", "Expansion Chassis", "SubChassis",
"Bus Expansion Chassis", "Peripheral Chassis", "RAID Chassis",
"Rack Mount Chassis"
};
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);
#endif /* IPMI_FRU_H */

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