summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ipmid: update chassis identify commandVernon Mauery2019-04-091-26/+16
| | | | | | | | | | | | Modify to use the new provider API. One by one, change calls to remove any legacy API constructs. Tested-by: ipmitool chassis identify ipmitool chassis identify 0 ipmitool chassis identify force Change-Id: I91bc21fdaef74eb32f297e0fa54edbc2e1bf4c2b Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Add a tuple type for packingVernon Mauery2019-04-093-18/+72
| | | | | | | | | | | | | At the top level, payload had the ability to pack a tuple, but it did it by splitting it into its parts and packing those individually. But if one of those parts was a tuple, it would fail. This moves the tuple packing code into the packing templates so that it is possible to pack a nested tuple of tuples. Tested-by: newly written tuple unit tests pass Change-Id: Icd80926314072df78b0083a823dcfb46e944e365 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Add error message to build to make packing type errors clearVernon Mauery2019-04-091-0/+2
| | | | | | | | | | | | | Because the base template actually handles things (all integer types), it needs to ward off non-integer types in a clear way, rather than relying on the user seeing that a tuple doesn't have an operator <<(), for example. This provides a clear message if a specialized pack operation was not hit. Tested-by: attempted to build with a non-supported pack type Change-Id: I66280831e88b4eac903b89f523e5f1a56a53cf9d Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Add: Get channel payload support commandSaravanan Palanisamy2019-04-094-0/+129
| | | | | | | | | | | | | | | | | | Implemented Get Channel Payload Support command (IPMI Spec sec 24.8) The same is implemented under channel commands, and will be available for both Host & Net ipmid. Uses channel configuration to differentiate between session / session-less channel Tested-by: 1. Verified command executed successfully for session based channel ipmitool raw 6 0x4E 0x1 // Command 03 00 15 00 00 00 00 00 // Response 2. Verified sessionless channel error is returned. Change-Id: I8b294234415b4467aeae6c23c192750471536f4e Signed-off-by: Saravanan Palanisamy <saravanan.palanisamy@intel.com> Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* Add helper functions to simplify error responsesVernon Mauery2019-04-081-3/+100
| | | | | | | | | | | | | | | Most IPMI commands have some error response. This makes it more intuitive what is happening, changing return ipmi::response(cc::CommandNotAvailable); to return ipmi::responseCommandNotAvailable(); which is parallel to the success respones of: return ipmi::responseSuccess(); Change-Id: Ibbd401c4007a02e91ab4983814b920d6d7f02404 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Only include ipmid/api.hpp for the new APIVernon Mauery2019-04-0827-396/+379
| | | | | | | | | | | | | | After some feedback from users of the new IPMI API, they wanted to see two things: 1) don't require ipmid/api.hpp and ipmid/registration.hpp to be able to write new handlers 2) only require including ipmid/api.hpp (instead of ipmid/api.h) So now, by simply including ipmid/api.hpp instead of ipmid/api.h (deprecated), handlers incorporating the new IPMI API can be written. Change-Id: I446dcce70cff03d4ecc28c658292d052485f77fc Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* remove app wildcard handlerVernon Mauery2019-04-051-21/+0
| | | | | | | | Tested-by: ipmitool raw 6 0x88 -> returns c1 Change-Id: I1f22a70d135ed0ab39c6b1fbacf41e8d5ff20b65 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* rewrite Get BT Capabilities using new provider APIVernon Mauery2019-04-051-21/+13
| | | | | | | | | | | Modify to use the new provider API. One by one, change calls to remove any legacy API constructs. Tested-by: ipmitool raw 6 0x36 01 3f 3f 0a 01 Change-Id: I9be3d21c041ba1d99f6672c4501faafcca117d11 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* rewrite Get Self Test Results to use new provider APIVernon Mauery2019-04-051-20/+7
| | | | | | | | | | | Modify to use the new provider API. One by one, change calls to remove any legacy API constructs. Tested-by: ipmitool raw 6 4 56 00 Change-Id: I3cf0a9bd93df6b12584861b4c60b272ff84b7dae Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* rewrite Get Device ID using new provider APIVernon Mauery2019-04-051-72/+70
| | | | | | | | | | | Modify to use the new provider API. One by one, change calls to remove any legacy API constructs. Tested-by: ipmitool raw 6 1 check for expected output Change-Id: I59688627eb32670559c1defad0b7af8abeb84c75 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Add convert current channel number functionRichard Marian Thomaiyar2019-04-051-0/+20
| | | | | | | | | | | | | | Support for convert current channel number based on ipmi::Context is added. Tested: Verified by updating the channel number manually and function returns correctly. For correct value another gerrit patch is needed which will advertise proper channel from which the command originated. Change-Id: Id17d87b6a945b0264c8f14348a50bc2c087d187e Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* Fix utility.hpp to use correct types for Request and ContextVernon Mauery2019-04-051-1/+10
| | | | | | | | | | | When requesting a Request or Context object as part of the handler signature, it should be a std::shared_ptr<ipmi::Context> or std::shared_ptr<ipmi:message::Request>. There was a bug that made it so it was not possible to have either of those in the signature. This commit enables both. Change-Id: Ib52000f643d7b5f21bc4022629e7d7b03a524dc1 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Add support for returning optional valuesVernon Mauery2019-04-052-0/+42
| | | | | | | | | | | Some commands have optional return values. This allows the handlers to be defined as returning an optional<T> value and then in the body of the handler set the value in the optional or not. Tested-by: unit test runs successfully Change-Id: Ib38a4589609fb1eb192106e511c9ee3a507ac42f Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* message: pack: add variant supportJames Feist2019-04-042-10/+39
| | | | | | | | | | | Add variant support to allow return of mutliple specific types. Also change types to const as this is required by the visitor and these could have been const all along. Tested: Added unit test and used in oem provider Change-Id: I5cb056c15d4813b9eee58eecb707664477d019d9 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Catch sdbusplus exceptions in IPMI netVernon Mauery2019-04-042-3/+4
| | | | | | | | | Missing the correct exception was causing issues with setting the IPV4 address Change-Id: Ieaaacfcbaec82a0c3b110889817a7ceb9cda8d3c Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com> Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
* update apphandler #include to match styleVernon Mauery2019-04-011-7/+8
| | | | | | | Remove the "" style includes in preference of the <> style Change-Id: I74bfa4dcadeaca7fe2341d5a9221844ebe2653b8 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Remove old channel commandsVernon Mauery2019-04-012-190/+1
| | | | | | | | | New channel commands have been implemented in user_channel/channelcommands.cpp This removes the old, unused command implementation Change-Id: I054ea053d25865e0d4203f2ae294778d31817637 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* remove legacy ipmid.cpp and ipmid.hppVernon Mauery2019-04-0110-735/+6
| | | | | | | These two files have now been replaced with newer APIs and can be removed. Change-Id: If60227b24188c6796211ca43379169f9a95c9cb3 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Fix: Set Lan Configuration parameterRichard Marian Thomaiyar2019-04-011-15/+31
| | | | | | | | | | | | | | Allow individual parameter changes to take effect based on timer. i.e. setting any one LAN parameter change will take effect even without Set In Progress parameter update Verification: Verified lan settings change to static alone using ipmitool lan and manually issued parameter update without SET_IN_PROGRESS change. Change-Id: I2a9f8e8ef94ecb23da8bac38a6b49249544e8975 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* build: install into bin instead of sbinPatrick Venture2019-04-012-2/+2
| | | | | | | Installs into bin instead of sbin per guidelines. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: If171989d2c0c6a53d9368b776ac98dea743057da
* allow legacy handlers to register with groupoem extensionVernon Mauery2019-04-011-1/+14
| | | | | | | | | | | | | DCMI uses the group oem extension 0xdc. The legacy registration allowed for registering with the group extension netfn and did nothing with the actual group extension ID. This change makes the assumption that all legacy group extension registrations are dcmi and registers them as such with the new group handler machinery. Tested-by: Run ipmitool dcmi discover and see it show information Change-Id: I862ba212a7fe2e2dad83d6c9f22e7d1a48b7d406 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* resolve symbolic links to only load each library onceVernon Mauery2019-03-291-0/+6
| | | | | | | | | | Historically, the provider libraries and symlinks to them were installed in the /usr/lib/ipmid-providers directory. This can cause ipmid to attempt to load each one twice. This change will make it so ipmid will not load symlinks, but only real files. Change-Id: I1353f01d509ef495bfa666eed97b034d73a1a90a Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Remove experimental filesystem spliceVernon Mauery2019-03-287-91/+7
| | | | | | | | | | In order to be compatible with older versions of GCC that did not have the experimental filesystem moved over to the standard paths, the code would splice the experimental code into the std namespace. This is no longer necessary with yocto 2.6 and the latest versions of GCC. Change-Id: I2db13c52a91456318795819f2d45c3386b4c56d2 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Adding Set Password API support in UserlayerSuryakanth Sekar2019-03-267-79/+142
| | | | | | | | | | | | | | | | | | | | Moved the pam function from libusercommand to libuserlayer Added the setPassword API in user layer. There are modules which requires to use set password functionality (other ipmi providers-OEM),so it's better to keep the set-password abstracted in user-layer instead of user-commands. LIBS macro hold libpam and libmapper. we want to separate the libpam from lib usercommand. so,replaced LIBS with libmapper alone. Tested:Able to set the password in ipmi using userlayer. ex: ipmitool user set password <userid> <password> user password should set properly. Change-Id: I32d55ff5c042613c89805c6b9393d18cbf880461 Signed-off-by: Suryakanth Sekar <suryakanth.sekar@linux.intel.com>
* delete writechannel.mako.cppPatrick Venture2019-03-251-20/+0
| | | | | | | Delete obsolete scripts/writechannel.mako.cpp Change-Id: I79dac382132bf89877f2718d1b6219a2503e415e Signed-off-by: Patrick Venture <venture@google.com>
* dcmihandler: Fix Get DCMI Capabilities commandKirill Pakhomov2019-03-252-8/+17
| | | | | | | | | | | | Get DCMI Capabilities (Discover) command returned wrong values for parameters exceeding 1 byte length. Also added the check for SEL entries number range per DCMI specification. Tested: the condition for value limit check works properly. Change-Id: Iee0d75594067630bb6094d05533c87e3ad82807e Signed-off-by: Kirill Pakhomov <k.pakhomov@yadro.com>
* move types.hpp to ipmid/types.hpp for exportVernon Mauery2019-03-2520-22/+20
| | | | | | | | | | types.hpp is required by utility.hpp, which is exported, so it needs to be exported as well. This moves it to the include/libipmid directory, changes the Makefile to export it, and changes all the files that include it so it can be found in the right place. Change-Id: I30ec365446e4de466c266ec4faa327478460ec05 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Move util.cpp/util.hpp to libipmidVernon Mauery2019-03-2524-28/+24
| | | | | | | | | | | | | | | | 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>
* do not use auto and rename handles to providersVernon Mauery2019-03-251-2/+3
| | | | | | | | | 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>
* [User Mgmt]: Update local user enabled state cacheRichard Marian Thomaiyar2019-03-251-0/+10
| | | | | | | | | | | | 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>
* Cleanup: Get rid of duplicate getChannelName()Richard Marian Thomaiyar2019-03-254-16/+3
| | | | | | | | | | | | 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>
* Add user context parameter to legacy ipmi handler registrationVernon Mauery2019-03-212-5/+8
| | | | | | | | | 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>
* make ipmid respond to SIGTERM and SIGINT for clean shutdownVernon Mauery2019-03-202-6/+21
| | | | | | | | | | | | | | | 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>
* Add generic signal handling API to work with boost::asioVernon Mauery2019-03-203-0/+142
| | | | | | | | | | | | 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>
* make utility.hpp available for external things that include ipmid/api.hppVernon Mauery2019-03-191-0/+1
| | | | | Change-Id: Iafe6827fa545d72666994bb68b5972cde4d0a1ff Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Change linkage of ipmid_get_sdbus_plus_handler() to libipmid.soVernon Mauery2019-03-196-40/+96
| | | | | | | | | | | | | | 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>
* errorResponse must not pack completion code in data payloadVernon Mauery2019-03-151-3/+3
| | | | | | | | | | | | | 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>
* Use payload interface to unpack group/IANA from messageVernon Mauery2019-03-151-2/+2
| | | | | | | | | | | | 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>
* utils: Use 5s timeout for D-Bus get/set property callsKun Yi2019-03-122-12/+26
| | | | | | | | | | | | | | | | | | | | 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
* fix whitelist RestrictionMode lookupVernon Mauery2019-03-071-3/+6
| | | | | | | | | | | 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>
* [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>
OpenPOWER on IntegriCloud