blob: 5de569158ba56ed818d8d6050262f46f55a14199 [file] [log] [blame]
Shantappa Teekappanavar1ac61622021-06-22 19:07:29 -05001#pragma once
2
3#include <sdbusplus/bus.hpp>
4#include <xyz/openbmc_project/Logging/Create/server.hpp>
5
6#include <string>
7
8namespace watchdog
9{
10namespace dump
11{
12
13enum ReturnCodes
14{
15 RC_SUCCESS = 0,
16 RC_NOT_HANDLED = 1,
17 RC_DBUS_ERROR = 2
18};
19
20using FFDCFormat =
21 sdbusplus::xyz::openbmc_project::Logging::server::Create::FFDCFormat;
22
23using 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 **/
40int 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 */
55uint32_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