1*40e9b92eSEd Tanous // SPDX-License-Identifier: Apache-2.0 2*40e9b92eSEd Tanous // SPDX-FileCopyrightText: Copyright OpenBMC Authors 30ec8b83dSEd Tanous #pragma once 40ec8b83dSEd Tanous #include <nlohmann/json.hpp> 50ec8b83dSEd Tanous 60ec8b83dSEd Tanous namespace log_service 70ec8b83dSEd Tanous { 80ec8b83dSEd Tanous // clang-format off 90ec8b83dSEd Tanous 100ec8b83dSEd Tanous enum class OverWritePolicy{ 110ec8b83dSEd Tanous Invalid, 120ec8b83dSEd Tanous Unknown, 130ec8b83dSEd Tanous WrapsWhenFull, 140ec8b83dSEd Tanous NeverOverWrites, 150ec8b83dSEd Tanous }; 160ec8b83dSEd Tanous 170ec8b83dSEd Tanous enum class LogEntryTypes{ 180ec8b83dSEd Tanous Invalid, 190ec8b83dSEd Tanous Event, 200ec8b83dSEd Tanous SEL, 210ec8b83dSEd Tanous Multiple, 220ec8b83dSEd Tanous OEM, 23e9cc1bc9SEd Tanous CXL, 240ec8b83dSEd Tanous }; 250ec8b83dSEd Tanous 260ec8b83dSEd Tanous enum class SyslogSeverity{ 270ec8b83dSEd Tanous Invalid, 280ec8b83dSEd Tanous Emergency, 290ec8b83dSEd Tanous Alert, 300ec8b83dSEd Tanous Critical, 310ec8b83dSEd Tanous Error, 320ec8b83dSEd Tanous Warning, 330ec8b83dSEd Tanous Notice, 340ec8b83dSEd Tanous Informational, 350ec8b83dSEd Tanous Debug, 360ec8b83dSEd Tanous All, 370ec8b83dSEd Tanous }; 380ec8b83dSEd Tanous 390ec8b83dSEd Tanous enum class SyslogFacility{ 400ec8b83dSEd Tanous Invalid, 410ec8b83dSEd Tanous Kern, 420ec8b83dSEd Tanous User, 430ec8b83dSEd Tanous Mail, 440ec8b83dSEd Tanous Daemon, 450ec8b83dSEd Tanous Auth, 460ec8b83dSEd Tanous Syslog, 470ec8b83dSEd Tanous LPR, 480ec8b83dSEd Tanous News, 490ec8b83dSEd Tanous UUCP, 500ec8b83dSEd Tanous Cron, 510ec8b83dSEd Tanous Authpriv, 520ec8b83dSEd Tanous FTP, 530ec8b83dSEd Tanous NTP, 540ec8b83dSEd Tanous Security, 550ec8b83dSEd Tanous Console, 560ec8b83dSEd Tanous SolarisCron, 570ec8b83dSEd Tanous Local0, 580ec8b83dSEd Tanous Local1, 590ec8b83dSEd Tanous Local2, 600ec8b83dSEd Tanous Local3, 610ec8b83dSEd Tanous Local4, 620ec8b83dSEd Tanous Local5, 630ec8b83dSEd Tanous Local6, 640ec8b83dSEd Tanous Local7, 650ec8b83dSEd Tanous }; 660ec8b83dSEd Tanous 670ec8b83dSEd Tanous enum class LogDiagnosticDataTypes{ 680ec8b83dSEd Tanous Invalid, 690ec8b83dSEd Tanous Manager, 700ec8b83dSEd Tanous PreOS, 710ec8b83dSEd Tanous OS, 720ec8b83dSEd Tanous OEM, 730ec8b83dSEd Tanous }; 740ec8b83dSEd Tanous 75a8d8f9d8SEd Tanous enum class LogPurpose{ 76a8d8f9d8SEd Tanous Invalid, 77a8d8f9d8SEd Tanous Diagnostic, 78a8d8f9d8SEd Tanous Operations, 79a8d8f9d8SEd Tanous Security, 80a8d8f9d8SEd Tanous Telemetry, 81a8d8f9d8SEd Tanous ExternalEntity, 82a8d8f9d8SEd Tanous OEM, 83a8d8f9d8SEd Tanous }; 84a8d8f9d8SEd Tanous 852ae81db9SGunnar Mills enum class TransferProtocolType{ 862ae81db9SGunnar Mills Invalid, 872ae81db9SGunnar Mills CIFS, 882ae81db9SGunnar Mills FTP, 892ae81db9SGunnar Mills SFTP, 902ae81db9SGunnar Mills HTTP, 912ae81db9SGunnar Mills HTTPS, 922ae81db9SGunnar Mills NFS, 932ae81db9SGunnar Mills SCP, 942ae81db9SGunnar Mills TFTP, 952ae81db9SGunnar Mills OEM, 962ae81db9SGunnar Mills }; 972ae81db9SGunnar Mills 98f2a8e57eSGunnar Mills enum class AutoClearResolvedEntries{ 99f2a8e57eSGunnar Mills Invalid, 100f2a8e57eSGunnar Mills ClearEventGroup, 101f2a8e57eSGunnar Mills RetainCauseResolutionEntries, 102f2a8e57eSGunnar Mills UpdateCauseEntry, 103f2a8e57eSGunnar Mills None, 104f2a8e57eSGunnar Mills }; 105f2a8e57eSGunnar Mills 1060ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(OverWritePolicy, { 1070ec8b83dSEd Tanous {OverWritePolicy::Invalid, "Invalid"}, 1080ec8b83dSEd Tanous {OverWritePolicy::Unknown, "Unknown"}, 1090ec8b83dSEd Tanous {OverWritePolicy::WrapsWhenFull, "WrapsWhenFull"}, 1100ec8b83dSEd Tanous {OverWritePolicy::NeverOverWrites, "NeverOverWrites"}, 1110ec8b83dSEd Tanous }); 1120ec8b83dSEd Tanous 1130ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(LogEntryTypes, { 1140ec8b83dSEd Tanous {LogEntryTypes::Invalid, "Invalid"}, 1150ec8b83dSEd Tanous {LogEntryTypes::Event, "Event"}, 1160ec8b83dSEd Tanous {LogEntryTypes::SEL, "SEL"}, 1170ec8b83dSEd Tanous {LogEntryTypes::Multiple, "Multiple"}, 1180ec8b83dSEd Tanous {LogEntryTypes::OEM, "OEM"}, 119e9cc1bc9SEd Tanous {LogEntryTypes::CXL, "CXL"}, 1200ec8b83dSEd Tanous }); 1210ec8b83dSEd Tanous 1220ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(SyslogSeverity, { 1230ec8b83dSEd Tanous {SyslogSeverity::Invalid, "Invalid"}, 1240ec8b83dSEd Tanous {SyslogSeverity::Emergency, "Emergency"}, 1250ec8b83dSEd Tanous {SyslogSeverity::Alert, "Alert"}, 1260ec8b83dSEd Tanous {SyslogSeverity::Critical, "Critical"}, 1270ec8b83dSEd Tanous {SyslogSeverity::Error, "Error"}, 1280ec8b83dSEd Tanous {SyslogSeverity::Warning, "Warning"}, 1290ec8b83dSEd Tanous {SyslogSeverity::Notice, "Notice"}, 1300ec8b83dSEd Tanous {SyslogSeverity::Informational, "Informational"}, 1310ec8b83dSEd Tanous {SyslogSeverity::Debug, "Debug"}, 1320ec8b83dSEd Tanous {SyslogSeverity::All, "All"}, 1330ec8b83dSEd Tanous }); 1340ec8b83dSEd Tanous 1350ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(SyslogFacility, { 1360ec8b83dSEd Tanous {SyslogFacility::Invalid, "Invalid"}, 1370ec8b83dSEd Tanous {SyslogFacility::Kern, "Kern"}, 1380ec8b83dSEd Tanous {SyslogFacility::User, "User"}, 1390ec8b83dSEd Tanous {SyslogFacility::Mail, "Mail"}, 1400ec8b83dSEd Tanous {SyslogFacility::Daemon, "Daemon"}, 1410ec8b83dSEd Tanous {SyslogFacility::Auth, "Auth"}, 1420ec8b83dSEd Tanous {SyslogFacility::Syslog, "Syslog"}, 1430ec8b83dSEd Tanous {SyslogFacility::LPR, "LPR"}, 1440ec8b83dSEd Tanous {SyslogFacility::News, "News"}, 1450ec8b83dSEd Tanous {SyslogFacility::UUCP, "UUCP"}, 1460ec8b83dSEd Tanous {SyslogFacility::Cron, "Cron"}, 1470ec8b83dSEd Tanous {SyslogFacility::Authpriv, "Authpriv"}, 1480ec8b83dSEd Tanous {SyslogFacility::FTP, "FTP"}, 1490ec8b83dSEd Tanous {SyslogFacility::NTP, "NTP"}, 1500ec8b83dSEd Tanous {SyslogFacility::Security, "Security"}, 1510ec8b83dSEd Tanous {SyslogFacility::Console, "Console"}, 1520ec8b83dSEd Tanous {SyslogFacility::SolarisCron, "SolarisCron"}, 1530ec8b83dSEd Tanous {SyslogFacility::Local0, "Local0"}, 1540ec8b83dSEd Tanous {SyslogFacility::Local1, "Local1"}, 1550ec8b83dSEd Tanous {SyslogFacility::Local2, "Local2"}, 1560ec8b83dSEd Tanous {SyslogFacility::Local3, "Local3"}, 1570ec8b83dSEd Tanous {SyslogFacility::Local4, "Local4"}, 1580ec8b83dSEd Tanous {SyslogFacility::Local5, "Local5"}, 1590ec8b83dSEd Tanous {SyslogFacility::Local6, "Local6"}, 1600ec8b83dSEd Tanous {SyslogFacility::Local7, "Local7"}, 1610ec8b83dSEd Tanous }); 1620ec8b83dSEd Tanous 1630ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(LogDiagnosticDataTypes, { 1640ec8b83dSEd Tanous {LogDiagnosticDataTypes::Invalid, "Invalid"}, 1650ec8b83dSEd Tanous {LogDiagnosticDataTypes::Manager, "Manager"}, 1660ec8b83dSEd Tanous {LogDiagnosticDataTypes::PreOS, "PreOS"}, 1670ec8b83dSEd Tanous {LogDiagnosticDataTypes::OS, "OS"}, 1680ec8b83dSEd Tanous {LogDiagnosticDataTypes::OEM, "OEM"}, 1690ec8b83dSEd Tanous }); 1700ec8b83dSEd Tanous 171a8d8f9d8SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(LogPurpose, { 172a8d8f9d8SEd Tanous {LogPurpose::Invalid, "Invalid"}, 173a8d8f9d8SEd Tanous {LogPurpose::Diagnostic, "Diagnostic"}, 174a8d8f9d8SEd Tanous {LogPurpose::Operations, "Operations"}, 175a8d8f9d8SEd Tanous {LogPurpose::Security, "Security"}, 176a8d8f9d8SEd Tanous {LogPurpose::Telemetry, "Telemetry"}, 177a8d8f9d8SEd Tanous {LogPurpose::ExternalEntity, "ExternalEntity"}, 178a8d8f9d8SEd Tanous {LogPurpose::OEM, "OEM"}, 179a8d8f9d8SEd Tanous }); 180a8d8f9d8SEd Tanous 1812ae81db9SGunnar Mills NLOHMANN_JSON_SERIALIZE_ENUM(TransferProtocolType, { 1822ae81db9SGunnar Mills {TransferProtocolType::Invalid, "Invalid"}, 1832ae81db9SGunnar Mills {TransferProtocolType::CIFS, "CIFS"}, 1842ae81db9SGunnar Mills {TransferProtocolType::FTP, "FTP"}, 1852ae81db9SGunnar Mills {TransferProtocolType::SFTP, "SFTP"}, 1862ae81db9SGunnar Mills {TransferProtocolType::HTTP, "HTTP"}, 1872ae81db9SGunnar Mills {TransferProtocolType::HTTPS, "HTTPS"}, 1882ae81db9SGunnar Mills {TransferProtocolType::NFS, "NFS"}, 1892ae81db9SGunnar Mills {TransferProtocolType::SCP, "SCP"}, 1902ae81db9SGunnar Mills {TransferProtocolType::TFTP, "TFTP"}, 1912ae81db9SGunnar Mills {TransferProtocolType::OEM, "OEM"}, 1922ae81db9SGunnar Mills }); 1932ae81db9SGunnar Mills 194f2a8e57eSGunnar Mills NLOHMANN_JSON_SERIALIZE_ENUM(AutoClearResolvedEntries, { 195f2a8e57eSGunnar Mills {AutoClearResolvedEntries::Invalid, "Invalid"}, 196f2a8e57eSGunnar Mills {AutoClearResolvedEntries::ClearEventGroup, "ClearEventGroup"}, 197f2a8e57eSGunnar Mills {AutoClearResolvedEntries::RetainCauseResolutionEntries, "RetainCauseResolutionEntries"}, 198f2a8e57eSGunnar Mills {AutoClearResolvedEntries::UpdateCauseEntry, "UpdateCauseEntry"}, 199f2a8e57eSGunnar Mills {AutoClearResolvedEntries::None, "None"}, 200f2a8e57eSGunnar Mills }); 201f2a8e57eSGunnar Mills 2020ec8b83dSEd Tanous } 2030ec8b83dSEd Tanous // clang-format on 204