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 /**
12  * Create a PEL for the specified event type
13  *
14  * The additional data provided in the map will be placed in a user data
15  * section of the PEL and may additionally contain key words to trigger
16  * certain behaviors by the backend logging code. Each set of data described
17  * in the vector of ffdc data will be placed in additional user data
18  * sections.
19  *
20  * @param  i_event - the event type
21  * @param  i_additional - map of additional data
22  * @param  i_ffdc - vector of ffdc data
23  * @return Platform log id or 0 if error
24  */
25 uint32_t createPel(const std::string& i_event,
26                    std::map<std::string, std::string>& i_additional,
27                    const std::vector<util::FFDCTuple>& i_ffdc);
28 
29 /**
30  * Create a PEL from raw PEL data
31  *
32  * Create a PEL based on the pel defined in the data buffer specified.
33  *
34  * @param   i_buffer - buffer containing a raw PEL
35  */
36 void createPelRaw(const std::vector<uint8_t>& i_buffer);
37 
38 /**
39  * Get file descriptor of exisitng PEL
40  *
41  * The backend logging code will search for a PEL having the provided pel id
42  * and return a file descriptor of a file containing this pel in raw form.
43  *
44  * @param  i_pelid - the PEL ID
45  * @return file descriptor or -1 if error
46  */
47 int getPel(const uint32_t i_pelId);
48 
49 } // namespace attn
50