| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
* Move functions to private as appropriate
* Reorder functions to match declaration order
* Declare arguments as const when appropriate
* Rename to getActionHandler() to match previous method name
Signed-off-by: Kun Yi <kunyi731@gmail.com>
Change-Id: I7d3b5bbb07c218c6c2d6277a1f19d8a0299bd6e6
|
|
|
|
|
|
|
|
| |
The getPath call is only used once. Getting rid of it makes it easier to
understand.
Signed-off-by: Kun Yi <kunyi731@gmail.com>
Change-Id: Ifc8859f5fc68bb594003a6db7f7e80b1c1dfed28
|
|
|
|
|
|
|
|
|
| |
The old code deletes session from the session map before doing a lookup
of the path. Fix the order and add a unit test to catch the error case.
(The unit test would fail without this fix).
Signed-off-by: Kun Yi <kunyi731@gmail.com>
Change-Id: If043d6aad7bbaafa19ae3b63a6d9cc7a836d25b5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Simplify code and address comments from
http://gerrit.openbmc-project.xyz/c/openbmc/phosphor-ipmi-blobs/+/27399:
* Use C++17 syntax of intializers in conditionals to simplify code.
* Move getActionHandle() implementation to .cpp
* return false explicitly
Tested:
Unit tests still pass.
Signed-off-by: Kun Yi <kunyi731@gmail.com>
Change-Id: I08a78125206f284d8c748822912e11828fb39968
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of using private methods to change data, directly operate on
it. Currently no test depends on these methods.
There is also a minor bug fix: the previous code will not increment or
decrement the open session count if the blobId is an empty string,
however there is no check on the manager side. If empty blobIds are
disallowed they should be checked earlier.
Signed-off-by: Kun Yi <kunyi731@gmail.com>
Change-Id: I8d97e098bed2d5c27a204a86ed688d0d9a98f0a2
|
|
|
|
|
|
|
|
| |
Add simple tests to ensure the session expire method is called when
the timeout is set to zero.
Signed-off-by: Kun Yi <kunyi731@gmail.com>
Change-Id: Ic6e973ede760a6a6f15726d5b6c93a892d858c8b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the caller opens sessions but doesn't close them, either
intentionally or unintentionally, session IDs will leak. Once the
maximum number of sessions are reached, no new session can be opened.
Implement a cleanup procedure to automatically remove stale sessions. If
a session hasn't seen activity for a while, call the expire()
functions on the handler, and remove the session from tracking table.
For handlers that haven't implemented the expire() call this change will
be a no-op.
Signed-off-by: Kun Yi <kunyi731@gmail.com>
Change-Id: I895ae19b4003d2d6f7a0b2e73370fe5aa664adee
|
|
|
|
|
|
|
|
|
| |
Add a timestamp member in SessionStat to capture when the session
sees activity last, and update it with every action. The timestamp
will be used to check when the session should expire.
Signed-off-by: Kun Yi <kunyi731@gmail.com>
Change-Id: Ic781d54173099bff76b3c37dd296521680fe7986
|
|
|
|
|
|
|
|
| |
Use a single method to fetch the handler, if it can be found using
session ID.
Signed-off-by: Kun Yi <kunyi731@gmail.com>
Change-Id: I648cbc48ebfae479f63d34e8f2465d2c8cbe9d64
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because this structure is not anything special, simply use the cpp
idiomatic way of referencing the object.
Consistently, structures that are packed still have "struct" used in
declarations. However, this distinction is only clear through its usage
and nothing in the language. Perhaps a better approach would be
notational naming struct PackedXYZ {};. However, that can get out of
control quickly.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I3b7e48e4b6687ef2e15e9d07c0eeba96eb5d2552
|
|
|
|
|
| |
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Iac2768eebcf1ab28e28cdba601574dbede4fc9ec
|
|
|
|
|
|
|
|
|
|
| |
Provide contract details for what handlers can expect from the blob
manager. This saves extra checks within the handler.
Incidental markdown cleanup.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I572fdfb9e726d9f4d1ba89bb92b38c67cd7f07e2
|
|
|
|
|
| |
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Ic5aa3e38b4df33a2cfa29c575f17097e38d06605
|
|
|
|
|
| |
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I22ac3b8c5ad49e2fa3424ef6d9f03a3d5dc7bf51
|
|
|
|
|
|
|
|
|
| |
Split the object into two pieces so we can pass part of it to the
unit-tests.
Tested: Verified the coverage output processed the files.
Change-Id: Idf1bdf9d21eb1324395eb9a2c09ff8f1b4ecad6b
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
| |
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: I09b88e6b4792c99140a73a4ceb11d2896ee13562
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
| |
Drop all code that is now handled by the ipmiblob library provided by
the new ipmi-blob-tool. This is a library that can be included on the
BMC if necessary, but relies on nothing that is strictly meant for the
BMC.
Change-Id: I2b02ae0d432e84c08e598d27eef85b57c06a70fc
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
ipmiblob is the library provided by ipmi-blob-tool.
Change-Id: Ic58065eb280e8628f36764bd40f973be10f114ca
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
Use filesystem now that it should be available instead of
experimental::filesystem.
Change-Id: Ia9b17f33ced70fe2f1f12f11d8708d15ff422bfa
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Enable valgrind tests.
Change-Id: Ib5ec22a19c043ef45f5274e4716e2abbae9c19da
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
Enable code coverage for the project. Valgrind not enabled in this
step.
Change-Id: I439d58b23d2bc29d6f602600319074c8fd8c04d6
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Rework gtest checks to be modeled after openbmc/gpioplus.
Change-Id: I263bf12c0323ebee5d95b569ce28da2042bd3c1d
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
Use the defaults in the pkg check where the default error message is
sufficient to identify which package is missing.
Change-Id: I420f4702c9cf78af58854fba06e731e49e1ec5f2
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
The openbmc oem number is used within the code, but not specified in the
readme. Add this number to the readme.
Change-Id: I3db669fb347cee6596bd973a09910a962eb03570
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
| |
phosphor-host-ipmid now exposes a library along with headers for
interfacing with the ipmi daemon. Compile and link against the new
library.
Change-Id: I663e6607f711bc8bae0a2127db524868f6d4cc32
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
| |
Move the blob command enum to an installed header to improve cross-use.
Change-Id: I2093bf993f76a2b87f8e7fdbdfcbaf2dfc012af9
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The host-client cannot try to read back more than this number of bytes
without hitting a memory overflow in phosphor-host-ipmid. The method we
can call to dynamically receive that number isn't currently linking out
of the userlayer library.
Note: Once the configure_ac can find and provide the userlayer library
from phosphor-host-ipmid, we can remove the hard-coded 64 and 0xe.
Change-Id: I08f6bb59ce44279f76a494dccaa477ae75d532c4
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
All blob handlers need to implement this prototype. It's called by the
blob manager when it's loading the various blob handler objects.
Change-Id: I62329baeb536a624abeb17995bb778ec1c11ca8f
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
Stop installing the manager header as it is no longer meant to be
exported, but rather used only internally within this repository.
Change-Id: I2ab21a31fd745e1b3e36fc39ffea5e26d373ff51
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
| |
The read command, if returning 0 bytes of data, does return the CRC.
Tested: Verified via a client implementation that it now behaves as
expected on returning 0 bytes from a read (returns only the CRC).
Change-Id: I84200c0fbe8400cc9234b55991fee750cb84faa2
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Typo fix in manager_cpp for word "available"
Change-Id: I0c4382023fef63f332d4cd677d82ad30e0a44b26
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
| |
Cleanup the configure script package include lines. There isn't a set
style for this yet, but this is an attempt to improve readability
whereas it's often one long line per library. The CI will fail if there
aren't backslashes on lines for the AC_CHECK_HEADER.
Change-Id: I07be3e9c4ac7cd70a9e0d03299d25dcce6910cef
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
New autotools directory: m4, add to .gitignore.
Change-Id: Idc6d0f7c53927c62602a5caa16010941d5a75b33
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
On failures (or some silent success), set the return
buffer length to 0.
Change-Id: I118788ffddd2bfc031b3392db4cf13ab04b49287
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
Add blob handler path to configure_ac and use this
path for searching.
Change-Id: Ie0e33e93822bc6e95ace2fed5abe66f42dae5ca5
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
add -I m4 to Makefile for ACLOCAL_AMFLAGS
add macro dirs to configure_ac
Change-Id: Ied5ca518fedab65c63d0c89bcd0f21c3d32265e1
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
Add interface defining the methods for dynamic linking to enable
testing.
Change-Id: If4d090d3cedc019b426435a1f651191803bfc1a9
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
| |
Add missing header: blobs-ipmid/manager.hpp. The code receives this
header through another header. However, it should declare this
inclusion requirement itself.
Change-Id: Ib82909681a45a18489f65ec42b74a1824285efa1
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
Add missing copyright headers to the source files. Originally, left
off. Reviewing other new sources acted as a reminder.
Change-Id: I7ac612fbea731885b93cb13346afcddda54bdec3
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
| |
The command entry for blobTransferCmd was accepted into
phosphor-host-ipmid's oem header. Therefore, no longer specify it
locally.
Change-Id: Ib5879cb31f855c5b5662e659d71c21e5fd6c50a3
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
Use a predefined factory symbol to build each handler after loading the
library.
Change-Id: I0369c6e46a57c2e8533409d8b06eb74a3962434c
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
| |
Add -export-dynamic to Makefile linker flags so that blob handlers can
access getBlobManager() when they're loaded.
Tested: The symbols are now exported, however, blob handlers still
cannot resolve blobs::getBlobManager().
Change-Id: I025fdbd701133fc59356e3a0ed8881b2cdd0f2a0
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
| |
Fix library search logic to load libraries installed of the format:
libname.so.? versus libname.so because the recipe creates a symlink of
the form libname.so.? only.
Tested: Now it finds and loads the handlers.
Change-Id: Ie7280f41a678bf78db226bb458c02396e352da56
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
| |
Skip the 0'd CRC bytes on reply computation, mirroring the skipping
during request validation.
Tested: Verified via client the CRC for the reply now matches
expectations.
Change-Id: I18da28604a388fb4210c55f3e54410a067b9f10a
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The IPMI packet validation code must return specific IPMI errors
corresponding to what error has occurred instead of the invalid command
error.
Update all IPMI handler pieces to return more specific errors.
Change-Id: I8d21e92015d84cc0880e3b83991aed7288e19eab
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Add -flto to CXXFLAGS to allow build optimization.
Change-Id: Icc7bd996bd512a0d84a35b6a0449f69611a69de1
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
Cleanup spaces from the Makefile. Automake is ok with spaces, but for a
cleaner file, use tabs.
Change-Id: Ie18f80a5e65a05611472e61801b669e1564b17e1
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
| |
Fixup a typo in the library path. The library path will be specified in
a later patchset from the configure.ac by default, but that typo would
have just lived there instead.
Change-Id: Ia9f95fc46e3835781e4dbe3b3fdb2d9d36b7e565
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
|
| |
[manager.cpp:150]: (style) Consider using std::find_if algorithm
instead of a raw loop.
Note: Amusingly switching to a const iterator allowed cppcheck to find
this cleanup.
Change-Id: I16d87d4dde165fbb226259d1abc8deaa51569af1
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Apply const to read-only iterators.
Change-Id: Ib58f98596cb9f185d3b16a0b1fbd895dd37d3fd6
Signed-off-by: Patrick Venture <venture@google.com>
|