1 // SPDX-License-Identifier: Apache-2.0 2 // SPDX-FileCopyrightText: Copyright OpenBMC Authors 3 #pragma once 4 #include <nlohmann/json.hpp> 5 6 namespace update_service 7 { 8 // clang-format off 9 10 enum class TransferProtocolType{ 11 Invalid, 12 CIFS, 13 FTP, 14 SFTP, 15 HTTP, 16 HTTPS, 17 NSF, 18 SCP, 19 TFTP, 20 OEM, 21 NFS, 22 }; 23 24 enum class ApplyTime{ 25 Invalid, 26 Immediate, 27 OnReset, 28 AtMaintenanceWindowStart, 29 InMaintenanceWindowOnReset, 30 OnStartUpdateRequest, 31 OnTargetReset, 32 }; 33 34 enum class SupportedUpdateImageFormatType{ 35 Invalid, 36 PLDMv1_0, 37 PLDMv1_1, 38 PLDMv1_2, 39 PLDMv1_3, 40 UEFICapsule, 41 VendorDefined, 42 }; 43 44 NLOHMANN_JSON_SERIALIZE_ENUM(TransferProtocolType, { 45 {TransferProtocolType::Invalid, "Invalid"}, 46 {TransferProtocolType::CIFS, "CIFS"}, 47 {TransferProtocolType::FTP, "FTP"}, 48 {TransferProtocolType::SFTP, "SFTP"}, 49 {TransferProtocolType::HTTP, "HTTP"}, 50 {TransferProtocolType::HTTPS, "HTTPS"}, 51 {TransferProtocolType::NSF, "NSF"}, 52 {TransferProtocolType::SCP, "SCP"}, 53 {TransferProtocolType::TFTP, "TFTP"}, 54 {TransferProtocolType::OEM, "OEM"}, 55 {TransferProtocolType::NFS, "NFS"}, 56 }); 57 58 NLOHMANN_JSON_SERIALIZE_ENUM(ApplyTime, { 59 {ApplyTime::Invalid, "Invalid"}, 60 {ApplyTime::Immediate, "Immediate"}, 61 {ApplyTime::OnReset, "OnReset"}, 62 {ApplyTime::AtMaintenanceWindowStart, "AtMaintenanceWindowStart"}, 63 {ApplyTime::InMaintenanceWindowOnReset, "InMaintenanceWindowOnReset"}, 64 {ApplyTime::OnStartUpdateRequest, "OnStartUpdateRequest"}, 65 {ApplyTime::OnTargetReset, "OnTargetReset"}, 66 }); 67 68 NLOHMANN_JSON_SERIALIZE_ENUM(SupportedUpdateImageFormatType, { 69 {SupportedUpdateImageFormatType::Invalid, "Invalid"}, 70 {SupportedUpdateImageFormatType::PLDMv1_0, "PLDMv1_0"}, 71 {SupportedUpdateImageFormatType::PLDMv1_1, "PLDMv1_1"}, 72 {SupportedUpdateImageFormatType::PLDMv1_2, "PLDMv1_2"}, 73 {SupportedUpdateImageFormatType::PLDMv1_3, "PLDMv1_3"}, 74 {SupportedUpdateImageFormatType::UEFICapsule, "UEFICapsule"}, 75 {SupportedUpdateImageFormatType::VendorDefined, "VendorDefined"}, 76 }); 77 78 } 79 // clang-format on 80