1 #pragma once
2 #include <nlohmann/json.hpp>
3 
4 namespace log_service
5 {
6 // clang-format off
7 
8 enum class OverWritePolicy{
9     Invalid,
10     Unknown,
11     WrapsWhenFull,
12     NeverOverWrites,
13 };
14 
15 enum class LogEntryTypes{
16     Invalid,
17     Event,
18     SEL,
19     Multiple,
20     OEM,
21     CXL,
22 };
23 
24 enum class SyslogSeverity{
25     Invalid,
26     Emergency,
27     Alert,
28     Critical,
29     Error,
30     Warning,
31     Notice,
32     Informational,
33     Debug,
34     All,
35 };
36 
37 enum class SyslogFacility{
38     Invalid,
39     Kern,
40     User,
41     Mail,
42     Daemon,
43     Auth,
44     Syslog,
45     LPR,
46     News,
47     UUCP,
48     Cron,
49     Authpriv,
50     FTP,
51     NTP,
52     Security,
53     Console,
54     SolarisCron,
55     Local0,
56     Local1,
57     Local2,
58     Local3,
59     Local4,
60     Local5,
61     Local6,
62     Local7,
63 };
64 
65 enum class LogDiagnosticDataTypes{
66     Invalid,
67     Manager,
68     PreOS,
69     OS,
70     OEM,
71 };
72 
73 enum class LogPurpose{
74     Invalid,
75     Diagnostic,
76     Operations,
77     Security,
78     Telemetry,
79     ExternalEntity,
80     OEM,
81 };
82 
83 enum class TransferProtocolType{
84     Invalid,
85     CIFS,
86     FTP,
87     SFTP,
88     HTTP,
89     HTTPS,
90     NFS,
91     SCP,
92     TFTP,
93     OEM,
94 };
95 
96 enum class AutoClearResolvedEntries{
97     Invalid,
98     ClearEventGroup,
99     RetainCauseResolutionEntries,
100     UpdateCauseEntry,
101     None,
102 };
103 
104 NLOHMANN_JSON_SERIALIZE_ENUM(OverWritePolicy, {
105     {OverWritePolicy::Invalid, "Invalid"},
106     {OverWritePolicy::Unknown, "Unknown"},
107     {OverWritePolicy::WrapsWhenFull, "WrapsWhenFull"},
108     {OverWritePolicy::NeverOverWrites, "NeverOverWrites"},
109 });
110 
111 NLOHMANN_JSON_SERIALIZE_ENUM(LogEntryTypes, {
112     {LogEntryTypes::Invalid, "Invalid"},
113     {LogEntryTypes::Event, "Event"},
114     {LogEntryTypes::SEL, "SEL"},
115     {LogEntryTypes::Multiple, "Multiple"},
116     {LogEntryTypes::OEM, "OEM"},
117     {LogEntryTypes::CXL, "CXL"},
118 });
119 
120 NLOHMANN_JSON_SERIALIZE_ENUM(SyslogSeverity, {
121     {SyslogSeverity::Invalid, "Invalid"},
122     {SyslogSeverity::Emergency, "Emergency"},
123     {SyslogSeverity::Alert, "Alert"},
124     {SyslogSeverity::Critical, "Critical"},
125     {SyslogSeverity::Error, "Error"},
126     {SyslogSeverity::Warning, "Warning"},
127     {SyslogSeverity::Notice, "Notice"},
128     {SyslogSeverity::Informational, "Informational"},
129     {SyslogSeverity::Debug, "Debug"},
130     {SyslogSeverity::All, "All"},
131 });
132 
133 NLOHMANN_JSON_SERIALIZE_ENUM(SyslogFacility, {
134     {SyslogFacility::Invalid, "Invalid"},
135     {SyslogFacility::Kern, "Kern"},
136     {SyslogFacility::User, "User"},
137     {SyslogFacility::Mail, "Mail"},
138     {SyslogFacility::Daemon, "Daemon"},
139     {SyslogFacility::Auth, "Auth"},
140     {SyslogFacility::Syslog, "Syslog"},
141     {SyslogFacility::LPR, "LPR"},
142     {SyslogFacility::News, "News"},
143     {SyslogFacility::UUCP, "UUCP"},
144     {SyslogFacility::Cron, "Cron"},
145     {SyslogFacility::Authpriv, "Authpriv"},
146     {SyslogFacility::FTP, "FTP"},
147     {SyslogFacility::NTP, "NTP"},
148     {SyslogFacility::Security, "Security"},
149     {SyslogFacility::Console, "Console"},
150     {SyslogFacility::SolarisCron, "SolarisCron"},
151     {SyslogFacility::Local0, "Local0"},
152     {SyslogFacility::Local1, "Local1"},
153     {SyslogFacility::Local2, "Local2"},
154     {SyslogFacility::Local3, "Local3"},
155     {SyslogFacility::Local4, "Local4"},
156     {SyslogFacility::Local5, "Local5"},
157     {SyslogFacility::Local6, "Local6"},
158     {SyslogFacility::Local7, "Local7"},
159 });
160 
161 NLOHMANN_JSON_SERIALIZE_ENUM(LogDiagnosticDataTypes, {
162     {LogDiagnosticDataTypes::Invalid, "Invalid"},
163     {LogDiagnosticDataTypes::Manager, "Manager"},
164     {LogDiagnosticDataTypes::PreOS, "PreOS"},
165     {LogDiagnosticDataTypes::OS, "OS"},
166     {LogDiagnosticDataTypes::OEM, "OEM"},
167 });
168 
169 NLOHMANN_JSON_SERIALIZE_ENUM(LogPurpose, {
170     {LogPurpose::Invalid, "Invalid"},
171     {LogPurpose::Diagnostic, "Diagnostic"},
172     {LogPurpose::Operations, "Operations"},
173     {LogPurpose::Security, "Security"},
174     {LogPurpose::Telemetry, "Telemetry"},
175     {LogPurpose::ExternalEntity, "ExternalEntity"},
176     {LogPurpose::OEM, "OEM"},
177 });
178 
179 NLOHMANN_JSON_SERIALIZE_ENUM(TransferProtocolType, {
180     {TransferProtocolType::Invalid, "Invalid"},
181     {TransferProtocolType::CIFS, "CIFS"},
182     {TransferProtocolType::FTP, "FTP"},
183     {TransferProtocolType::SFTP, "SFTP"},
184     {TransferProtocolType::HTTP, "HTTP"},
185     {TransferProtocolType::HTTPS, "HTTPS"},
186     {TransferProtocolType::NFS, "NFS"},
187     {TransferProtocolType::SCP, "SCP"},
188     {TransferProtocolType::TFTP, "TFTP"},
189     {TransferProtocolType::OEM, "OEM"},
190 });
191 
192 NLOHMANN_JSON_SERIALIZE_ENUM(AutoClearResolvedEntries, {
193     {AutoClearResolvedEntries::Invalid, "Invalid"},
194     {AutoClearResolvedEntries::ClearEventGroup, "ClearEventGroup"},
195     {AutoClearResolvedEntries::RetainCauseResolutionEntries, "RetainCauseResolutionEntries"},
196     {AutoClearResolvedEntries::UpdateCauseEntry, "UpdateCauseEntry"},
197     {AutoClearResolvedEntries::None, "None"},
198 });
199 
200 }
201 // clang-format on
202