1 #pragma once
2 #include <nlohmann/json.hpp>
3 
4 namespace event_destination
5 {
6 // clang-format off
7 
8 enum class EventFormatType{
9     Invalid,
10     Event,
11     MetricReport,
12 };
13 
14 enum class EventDestinationProtocol{
15     Invalid,
16     Redfish,
17     Kafka,
18     SNMPv1,
19     SNMPv2c,
20     SNMPv3,
21     SMTP,
22     SyslogTLS,
23     SyslogTCP,
24     SyslogUDP,
25     SyslogRELP,
26     OEM,
27 };
28 
29 enum class SubscriptionType{
30     Invalid,
31     RedfishEvent,
32     SSE,
33     SNMPTrap,
34     SNMPInform,
35     Syslog,
36     OEM,
37 };
38 
39 enum class DeliveryRetryPolicy{
40     Invalid,
41     TerminateAfterRetries,
42     SuspendRetries,
43     RetryForever,
44     RetryForeverWithBackoff,
45 };
46 
47 enum class SNMPAuthenticationProtocols{
48     Invalid,
49     None,
50     CommunityString,
51     HMAC_MD5,
52     HMAC_SHA96,
53     HMAC128_SHA224,
54     HMAC192_SHA256,
55     HMAC256_SHA384,
56     HMAC384_SHA512,
57 };
58 
59 enum class SNMPEncryptionProtocols{
60     Invalid,
61     None,
62     CBC_DES,
63     CFB128_AES128,
64 };
65 
66 enum class SyslogSeverity{
67     Invalid,
68     Emergency,
69     Alert,
70     Critical,
71     Error,
72     Warning,
73     Notice,
74     Informational,
75     Debug,
76     All,
77 };
78 
79 enum class SyslogFacility{
80     Invalid,
81     Kern,
82     User,
83     Mail,
84     Daemon,
85     Auth,
86     Syslog,
87     LPR,
88     News,
89     UUCP,
90     Cron,
91     Authpriv,
92     FTP,
93     NTP,
94     Security,
95     Console,
96     SolarisCron,
97     Local0,
98     Local1,
99     Local2,
100     Local3,
101     Local4,
102     Local5,
103     Local6,
104     Local7,
105 };
106 
107 NLOHMANN_JSON_SERIALIZE_ENUM(EventFormatType, {
108     {EventFormatType::Invalid, "Invalid"},
109     {EventFormatType::Event, "Event"},
110     {EventFormatType::MetricReport, "MetricReport"},
111 });
112 
113 NLOHMANN_JSON_SERIALIZE_ENUM(EventDestinationProtocol, {
114     {EventDestinationProtocol::Invalid, "Invalid"},
115     {EventDestinationProtocol::Redfish, "Redfish"},
116     {EventDestinationProtocol::Kafka, "Kafka"},
117     {EventDestinationProtocol::SNMPv1, "SNMPv1"},
118     {EventDestinationProtocol::SNMPv2c, "SNMPv2c"},
119     {EventDestinationProtocol::SNMPv3, "SNMPv3"},
120     {EventDestinationProtocol::SMTP, "SMTP"},
121     {EventDestinationProtocol::SyslogTLS, "SyslogTLS"},
122     {EventDestinationProtocol::SyslogTCP, "SyslogTCP"},
123     {EventDestinationProtocol::SyslogUDP, "SyslogUDP"},
124     {EventDestinationProtocol::SyslogRELP, "SyslogRELP"},
125     {EventDestinationProtocol::OEM, "OEM"},
126 });
127 
128 NLOHMANN_JSON_SERIALIZE_ENUM(SubscriptionType, {
129     {SubscriptionType::Invalid, "Invalid"},
130     {SubscriptionType::RedfishEvent, "RedfishEvent"},
131     {SubscriptionType::SSE, "SSE"},
132     {SubscriptionType::SNMPTrap, "SNMPTrap"},
133     {SubscriptionType::SNMPInform, "SNMPInform"},
134     {SubscriptionType::Syslog, "Syslog"},
135     {SubscriptionType::OEM, "OEM"},
136 });
137 
138 NLOHMANN_JSON_SERIALIZE_ENUM(DeliveryRetryPolicy, {
139     {DeliveryRetryPolicy::Invalid, "Invalid"},
140     {DeliveryRetryPolicy::TerminateAfterRetries, "TerminateAfterRetries"},
141     {DeliveryRetryPolicy::SuspendRetries, "SuspendRetries"},
142     {DeliveryRetryPolicy::RetryForever, "RetryForever"},
143     {DeliveryRetryPolicy::RetryForeverWithBackoff, "RetryForeverWithBackoff"},
144 });
145 
146 NLOHMANN_JSON_SERIALIZE_ENUM(SNMPAuthenticationProtocols, {
147     {SNMPAuthenticationProtocols::Invalid, "Invalid"},
148     {SNMPAuthenticationProtocols::None, "None"},
149     {SNMPAuthenticationProtocols::CommunityString, "CommunityString"},
150     {SNMPAuthenticationProtocols::HMAC_MD5, "HMAC_MD5"},
151     {SNMPAuthenticationProtocols::HMAC_SHA96, "HMAC_SHA96"},
152     {SNMPAuthenticationProtocols::HMAC128_SHA224, "HMAC128_SHA224"},
153     {SNMPAuthenticationProtocols::HMAC192_SHA256, "HMAC192_SHA256"},
154     {SNMPAuthenticationProtocols::HMAC256_SHA384, "HMAC256_SHA384"},
155     {SNMPAuthenticationProtocols::HMAC384_SHA512, "HMAC384_SHA512"},
156 });
157 
158 NLOHMANN_JSON_SERIALIZE_ENUM(SNMPEncryptionProtocols, {
159     {SNMPEncryptionProtocols::Invalid, "Invalid"},
160     {SNMPEncryptionProtocols::None, "None"},
161     {SNMPEncryptionProtocols::CBC_DES, "CBC_DES"},
162     {SNMPEncryptionProtocols::CFB128_AES128, "CFB128_AES128"},
163 });
164 
165 NLOHMANN_JSON_SERIALIZE_ENUM(SyslogSeverity, {
166     {SyslogSeverity::Invalid, "Invalid"},
167     {SyslogSeverity::Emergency, "Emergency"},
168     {SyslogSeverity::Alert, "Alert"},
169     {SyslogSeverity::Critical, "Critical"},
170     {SyslogSeverity::Error, "Error"},
171     {SyslogSeverity::Warning, "Warning"},
172     {SyslogSeverity::Notice, "Notice"},
173     {SyslogSeverity::Informational, "Informational"},
174     {SyslogSeverity::Debug, "Debug"},
175     {SyslogSeverity::All, "All"},
176 });
177 
178 NLOHMANN_JSON_SERIALIZE_ENUM(SyslogFacility, {
179     {SyslogFacility::Invalid, "Invalid"},
180     {SyslogFacility::Kern, "Kern"},
181     {SyslogFacility::User, "User"},
182     {SyslogFacility::Mail, "Mail"},
183     {SyslogFacility::Daemon, "Daemon"},
184     {SyslogFacility::Auth, "Auth"},
185     {SyslogFacility::Syslog, "Syslog"},
186     {SyslogFacility::LPR, "LPR"},
187     {SyslogFacility::News, "News"},
188     {SyslogFacility::UUCP, "UUCP"},
189     {SyslogFacility::Cron, "Cron"},
190     {SyslogFacility::Authpriv, "Authpriv"},
191     {SyslogFacility::FTP, "FTP"},
192     {SyslogFacility::NTP, "NTP"},
193     {SyslogFacility::Security, "Security"},
194     {SyslogFacility::Console, "Console"},
195     {SyslogFacility::SolarisCron, "SolarisCron"},
196     {SyslogFacility::Local0, "Local0"},
197     {SyslogFacility::Local1, "Local1"},
198     {SyslogFacility::Local2, "Local2"},
199     {SyslogFacility::Local3, "Local3"},
200     {SyslogFacility::Local4, "Local4"},
201     {SyslogFacility::Local5, "Local5"},
202     {SyslogFacility::Local6, "Local6"},
203     {SyslogFacility::Local7, "Local7"},
204 });
205 
206 }
207 // clang-format on
208