blob: fcdebd65bac6bb0b01bb8c8290403ae2db4ea887 [file] [log] [blame]
Dhruvaraj Subhashchandran9e905372021-08-20 04:06:06 -05001#pragma once
2
3#include "dump_utils.hpp"
4
5namespace openpower
6{
7namespace dump
8{
9namespace util
10{
11
12/** @brief Check whether OpenPOWER dumps are enabled
13 *
14 * param[in] bus - D-Bus handle
15 *
16 * If the settings service is not running then considering as
17 * the dumps are enabled.
18 * @return true - if dumps are enabled, false - if dumps are not enabled
19 */
Patrick Williams8098ca62023-06-24 03:07:54 -050020bool isOPDumpsEnabled(sdbusplus::bus_t& bus);
Dhruvaraj Subhashchandran9e905372021-08-20 04:06:06 -050021
Dhruvaraj Subhashchandran1ddb0062022-05-06 06:21:11 -050022using BIOSAttrValueType = std::variant<int64_t, std::string>;
23
24/** @brief Read a BIOS attribute value
25 *
26 * @param[in] attrName - Name of the BIOS attribute
27 * @param[in] bus - D-Bus handle
28 *
29 * @return The value of the BIOS attribute as a variant of possible types
30 *
31 * @throws sdbusplus::exception::SdBusError if failed to read the attribute
32 */
33BIOSAttrValueType readBIOSAttribute(const std::string& attrName,
Patrick Williams8098ca62023-06-24 03:07:54 -050034 sdbusplus::bus_t& bus);
Dhruvaraj Subhashchandran1ddb0062022-05-06 06:21:11 -050035
36/** @brief Check whether a system is in progress or available to offload.
37 *
38 * @param[in] bus - D-Bus handle
39 *
40 * @return true - A dump is in progress or available to offload
41 * false - No dump in progress
42 */
Patrick Williams8098ca62023-06-24 03:07:54 -050043bool isSystemDumpInProgress(sdbusplus::bus_t& bus);
Dhruvaraj Subhashchandran9e905372021-08-20 04:06:06 -050044} // namespace util
45} // namespace dump
46} // namespace openpower