Adriana Kobylak | 70ca242 | 2018-09-06 14:23:38 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | // With OpenSSL 1.1.0, some functions were deprecated. Need to abstract them |
| 4 | // to make the code backward compatible with older OpenSSL veresions. |
| 5 | // Reference: https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes |
| 6 | #if OPENSSL_VERSION_NUMBER < 0x10100000L |
| 7 | |
| 8 | #include <openssl/evp.h> |
| 9 | |
Lei YU | e499446 | 2019-03-14 14:41:53 +0800 | [diff] [blame] | 10 | #include <sdbusplus/bus.hpp> |
Andrew Geissler | ab139ce | 2020-05-16 13:22:09 -0500 | [diff] [blame] | 11 | #include <string> |
Lei YU | e499446 | 2019-03-14 14:41:53 +0800 | [diff] [blame] | 12 | |
Adriana Kobylak | 70ca242 | 2018-09-06 14:23:38 -0500 | [diff] [blame] | 13 | extern "C" { |
| 14 | EVP_MD_CTX* EVP_MD_CTX_new(void); |
| 15 | void EVP_MD_CTX_free(EVP_MD_CTX* ctx); |
| 16 | } |
| 17 | |
Lei YU | e499446 | 2019-03-14 14:41:53 +0800 | [diff] [blame] | 18 | namespace utils |
| 19 | { |
| 20 | |
| 21 | /** |
| 22 | * @brief Gets the D-Bus Service name for the input D-Bus path |
| 23 | * |
| 24 | * @param[in] bus - Bus handler |
| 25 | * @param[in] path - Object Path |
| 26 | * @param[in] intf - Interface |
| 27 | * |
| 28 | * @return Service name |
| 29 | * @error InternalFailure exception thrown |
| 30 | */ |
| 31 | std::string getService(sdbusplus::bus::bus& bus, const std::string& path, |
| 32 | const std::string& intf); |
| 33 | |
| 34 | /** @brief Suspend hiomapd. |
| 35 | * |
| 36 | * @param[in] bus - The D-Bus bus object. |
| 37 | */ |
| 38 | void hiomapdSuspend(sdbusplus::bus::bus& bus); |
| 39 | |
| 40 | /** @brief Resume hiomapd. |
| 41 | * |
| 42 | * @param[in] bus - The D-Bus bus object. |
| 43 | */ |
| 44 | void hiomapdResume(sdbusplus::bus::bus& bus); |
| 45 | |
| 46 | } // namespace utils |
| 47 | |
Adriana Kobylak | 70ca242 | 2018-09-06 14:23:38 -0500 | [diff] [blame] | 48 | #endif // OPENSSL_VERSION_NUMBER < 0x10100000L |