<feed xmlns='http://www.w3.org/2005/Atom'>
<title>phosphor-host-ipmid/include/ipmid/message, branch master</title>
<subtitle>OpenBMC Phosphor local IPMI daemon sources</subtitle>
<id>https://git.raptorcs.com/git/phosphor-host-ipmid/atom?h=master</id>
<link rel='self' href='https://git.raptorcs.com/git/phosphor-host-ipmid/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-host-ipmid/'/>
<updated>2019-09-16T20:12:11+00:00</updated>
<entry>
<title>fix logic error for unpack vector of tuple</title>
<updated>2019-09-16T20:12:11+00:00</updated>
<author>
<name>Vernon Mauery</name>
<email>vernon.mauery@linux.intel.com</email>
</author>
<published>2019-07-23T23:49:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-host-ipmid/commit/?id=caabc36b6a7596c6a6deb774770f4271f50942e9'/>
<id>urn:sha1:caabc36b6a7596c6a6deb774770f4271f50942e9</id>
<content type='text'>
Unpacking a vector of tuples is failing if the correct number of bytes
does not match an integral number of bytes needed to fully unpack all
the tuples.

Unpacking a tuple should return an error if it does not fully unpack all
the items. This will signal the vector unpack to bail and return however
many items it has unpacked to that point.

A vector unpack should always return success because no matter how many
items it has unpacked, it is fine, because a vector can have any number
of items.

Tested: Unit tests updated to check for proper unpacking of vectors and
        tuples (and optionals) as well as new unit tests added for more
        targetted testing.

Change-Id: I4b45198f8bc4a49913beb923d10079983179402a
Signed-off-by: Vernon Mauery &lt;vernon.mauery@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>unpack static assert on unsupported types</title>
<updated>2019-05-30T23:54:57+00:00</updated>
<author>
<name>Vernon Mauery</name>
<email>vernon.mauery@linux.intel.com</email>
</author>
<published>2019-05-30T22:20:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-host-ipmid/commit/?id=a3dd7661d18aeb47bbad271f40cc23efb5dea8b5'/>
<id>urn:sha1:a3dd7661d18aeb47bbad271f40cc23efb5dea8b5</id>
<content type='text'>
Unsupported types might not cause compile time errors but can result
in SIGILL errors at runtime when compiler warnings are ignored.

This was found when compiling an intel-ipmi-oem handler that attempted
to unpack an enum class type. The code compiles down to an empty
function (no return statement or value), which can result in all sorts
of undefined behavior. This change forces the unsupported types to emit
a static assert and fail to compile.

Tested: Created a handler that requests an enum class as an input and
        saw that the build fails with a static assert.

Change-Id: I123da15cb001756f07761cf7a60b799469926a2a
Signed-off-by: Vernon Mauery &lt;vernon.mauery@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>message/pack: Allow packing payloads</title>
<updated>2019-04-29T19:06:35+00:00</updated>
<author>
<name>William A. Kennington III</name>
<email>wak@google.com</email>
</author>
<published>2019-04-24T21:45:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-host-ipmid/commit/?id=e15e53eb5b3e8b279504710b5759fdfdd32bb128'/>
<id>urn:sha1:e15e53eb5b3e8b279504710b5759fdfdd32bb128</id>
<content type='text'>
Some IPMI handlers need the ability to support variable return types.
The easiest way to do that is to be able to return payloads and pack
them into the final payload.

Change-Id: I5098a1ab0998ada712096929eae40a3c88a6dea0
Signed-off-by: William A. Kennington III &lt;wak@google.com&gt;
</content>
</entry>
<entry>
<title>message/pack: Support packing string_views</title>
<updated>2019-04-29T19:06:35+00:00</updated>
<author>
<name>William A. Kennington III</name>
<email>wak@google.com</email>
</author>
<published>2019-04-24T21:44:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-host-ipmid/commit/?id=e2aec26caacdc65711a96ce3b6dbaa5ea526fc1f'/>
<id>urn:sha1:e2aec26caacdc65711a96ce3b6dbaa5ea526fc1f</id>
<content type='text'>
Now we don't need to make an intermediate copy of our data into an array
before packing it into a payload.

