summaryrefslogtreecommitdiffstats
path: root/ipmid.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Create libipmid and libipmid-hostWilliam A. Kennington III2019-02-071-2/+2
| | | | | | | | | | | | | | | | | | | 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>
* libipmi: Decouple user commandsWilliam A. Kennington III2018-12-201-1/+0
| | | | | | | | | | | | | This makes them an optional, separate provider like the sysfs cmds. Tested: Ran on real hardware that included libusercmds.so in /usr/lib/host-ipmid and on a machine that did not include it. Ran ipmitool on the host to verify that the user commands were present when expected. Change-Id: I07b3af5ae603c3e5f1ea41f0afc309329f4e185d Signed-off-by: William A. Kennington III <wak@google.com>
* ipmid: host-cmd-manager to use default event source for timersVernon Mauery2018-12-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The sdbusplus/timer.hpp class can be passed an event, but by default, it just uses the default system event queue. This updates the host-cmd-manager Manager class to use the defaults. Tested-by: Send the heartbeat command with the host powered off and watch for a timeout message: dbus-send --print-reply --system \ --dest=xyz.openbmc_project.Ipmi.Host \ /xyz/openbmc_project/control/host0 \ xyz.openbmc_project.Control.Host.Execute \ string:"xyz.openbmc_project.Control.Host.Command.Heartbeat" Watch the log (journalctl -f): Nov 27 00:34:52 wolfpass ipmid[1255]: Pushing cmd on to queue Nov 27 00:34:52 wolfpass ipmid[1255]: Pushing cmd on to queue Nov 27 00:34:52 wolfpass ipmid[1255]: Asserting SMS Attention Nov 27 00:34:52 wolfpass ipmid[1255]: SMS Attention asserted Nov 27 00:35:23 wolfpass ipmid[1255]: Host control timeout hit! Change-Id: I904d34b67050723a9c7e405bda4e02f1a9cb4dbd Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* ipmid: Use sd_event_loop()Andrew Jeffery2018-11-271-11/+1
| | | | | | | | | | The infinite for-loop over sd_event_run() is effectively the implementation of sd_event_loop(). sd_event_loop() has the additional features of terminating correctly and running exit tasks on sd_event_exit(). Change-Id: Ib01a9b1e43891cbb65cfcab1c7a000d2a13728de Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* move HOST_IPMI_LIB_PATH to configure.acPatrick Venture2018-11-201-0/+2
| | | | | | | | Per TODO in Makefile.am, move the definition of HOST_IPMI_LIB_PATH from the Makefile to the configure script. Change-Id: If39bf1193f4502c239a78e21487566b234b746f8 Signed-off-by: Patrick Venture <venture@google.com>
* Add kcs selfchannel support & define for LAN toossekar2018-11-201-0/+5
| | | | | | | | | | Define sudo API's for returning channel index for self channel. At moment, This API returns KCS for host-ipmi Change-Id: Icefd5d949e94d4399adaffdad102ccb18c1b7cdc Signed-off-by: ssekar <suryakanth.sekar@intel.com> Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* ipmid: use the default system busVernon Mauery2018-11-201-1/+1
| | | | | | | | | | The documentation says sd_bus_default_system() is preferred over sd_bus_open_system() because all the calls to sd_bus_default_system() will use the same resources, whereas the sd_bus_open_system() will create a new connection and consume more resources for every call. Change-Id: I0206a43eb2a8dd7c76b8246c9f9640a95b2e473c Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Add well-known nameJames Feist2018-11-081-0/+2
| | | | | | | | | | | For looking up the service a well-known name is very useful. Also dbus-broker default permissions require a well-known name to do matches. Tested-by: Found well-known name on dbus. Change-Id: Ieb85e808a1315204096c24a8d48a0e4a52fce764 Signed-off-by: James Feist <james.feist@linux.intel.com>
* cleanup: scope reductionPatrick Venture2018-10-311-2/+1
| | | | | | | | | | | | | | [app/channel.cpp:102]: (style) The scope of the variable 'resp' can be reduced. [ipmisensor.cpp:310]: (style) The scope of the variable 'i' can be reduced. [ipmid.cpp:506]: (style) The scope of the variable 'num_handlers' can be reduced. [read_fru_data.cpp:82]: (style) The scope of the variable 'fruId' can be reduced. [sensorhandler.cpp:256]: (style) The scope of the variable 'p' can be reduced. [storageaddsel.cpp:68]: (style) The scope of the variable 'p' can be reduced. Also delete two extra vertical lines. Change-Id: I8e72f8e1d94381f456674abf523d2f2fbdd8046d Signed-off-by: Patrick Venture <venture@google.com>
* Convert variant usage to std interfaceWilliam A. Kennington III2018-10-181-2/+4
| | | | | | | | | | | | | This is just a refactoring to use the c++17 std::variant interfaces instead of the mapbox::variant specific ones. We should be able to use mapbox::variant and std::variant interchangeably now. Tested: Built against sdbusplus with mapbox::variant and sbusplus using std::variant. Both variant compile and test out. Change-Id: I6fbaad3d12dd34968db6a10f3d74a65e07d0f0cc Signed-off-by: William A. Kennington III <wak@google.com>
* Use the common timer classVernon Mauery2018-10-181-2/+2
| | | | | | | | | The common timer class from sdbusplus offers all the timer goodness that we currently use. The unit test is also no longer needed (and has been added to sdbusplus's version of the timer.hpp implementation). Change-Id: I278817489433a29ca739f70fdacd8bb897797d66 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Fix IPMI SEL reservations and cancellationsJason M. Bills2018-10-051-3/+21
| | | | | | | | | | | | | | | | | | | | | | | Per the IPMI Spec, the SEL must be reserved to Delete an entry Clear the SEL Get a partial entry Add a partial entry The current SEL reservation must be cancelled when A SEL entry is added A SEL entry is deleted The SEL is cleared The device is reset A new reservation is requested This change adds a reservation status to track when a reservation is active and a method to cancel the current reservation, and it uses that to cancel the reservation in the Delete, Clear, and Add SEL methods. Change-Id: Ifd72e6d06ecc622855bd9ce8cc3928cbd0f2c34b Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
* add std namespace prefix to common methodsPatrick Venture2018-09-251-20/+22
| | | | | | | | Standard clib methods should be explicitly grabbed from the standard namespace. Change-Id: I8bcfcb260a99180d535ec8102c1a24c318cbc209 Signed-off-by: Patrick Venture <venture@google.com>
* replaced c headers with cpp where applicablePatrick Venture2018-09-251-3/+0
| | | | | Change-Id: I23a70eb540ccde5d2aba467426769feffb07b516 Signed-off-by: Patrick Venture <venture@google.com>
* rename headers to match stylePatrick Venture2018-09-251-6/+5
| | | | | | | | | | | | | | | | | | Moving headers from ".h" to ".hpp" Reworked the header inclusion a bit so that host-ipmid is treated as a library, and local headers aren't. renamed apphandler.h => apphandler.hpp renamed chassishandler.h => chassishandler.hpp renamed globalhandler.h => globalhandler.hpp renamed sensorhandler.h => sensorhandler.hpp renamed storageaddsel.h => storageaddsel.hpp renamed storagehandler.h => storagehandler.hpp renamed systemintfcmds.h => systemintfcmds.hpp Change-Id: I9d4ce3dd57e2e996800f9020a10cc10cdf2c3914 Signed-off-by: Patrick Venture <venture@google.com>
* add .clang-formatPatrick Venture2018-09-071-183/+198
| | | | | Change-Id: I7c2a527b4751a560703a61fcbe9638b150546af5 Signed-off-by: Patrick Venture <venture@google.com>
* Add OemRouter facility.Peter Hanson2018-07-251-0/+4
| | | | | | | | | | | | | OemRouter adds a facility to register OEM Group Message handlers, then dispatch matching messages to the registered handler. Added as a core source so that any dynamic provider can register its messages without requiring any specific load order. Includes code fixes for x86 portability. Change-Id: I47b8fe7873e3c7fdf35a00d3c8a7e17d30c398c4 Signed-off-by: Peter Hanson <peterh@google.com> Signed-off-by: Patrick Venture <venture@google.com>
* Fix to return sane error codeRichard Marian Thomaiyar2018-07-241-4/+17
| | | | | | | | | | | | | | Any unhandled exception in the IPMI command handler crashes the ipmi stack. IPMI command handler also becomes bulky to catch all exceptions which must return unspecified errors. This fix adds a catch in the ipmi router command handler functions, and returns IPMI_CC_UNSPECIFIED_ERROR for all the unhandled exceptions. With this fix, exceptions which has to throw IPMI_CC_UNSPECIFIED_ERROR, doesn't needs to be handled in the command handlers. Change-Id: I6cf9fa1f0e5c1d71c57eebb9a2d451fa986168d3 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* Reducing IPMI logging footprintAditya Saripalli2018-04-181-26/+54
| | | | | | | | | | | | -host-ipmid is very noisy in terms of journal logging. A small step towards cleaning that up. -Also converted printfs to phosphor-logging. Partially Resolves openbmc/openbmc#2507 Change-Id: I749c19c18d1cabf6f0216830c8cb0a08ee43d6de Signed-off-by: Aditya Saripalli <aditya0124@gmail.com> Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* SetLan: Apply the network changes once the timer expiresRatan Gupta2018-03-201-0/+3
| | | | | | | | | | | | Start the timer once the set in progress parameter set to set complete as part of Set LAN Configuration Parameters command. Resolves openbmc/openbmc#2932 Resolves openbmc/openbmc#2993 Change-Id: Ie6f3b331531da23c74fa44bb52fa1ddccffabd13 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* SDR: Adding fru records as part of Get SDR commandRatan Gupta2018-02-131-5/+6
| | | | | | | | | | | Currently Get SDR only responds with physical/virtual sensor records,it doesn't support for FRU records,This commit adds the support for FRU records. Resolves openbmc/openbmc#2776 Change-Id: I34edfa892b32f4e866cf0c084d97c2f3482d40f4 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Move error msg for trying wildcard into debug onlyPatrick Venture2017-09-201-0/+3
| | | | | | | | | | My logs are effectively full of this message, hiding out other useful messages because we run a lot of OEM traffic. Also, until the daemon fails to find the command via wildcard, it's not really an error worth reporting in most cases. Change-Id: Id6674f3e9a2f237de6bd37d6c9f89931a99d0951 Signed-off-by: Patrick Venture <venture@google.com>
* settings: handle multiple objects/interfacesDeepak Kodihalli2017-09-081-2/+3
| | | | | | | | | Handle the fact that a settings object can now implement multiple interfaces, and also the fact that multiple settings objects can implement the same interface. Change-Id: Icf55b08fe2d355a10f7007489dfddb128e05d90e Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Remove extra header inclusionPatrick Venture2017-09-061-1/+0
| | | | | Change-Id: I4f77b3731a52d8a8271e827d017ef2e8b7923fe6 Signed-off-by: Patrick Venture <venture@google.com>
* Make host command manager accessible by OpenPower OEMVishwanatha Subbanna2017-08-141-1/+2
| | | | | | | | | Since OpenPower Host IPMI OEM also needs to use the Host Command manager, need to place the files in appropriate directories and make needed changes. Change-Id: I7536a0ff1e53a844ec05f73c4e0605cbf4341465 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Use Host Command Manager in host interface implementationVishwanatha Subbanna2017-08-141-1/+34
| | | | | Change-Id: Icefce510a3a0022bf0288fa99518459b732a2e04 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* restriction_mode: switch to new settings APIDeepak Kodihalli2017-07-311-62/+72
| | | | | | | Resolves openbmc/openbmc#1489. Change-Id: If642a19204edcf2dbebb644f7abd67de749491e4 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Add sd_event processing to host ipmid applicationAndrew Geissler2017-05-091-13/+29
| | | | | | | | In order to support the timer function, it's required to use the sd_event loop instead of sdbus loop Change-Id: I3a30fee1a21cbfadd0cbb5478bf46bea4b5ca0b8 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Add privilege level for each IPMI commandTom2017-01-171-2/+2
| | | | | Change-Id: I07f160c6ea83dc91f46e21f263c4cf994aff081d Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Print failing object path after failed bus lookupBrad Bishop2016-10-061-1/+2
| | | | | Change-Id: I599d8297b4d2fd45831443685ea5b7d53f1515b6 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Refactor the code related to Sensor handlingTom2016-09-231-197/+0
| | | | | | | | | The sensor related code is moved to sensorhandler.c. These changes were part of the ipmi daemon code and would have to replicated in RMCP daemon. The refactoring would get away with those changes. Change-Id: Ib9e1a1929282221e6f259e4a54502eea82f42939 Signed-off-by: Tom <tomjoseph@in.ibm.com>
* ipmid: Change .H -> .hppPatrick Williams2016-09-061-1/+1
| | | | | Change-Id: Ia1ed05a533736105909717b86f16274b30d36401 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* ipmiwhitelist: Change .H -> .hppPatrick Williams2016-09-061-1/+1
| | | | | Change-Id: I1b4d00211913d1be61f33dfb02227ffc8f859584 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Hard-coded service name replaced with call to ObjectMapperSergey Solomin2016-08-251-3/+9
| | | | | | | | | | | | | In the openbmc code, the dbus service name is hardcoded. The ObjectMapper provides a way to find out the service name by issuing a GetObject method call to the ObjectMapper. That functionality is implemented in mapper.c The output of the call to the mapper is a service name. Resolves openbmc/openbmc#319. Change-Id: I724a31ede6bdf3ae4b361e730857b1f2696a8966 Signed-off-by: Sergey Solomin <sergey.solomin@us.ibm.com>
* Switch C++ source files to .cpp extensionMatthew Barth2016-08-081-0/+752
Change-Id: I495186b4afd58ec1e5d9d5c6472394f96541d17d Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
OpenPOWER on IntegriCloud