summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* blob_handler: remove redundant returnsHEADmasterBrandon Kim2019-10-181-7/+2
| | | | | | | ClangTidy was not happy with redundant returns for void functions. Signed-off-by: Brandon Kim <brandonkim@google.com> Change-Id: I72f1773ea041f890ca0dd2c6c3ab8fbb279390c9
* blob: implement deleteBlob commandBrandon Kim2019-10-185-0/+56
| | | | | | | | Implement the deleteBlob command for the blob handler. Adding a unit test to go along with it. Change-Id: I2bbc93a6e78d5311bd2033d6a8b179374777f794 Signed-off-by: Brandon Kim <brandonkim@google.com>
* blob_handler: remove unused respBrandon Kim2019-10-181-1/+1
| | | | | | | nit warning found while running unit test Change-Id: I7bdcb9fac4da4e5efae7eaf6262764cb00101e86 Signed-off-by: Brandon Kim <brandonkim@google.com>
* ipmi: pull the netfn and command into parametersPatrick Venture2019-05-317-45/+98
| | | | | | | | | Pull the netfn and cmd into parameters instead of hard-coding them for blob commands. Tested: Only ran unit-tests. Change-Id: I1a73de32e14cc78ece94a26f6c447824af88c984 Signed-off-by: Patrick Venture <venture@google.com>
* ipmi exceptions: add method to grab codePatrick Venture2019-05-291-2/+16
| | | | | | | | Add a method to grab the underlying code to allow easier repackaging of the exception into something else. Change-Id: Icf25254c612926429f623d757998c3927966e0aa Signed-off-by: Patrick Venture <venture@google.com>
* move blob command enum to blob_interface headerPatrick Venture2019-05-204-47/+78
| | | | | | | | Move the blob command enum to the blob_interface header that can be safely included by other code. Change-Id: If7c613cac9bdd460fc9a6cb3b59e4fc0dd3a861d Signed-off-by: Patrick Venture <venture@google.com>
* blob: add equality operator for StatResponsePatrick Venture2019-05-151-0/+6
| | | | | Change-Id: I918facfec4ffbd36f50862c62e366dec0cedd54f Signed-off-by: Patrick Venture <venture@google.com>
* blob_handler: make commit data parameter optionalPatrick Venture2019-05-151-1/+1
| | | | | | | | Make the commit data parameter optional by defaulting it to an empty vector. This is less code than using std::optional for this. Change-Id: Icd953e63fc68a658b29fff5a132e264f1aee5bbc Signed-off-by: Patrick Venture <venture@google.com>
* cleanup: add missing limits headerPatrick Venture2019-05-141-0/+1
| | | | | | | | Add missing limits header. Built fine without it with gcc8, etc, but not necessarily in other environments. Change-Id: Ib31693f04d77ad7518cfb41cc224f42d33b0ca2b Signed-off-by: Patrick Venture <venture@google.com>
* blob: implement commit commandPatrick Venture2019-05-145-0/+63
| | | | | | | Implement the commit command for the blob handler. Change-Id: Ia3be86083991cbdf7fe85c15986f4e1cb60971f5 Signed-off-by: Patrick Venture <venture@google.com>
* blob_handler: provide a convenience static factoryPatrick Venture2019-05-132-0/+17
| | | | | | | | Provide a static factory for convenience to get a unique_ptr to the base object. Change-Id: I058e7a28a6bc30182ed9ada5ea479a317d071893 Signed-off-by: Patrick Venture <venture@google.com>
* blob_handler: move from raw to managed pointerPatrick Venture2019-05-132-37/+80
| | | | | | | | | The blob handler object wants to explictly own its ipmi interface so that it can't be shared. This was a good-behavior, but now this codefies it. Change-Id: Ie368721a58dc30573f37dc3824da230aca5328d3 Signed-off-by: Patrick Venture <venture@google.com>
* ipmi_handler: provide unique creatorPatrick Venture2019-05-132-0/+12
| | | | | | | | Ideally ipmi handler objects should not be shared between objects, therefore provide a convenient unique creator. Change-Id: Iaaf9b4b37676699f0a7ecf6d2550b07e1080742e Signed-off-by: Patrick Venture <venture@google.com>
* cleanup: delete blob byte printingPatrick Venture2019-05-102-13/+0
| | | | | | | | Delete extra debug printing now that the code is verified as functioning as it should for a sufficient variety of commands. Change-Id: I885640c7c8cc049532b0dd42d587995c69a0d673 Signed-off-by: Patrick Venture <venture@google.com>
* bugfix: stat handler wasn't copying properlyPatrick Venture2019-05-071-1/+1
| | | | | | | | | The stat handler for metadata wasn't copying the bytes properly. Tested: Verified it no longer excepts during real-use and returns the correct contents. Change-Id: I93a67d7668fde2342e861027dbb0b8e11ae4cb96 Signed-off-by: Patrick Venture <venture@google.com>
* squash getStat variations into one underlying methodPatrick Venture2019-05-062-28/+25
| | | | | | | | Squash the getStat(name) and getStat(session) into one underlying method. Change-Id: I6c00b9f4128a64e3d1a918c8a9d1eaf252de32bc Signed-off-by: Patrick Venture <venture@google.com>
* implement session stat commandPatrick Venture2019-05-065-0/+75
| | | | | | | Implement the session stat command. Change-Id: I1ff715dd32d963722182db84b475bc9adbfcc7ea Signed-off-by: Patrick Venture <venture@google.com>
* test: add mock build testPatrick Venture2019-05-062-0/+22
| | | | | | | | Avoid breaking downstream dependencies by building the mocks that are exported. Change-Id: If171910dcff4fdd90d88d7aa611891c9c3fc4b85 Signed-off-by: Patrick Venture <venture@google.com>
* unit-test: use library instead of object filesPatrick Venture2019-03-191-3/+3
| | | | | | | | | | Use the library object instead of the specific object files for proper coverage functionality. Tested: Verified coverage output. Change-Id: Ia9ca935e774160ef5a83a823489160aa95a09169 Signed-off-by: Patrick Venture <venture@google.com>
* autotools: Fix for autoconf-archive 2019.01.19Patrick Venture2019-03-184-3/+17
| | | | | | | | | The code coverage macros from the archive changed in a backward incompatible way. This adds a workaround to autodetect either version and do the right thing. Change-Id: I4258fab8811f07760ebd73e8ac55c8493370e19b Signed-off-by: Patrick Venture <venture@google.com>
* blob_handler: fprintf tweakPatrick Venture2019-03-151-1/+1
| | | | | | | | [src/ipmiblob/blob_handler.cpp:141]: (warning) %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. Change-Id: I8e695a4656d47abe80396e1929b62b86421e761d Signed-off-by: Patrick Venture <venture@google.com>
* ipmi_errors: object cleanupPatrick Venture2019-03-151-14/+14
| | | | | | | | Cleanup the object to use a function to generate a constructor parameter instead of a constructor body. Change-Id: Ib9c9aea86212c67c1949d78e4105d6727557168b Signed-off-by: Patrick Venture <venture@google.com>
* install crc_mock headerPatrick Venture2019-03-073-2/+7
| | | | | | | | Install the crc_mock header for use in unit-tests in projects leveraging this implementation of CRC. Change-Id: Ia84caedb51e125ff3b051f93470990e44ff2540d Signed-off-by: Patrick Venture <venture@google.com>
* install crc headerPatrick Venture2019-03-071-1/+1
| | | | | | | | Originally, the CRC implementation was internal this library, however now it's going to be used by phosphor-ipmi-blobs. Change-Id: I7d528de1e593f791468b2cc7477a6c16ede2c43a Signed-off-by: Patrick Venture <venture@google.com>
* test: add unit-tests for the crc modulePatrick Venture2019-03-072-0/+48
| | | | | | | | Copied the unit-tests from phosphor-ipmi-blobs. The CRC module there will be dropped in favor of this one. Change-Id: I875ec67820218c7b9d1feec8aee84cdbbe84df54 Signed-off-by: Patrick Venture <venture@google.com>
* add .lcovrc filePatrick Venture2019-03-071-0/+3
| | | | | | | Add missing coverage configuration file. Change-Id: I551cb2fe29fd00e7a4bc6876fd7a64f456a0c513 Signed-off-by: Patrick Venture <venture@google.com>
* test header: s/host_tool/ipmiblob/Patrick Venture2019-03-071-6/+4
| | | | | | | Fixup the namespace for the mock. Change-Id: Id533f89fb8f2489895b749e9b864da419984cb37 Signed-off-by: Patrick Venture <venture@google.com>
* install blob_interface_mock headerPatrick Venture2019-03-072-0/+28
| | | | | | | | To enable unit-tests that deal with this library's objects, install the blob_interface_mock header. Change-Id: I230c9195c1c14a61c8b6bc838bb0a17ab8798053 Signed-off-by: Patrick Venture <venture@google.com>
* move internal namespace under ipmiblob namespacePatrick Venture2019-03-073-0/+9
| | | | | | | | | Avoid collisions if anyone else has this class under their own internal namespace by properly wrapping this internal namespace under the library's. Change-Id: I935c017cc109f12b339f4c65258ee43a03b3a3d5 Signed-off-by: Patrick Venture <venture@google.com>
* Makefile: add blob_errors to installed headersPatrick Venture2019-03-071-0/+1
| | | | | | | | | Add blob_errors.hpp to installed headers because code that uses this library will need to know the exceptions produced by it. Note: This was left out on accident. Change-Id: Id5da55b2e3c967481ea24442ada7232e15c97c36 Signed-off-by: Patrick Venture <venture@google.com>
* namespace: s/host_tool/ipmiblob/gPatrick Venture2019-03-0614-28/+28
| | | | | | | Renamed the namespace to encapsulate the library. Change-Id: I3deb82df5cf6916c505b57864e22a412542c9b6c Signed-off-by: Patrick Venture <venture@google.com>
* initial commitPatrick Venture2019-03-0627-0/+1841
| | | | | | | | Add initial code from phosphor-ipmi-flash/tools that was not specific to firmware update over ipmi-blobs. Change-Id: I360537a7392347fe989397a699f6a712bc36e62c Signed-off-by: Patrick Venture <venture@google.com>
* Add MAINTAINERS filePatrick Venture2019-03-051-0/+45
| | | | | | | Add MAINTAINERS file with one maintainer entry. Change-Id: I987f50299f41111bc1f4e6b4073797cac9a732c1 Signed-off-by: Patrick Venture <venture@google.com>
* Initial commitBrad Bishop2019-03-051-0/+201
OpenPOWER on IntegriCloud