1 #pragma once
2 
3 #include <sdbusplus/bus.hpp>
4 #include <xyz/openbmc_project/Logging/Create/server.hpp>
5 
6 #include <string>
7 
8 namespace watchdog
9 {
10 namespace dump
11 {
12 
13 enum ReturnCodes
14 {
15     RC_SUCCESS = 0,
16     RC_NOT_HANDLED = 1,
17     RC_DBUS_ERROR = 2
18 };
19 
20 using FFDCFormat =
21     sdbusplus::xyz::openbmc_project::Logging::server::Create::FFDCFormat;
22 
23 using FFDCTuple =
24     std::tuple<FFDCFormat, uint8_t, uint8_t, sdbusplus::message::unix_fd>;
25 
26 /**
27  * @brief Create a dbus method
28  *
29  * Find the dbus service associated with the dbus object path and create
30  * a dbus method for calling the specified dbus interface and function.
31  *
32  * @param path - dbus object path
33  * @param interface - dbus method interface
34  * @param function - dbus interface function
35  * @param method - method that is created
36  * @param extended - optional for extended methods
37  * @return non-zero if error
38  *
39  **/
40 int dbusMethod(const std::string& path, const std::string& interface,
41                const std::string& function, sdbusplus::message::message& method,
42                const std::string& extended = "");
43 
44 /**
45  * @brief Create a PEL for the specified event type
46  *
47  * The additional data provided in the map will be placed in a user data
48  * section of the PEL.
49  *
50  * @param  eventType - the event type
51  * @param  additional - map of additional data
52  * @param  ffdc - vector of ffdc data
53  * @return Platform log id or 0 if error
54  */
55 uint32_t createPel(const std::string& eventType,
56                    std::map<std::string, std::string>& additional,
57                    const std::vector<FFDCTuple>& ffdc);
58 
59 } // namespace dump
60 } // namespace watchdog
61