blob: 15d53fce2db088414d496b95fd474e5ef4cd136a [file] [log] [blame]
Jason M. Bills5e049d32018-10-19 12:59:38 -07001/*
2// Copyright (c) 2018 Intel Corporation
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15*/
16
17#pragma once
Jason M. Billsc4a336f2019-04-23 10:43:10 -070018#include <filesystem>
Jason M. Bills5e049d32018-10-19 12:59:38 -070019
Patrick Williams69f7fa32023-05-10 07:50:41 -050020static constexpr const char* ipmiSelObject = "xyz.openbmc_project.Logging.IPMI";
21static constexpr const char* ipmiSelPath = "/xyz/openbmc_project/Logging/IPMI";
22static constexpr const char* ipmiSelAddInterface =
Jason M. Bills5e049d32018-10-19 12:59:38 -070023 "xyz.openbmc_project.Logging.IPMI";
24
25// ID string generated using journalctl to include in the MESSAGE_ID field for
26// SEL entries. Helps with filtering SEL entries in the journal.
Patrick Williams69f7fa32023-05-10 07:50:41 -050027static constexpr const char* selMessageId = "b370836ccf2f4850ac5bee185b77893a";
Jason M. Bills5e049d32018-10-19 12:59:38 -070028static constexpr int selPriority = 5; // notice
29static constexpr uint8_t selSystemType = 0x02;
30static constexpr uint16_t selBMCGenID = 0x0020;
31static constexpr uint16_t selInvalidRecID =
32 std::numeric_limits<uint16_t>::max();
33static constexpr size_t selEvtDataMaxSize = 3;
34static constexpr size_t selOemDataMaxSize = 13;
Zhikui Ren25b26e12020-06-26 20:18:19 -070035static constexpr uint8_t selEvtDataUnspecified = 0xFF;
Jason M. Bills5e049d32018-10-19 12:59:38 -070036
Jason M. Billsc4a336f2019-04-23 10:43:10 -070037static const std::filesystem::path selLogDir = "/var/log";
38static const std::string selLogFilename = "ipmi_sel";
39
Jason M. Bills97be3532018-11-02 13:09:16 -070040template <typename... T>
Vincent Chou92721502024-01-24 15:09:24 -060041static uint16_t
Konstantin Aladyshev6f5342d2023-04-19 09:23:11 +000042 selAddSystemRecord(std::shared_ptr<sdbusplus::asio::connection> conn,
43 const std::string& message, const std::string& path,
Zhikui Ren672bdfc2020-07-14 11:37:01 -070044 const std::vector<uint8_t>& selData, const bool& assert,
45 const uint16_t& genId, T&&... metadata);