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     CFB128_AES192,
65     CFB128_AES256,
66 };
67 
68 enum class SyslogSeverity{
69     Invalid,
70     Emergency,
71     Alert,
72     Critical,
73     Error,
74     Warning,
75     Notice,
76     Informational,
77     Debug,
78     All,
79 };
80 
81 enum class SyslogFacility{
82     Invalid,
83     Kern,
84     User,
85     Mail,
86     Daemon,
87     Auth,
88     Syslog,
89     LPR,
90     News,
91     UUCP,
92     Cron,
93     Authpriv,
94     FTP,
95     NTP,
96     Security,
97     Console,
98     SolarisCron,
99     Local0,
100     Local1,
101     Local2,
102     Local3,
103     Local4,
104     Local5,
105     Local6,
106     Local7,
107 };
108 
109 NLOHMANN_JSON_SERIALIZE_ENUM(EventFormatType, {
110     {EventFormatType::Invalid, "Invalid"},
111     {EventFormatType::Event, "Event"},
112     {EventFormatType::MetricReport, "MetricReport"},
113 });
114 
115 NLOHMANN_JSON_SERIALIZE_ENUM(EventDestinationProtocol, {
116     {EventDestinationProtocol::Invalid, "Invalid"},
117     {EventDestinationProtocol::Redfish, "Redfish"},
118     {EventDestinationProtocol::Kafka, "Kafka"},
119     {EventDestinationProtocol::SNMPv1, "SNMPv1"},
120     {EventDestinationProtocol::SNMPv2c, "SNMPv2c"},
121     {EventDestinationProtocol::SNMPv3, "SNMPv3"},
122     {EventDestinationProtocol::SMTP, "SMTP"},
123     {EventDestinationProtocol::SyslogTLS, "SyslogTLS"},
124     {EventDestinationProtocol::SyslogTCP, "SyslogTCP"},
125     {EventDestinationProtocol::SyslogUDP, "SyslogUDP"},
126     {EventDestinationProtocol::SyslogRELP, "SyslogRELP"},
127     {EventDestinationProtocol::OEM, "OEM"},
128 });
129 
130 NLOHMANN_JSON_SERIALIZE_ENUM(SubscriptionType, {
131     {SubscriptionType::Invalid, "Invalid"},
132     {SubscriptionType::RedfishEvent, "RedfishEvent"},
133     {SubscriptionType::SSE, "SSE"},
134     {SubscriptionType::SNMPTrap, "SNMPTrap"},
135     {SubscriptionType::SNMPInform, "SNMPInform"},
136     {SubscriptionType::Syslog, "Syslog"},
137     {SubscriptionType::OEM, "OEM"},
138 });
139 
140 NLOHMANN_JSON_SERIALIZE_ENUM(DeliveryRetryPolicy, {
141     {DeliveryRetryPolicy::Invalid, "Invalid"},
142     {DeliveryRetryPolicy::TerminateAfterRetries, "TerminateAfterRetries"},
143     {DeliveryRetryPolicy::SuspendRetries, "SuspendRetries"},
144     {DeliveryRetryPolicy::RetryForever, "RetryForever"},
145     {DeliveryRetryPolicy::RetryForeverWithBackoff, "RetryForeverWithBackoff"},
146 });
147 
148 NLOHMANN_JSON_SERIALIZE_ENUM(SNMPAuthenticationProtocols, {
149     {SNMPAuthenticationProtocols::Invalid, "Invalid"},
150     {SNMPAuthenticationProtocols::None, "None"},
151     {SNMPAuthenticationProtocols::CommunityString, "CommunityString"},
152     {SNMPAuthenticationProtocols::HMAC_MD5, "HMAC_MD5"},
153     {SNMPAuthenticationProtocols::HMAC_SHA96, "HMAC_SHA96"},
154     {SNMPAuthenticationProtocols::HMAC128_SHA224, "HMAC128_SHA224"},
155     {SNMPAuthenticationProtocols::HMAC192_SHA256, "HMAC192_SHA256"},
156     {SNMPAuthenticationProtocols::HMAC256_SHA384, "HMAC256_SHA384"},
157     {SNMPAuthenticationProtocols::HMAC384_SHA512, "HMAC384_SHA512"},
158 });
159 
160 NLOHMANN_JSON_SERIALIZE_ENUM(SNMPEncryptionProtocols, {
161     {SNMPEncryptionProtocols::Invalid, "Invalid"},
162     {SNMPEncryptionProtocols::None, "None"},
163     {SNMPEncryptionProtocols::CBC_DES, "CBC_DES"},
164     {SNMPEncryptionProtocols::CFB128_AES128, "CFB128_AES128"},
165     {SNMPEncryptionProtocols::CFB128_AES192, "CFB128_AES192"},
166     {SNMPEncryptionProtocols::CFB128_AES256, "CFB128_AES256"},
167 });
168 
169 NLOHMANN_JSON_SERIALIZE_ENUM(SyslogSeverity, {
170     {SyslogSeverity::Invalid, "Invalid"},
171     {SyslogSeverity::Emergency, "Emergency"},
172     {SyslogSeverity::Alert, "Alert"},
173     {SyslogSeverity::Critical, "Critical"},
174     {SyslogSeverity::Error, "Error"},
175     {SyslogSeverity::Warning, "Warning"},
176     {SyslogSeverity::Notice, "Notice"},
177     {SyslogSeverity::Informational, "Informational"},
178     {SyslogSeverity::Debug, "Debug"},
179     {SyslogSeverity::All, "All"},
180 });
181 
182 NLOHMANN_JSON_SERIALIZE_ENUM(SyslogFacility, {
183     {SyslogFacility::Invalid, "Invalid"},
184     {SyslogFacility::Kern, "Kern"},
185     {SyslogFacility::User, "User"},
186     {SyslogFacility::Mail, "Mail"},
187     {SyslogFacility::Daemon, "Daemon"},
188     {SyslogFacility::Auth, "Auth"},
189     {SyslogFacility::Syslog, "Syslog"},
190     {SyslogFacility::LPR, "LPR"},
191     {SyslogFacility::News, "News"},
192     {SyslogFacility::UUCP, "UUCP"},
193     {SyslogFacility::Cron, "Cron"},
194     {SyslogFacility::Authpriv, "Authpriv"},
195     {SyslogFacility::FTP, "FTP"},
196     {SyslogFacility::NTP, "NTP"},
197     {SyslogFacility::Security, "Security"},
198     {SyslogFacility::Console, "Console"},
199     {SyslogFacility::SolarisCron, "SolarisCron"},
200     {SyslogFacility::Local0, "Local0"},
201     {SyslogFacility::Local1, "Local1"},
202     {SyslogFacility::Local2, "Local2"},
203     {SyslogFacility::Local3, "Local3"},
204     {SyslogFacility::Local4, "Local4"},
205     {SyslogFacility::Local5, "Local5"},
206     {SyslogFacility::Local6, "Local6"},
207     {SyslogFacility::Local7, "Local7"},
208 });
209 
210 }
211 // clang-format on
212