1 #pragma once 2 3 #include "ffdc_file.hpp" 4 5 #include <sdbusplus/bus.hpp> 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 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, 36 const std::string& function, sdbusplus::message_t& method, 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 54 /** 55 * @brief Query host state 56 * 57 * @return true if the CurrentHostState is 'Running' 58 */ 59 bool isHostStateRunning(); 60 61 } // namespace dump 62 } // namespace watchdog 63