Ben Tyner | 188f109 | 2021-02-01 09:33:06 -0600 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <sdbusplus/bus.hpp> |
| 4 | #include <util/ffdc_file.hpp> |
| 5 | |
| 6 | #include <string> |
| 7 | |
| 8 | namespace attn |
| 9 | { |
| 10 | |
| 11 | /** |
Ben Tyner | 5c5db65 | 2021-02-22 18:22:35 -0600 | [diff] [blame] | 12 | * Create a dbus method |
| 13 | * |
| 14 | * Find the dbus service associated with the dbus object path and create |
| 15 | * a dbus method for calling the specified dbus interface and function. |
| 16 | * |
| 17 | * @param i_path - dbus object path |
| 18 | * @param i_interface - dbus method interface |
| 19 | * @param i_function - dbus interface function |
| 20 | * @param o_method - method that is created |
| 21 | * @param i_extended - optional for extended methods |
| 22 | * @return non-zero if error |
| 23 | * |
| 24 | **/ |
| 25 | int dbusMethod(const std::string& i_path, const std::string& i_interface, |
| 26 | const std::string& i_function, |
| 27 | sdbusplus::message::message& o_method, |
| 28 | const std::string& i_extended = ""); |
| 29 | |
| 30 | /** |
Ben Tyner | 188f109 | 2021-02-01 09:33:06 -0600 | [diff] [blame] | 31 | * Create a PEL for the specified event type |
| 32 | * |
| 33 | * The additional data provided in the map will be placed in a user data |
| 34 | * section of the PEL and may additionally contain key words to trigger |
| 35 | * certain behaviors by the backend logging code. Each set of data described |
| 36 | * in the vector of ffdc data will be placed in additional user data |
| 37 | * sections. |
| 38 | * |
| 39 | * @param i_event - the event type |
| 40 | * @param i_additional - map of additional data |
| 41 | * @param i_ffdc - vector of ffdc data |
| 42 | * @return Platform log id or 0 if error |
| 43 | */ |
| 44 | uint32_t createPel(const std::string& i_event, |
| 45 | std::map<std::string, std::string>& i_additional, |
| 46 | const std::vector<util::FFDCTuple>& i_ffdc); |
| 47 | |
| 48 | /** |
| 49 | * Create a PEL from raw PEL data |
| 50 | * |
| 51 | * Create a PEL based on the pel defined in the data buffer specified. |
| 52 | * |
| 53 | * @param i_buffer - buffer containing a raw PEL |
| 54 | */ |
| 55 | void createPelRaw(const std::vector<uint8_t>& i_buffer); |
| 56 | |
| 57 | /** |
| 58 | * Get file descriptor of exisitng PEL |
| 59 | * |
| 60 | * The backend logging code will search for a PEL having the provided pel id |
| 61 | * and return a file descriptor of a file containing this pel in raw form. |
| 62 | * |
| 63 | * @param i_pelid - the PEL ID |
| 64 | * @return file descriptor or -1 if error |
| 65 | */ |
| 66 | int getPel(const uint32_t i_pelId); |
| 67 | |
Ben Tyner | 188f109 | 2021-02-01 09:33:06 -0600 | [diff] [blame] | 68 | } // namespace attn |