summaryrefslogtreecommitdiffstats
path: root/storagehandler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move util.cpp/util.hpp to libipmidVernon Mauery2019-03-251-1/+1
| | | | | | | | | | | | | | | | 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>
* eSEL: Remove code related to logging eSELTom Joseph2019-02-071-4/+0
| | | | | Change-Id: I5392202352c2baa70d61768cbaef9eb0e1faad56 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Create libipmid and libipmid-hostWilliam A. Kennington III2019-02-071-1/+1
| | | | | | | | | | | | | | | | | | | 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>
* Revert "eSEL: Remove unused code related to logging eSEL"Tom Joseph2019-02-041-0/+4
| | | | | | | | | | 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
* eSEL: Remove unused code related to logging eSELTom Joseph2019-02-011-4/+0
| | | | | Change-Id: Ia9815102064d20795a44b8e6a7d8b324c280756c Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* storage: gcc8: standardize use of std::filesystemBrad Bishop2018-11-271-1/+1
| | | | | | | | | | | | This was already done repo-wide with 185b9f8b but this one spot appears to have been missed, and was caught by gcc8: | ../git/storagehandler.cpp:276:39: error: 'filesystem' is not a namespace-name | namespace fs = std::experimental::filesystem; | ^~~~~~~~~~ Change-Id: I79d70f0ba1268eae9fc76be690313a5128b59f17 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Convert variant usage to std interfaceWilliam A. Kennington III2018-10-181-1/+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>
* Fix IPMI SEL reservations and cancellationsJason M. Bills2018-10-051-12/+18
| | | | | | | | | | | | | | | | | | | | | | | 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-16/+19
| | | | | | | | Standard clib methods should be explicitly grabbed from the standard namespace. Change-Id: I8bcfcb260a99180d535ec8102c1a24c318cbc209 Signed-off-by: Patrick Venture <venture@google.com>
* move filesystem inclusion to bottom of listPatrick Venture2018-09-251-17/+18
| | | | | Change-Id: I4aa3c984992236bb5b4a5c62c3d42a33c12d55de Signed-off-by: Patrick Venture <venture@google.com>
* rename headers to match stylePatrick Venture2018-09-251-5/+4
| | | | | | | | | | | | | | | | | | 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>
* Handle SdBusError exception in SEL commandsTom Joseph2018-09-121-11/+41
| | | | | Change-Id: Ia79b3e2ea4ca8783c912c9864be32107d170d561 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* add .clang-formatPatrick Venture2018-09-071-138/+133
| | | | | Change-Id: I7c2a527b4751a560703a61fcbe9638b150546af5 Signed-off-by: Patrick Venture <venture@google.com>
* Standardize use of filesystemVernon Mauery2018-08-081-1/+11
| | | | | | | | | If <filesystem> exists, use that, if it doesn't, try <experimental/filesystem>. Either way, access it from std via a namespace splice. Change-Id: I5b35ee9f74b88e188cb3ca3fed9abaec64933697 Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
* Fix Host time is not getting printed to journalNagaraju Goruganti2018-05-081-2/+4
| | | | | | | | | | | | log<level::DEBUG> is not putting Host time into journal, instead it is putting it in the metadata. Made fix for it. Testing: ipmitool sel time get # Host time:xxx XXX x xx:xx:xx xxxx will be # printed in into journal Change-Id: I0ba72a871469a30c605ee3ec91a07787959d5ae3 Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* Check the offset length in the Read FRU commandTom Joseph2018-05-081-0/+5
| | | | | | | | | | The offset length is validated against the size of the FRU area, before proceeding with populating the response of the Read FRU command. Resolves openbmc/openbmc#3132 Change-Id: I2bc660b7e389f5c85bac0acc8068dd53ab328a65 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Check if the FRU Id is valid for FRU commandsTom Joseph2018-04-231-2/+16
| | | | | | | | | | | Validate FRU Id before proceesing with the command handling. Do not report error log for any FRU command failure, since IPMI is an external interface. Resolves openbmc/openbmc#3016 Change-Id: I9e2af3ce50285662f1b8f9600222e9ff3057a7e3 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Reducing IPMI logging footprintAditya Saripalli2018-04-181-28/+2
| | | | | | | | | | | | -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>
* Fixed broken "fru read" commandNagaraju Goruganti2018-03-271-15/+14
| | | | | | | | | | | | | | | | Fixed below given two issues: 1.We are getting seg-fault due to incorrect format specifiers for log-entry. 2.When requested data count plus offset exceeds fruArea size, we through error, instead we can return remaining bytes. Tested: 1.Verified using below given command. ipmitool -I lanplus -C 3 -P 0penBmc -H <BMP_IP> fru read <fru_id> fru_file Resolves openbmc/openbmc#2893 Change-Id: Iecfe80ed7230b936eca86fd16208582ee7b4e09c Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* Implement Get SDR and Reserve SDR repository commandTom Joseph2018-03-011-0/+11
| | | | | | | | | | | Both Get SDR and Reserve SDR repository command is same as Get Device SDR and Reserve Device SDR command respectively. So the same implementation is shared. Resolves openbmc/openbmc#2615 Change-Id: I64e37837bc5a616bed41a3ceff7d63033d88455c Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Add Get Repository Info CommandDhruvaraj Subhashchandran2018-02-161-0/+31
| | | | | | | | | | Adding support for Get Repository Info command, which returns information about the SDR repository. resolves openbmc/openbmc#2614 Change-Id: Id1219de8021b5403a775ad6e8577dbc8edfc60cb Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
* FRU: Fix response for Read FRU Data CommandRatan Gupta2018-02-131-3/+11
| | | | | | | | 1) Add the count field as part of read fru command response. 2) Fix in copying the data from the offset. Change-Id: I2eaa76e82179ad65ba3af0f1795aeec40e68a0fc Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Commit a MaintenanceProcedure log entry on a 0xDE SEL recordTom Joseph2017-11-031-1/+13
| | | | | | | | | | | | In the case of a procedure callout, HB sends a eSEL of 0xDF type. It is followed by a Add SEL record with OEM record type 0xDE and byte 11 in the record indicate the procedure associated with the eSEL. Resolves openbmc/openbmc#2368 Change-Id: Ia57f423c9d533cd8968b613d7522b409a9820198 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Update Journal Variable NamesGunnar Mills2017-10-191-2/+3
| | | | | | | | | Journal entry variable names should be uppercase. https://www.freedesktop.org/software/systemd/man/sd_journal_print.html Also, fixed indentation. Change-Id: I2c838332ab7811ccc9a2c99f5b1f558c48f25f76 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* storagehandler: Use new phosphor-timemanager interfaceLei YU2017-10-191-89/+84
| | | | | | | | Update SEL-Time handlers to use sdbusplus and new phosphor-timemanager interface. Change-Id: Ib931a6bedc14037fc1a0a7c25698f67272520bb5 Signed-off-by: Lei YU <mine260309@gmail.com>
* storagehandler: sort include filesLei YU2017-10-171-11/+14
| | | | | Change-Id: Iaf49ed787a2e077af27f28d22507456e8efa2b41 Signed-off-by: Lei YU <mine260309@gmail.com>
* cater for property change signal to invalidate fru dataMarri Devender Rao2017-07-261-0/+1
| | | | | | | Resolves openbmc/openbmc#1560 Change-Id: I90897959dab76181a6006c372c4b60cc1bdd0c0c Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* cater for fru read callback functionsMarri Devender Rao2017-07-251-3/+64
| | | | | Change-Id: I2fdaef98faa6adc19efce0ede93b4ee728b9404c Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* register call back functions for FRU read commandsMarri Devender Rao2017-07-251-1/+32
| | | | | Change-Id: Idb0230ea173940deb17314dc09c4a562b97ede20 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Add Clear SEL commandTom Joseph2017-07-191-0/+104
| | | | | Change-Id: I35b07e0bf1012d4b660d10cf17a47318f3c4e6e2 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Add Delete SEL entry commandTom Joseph2017-07-191-0/+92
| | | | | Change-Id: Iabeaca4b5057ef1bae44cb6d30704de3ce2f1269 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Add Get SEL entry commandTom Joseph2017-07-191-0/+120
| | | | | Change-Id: I09983a127c7c2817a0ebb6d64ffb2a9585dcd235 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Add Get SEL Info commandTom Joseph2017-07-191-28/+71
| | | | | Change-Id: I8caa38ee461d6c570a6d7ab73376eb6aea701391 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Add privilege level for each IPMI commandTom2017-01-171-6/+18
| | | | | Change-Id: I07f160c6ea83dc91f46e21f263c4cf994aff081d Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Modify GET_SEL_TIME and SET_SEL_TIME to use TimeManager APIsVishwanatha Subbanna2016-11-111-29/+114
| | | | | | | | | GET_SEL_TIME and SET_SEL_TIME command handlers are using gettimeofday and settimeofday respectively. This patch will change the mechanism to use APIs that are provided by org.openbmc.TimeManager daemon istead of POSIX calls. Change-Id: I4890f4a2c27131d902e7417db023eb4cdd7d8626 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Ensure all tools are building with -Wall and -WerrorMatthew Barth2016-09-211-2/+0
| | | | | | | | Corrected resulting compiler errors from correctly adding -Wall & -Werror within configure.ac. Change-Id: Ia7aaafa83103322ad4b50171d62144624dd71e42 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Modify respond of un-supported IPMI commandNan Li2016-09-091-1/+1
| | | | | | | | | | | A number of callbacks are registered for 'WILDCARD' types, which currently do nothing except respond with CC_OK(00h). Change complete codes to CC_INVALID(C1h). Resolves openbmc/openbmc#469. Change-Id: I91ea5ee1a23284a4159ff1c1867342e89c6fa444 Signed-off-by: Nan Li <william.bjlinan@hotmail.com>
* Allow out-of-tree buildsPatrick Williams2016-09-061-1/+1
| | | | | Change-Id: If4b97e65f63c3abbf23140dd97b9febe00b3be0d Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Switch C++ source files to .cpp extensionMatthew Barth2016-08-081-0/+171
Change-Id: I495186b4afd58ec1e5d9d5c6472394f96541d17d Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
OpenPOWER on IntegriCloud