summaryrefslogtreecommitdiffstats
path: root/include/ipmid/message
Commit message (Collapse)AuthorAgeFilesLines
* message/pack: Check for outstanding bitsWilliam A. Kennington III2019-04-291-0/+4
| | | | | | | | | | Currently, if you pack a non-byte aligned member into a message and then pack an array, it will do the wrong thing and treat the unaligned data as being appended to the end of the message. Allowing for this behavior is convoluted and probably not useful, so just return an error. Change-Id: I6f200dbea96c41f49a110ba7536ccfd37115d277 Signed-off-by: William A. Kennington III <wak@google.com>
* message/payload: Clean up check / trailing stateWilliam A. Kennington III2019-04-291-5/+1
| | | | | | | | | | | | | | | | We want to be able to trivially re-use payloads for marshalling data from a buffer into other formats. This change tries to make the meaning of trailingOk and unpackCheck consistent, since the meanings didn't seem clear in the previous code. Now, unpackCheck is only used to determine if unpacking was checked, and trailingOk determines if unpackCheck is required. This also fixes lots of spurious warnings being printed for commands which were checking their output correctly, or were legacy and unable to check output. Change-Id: Id7aa9266693b4e3f896027acf6b3e5d757fdf981 Signed-off-by: William A. Kennington III <wak@google.com>
* Fix compilation warning regarding std::variantAlexander Amelkin2019-04-161-0/+1
| | | | | | | | | | | | When building with SDK, the compiler complains about ’variant’ being not a member of ’std’: .../pack.hpp:249:24: error: ‘variant’ is not a member of ‘std’ This commit adds appropriate #include to fix that. Change-Id: I99d6b7c17cbe1f49d706821797cf3fa03ca8c26a Signed-off-by: Alexander Amelkin <a.amelkin@yadro.com>
* message/unpack: Fix undefined behaviorWilliam A. Kennington III2019-04-111-1/+3
| | | | | | | | | | | | | It's UB to shift an integer by the size of that integer. More specifically, if you disable compiler optimization and try and unpack a 32 bit bitset you will end up with a 0x0 mask. Avoid UB by replacing shift subtract with a negate shift. Tested: Unit tests pass now. Change-Id: I03a6f866a51c955b57787d641da9180841747e4c Signed-off-by: William A. Kennington III <wak@google.com>
* Add a tuple type for packingVernon Mauery2019-04-091-0/+11
| | | | | | | | | | | | | 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 support for returning optional valuesVernon Mauery2019-04-051-0/+16
| | | | | | | | | | | 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-041-10/+24
| | | | | | | | | | | 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>
* ipmid: Compiler-generated unpacking and packing of messagesVernon Mauery2019-02-253-0/+672
handler.hpp has the templated wrapping bits for ipmi command handler callbacks implemented. message.hpp has the serialization/deserialization of the ipmi data stream into packed tuples for functions. message/pack.hpp and message/unpack.hpp contain the actual serialization and deserialization of types. Change-Id: If997f8768c8488ab6ac022526a5ef9a1bce57fcb Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
OpenPOWER on IntegriCloud