1 // SPDX-License-Identifier: Apache-2.0 2 // SPDX-FileCopyrightText: Copyright OpenBMC Authors 3 #pragma once 4 #include <nlohmann/json.hpp> 5 6 namespace computer_system 7 { 8 // clang-format off 9 10 enum class BootSource{ 11 Invalid, 12 None, 13 Pxe, 14 Floppy, 15 Cd, 16 Usb, 17 Hdd, 18 BiosSetup, 19 Utilities, 20 Diags, 21 UefiShell, 22 UefiTarget, 23 SDCard, 24 UefiHttp, 25 RemoteDrive, 26 UefiBootNext, 27 Recovery, 28 }; 29 30 enum class SystemType{ 31 Invalid, 32 Physical, 33 Virtual, 34 OS, 35 PhysicallyPartitioned, 36 VirtuallyPartitioned, 37 Composed, 38 DPU, 39 }; 40 41 enum class IndicatorLED{ 42 Invalid, 43 Unknown, 44 Lit, 45 Blinking, 46 Off, 47 }; 48 49 enum class BootSourceOverrideEnabled{ 50 Invalid, 51 Disabled, 52 Once, 53 Continuous, 54 }; 55 56 enum class MemoryMirroring{ 57 Invalid, 58 System, 59 DIMM, 60 Hybrid, 61 None, 62 }; 63 64 enum class BootSourceOverrideMode{ 65 Invalid, 66 Legacy, 67 UEFI, 68 }; 69 70 enum class InterfaceType{ 71 Invalid, 72 TPM1_2, 73 TPM2_0, 74 TCM1_0, 75 }; 76 77 enum class HostingRole{ 78 Invalid, 79 ApplicationServer, 80 StorageServer, 81 Switch, 82 Appliance, 83 BareMetalServer, 84 VirtualMachineServer, 85 ContainerServer, 86 }; 87 88 enum class InterfaceTypeSelection{ 89 Invalid, 90 None, 91 FirmwareUpdate, 92 BiosSetting, 93 OemMethod, 94 }; 95 96 enum class WatchdogWarningActions{ 97 Invalid, 98 None, 99 DiagnosticInterrupt, 100 SMI, 101 MessagingInterrupt, 102 SCI, 103 OEM, 104 }; 105 106 enum class WatchdogTimeoutActions{ 107 Invalid, 108 None, 109 ResetSystem, 110 PowerCycle, 111 PowerDown, 112 OEM, 113 }; 114 115 enum class PowerRestorePolicyTypes{ 116 Invalid, 117 AlwaysOn, 118 AlwaysOff, 119 LastState, 120 }; 121 122 enum class BootOrderTypes{ 123 Invalid, 124 BootOrder, 125 AliasBootOrder, 126 }; 127 128 enum class AutomaticRetryConfig{ 129 Invalid, 130 Disabled, 131 RetryAttempts, 132 RetryAlways, 133 }; 134 135 enum class BootProgressTypes{ 136 Invalid, 137 None, 138 PrimaryProcessorInitializationStarted, 139 BusInitializationStarted, 140 MemoryInitializationStarted, 141 SecondaryProcessorInitializationStarted, 142 PCIResourceConfigStarted, 143 SystemHardwareInitializationComplete, 144 SetupEntered, 145 OSBootStarted, 146 OSRunning, 147 OEM, 148 }; 149 150 enum class GraphicalConnectTypesSupported{ 151 Invalid, 152 KVMIP, 153 OEM, 154 }; 155 156 enum class TrustedModuleRequiredToBoot{ 157 Invalid, 158 Disabled, 159 Required, 160 }; 161 162 enum class StopBootOnFault{ 163 Invalid, 164 Never, 165 AnyFault, 166 }; 167 168 enum class PowerMode{ 169 Invalid, 170 MaximumPerformance, 171 BalancedPerformance, 172 PowerSaving, 173 Static, 174 OSControlled, 175 OEM, 176 EfficiencyFavorPower, 177 EfficiencyFavorPerformance, 178 }; 179 180 enum class CompositionUseCase{ 181 Invalid, 182 ResourceBlockCapable, 183 ExpandableSystem, 184 }; 185 186 enum class KMIPCachePolicy{ 187 Invalid, 188 None, 189 AfterFirstUse, 190 }; 191 192 enum class DecommissionType{ 193 Invalid, 194 All, 195 UserData, 196 ManagerConfig, 197 BIOSConfig, 198 NetworkConfig, 199 StorageConfig, 200 Logs, 201 TPM, 202 }; 203 204 enum class LastResetCauses{ 205 Invalid, 206 PowerButtonPress, 207 ManagementCommand, 208 PowerRestorePolicy, 209 RTCWakeup, 210 WatchdogExpiration, 211 OSSoftRestart, 212 SystemCrash, 213 ThermalEvent, 214 PowerEvent, 215 Unknown, 216 }; 217 218 enum class ExportType{ 219 Invalid, 220 NonDestructive, 221 CloneWithinFabric, 222 Replacement, 223 }; 224 225 enum class Component{ 226 Invalid, 227 All, 228 Manager, 229 BIOS, 230 Network, 231 Storage, 232 }; 233 234 enum class ExportSecurity{ 235 Invalid, 236 IncludeSensitiveData, 237 HashedDataOnly, 238 ExcludeSensitiveData, 239 }; 240 241 NLOHMANN_JSON_SERIALIZE_ENUM(BootSource, { 242 {BootSource::Invalid, "Invalid"}, 243 {BootSource::None, "None"}, 244 {BootSource::Pxe, "Pxe"}, 245 {BootSource::Floppy, "Floppy"}, 246 {BootSource::Cd, "Cd"}, 247 {BootSource::Usb, "Usb"}, 248 {BootSource::Hdd, "Hdd"}, 249 {BootSource::BiosSetup, "BiosSetup"}, 250 {BootSource::Utilities, "Utilities"}, 251 {BootSource::Diags, "Diags"}, 252 {BootSource::UefiShell, "UefiShell"}, 253 {BootSource::UefiTarget, "UefiTarget"}, 254 {BootSource::SDCard, "SDCard"}, 255 {BootSource::UefiHttp, "UefiHttp"}, 256 {BootSource::RemoteDrive, "RemoteDrive"}, 257 {BootSource::UefiBootNext, "UefiBootNext"}, 258 {BootSource::Recovery, "Recovery"}, 259 }); 260 261 NLOHMANN_JSON_SERIALIZE_ENUM(SystemType, { 262 {SystemType::Invalid, "Invalid"}, 263 {SystemType::Physical, "Physical"}, 264 {SystemType::Virtual, "Virtual"}, 265 {SystemType::OS, "OS"}, 266 {SystemType::PhysicallyPartitioned, "PhysicallyPartitioned"}, 267 {SystemType::VirtuallyPartitioned, "VirtuallyPartitioned"}, 268 {SystemType::Composed, "Composed"}, 269 {SystemType::DPU, "DPU"}, 270 }); 271 272 NLOHMANN_JSON_SERIALIZE_ENUM(IndicatorLED, { 273 {IndicatorLED::Invalid, "Invalid"}, 274 {IndicatorLED::Unknown, "Unknown"}, 275 {IndicatorLED::Lit, "Lit"}, 276 {IndicatorLED::Blinking, "Blinking"}, 277 {IndicatorLED::Off, "Off"}, 278 }); 279 280 NLOHMANN_JSON_SERIALIZE_ENUM(BootSourceOverrideEnabled, { 281 {BootSourceOverrideEnabled::Invalid, "Invalid"}, 282 {BootSourceOverrideEnabled::Disabled, "Disabled"}, 283 {BootSourceOverrideEnabled::Once, "Once"}, 284 {BootSourceOverrideEnabled::Continuous, "Continuous"}, 285 }); 286 287 NLOHMANN_JSON_SERIALIZE_ENUM(MemoryMirroring, { 288 {MemoryMirroring::Invalid, "Invalid"}, 289 {MemoryMirroring::System, "System"}, 290 {MemoryMirroring::DIMM, "DIMM"}, 291 {MemoryMirroring::Hybrid, "Hybrid"}, 292 {MemoryMirroring::None, "None"}, 293 }); 294 295 NLOHMANN_JSON_SERIALIZE_ENUM(BootSourceOverrideMode, { 296 {BootSourceOverrideMode::Invalid, "Invalid"}, 297 {BootSourceOverrideMode::Legacy, "Legacy"}, 298 {BootSourceOverrideMode::UEFI, "UEFI"}, 299 }); 300 301 NLOHMANN_JSON_SERIALIZE_ENUM(InterfaceType, { 302 {InterfaceType::Invalid, "Invalid"}, 303 {InterfaceType::TPM1_2, "TPM1_2"}, 304 {InterfaceType::TPM2_0, "TPM2_0"}, 305 {InterfaceType::TCM1_0, "TCM1_0"}, 306 }); 307 308 NLOHMANN_JSON_SERIALIZE_ENUM(HostingRole, { 309 {HostingRole::Invalid, "Invalid"}, 310 {HostingRole::ApplicationServer, "ApplicationServer"}, 311 {HostingRole::StorageServer, "StorageServer"}, 312 {HostingRole::Switch, "Switch"}, 313 {HostingRole::Appliance, "Appliance"}, 314 {HostingRole::BareMetalServer, "BareMetalServer"}, 315 {HostingRole::VirtualMachineServer, "VirtualMachineServer"}, 316 {HostingRole::ContainerServer, "ContainerServer"}, 317 }); 318 319 NLOHMANN_JSON_SERIALIZE_ENUM(InterfaceTypeSelection, { 320 {InterfaceTypeSelection::Invalid, "Invalid"}, 321 {InterfaceTypeSelection::None, "None"}, 322 {InterfaceTypeSelection::FirmwareUpdate, "FirmwareUpdate"}, 323 {InterfaceTypeSelection::BiosSetting, "BiosSetting"}, 324 {InterfaceTypeSelection::OemMethod, "OemMethod"}, 325 }); 326 327 NLOHMANN_JSON_SERIALIZE_ENUM(WatchdogWarningActions, { 328 {WatchdogWarningActions::Invalid, "Invalid"}, 329 {WatchdogWarningActions::None, "None"}, 330 {WatchdogWarningActions::DiagnosticInterrupt, "DiagnosticInterrupt"}, 331 {WatchdogWarningActions::SMI, "SMI"}, 332 {WatchdogWarningActions::MessagingInterrupt, "MessagingInterrupt"}, 333 {WatchdogWarningActions::SCI, "SCI"}, 334 {WatchdogWarningActions::OEM, "OEM"}, 335 }); 336 337 NLOHMANN_JSON_SERIALIZE_ENUM(WatchdogTimeoutActions, { 338 {WatchdogTimeoutActions::Invalid, "Invalid"}, 339 {WatchdogTimeoutActions::None, "None"}, 340 {WatchdogTimeoutActions::ResetSystem, "ResetSystem"}, 341 {WatchdogTimeoutActions::PowerCycle, "PowerCycle"}, 342 {WatchdogTimeoutActions::PowerDown, "PowerDown"}, 343 {WatchdogTimeoutActions::OEM, "OEM"}, 344 }); 345 346 NLOHMANN_JSON_SERIALIZE_ENUM(PowerRestorePolicyTypes, { 347 {PowerRestorePolicyTypes::Invalid, "Invalid"}, 348 {PowerRestorePolicyTypes::AlwaysOn, "AlwaysOn"}, 349 {PowerRestorePolicyTypes::AlwaysOff, "AlwaysOff"}, 350 {PowerRestorePolicyTypes::LastState, "LastState"}, 351 }); 352 353 NLOHMANN_JSON_SERIALIZE_ENUM(BootOrderTypes, { 354 {BootOrderTypes::Invalid, "Invalid"}, 355 {BootOrderTypes::BootOrder, "BootOrder"}, 356 {BootOrderTypes::AliasBootOrder, "AliasBootOrder"}, 357 }); 358 359 NLOHMANN_JSON_SERIALIZE_ENUM(AutomaticRetryConfig, { 360 {AutomaticRetryConfig::Invalid, "Invalid"}, 361 {AutomaticRetryConfig::Disabled, "Disabled"}, 362 {AutomaticRetryConfig::RetryAttempts, "RetryAttempts"}, 363 {AutomaticRetryConfig::RetryAlways, "RetryAlways"}, 364 }); 365 366 NLOHMANN_JSON_SERIALIZE_ENUM(BootProgressTypes, { 367 {BootProgressTypes::Invalid, "Invalid"}, 368 {BootProgressTypes::None, "None"}, 369 {BootProgressTypes::PrimaryProcessorInitializationStarted, "PrimaryProcessorInitializationStarted"}, 370 {BootProgressTypes::BusInitializationStarted, "BusInitializationStarted"}, 371 {BootProgressTypes::MemoryInitializationStarted, "MemoryInitializationStarted"}, 372 {BootProgressTypes::SecondaryProcessorInitializationStarted, "SecondaryProcessorInitializationStarted"}, 373 {BootProgressTypes::PCIResourceConfigStarted, "PCIResourceConfigStarted"}, 374 {BootProgressTypes::SystemHardwareInitializationComplete, "SystemHardwareInitializationComplete"}, 375 {BootProgressTypes::SetupEntered, "SetupEntered"}, 376 {BootProgressTypes::OSBootStarted, "OSBootStarted"}, 377 {BootProgressTypes::OSRunning, "OSRunning"}, 378 {BootProgressTypes::OEM, "OEM"}, 379 }); 380 381 NLOHMANN_JSON_SERIALIZE_ENUM(GraphicalConnectTypesSupported, { 382 {GraphicalConnectTypesSupported::Invalid, "Invalid"}, 383 {GraphicalConnectTypesSupported::KVMIP, "KVMIP"}, 384 {GraphicalConnectTypesSupported::OEM, "OEM"}, 385 }); 386 387 NLOHMANN_JSON_SERIALIZE_ENUM(TrustedModuleRequiredToBoot, { 388 {TrustedModuleRequiredToBoot::Invalid, "Invalid"}, 389 {TrustedModuleRequiredToBoot::Disabled, "Disabled"}, 390 {TrustedModuleRequiredToBoot::Required, "Required"}, 391 }); 392 393 NLOHMANN_JSON_SERIALIZE_ENUM(StopBootOnFault, { 394 {StopBootOnFault::Invalid, "Invalid"}, 395 {StopBootOnFault::Never, "Never"}, 396 {StopBootOnFault::AnyFault, "AnyFault"}, 397 }); 398 399 NLOHMANN_JSON_SERIALIZE_ENUM(PowerMode, { 400 {PowerMode::Invalid, "Invalid"}, 401 {PowerMode::MaximumPerformance, "MaximumPerformance"}, 402 {PowerMode::BalancedPerformance, "BalancedPerformance"}, 403 {PowerMode::PowerSaving, "PowerSaving"}, 404 {PowerMode::Static, "Static"}, 405 {PowerMode::OSControlled, "OSControlled"}, 406 {PowerMode::OEM, "OEM"}, 407 {PowerMode::EfficiencyFavorPower, "EfficiencyFavorPower"}, 408 {PowerMode::EfficiencyFavorPerformance, "EfficiencyFavorPerformance"}, 409 }); 410 411 NLOHMANN_JSON_SERIALIZE_ENUM(CompositionUseCase, { 412 {CompositionUseCase::Invalid, "Invalid"}, 413 {CompositionUseCase::ResourceBlockCapable, "ResourceBlockCapable"}, 414 {CompositionUseCase::ExpandableSystem, "ExpandableSystem"}, 415 }); 416 417 NLOHMANN_JSON_SERIALIZE_ENUM(KMIPCachePolicy, { 418 {KMIPCachePolicy::Invalid, "Invalid"}, 419 {KMIPCachePolicy::None, "None"}, 420 {KMIPCachePolicy::AfterFirstUse, "AfterFirstUse"}, 421 }); 422 423 NLOHMANN_JSON_SERIALIZE_ENUM(DecommissionType, { 424 {DecommissionType::Invalid, "Invalid"}, 425 {DecommissionType::All, "All"}, 426 {DecommissionType::UserData, "UserData"}, 427 {DecommissionType::ManagerConfig, "ManagerConfig"}, 428 {DecommissionType::BIOSConfig, "BIOSConfig"}, 429 {DecommissionType::NetworkConfig, "NetworkConfig"}, 430 {DecommissionType::StorageConfig, "StorageConfig"}, 431 {DecommissionType::Logs, "Logs"}, 432 {DecommissionType::TPM, "TPM"}, 433 }); 434 435 NLOHMANN_JSON_SERIALIZE_ENUM(LastResetCauses, { 436 {LastResetCauses::Invalid, "Invalid"}, 437 {LastResetCauses::PowerButtonPress, "PowerButtonPress"}, 438 {LastResetCauses::ManagementCommand, "ManagementCommand"}, 439 {LastResetCauses::PowerRestorePolicy, "PowerRestorePolicy"}, 440 {LastResetCauses::RTCWakeup, "RTCWakeup"}, 441 {LastResetCauses::WatchdogExpiration, "WatchdogExpiration"}, 442 {LastResetCauses::OSSoftRestart, "OSSoftRestart"}, 443 {LastResetCauses::SystemCrash, "SystemCrash"}, 444 {LastResetCauses::ThermalEvent, "ThermalEvent"}, 445 {LastResetCauses::PowerEvent, "PowerEvent"}, 446 {LastResetCauses::Unknown, "Unknown"}, 447 }); 448 449 NLOHMANN_JSON_SERIALIZE_ENUM(ExportType, { 450 {ExportType::Invalid, "Invalid"}, 451 {ExportType::NonDestructive, "NonDestructive"}, 452 {ExportType::CloneWithinFabric, "CloneWithinFabric"}, 453 {ExportType::Replacement, "Replacement"}, 454 }); 455 456 NLOHMANN_JSON_SERIALIZE_ENUM(Component, { 457 {Component::Invalid, "Invalid"}, 458 {Component::All, "All"}, 459 {Component::Manager, "Manager"}, 460 {Component::BIOS, "BIOS"}, 461 {Component::Network, "Network"}, 462 {Component::Storage, "Storage"}, 463 }); 464 465 NLOHMANN_JSON_SERIALIZE_ENUM(ExportSecurity, { 466 {ExportSecurity::Invalid, "Invalid"}, 467 {ExportSecurity::IncludeSensitiveData, "IncludeSensitiveData"}, 468 {ExportSecurity::HashedDataOnly, "HashedDataOnly"}, 469 {ExportSecurity::ExcludeSensitiveData, "ExcludeSensitiveData"}, 470 }); 471 472 } 473 // clang-format on 474