Change-Id: Iac79a79e0ae95835cb67d617a966a92ce8dcd5f8
Signed-off-by: William A. Kennington III &lt;wak@google.com&gt;
</content>
</entry>
<entry>
<title>message/pack: Check for outstanding bits</title>
<updated>2019-04-29T19:06:35+00:00</updated>
<author>
<name>William A. Kennington III</name>
<email>wak@google.com</email>
</author>
<published>2019-04-24T21:44:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-host-ipmid/commit/?id=906e0f802b56d26e7e0c65eba797fa8a596dee91'/>
<id>urn:sha1:906e0f802b56d26e7e0c65eba797fa8a596dee91</id>
<content type='text'>
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 &lt;wak@google.com&gt;
</content>
</entry>
<entry>
<title>message/payload: Clean up check / trailing state</title>
<updated>2019-04-29T19:06:35+00:00</updated>
<author>
<name>William A. Kennington III</name>
<email>wak@google.com</email>
</author>
<published>2019-04-24T08:44:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-host-ipmid/commit/?id=51694c22130d4f6160f63167a547d0a40763ef31'/>
<id>urn:sha1:51694c22130d4f6160f63167a547d0a40763ef31</id>
<content type='text'>
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 &lt;wak@google.com&gt;
</content>
</entry>
<entry>
<title>Fix compilation warning regarding std::variant</title>
<updated>2019-04-16T02:57:47+00:00</updated>
<author>
<name>Alexander Amelkin</name>
<email>a.amelkin@yadro.com</email>
</author>
<published>2019-04-15T12:11:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-host-ipmid/commit/?id=00b096d1c8a95a83b78464d722bb0336091ddec4'/>
<id>urn:sha1:00b096d1c8a95a83b78464d722bb0336091ddec4</id>
<content type='text'>
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 &lt;a.amelkin@yadro.com&gt;
</content>
</entry>
<entry>
<title>message/unpack: Fix undefined behavior</title>
<updated>2019-04-12T01:40:25+00:00</updated>
<author>
<name>William A. Kennington III</name>
<email>wak@google.com</email>
</author>
<published>2019-04-09T03:27:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-host-ipmid/commit/?id=0d49e47978d5f2d0b108b0ddc65943763e88f729'/>
<id>urn:sha1:0d49e47978d5f2d0b108b0ddc65943763e88f729</id>
<content type='text'>
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 &lt;wak@google.com&gt;
</content>
</entry>
<entry>
<title>Add a tuple type for packing</title>
<updated>2019-04-09T17:42:38+00:00</updated>
<author>
<name>Vernon Mauery</name>
<email>vernon.mauery@linux.intel.com</email>
</author>
<published>2019-04-08T17:01:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-host-ipmid/commit/?id=508c457688e4be878f75f7951ac2e5e95e7de3a8'/>
<id>urn:sha1:508c457688e4be878f75f7951ac2e5e95e7de3a8</id>
<content type='text'>
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 &lt;vernon.mauery@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>Add error message to build to make packing type errors clear</title>
<updated>2019-04-09T17:39:06+00:00</updated>
<author>
<name>Vernon Mauery</name>
<email>vernon.mauery@linux.intel.com</email>
</author>
<published>2019-04-08T16:59:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/phosphor-host-ipmid/commit/?id=336405b85e88fdc46896437cb02fe52b46079369'/>
<id>urn:sha1:336405b85e88fdc46896437cb02fe52b46079369</id>
<content type='text'>
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 &lt;&lt;(),
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 &lt;vernon.mauery@linux.intel.com&gt;
</content>
</entry>
</feed>
