Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 1 | /* |
| 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 |
| 18 | |
| 19 | static constexpr char const *ipmiSelObject = "xyz.openbmc_project.Logging.IPMI"; |
| 20 | static constexpr char const *ipmiSelPath = "/xyz/openbmc_project/Logging/IPMI"; |
| 21 | static constexpr char const *ipmiSelAddInterface = |
| 22 | "xyz.openbmc_project.Logging.IPMI"; |
| 23 | |
| 24 | // ID string generated using journalctl to include in the MESSAGE_ID field for |
| 25 | // SEL entries. Helps with filtering SEL entries in the journal. |
| 26 | static constexpr char const *selMessageId = "b370836ccf2f4850ac5bee185b77893a"; |
| 27 | static constexpr int selPriority = 5; // notice |
| 28 | static constexpr uint8_t selSystemType = 0x02; |
| 29 | static constexpr uint16_t selBMCGenID = 0x0020; |
| 30 | static constexpr uint16_t selInvalidRecID = |
| 31 | std::numeric_limits<uint16_t>::max(); |
| 32 | static constexpr size_t selEvtDataMaxSize = 3; |
| 33 | static constexpr size_t selOemDataMaxSize = 13; |
| 34 | |
Jason M. Bills | 97be353 | 2018-11-02 13:09:16 -0700 | [diff] [blame^] | 35 | template <typename... T> |
| 36 | static uint16_t |
| 37 | selAddSystemRecord(const std::string &message, const std::string &path, |
| 38 | const std::vector<uint8_t> &selData, const bool &assert, |
| 39 | const uint16_t &genId, T &&... metadata); |