blob: acb44ca52110b58b7e568a180af6d7f412316a51 [file] [log] [blame]
Adriana Kobylak70ca2422018-09-06 14:23:38 -05001#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 YUe4994462019-03-14 14:41:53 +080010#include <sdbusplus/bus.hpp>
Brad Bishop8facccf2020-11-04 09:44:58 -050011
Andrew Geisslerab139ce2020-05-16 13:22:09 -050012#include <string>
Lei YUe4994462019-03-14 14:41:53 +080013
Brad Bishop8facccf2020-11-04 09:44:58 -050014extern "C"
15{
16 EVP_MD_CTX* EVP_MD_CTX_new(void);
17 void EVP_MD_CTX_free(EVP_MD_CTX* ctx);
Adriana Kobylak70ca2422018-09-06 14:23:38 -050018}
19
Lei YUe4994462019-03-14 14:41:53 +080020namespace utils
21{
22
23/**
24 * @brief Gets the D-Bus Service name for the input D-Bus path
25 *
26 * @param[in] bus - Bus handler
27 * @param[in] path - Object Path
28 * @param[in] intf - Interface
29 *
30 * @return Service name
31 * @error InternalFailure exception thrown
32 */
33std::string getService(sdbusplus::bus::bus& bus, const std::string& path,
34 const std::string& intf);
35
36/** @brief Suspend hiomapd.
37 *
38 * @param[in] bus - The D-Bus bus object.
39 */
40void hiomapdSuspend(sdbusplus::bus::bus& bus);
41
42/** @brief Resume hiomapd.
43 *
44 * @param[in] bus - The D-Bus bus object.
45 */
46void hiomapdResume(sdbusplus::bus::bus& bus);
47
48} // namespace utils
49
Adriana Kobylak70ca2422018-09-06 14:23:38 -050050#endif // OPENSSL_VERSION_NUMBER < 0x10100000L