Shantappa Teekappanavar | 1ac6162 | 2021-06-22 19:07:29 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Shantappa Teekappanavar | b64983f | 2022-02-01 09:28:10 -0600 | [diff] [blame] | 3 | #include "ffdc_file.hpp" |
| 4 | |
Shantappa Teekappanavar | 1ac6162 | 2021-06-22 19:07:29 -0500 | [diff] [blame] | 5 | #include <sdbusplus/bus.hpp> |
Shantappa Teekappanavar | 1ac6162 | 2021-06-22 19:07:29 -0500 | [diff] [blame] | 6 | |
| 7 | #include <string> |
| 8 | |
| 9 | namespace watchdog |
| 10 | { |
| 11 | namespace dump |
| 12 | { |
| 13 | |
| 14 | enum ReturnCodes |
| 15 | { |
| 16 | RC_SUCCESS = 0, |
| 17 | RC_NOT_HANDLED = 1, |
| 18 | RC_DBUS_ERROR = 2 |
| 19 | }; |
| 20 | |
Shantappa Teekappanavar | 1ac6162 | 2021-06-22 19:07:29 -0500 | [diff] [blame] | 21 | /** |
| 22 | * @brief Create a dbus method |
| 23 | * |
| 24 | * Find the dbus service associated with the dbus object path and create |
| 25 | * a dbus method for calling the specified dbus interface and function. |
| 26 | * |
| 27 | * @param path - dbus object path |
| 28 | * @param interface - dbus method interface |
| 29 | * @param function - dbus interface function |
| 30 | * @param method - method that is created |
| 31 | * @param extended - optional for extended methods |
| 32 | * @return non-zero if error |
| 33 | * |
| 34 | **/ |
| 35 | int dbusMethod(const std::string& path, const std::string& interface, |
Patrick Williams | fc43756 | 2022-07-22 19:26:52 -0500 | [diff] [blame] | 36 | const std::string& function, sdbusplus::message_t& method, |
Shantappa Teekappanavar | 1ac6162 | 2021-06-22 19:07:29 -0500 | [diff] [blame] | 37 | const std::string& extended = ""); |
| 38 | |
| 39 | /** |
| 40 | * @brief Create a PEL for the specified event type |
| 41 | * |
| 42 | * The additional data provided in the map will be placed in a user data |
| 43 | * section of the PEL. |
| 44 | * |
| 45 | * @param eventType - the event type |
| 46 | * @param additional - map of additional data |
| 47 | * @param ffdc - vector of ffdc data |
| 48 | * @return Platform log id or 0 if error |
| 49 | */ |
| 50 | uint32_t createPel(const std::string& eventType, |
| 51 | std::map<std::string, std::string>& additional, |
| 52 | const std::vector<FFDCTuple>& ffdc); |
| 53 | |
Shantappa Teekappanavar | e6978e5 | 2022-03-03 18:34:25 -0600 | [diff] [blame] | 54 | /** |
| 55 | * @brief Query host state |
| 56 | * |
| 57 | * @return true if the CurrentHostState is 'Running' |
| 58 | */ |
| 59 | bool isHostStateRunning(); |
| 60 | |
Shantappa Teekappanavar | 1ac6162 | 2021-06-22 19:07:29 -0500 | [diff] [blame] | 61 | } // namespace dump |
| 62 | } // namespace watchdog |