-
Notifications
You must be signed in to change notification settings - Fork 10
/
utils.hpp
70 lines (56 loc) · 1.69 KB
/
utils.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
// With OpenSSL 1.1.0, some functions were deprecated. Need to abstract them
// to make the code backward compatible with older OpenSSL versions.
// Reference: https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#include <openssl/evp.h>
#include <sdbusplus/bus.hpp>
#include <string>
extern "C"
{
EVP_MD_CTX* EVP_MD_CTX_new(void);
void EVP_MD_CTX_free(EVP_MD_CTX* ctx);
}
namespace utils
{
/**
* @brief Gets the D-Bus Service name for the input D-Bus path
*
* @param[in] bus - Bus handler
* @param[in] path - Object Path
* @param[in] intf - Interface
*
* @return Service name
* @error InternalFailure exception thrown
*/
std::string getService(sdbusplus::bus_t& bus, const std::string& path,
const std::string& intf);
/** @brief Suspend hiomapd.
*
* @param[in] bus - The D-Bus bus object.
*/
void hiomapdSuspend(sdbusplus::bus_t& bus);
/** @brief Resume hiomapd.
*
* @param[in] bus - The D-Bus bus object.
*/
void hiomapdResume(sdbusplus::bus_t& bus);
/** @brief Set the Hardware Management Console Managed bios attribute to
* Disabled to clear the indication that the system is HMC-managed.
*
* @param[in] bus - The D-Bus bus object.
*/
void clearHMCManaged(sdbusplus::bus_t& bus);
/** @brief Set the Clear hypervisor NVRAM bios attribute to Enabled to indicate
* to the hypervisor to clear its NVRAM.
*
* @param[in] bus - The D-Bus bus object.
*/
void setClearNvram(sdbusplus::bus_t& bus);
/** @brief DeleteAll error logs
*
* @param[in] bus - The D-Bus bus object.
*/
void deleteAllErrorLogs(sdbusplus::bus_t& bus);
} // namespace utils
#endif // OPENSSL_VERSION_NUMBER < 0x10100000L