diff options
| author | Adriana Kobylak <anoo@us.ibm.com> | 2017-01-04 12:14:04 -0600 |
|---|---|---|
| committer | Adriana Kobylak <anoo@us.ibm.com> | 2017-01-13 10:58:17 -0600 |
| commit | b6dcf97fdf0d9c673812942f5b4e8b2691ceb5a3 (patch) | |
| tree | 4048351b46913fe87de40217ea15158b506697d9 | |
| parent | c54967749878bad5e599ccfcdec207c37e518e2c (diff) | |
| download | sdbusplus-b6dcf97fdf0d9c673812942f5b4e8b2691ceb5a3.tar.gz sdbusplus-b6dcf97fdf0d9c673812942f5b4e8b2691ceb5a3.zip | |
message: Add get_cookie method
The message cookie will be used to generate a unique hash id.
Change-Id: Iffb30a287659aa633b399fb1b2efaa450bf66240
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
| -rw-r--r-- | sdbusplus/message.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sdbusplus/message.hpp b/sdbusplus/message.hpp index 7cb4c1c..7ef81e6 100644 --- a/sdbusplus/message.hpp +++ b/sdbusplus/message.hpp @@ -114,6 +114,17 @@ struct message return sd_bus_message_is_method_error(_msg.get(), nullptr); } + /** @brief Get the transaction cookie of a message. + * + * @return The transaction cookie of a message. + */ + auto get_cookie() + { + uint64_t cookie; + sd_bus_message_get_cookie(_msg.get(), &cookie); + return cookie; + } + /** @brief Check if message is a method call for an interface/method. * * @param[in] interface - The interface to match. |

