1 #pragma once 2 #include <nlohmann/json.hpp> 3 4 namespace computer_system 5 { 6 // clang-format off 7 8 enum class BootSource{ 9 Invalid, 10 None, 11 Pxe, 12 Floppy, 13 Cd, 14 Usb, 15 Hdd, 16 BiosSetup, 17 Utilities, 18 Diags, 19 UefiShell, 20 UefiTarget, 21 SDCard, 22 UefiHttp, 23 RemoteDrive, 24 UefiBootNext, 25 Recovery, 26 }; 27 28 enum class SystemType{ 29 Invalid, 30 Physical, 31 Virtual, 32 OS, 33 PhysicallyPartitioned, 34 VirtuallyPartitioned, 35 Composed, 36 DPU, 37 }; 38 39 enum class IndicatorLED{ 40 Invalid, 41 Unknown, 42 Lit, 43 Blinking, 44 Off, 45 }; 46 47 enum class PowerState{ 48 Invalid, 49 On, 50 Off, 51 PoweringOn, 52 PoweringOff, 53 }; 54 55 enum class BootSourceOverrideEnabled{ 56 Invalid, 57 Disabled, 58 Once, 59 Continuous, 60 }; 61 62 enum class MemoryMirroring{ 63 Invalid, 64 System, 65 DIMM, 66 Hybrid, 67 None, 68 }; 69 70 enum class BootSourceOverrideMode{ 71 Invalid, 72 Legacy, 73 UEFI, 74 }; 75 76 enum class InterfaceType{ 77 Invalid, 78 TPM1_2, 79 TPM2_0, 80 TCM1_0, 81 }; 82 83 enum class HostingRole{ 84 Invalid, 85 ApplicationServer, 86 StorageServer, 87 Switch, 88 Appliance, 89 BareMetalServer, 90 VirtualMachineServer, 91 ContainerServer, 92 }; 93 94 enum class InterfaceTypeSelection{ 95 Invalid, 96 None, 97 FirmwareUpdate, 98 BiosSetting, 99 OemMethod, 100 }; 101 102 enum class WatchdogWarningActions{ 103 Invalid, 104 None, 105 DiagnosticInterrupt, 106 SMI, 107 MessagingInterrupt, 108 SCI, 109 OEM, 110 }; 111 112 enum class WatchdogTimeoutActions{ 113 Invalid, 114 None, 115 ResetSystem, 116 PowerCycle, 117 PowerDown, 118 OEM, 119 }; 120 121 enum class PowerRestorePolicyTypes{ 122 Invalid, 123 AlwaysOn, 124 AlwaysOff, 125 LastState, 126 }; 127 128 enum class BootOrderTypes{ 129 Invalid, 130 BootOrder, 131 AliasBootOrder, 132 }; 133 134 enum class AutomaticRetryConfig{ 135 Invalid, 136 Disabled, 137 RetryAttempts, 138 RetryAlways, 139 }; 140 141 enum class BootProgressTypes{ 142 Invalid, 143 None, 144 PrimaryProcessorInitializationStarted, 145 BusInitializationStarted, 146 MemoryInitializationStarted, 147 SecondaryProcessorInitializationStarted, 148 PCIResourceConfigStarted, 149 SystemHardwareInitializationComplete, 150 SetupEntered, 151 OSBootStarted, 152 OSRunning, 153 OEM, 154 }; 155 156 enum class GraphicalConnectTypesSupported{ 157 Invalid, 158 KVMIP, 159 OEM, 160 }; 161 162 enum class TrustedModuleRequiredToBoot{ 163 Invalid, 164 Disabled, 165 Required, 166 }; 167 168 enum class StopBootOnFault{ 169 Invalid, 170 Never, 171 AnyFault, 172 }; 173 174 enum class PowerMode{ 175 Invalid, 176 MaximumPerformance, 177 BalancedPerformance, 178 PowerSaving, 179 Static, 180 OSControlled, 181 OEM, 182 }; 183 184 enum class CompositionUseCase{ 185 Invalid, 186 ResourceBlockCapable, 187 ExpandableSystem, 188 }; 189 190 NLOHMANN_JSON_SERIALIZE_ENUM(BootSource, { 191 {BootSource::Invalid, "Invalid"}, 192 {BootSource::None, "None"}, 193 {BootSource::Pxe, "Pxe"}, 194 {BootSource::Floppy, "Floppy"}, 195 {BootSource::Cd, "Cd"}, 196 {BootSource::Usb, "Usb"}, 197 {BootSource::Hdd, "Hdd"}, 198 {BootSource::BiosSetup, "BiosSetup"}, 199 {BootSource::Utilities, "Utilities"}, 200 {BootSource::Diags, "Diags"}, 201 {BootSource::UefiShell, "UefiShell"}, 202 {BootSource::UefiTarget, "UefiTarget"}, 203 {BootSource::SDCard, "SDCard"}, 204 {BootSource::UefiHttp, "UefiHttp"}, 205 {BootSource::RemoteDrive, "RemoteDrive"}, 206 {BootSource::UefiBootNext, "UefiBootNext"}, 207 {BootSource::Recovery, "Recovery"}, 208 }); 209 210 NLOHMANN_JSON_SERIALIZE_ENUM(SystemType, { 211 {SystemType::Invalid, "Invalid"}, 212 {SystemType::Physical, "Physical"}, 213 {SystemType::Virtual, "Virtual"}, 214 {SystemType::OS, "OS"}, 215 {SystemType::PhysicallyPartitioned, "PhysicallyPartitioned"}, 216 {SystemType::VirtuallyPartitioned, "VirtuallyPartitioned"}, 217 {SystemType::Composed, "Composed"}, 218 {SystemType::DPU, "DPU"}, 219 }); 220 221 NLOHMANN_JSON_SERIALIZE_ENUM(IndicatorLED, { 222 {IndicatorLED::Invalid, "Invalid"}, 223 {IndicatorLED::Unknown, "Unknown"}, 224 {IndicatorLED::Lit, "Lit"}, 225 {IndicatorLED::Blinking, "Blinking"}, 226 {IndicatorLED::Off, "Off"}, 227 }); 228 229 NLOHMANN_JSON_SERIALIZE_ENUM(PowerState, { 230 {PowerState::Invalid, "Invalid"}, 231 {PowerState::On, "On"}, 232 {PowerState::Off, "Off"}, 233 {PowerState::PoweringOn, "PoweringOn"}, 234 {PowerState::PoweringOff, "PoweringOff"}, 235 }); 236 237 NLOHMANN_JSON_SERIALIZE_ENUM(BootSourceOverrideEnabled, { 238 {BootSourceOverrideEnabled::Invalid, "Invalid"}, 239 {BootSourceOverrideEnabled::Disabled, "Disabled"}, 240 {BootSourceOverrideEnabled::Once, "Once"}, 241 {BootSourceOverrideEnabled::Continuous, "Continuous"}, 242 }); 243 244 NLOHMANN_JSON_SERIALIZE_ENUM(MemoryMirroring, { 245 {MemoryMirroring::Invalid, "Invalid"}, 246 {MemoryMirroring::System, "System"}, 247 {MemoryMirroring::DIMM, "DIMM"}, 248 {MemoryMirroring::Hybrid, "Hybrid"}, 249 {MemoryMirroring::None, "None"}, 250 }); 251 252 NLOHMANN_JSON_SERIALIZE_ENUM(BootSourceOverrideMode, { 253 {BootSourceOverrideMode::Invalid, "Invalid"}, 254 {BootSourceOverrideMode::Legacy, "Legacy"}, 255 {BootSourceOverrideMode::UEFI, "UEFI"}, 256 }); 257 258 NLOHMANN_JSON_SERIALIZE_ENUM(InterfaceType, { 259 {InterfaceType::Invalid, "Invalid"}, 260 {InterfaceType::TPM1_2, "TPM1_2"}, 261 {InterfaceType::TPM2_0, "TPM2_0"}, 262 {InterfaceType::TCM1_0, "TCM1_0"}, 263 }); 264 265 NLOHMANN_JSON_SERIALIZE_ENUM(HostingRole, { 266 {HostingRole::Invalid, "Invalid"}, 267 {HostingRole::ApplicationServer, "ApplicationServer"}, 268 {HostingRole::StorageServer, "StorageServer"}, 269 {HostingRole::Switch, "Switch"}, 270 {HostingRole::Appliance, "Appliance"}, 271 {HostingRole::BareMetalServer, "BareMetalServer"}, 272 {HostingRole::VirtualMachineServer, "VirtualMachineServer"}, 273 {HostingRole::ContainerServer, "ContainerServer"}, 274 }); 275 276 NLOHMANN_JSON_SERIALIZE_ENUM(InterfaceTypeSelection, { 277 {InterfaceTypeSelection::Invalid, "Invalid"}, 278 {InterfaceTypeSelection::None, "None"}, 279 {InterfaceTypeSelection::FirmwareUpdate, "FirmwareUpdate"}, 280 {InterfaceTypeSelection::BiosSetting, "BiosSetting"}, 281 {InterfaceTypeSelection::OemMethod, "OemMethod"}, 282 }); 283 284 NLOHMANN_JSON_SERIALIZE_ENUM(WatchdogWarningActions, { 285 {WatchdogWarningActions::Invalid, "Invalid"}, 286 {WatchdogWarningActions::None, "None"}, 287 {WatchdogWarningActions::DiagnosticInterrupt, "DiagnosticInterrupt"}, 288 {WatchdogWarningActions::SMI, "SMI"}, 289 {WatchdogWarningActions::MessagingInterrupt, "MessagingInterrupt"}, 290 {WatchdogWarningActions::SCI, "SCI"}, 291 {WatchdogWarningActions::OEM, "OEM"}, 292 }); 293 294 NLOHMANN_JSON_SERIALIZE_ENUM(WatchdogTimeoutActions, { 295 {WatchdogTimeoutActions::Invalid, "Invalid"}, 296 {WatchdogTimeoutActions::None, "None"}, 297 {WatchdogTimeoutActions::ResetSystem, "ResetSystem"}, 298 {WatchdogTimeoutActions::PowerCycle, "PowerCycle"}, 299 {WatchdogTimeoutActions::PowerDown, "PowerDown"}, 300 {WatchdogTimeoutActions::OEM, "OEM"}, 301 }); 302 303 NLOHMANN_JSON_SERIALIZE_ENUM(PowerRestorePolicyTypes, { 304 {PowerRestorePolicyTypes::Invalid, "Invalid"}, 305 {PowerRestorePolicyTypes::AlwaysOn, "AlwaysOn"}, 306 {PowerRestorePolicyTypes::AlwaysOff, "AlwaysOff"}, 307 {PowerRestorePolicyTypes::LastState, "LastState"}, 308 }); 309 310 NLOHMANN_JSON_SERIALIZE_ENUM(BootOrderTypes, { 311 {BootOrderTypes::Invalid, "Invalid"}, 312 {BootOrderTypes::BootOrder, "BootOrder"}, 313 {BootOrderTypes::AliasBootOrder, "AliasBootOrder"}, 314 }); 315 316 NLOHMANN_JSON_SERIALIZE_ENUM(AutomaticRetryConfig, { 317 {AutomaticRetryConfig::Invalid, "Invalid"}, 318 {AutomaticRetryConfig::Disabled, "Disabled"}, 319 {AutomaticRetryConfig::RetryAttempts, "RetryAttempts"}, 320 {AutomaticRetryConfig::RetryAlways, "RetryAlways"}, 321 }); 322 323 NLOHMANN_JSON_SERIALIZE_ENUM(BootProgressTypes, { 324 {BootProgressTypes::Invalid, "Invalid"}, 325 {BootProgressTypes::None, "None"}, 326 {BootProgressTypes::PrimaryProcessorInitializationStarted, "PrimaryProcessorInitializationStarted"}, 327 {BootProgressTypes::BusInitializationStarted, "BusInitializationStarted"}, 328 {BootProgressTypes::MemoryInitializationStarted, "MemoryInitializationStarted"}, 329 {BootProgressTypes::SecondaryProcessorInitializationStarted, "SecondaryProcessorInitializationStarted"}, 330 {BootProgressTypes::PCIResourceConfigStarted, "PCIResourceConfigStarted"}, 331 {BootProgressTypes::SystemHardwareInitializationComplete, "SystemHardwareInitializationComplete"}, 332 {BootProgressTypes::SetupEntered, "SetupEntered"}, 333 {BootProgressTypes::OSBootStarted, "OSBootStarted"}, 334 {BootProgressTypes::OSRunning, "OSRunning"}, 335 {BootProgressTypes::OEM, "OEM"}, 336 }); 337 338 NLOHMANN_JSON_SERIALIZE_ENUM(GraphicalConnectTypesSupported, { 339 {GraphicalConnectTypesSupported::Invalid, "Invalid"}, 340 {GraphicalConnectTypesSupported::KVMIP, "KVMIP"}, 341 {GraphicalConnectTypesSupported::OEM, "OEM"}, 342 }); 343 344 NLOHMANN_JSON_SERIALIZE_ENUM(TrustedModuleRequiredToBoot, { 345 {TrustedModuleRequiredToBoot::Invalid, "Invalid"}, 346 {TrustedModuleRequiredToBoot::Disabled, "Disabled"}, 347 {TrustedModuleRequiredToBoot::Required, "Required"}, 348 }); 349 350 NLOHMANN_JSON_SERIALIZE_ENUM(StopBootOnFault, { 351 {StopBootOnFault::Invalid, "Invalid"}, 352 {StopBootOnFault::Never, "Never"}, 353 {StopBootOnFault::AnyFault, "AnyFault"}, 354 }); 355 356 NLOHMANN_JSON_SERIALIZE_ENUM(PowerMode, { 357 {PowerMode::Invalid, "Invalid"}, 358 {PowerMode::MaximumPerformance, "MaximumPerformance"}, 359 {PowerMode::BalancedPerformance, "BalancedPerformance"}, 360 {PowerMode::PowerSaving, "PowerSaving"}, 361 {PowerMode::Static, "Static"}, 362 {PowerMode::OSControlled, "OSControlled"}, 363 {PowerMode::OEM, "OEM"}, 364 }); 365 366 NLOHMANN_JSON_SERIALIZE_ENUM(CompositionUseCase, { 367 {CompositionUseCase::Invalid, "Invalid"}, 368 {CompositionUseCase::ResourceBlockCapable, "ResourceBlockCapable"}, 369 {CompositionUseCase::ExpandableSystem, "ExpandableSystem"}, 370 }); 371 372 } 373 // clang-format on 374