summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [IPMI]Set/Get global enablesJia, Chunhui2019-03-073-7/+50
| | | | | | | | | | | | 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>
* Fix: User commands require channel layer libRichard Marian Thomaiyar2019-03-041-1/+2
| | | | | | | | | | | | | | 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>
* Extra Bytes in response data for chassis Identify commandJia, Chunhui2019-03-041-0/+1
| | | | | | | | | | 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>
* Add back an interface used by an external providerVernon Mauery2019-02-272-1/+9
| | | | | | | | | 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>
* Set new default ipmid provider pathVernon Mauery2019-02-251-1/+1
| | | | | | | | 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>
* ipmid: Add whitelist filtering using the new filter registration mechanismVernon Mauery2019-02-252-2/+181
| | | | | | | | 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>
* ipmid: Add command filter mechanismVernon Mauery2019-02-254-0/+180
| | | | | | | | | | | | | | | 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>
* ipmid: Add in Native OEM and Group OEM supportVernon Mauery2019-02-253-1/+309
| | | | | | | | | | 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>
* ipmid: Rewrite ipmid to use the new architectureVernon Mauery2019-02-255-24/+482
| | | | | | | | | | | | | 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>
* ipmid: add message packing/unpacking unit testsVernon Mauery2019-02-254-2/+1536
| | | | | | | | | | 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>
* ipmid: Compiler-generated unpacking and packing of messagesVernon Mauery2019-02-2511-0/+2492
| | | | | | | | | | | | | 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>
* ipmid: move channel code from libuserlayer to libchannellayerVernon Mauery2019-02-252-11/+8
| | | | | | | | | | | | 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>
* user_mgmt: drop c_str() when param is std::stringPatrick Venture2019-02-211-4/+4
| | | | | | | | | Do not use c_str() when parameter is std::string. Caught via cppcheck. Change-Id: Iad7c1296d8be363df10ccf9278231187d7d29052 Signed-off-by: Patrick Venture <venture@google.com>
* include: Makefile_am: force symlink creationPatrick Venture2019-02-201-6/+6
| | | | | | | | | 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>
* gitignore: add entity-gen.cppPatrick Venture2019-02-201-0/+1
| | | | | | | Add generated file entity-gen.cpp Change-Id: Id2d13de766b3d4c924bc9a48963e556a9ec86f58 Signed-off-by: Patrick Venture <venture@google.com>
* build: pkg anti-pattern: use defaultsPatrick Venture2019-02-161-6/+4
| | | | | | | | 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>
* Add support for Entity Association RecordJaghathiswari Rankappagounder Natarajan2019-02-158-7/+387
| | | | | | | | | | | | | | 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>
* phosphor-host-ipmid: Add support for settable bit in FULL SDRJaghathiswari Rankappagounder Natarajan2019-02-151-0/+5
| | | | | | | | | | | | | | | | | 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>
* build: check for json headerPatrick Venture2019-02-131-0/+1
| | | | | | | Check for the json header during configuration. Change-Id: I704c653e7fd51b756f65a90e541178cf1f19783b Signed-off-by: Patrick Venture <venture@google.com>
* Create the libchannellayer library so it can split from libuserlayerVernon Mauery2019-02-122-1/+14
| | | | | | | | 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>
* Get the correct present countdown value when watchdog is stoppedYong Li2019-02-121-4/+8
| | | | | | | | | | | | 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>
* Add timer use field support in watchdog commandYong Li2019-02-123-0/+108
| | | | | | | | | 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>
* dcmihandler: Add DCMI Power management support checkKirill Pakhomov2019-02-122-0/+44
| | | | | | | | | | 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>
* dcmihandler: Add parameterization to JSON parser method.Kirill Pakhomov2019-02-122-11/+12
| | | | | | | | 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>
* Set init_priority attribute for global variables in shared libLei YU2019-02-124-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ipmi_fru_info_area: Handle exception during parsing of chassis typeOskar Senft2019-02-111-1/+11
| | | | | | | This is a fix for 40f59e2c50572705496ae743577f124f24afd77e. Change-Id: I850f87968600759c2758841803ebd23c0856319d Signed-off-by: Oskar Senft <osk@google.com>
* Platform event commandJia, Chunhui2019-02-073-0/+117
| | | | | | | | | | | | | | | | | | 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>
* eSEL: Remove code related to logging eSELTom Joseph2019-02-073-236/+0
| | | | | Change-Id: I5392202352c2baa70d61768cbaef9eb0e1faad56 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Create libipmid and libipmid-hostWilliam A. Kennington III2019-02-0743-50/+123
| | | | | | | | | | | | | | | | | | | 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>
* Add request data length check to IPMI SEL commandsJason M. Bills2019-02-061-0/+46
| | | | | | | | | | | | | | | 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>
* Removing net.hpp and net.cpp because functionality movedJohnathan Mantey2019-02-056-120/+1
| | | | | | | | 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>
* Changes to align with IPMI specYong Li2019-02-051-4/+5
| | | | | | | | | | | | 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>
* Acquire the NIC netmaskJohnathan Mantey2019-02-051-3/+3
| | | | | | | The netmask value was not being pulled from the correct DBus path. Change-Id: I4b163d5269737f7a9556d7b5ceafa25a5034d327 Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
* IPMI channel to NIC device mapping modified within JSON config fileJohnathan Mantey2019-02-048-39/+84
| | | | | | | | | | | 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>
* Move public variables to the class private space.Johnathan Mantey2019-02-041-4/+10
| | | | | | | | | | 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>
* Refactor the initialization of the channel data from the JSONJohnathan Mantey2019-02-042-60/+47
| | | | | | | | | | | | 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>
* Eliminate public function returning pointer to private class dataJohnathan Mantey2019-02-042-36/+36
| | | | | | | | 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>
* Update DBus initialization and useJohnathan Mantey2019-02-042-16/+7
| | | | | | | | The DBus instance variable is no longer a passed parameter to instance methods. Instance methods can access the private DBus variable directly. Change-Id: Id0c988802e5ad6c2757e7a243ee92331f447ac0d Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
* Revert "eSEL: Remove unused code related to logging eSEL"Tom Joseph2019-02-048-0/+658
| | | | | | | | | | This reverts commit 54fad6de0541c2f98e9b511f1d30bbcbcd743db6. This commit is reverted because the mapping of D-Bus object path to sensor information is still needed. The mapping is needed to serve the SEL commands which translate D-Bus logging objects to SEL entries. Change-Id: I2505299671db1f0bd7f116ef0e2ca4a0273eead8
* Use network interface name as channel nameRichard Marian Thomaiyar2019-02-023-66/+29
| | | | | | | | | | | | | | Use network interface name as channel name for the LAN channels. Mapper related to convert IPMI LAN reference to network interface is not needed anymore, and the same has been removed. Unit-test: verified ipmitool channel info for channel 1 & 2 and made sure it works fine as expected. Change-Id: Id87e2924a2a21a846507d6378b1b615000280f06 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* transporthandler: Add IPV6 LAN parameters to enumPatrick Venture2019-02-021-3/+50
| | | | | | | | Add the IPV6 LAN parameters to the enum. These commands are not yet supported. Change-Id: I9847fe7c70ef66a2f0138ba79651376c011a2273 Signed-off-by: Patrick Venture <venture@google.com>
* Fix: Return error for invalid privilegesRichard Marian Thomaiyar2019-02-021-6/+10
| | | | | | | | | | | | Return error code 0xCC for invalid privileges requested in SetChannelAccess command. Unit-Test: 1. Verified 0xCC is returned for command (reserved privilege) ipmitool raw 0x6 0x40 0x1 0x82 0x80 Change-Id: I3ea1ee6e02019ef0ae5f812e7d5dd999d710e4e7 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* Fix: Handle return codes for user commmandsRichard Marian Thomaiyar2019-02-021-8/+16
| | | | | | | | | | | Handle the missed return code for the user commands Unit-test: 1. Verified user list & error codes in ipmitool user list 1 Change-Id: Ia62aebc367dd2606df1dd25507953bf465ab40d7 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* Fix: Check reserved fields in channel cmds requestRichard Marian Thomaiyar2019-02-021-6/+6
| | | | | | | | | | | | Check reserved fields in channel cmds request and return 0xCC, if reserved fields are set Unit-Test: 1. Verified 0xCC is returned if reserved fields are set ipmitool raw 0x6 0x40 0x11 0x82 0x81 Change-Id: I4ca18c35d1435c6f9a636eb2c2730e63d8df319b Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* Fix: NoAccess priv is tied with empty priv attrRichard Marian Thomaiyar2019-02-011-4/+0
| | | | | | | | | | | | | | SetUserAccess command must accept NoAccess privilege and update user-manager with empty privilege attribute for that user. Unit-test: verified it using following command, and access marked as NoAccess when queriying user list ipmitool raw 6 0x43 0x91 0x1 0x0f 0x00 Change-Id: Id63061edfc7777b7cb88c2cd7c693ea0b98c7949 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* eSEL: Remove unused code related to logging eSELTom Joseph2019-02-018-658/+0
| | | | | Change-Id: Ia9815102064d20795a44b8e6a7d8b324c280756c Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Removal of excess 16 bytes paddingRichard Marian Thomaiyar2019-01-311-9/+1
| | | | | | | | | | | | | | | | | | | | | Cipher block padding is applied twice(once manually, and once through EVP_CipherFinal()) causing excess 16 bytes of data. Manual padding is removed to fix the issue. Unit-Test: 1. Verified that files are padded correctly without excess 16 bytes. Also, verified the password update and RMCP+ login using ipmitool ipmitool user set password <userid> <password> ipmitool -I lanplus -H 127.0.0.1 -U <userid> -P <password> raw 6 1 2. Also verified renaming of user name and login after that Resolves openbmc/openbmc#3463 Change-Id: Idec14b100bf7558137ff14601eb590b50cdbd7bf Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* Fix: Get Channel Cipher suite to list algoRichard Marian Thomaiyar2019-01-291-28/+43
| | | | | | | | | | | | | | | Implemented Get channel cipher suite command to list the supported algorithms. Previously this command supported only list by cipher suite. Unit test: Verified that algorithms are listed for both byte3 bit7 set / un-set ipmitool raw 0x6 0x54 0x1 0x0 0x80 ipmitool raw 0x6 0x54 0x1 0x0 0x00 both listed alogrithms as expected Change-Id: I7b0ac74293cce869f5bcaa3c5ec226e1d237ccdf Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* Return error for password length bit mismatchRichard Marian Thomaiyar2019-01-171-2/+7
| | | | | | | | | | | | | | | Return InvalidLength error, for password length bit mismatch for Set User Password command. i.e. if length is specified as 16 then accept only 16 byte charachers and for length specified as 20 accept 20 byte characters Unit-test: 1. Verified both by issuing proper 20 & 16 byte length filed 2. Also verified error sending 20 character byte by setting 16 byte length Change-Id: I1e6cca3b4dcd920e8e8dfcf23344c10d1bf37ca2 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* ipmid: channel: add max transfer size propertyVernon Mauery2019-01-114-0/+31
| | | | | | | | | Each channel can have a different maximum transfer size. This should be exposed so that it is easier to tell how many bytes it is possible to send or receive on a given channel. Change-Id: Ie277eb7a802edc1deeefe201a7560d371920f519 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
OpenPOWER on IntegriCloud