| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are functions that are used widely by ipmid providers, so it makes
sense to put them in libipmi.so (the library that all providers must
link against).
Tested-by: use nm to inspect the binaries to see that the symbols are in
the expected library.
arm-openbmc-linux-gnueabi-nm libipmid.so.0.0.0 \
| grep getDbusObject
0001063c T _ZN4ipmi13getDbusObjectERN9sdbusplus....
Change-Id: I1221f807f2711c5301c5574623564ea1ae48a437
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
| |
handles is a poor name choice for the list of IpmiProviders and being
declared as an auto is hard to see what type it really is. This changes
the type to be fixed and uses a more appropriate name for the variable.
Change-Id: I35f744c491f3810c7381738516b8ff0a6f20f129
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added missing user enabled state update, to reflect the
enabled state immediately.
Tested-by:
1.verified updated user enabled state is reflected immediately
by querying getaccess for the user id
Change-Id: I42f7cbbe5a1bec9ffaafa61d5c550ea914bddc9c
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Get rid of duplicate getChannelName function. Use
the one with uint8_t channelNum.
Tested-by:
1. Verified RMCP+ session establishement works with newly
created user
Change-Id: Iac22ec665ece97d4f9471cfb40220b472bdf01e8
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
|
|
|
|
|
|
|
|
|
| |
This part was originally omitted, but needed by some external provider
libraries. This will more closely mimic the behavior of ipmid prior to
the architecture update.
Change-Id: I5db35222e268a117480285c700d88206d6505d92
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On some systems ipmid was not responding to SIGTERM so systemd
could not shut it down in a clean manner, resorting to SIGKILL
after a long timeout. This adds code to respond to SIGTERM and
SIGINT and safely unwind all the provider libraries on exit.
Tested-by: running ipmid; in another shell, and running
'killall -15 ipmid' or 'killall -2 ipmid' to send
SIGTERM or SIGINT and watch that ipmid shuts down
in a controlled and timely manner.
Change-Id: I690846796523bebea1a08845c0d17e1df2a94fee
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows providers or the main application to handle POSIX signals
using a callback chain. Each handler can return continueExecution or
breakExecution to stop the signal handling chain or allow it to
continue. Each handler is registered with a priority and upon reciept of
a signal, each handler is executed in priority order until the end of
the list is reached or one returns with breakExecution.
Change-Id: Idd83625eb1a2d3bdafc92bdd839e0d6386177ff2
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
| |
Change-Id: Iafe6827fa545d72666994bb68b5972cde4d0a1ff
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ipmid_get_sdbus_plus_handler() was re-added to be a part of
systemintfcmds where it was used. This moves it to libipmid.so
because that is where symbols used by both ipmid and the providers
should be.
Because ipmid_get_sdbus_plus_handler() relies on the io service and the
main sdbus::asio::connection is also right there, this moves those
symbols to libipmid as well to keep coherent.
Change-Id: Ib125a0c217c8bcf47a8a4bd0c557eb69e928245b
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Until the response goes back out onto D-Bus, the completion code is held
in a separate part of the Response object. The D-Bus response has a
separate field for the completion code as well, reserving a byte array
for response data only.
This fixes the ipmitool error message 'Bad response length, len=1' when
it attempts to query the PICMG capabilities.
Change-Id: Iff0c3cb2e46a20e52229265eebb0995878a41714
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Directly calling unpack from the Request interface will attempt to
unpack the whole message, resulting in a 0xC7 response if the whole
message was not unpacked. Since at this point in the execution, the
point is to only extract the group ID or the IANA, the lower-level
Payload unpack interface must be used. This allows for partial unpacks
and only returns error if there are not enough bytes to unpack.
Change-Id: Ie18377597e925eff89c9b7c1a6d2258627d5f240
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the timeout param is not specified in a sdbus call, the default value
of 25s is used, if not configured in the systemd configuration file.
It turns out this timeout is too long than ideal, since the other pieces
in the IPMI stack have much smaller timeout values. For example, the
BTbridge/KCSbridge has a timeout of 5s. It is unnecessary to let ipmid
getting blocked on waiting for D-Bus replies.
This commit changes the timeout to 5 seconds on D-Bus get/set properties,
mainly because these calls are the majority of sensor read/writes which
are most subject to operation timeouts. The other D-Bus operations might
be called for object/service discovering, which might be a one-time
startup procedure.
Resolves: openbmc/openbmc#3494
Signed-off-by: Kun Yi <kunyi731@gmail.com>
Change-Id: I5a55a8eb872b1ebe8730c673231be5037d24fc0b
|
|
|
|
|
|
|
|
|
|
|
| |
The whitelist RestrictionMode lookup was missing the interface name on
the properties get method call. This is a fixup for that.
Tested-by: watch ipmid startup and see that it does not complain about
fetching the whitelist setting.
Change-Id: I030c0c66771afcb987e0679595a2d662f7c3ea9e
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Recv Message Queue and SEL are enabled by default.
Event Message buffer are disabled by default (not supported).
Any request that try to change the mask will be rejected.
Test:
test pass with ipmitool
Change-Id: Ia6bd4a6bf7b2b04dcfde6bfec910ca854a7aaeb8
Signed-off-by: Jia, Chunhui <chunhui.jia@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As channel layer is separated out from user layer lib, it
has to be manually included in libusercommands, as user
command handlers use channel layer API's
Tested-by:
1. Made sure that libusercommands are loaded on it's own
without any undefined symbol error.
2. ipmitool user list 1 works on host interface
Change-Id: I6652ad248e01afc1349e3a9612754dbdb84b96ad
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
| |
From IPMI spec, response should be complete code only.
Tested:
ipmitool raw 0x00 0x04 0x02 0x00
Change-Id: I48a9f71e01c89ee1125d515c50e3e2655510d0ce
Signed-off-by: Jia, Chunhui <chunhui.jia@linux.intel.com>
|
|
|
|
|
|
|
|
|
| |
The move to the new API removed the ipmid_get_sdbus_plus_handler
interface because it looked like it was self-contained in the
executable, not realizing it was needed by an external provider.
Change-Id: I75bb898294cc59cae7d291f7a6a6ed1e61d62903
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
| |
Now that ipmid handles all the IPMI commands (for all interfaces),
converge to a single provider path.
Change-Id: Iad938d4440f8486741df491c7bfd0fa5f808afeb
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
| |
Implement the whitelist filtering as an optional provider using the
new filter registration mechanism.
Change-Id: I0d738e58508d31e6b1867e13b3b7ed048303d5d8
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Every ipmi command will pass through a filter prior to execution by the
registered handler. The filter consists of all registered filter
handlers that all must either return an IPMI error code or allow the
command to be executed. If any of the filter handlers return an error
code, the remaining handlers will not get a chance to run.
Each handler, executed in registered priority order, can be passed the
full message, or just the context (metadata describing the command,
netfn, cmd, etc.)
Change-Id: I3c48f19ebae0d24344b15fbcd2b940a32f8511d7
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
| |
Add full support for the IPMI OEM NetFn and the Group OEM support as
defined in the IPMI 2.0 specification.
For now the legacy OEM router mechanism is still supported.
Change-Id: I8cc999489000c6e0daf5aad3579838e6f499ba47
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New architecture highlights:
* The new registration detects handler type for argument unpacking.
* Upon completion the response is automatically packed.
* Handlers can make use of the new async/yield sdbusplus mechanism.
* The queue exports a new dbus interface for method-based IPMI calls.
* The legacy handler registration is still supported for now.
* The legacy dbus interface is still supported for now.
Change-Id: Iae8342d9771ccebd3a0834e35597c14be4cc39cf
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
| |
This adds unit tests for the various types that the message
packer/unpacker handles. This includes tests for simple messages as well
as complex messages. It also includes positive and negative testing to
make sure that failed packing and unpacking gets reported properly.
Change-Id: I9360c867cccbeba6a707dda6df6c5e29fa585c5c
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
handler.hpp has the templated wrapping bits for ipmi command handler
callbacks implemented.
message.hpp has the serialization/deserialization of the ipmi data
stream into packed tuples for functions.
message/pack.hpp and message/unpack.hpp contain the actual serialization
and deserialization of types.
Change-Id: If997f8768c8488ab6ac022526a5ef9a1bce57fcb
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Separate the channel implementation from the user implementation. It is
possible to link only against the channel layer, but if code is using
the user layer, it is likely to need both user and channel code.
This makes it so that ipmid can support the notion of channels without
supporting users.
Change-Id: I3a7eb7c004e1c2f8aeb696180139cf68c2c4aac0
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
| |
Do not use c_str() when parameter is std::string.
Caught via cppcheck.
Change-Id: Iad7c1296d8be363df10ccf9278231187d7d29052
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
| |
Force symlink creation. In the event, the daemon is being built and
installed when already present, should force creation of symlinks and
not fail on this case.
Change-Id: Ic2cf84c36422a3be208a18a07daacfc6c587162b
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Add generated file entity-gen.cpp
Change-Id: Id2d13de766b3d4c924bc9a48963e556a9ec86f58
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
Use the defaults in the pkg check where the default error message is
sufficient to identify which package is missing.
Change-Id: Iaa5325492d937899c06a5aecad9b6d1beaa81897
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adding support for Entity Association Record (SDR type - 0x08h)
This patch includes:
1) Entity Association Record yaml file example
2) Entity Assocation Record related script and mako file changes
3) Adding Entity Association Record in get_sdr IPMI command response
From the host, tested that entity association records can be fetched
Change-Id: I9cf598e5d27d2e8c6751bbaae2176e7c976974b1
Tested: Yes
Signed-off-by: Jaghathiswari Rankappagounder Natarajan <jaghu@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is a bit in SDR types 01h and 02h which indicate that a sensor is settable (Supports the "Set Sensor Reading And Event Status" command). Since OpenBMC has some sensors which support this command (eg. fan pwm sensor), the bit should also be set accordingly.
The bit in question is Settable Sensor and can be found:
IPMI Spec v2.0 rev 1.1:
Section 43.1 SDR Type 01h, Full Sensor Record
Table 43 - SDR Type 01h, byte 11, bit 7
Tested from the host side that the FULL SDR for sensors which are settable
shows up as settable.
Change-Id: I5bd140e035a5a96b977dbbbf4acaae0369e832d2
Tested: Yes
Signed-off-by: Jaghathiswari Rankappagounder Natarajan <jaghu@google.com>
|
|
|
|
|
|
|
| |
Check for the json header during configuration.
Change-Id: I704c653e7fd51b756f65a90e541178cf1f19783b
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
This will hold the channel manangement interface and implementation,
which can be used separately from the libuserlayer.
Change-Id: I06e7310223445cbb095f1e9caebc0e391afb704d
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The timeRemaining property in watchdog service will return 0
if the watchdog is not started.
Tested By:
ipmitool raw 0x6 0x24 0x0 0x0 0x0 0x0 0xa 0xb
ipmitool mc watchdog get
Change-Id: I27992f25a0e2c75df398ec5e2702b467365e9a32
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
|
|
|
|
|
|
|
|
|
| |
Tested:
ipmitool raw 0x06 0x24 1 0 0 0 0 0
ipmitool mc watchdog get
Change-Id: Iaffd6622821d33183a52f54a4e2e52a36aa17dde
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
| |
According to section 6.6 Power management of DCMI specification,
if power management feature is disabled,
the related commands (Get/Set/Activate/Deactive Power Limit)
should be unsupported.
Change-Id: I887f33babb2fe7a1ab97bb2d0720a693171e48a1
Signed-off-by: Kirill Pakhomov <k.pakhomov@yadro.com>
|
|
|
|
|
|
|
|
| |
Pass JSON config file name as a parameter
to make parser re-usable with various config files.
Change-Id: I5bf1e91121e0e75be58383151f265b32f39a5b60
Signed-off-by: Kirill Pakhomov <k.pakhomov@yadro.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code gets unspecified initializatio order for the global/static
variables in a shared library.
If unluck, a global/static variable may be initialized in *constructor*
function, and then initialized by the default contructor.
For exmaple, if `std::unique_ptr<xxx> var{nullptr};` is initialized in
constructor function, below init order may occur:
1. It is initialized in constructor;
2. Then it is initialized as nullptr;
And eventually when the code is to use the variable, we got nullptr.
We met such issues before on openbmc/openbmc#1581, and the technical
details could be found at [this SO question][1] and [this gcc email][2]
The solution is to specify the init_priority attribute, to make the
global/staic variables inititalize earlier than the contructors.
[1]: https://stackoverflow.com/questions/43941159/global-static-variables-initialization-issue-with-attribute-constructor-i
[2]: https://gcc.gnu.org/ml/gcc-patches/2017-03/msg00863.html
Change-Id: I901a6a5cddec12aec9512fe58b16735fa2ad90d7
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
| |
This is a fix for 40f59e2c50572705496ae743577f124f24afd77e.
Change-Id: I850f87968600759c2758841803ebd23c0856319d
Signed-off-by: Oskar Senft <osk@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This command is used for logging SEL.
Tested:
1. test with netipmid and ipmid.
2. test pass with good parameter
ipmitool raw 0x4 0x2 0x20 0x11 0x04 0x11 0x80 0xc0 0x10 0xFF
ipmitool raw 0x4 0x2 0x20 0x11 0x04 0x11 0x00 0x30 0x10 0xab
3. test pass with bad parameter (expect invalid data length error)
ipmitool raw 0x4 0x2 0x20 0x11 0x04 0x11 0x00 0x30
ipmitool raw 0x4 0x2 0x20 0x11 0x04 0x11 0x00 0x30 0x11
ipmitool raw 0x4 0x2 0x20 0x11 0x04 0x11 0x00 0xc0
ipmitool raw 0x4 0x2 0x20 0x11 0x04 0x11 0x00
Change-Id: I7d51aac8fee2edb1faeb91f4c96a033736068779
Signed-off-by: Jia, Chunhui <chunhui.jia@linux.intel.com>
|
|
|
|
|
| |
Change-Id: I5392202352c2baa70d61768cbaef9eb0e1faad56
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This starts a transition to common ipmid libraries that providers can
link against. It will allow for a cleaner separation between common
ipmid functionality and daemon type specific code. This is needed so we
can resolve all of the symbols in the providers at link time instead of
discovering bad linkage by building and running a full ipmi daemon.
In future commits libraries will be packaged for libipmid and libipmid-host
which provide all of the symbols used by the current set of ipmid
providers.
This is the first step, it just separates and renames the headers.
Legacy symlinks are still kept around for compatability. It also adds
stub libraries so that external users can start linking as intended.
Change-Id: I6bbd7a146362012d26812a7b039d1c4075862cbd
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes adds a data length check to all supported IPMI
SEL commands. This prevents a command from being handled when
too much data is provided in the request.
Tested: Ran Get SEL Info, Reserve SEL, Get SEL Entry, Add SEL Entry
Delete SEL Entry, Clear SEL, Get SEL Time, Set SEL Time, with and
without an extra byte. Without the extra byte, the commands returned
normally; with the extra byte, a 0xC7 is returned indicating that the
request data length is invalid.
Change-Id: Icdd7db80f1bced3e6efddb5c5655e9f44a4e0e3b
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
|
|
|
|
|
|
|
|
| |
The functionality provided by net.hpp and net.cpp has been moved into
the channel_mgmt class.
Change-Id: I4820609f87f27ebe81d9b36f7b8e95a5262985ac
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
IPMI Spec Section 19.2:
Unless otherwise noted, Reserved bits and fields in commands(request messages)
and responses shall be written as '0'.
Return "out of range" error for unsupported power policy
and also return the supported policies on success.
Change-Id: I51d63b86ef0d3076438649abc49c63267c57cbd5
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
|
|
|
|
|
|
|
| |
The netmask value was not being pulled from the correct DBus path.
Change-Id: I4b163d5269737f7a9556d7b5ceafa25a5034d327
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The IPMI to NIC channel mapping was done using a hard coded scheme.
The scheme used generic channel names which were then mapped to
specific device names. The hard coded generic to specific naming
convention is removed, and the JSON file contains the device name
directly.
Change-Id: Ibc6821cae5a26f2666467aba5346d364053f2582
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
|
|
|
|
|
|
|
|
|
|
| |
Moved two variables only used by the class into it's private variable
space.
Highlighted a method prototype that was buried within the variable list.
Change-Id: Ie90d6b7db85ce1a9e445de87d612c41b4337d7fc
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Copy the data retrieved from the JSON data files only after the
contents of the two JSON configuration files have been read
successfully.
The code has also been changed to eliminate excess indentation in
order to improve its readability and maintainability.
Change-Id: I2def95b854bef39a9e7b196ef340c3a06965653a
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
|
|
|
|
|
|
|
|
| |
The getChannelDataPtr method breaks class encapsulation. Only class
methods are supposed to have access to class private instance variables.
Change-Id: I5dbfb75f0fa409b82a1e7f426b2034d39f7df9ad
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
|