1 #pragma once 2 #include <nlohmann/json.hpp> 3 4 namespace volume 5 { 6 // clang-format off 7 8 enum class InitializeType{ 9 Invalid, 10 Fast, 11 Slow, 12 }; 13 14 enum class InitializeMethod{ 15 Invalid, 16 Skip, 17 Background, 18 Foreground, 19 }; 20 21 enum class RAIDType{ 22 Invalid, 23 RAID0, 24 RAID1, 25 RAID3, 26 RAID4, 27 RAID5, 28 RAID6, 29 RAID10, 30 RAID01, 31 RAID6TP, 32 RAID1E, 33 RAID50, 34 RAID60, 35 RAID00, 36 RAID10E, 37 RAID1Triple, 38 RAID10Triple, 39 None, 40 }; 41 42 enum class VolumeType{ 43 Invalid, 44 RawDevice, 45 NonRedundant, 46 Mirrored, 47 StripedWithParity, 48 SpannedMirrors, 49 SpannedStripesWithParity, 50 }; 51 52 enum class EncryptionTypes{ 53 Invalid, 54 NativeDriveEncryption, 55 ControllerAssisted, 56 SoftwareAssisted, 57 }; 58 59 enum class WriteHoleProtectionPolicyType{ 60 Invalid, 61 Off, 62 Journaling, 63 DistributedLog, 64 Oem, 65 }; 66 67 enum class VolumeUsageType{ 68 Invalid, 69 Data, 70 SystemData, 71 CacheOnly, 72 SystemReserve, 73 ReplicationReserve, 74 }; 75 76 enum class ReadCachePolicyType{ 77 Invalid, 78 ReadAhead, 79 AdaptiveReadAhead, 80 Off, 81 }; 82 83 enum class WriteCachePolicyType{ 84 Invalid, 85 WriteThrough, 86 ProtectedWriteBack, 87 UnprotectedWriteBack, 88 Off, 89 }; 90 91 enum class WriteCacheStateType{ 92 Invalid, 93 Unprotected, 94 Protected, 95 Degraded, 96 }; 97 98 enum class LBAFormatType{ 99 Invalid, 100 LBAFormat0, 101 LBAFormat1, 102 LBAFormat2, 103 LBAFormat3, 104 LBAFormat4, 105 LBAFormat5, 106 LBAFormat6, 107 LBAFormat7, 108 LBAFormat8, 109 LBAFormat9, 110 LBAFormat10, 111 LBAFormat11, 112 LBAFormat12, 113 LBAFormat13, 114 LBAFormat14, 115 LBAFormat15, 116 }; 117 118 NLOHMANN_JSON_SERIALIZE_ENUM(InitializeType, { 119 {InitializeType::Invalid, "Invalid"}, 120 {InitializeType::Fast, "Fast"}, 121 {InitializeType::Slow, "Slow"}, 122 }); 123 124 NLOHMANN_JSON_SERIALIZE_ENUM(InitializeMethod, { 125 {InitializeMethod::Invalid, "Invalid"}, 126 {InitializeMethod::Skip, "Skip"}, 127 {InitializeMethod::Background, "Background"}, 128 {InitializeMethod::Foreground, "Foreground"}, 129 }); 130 131 NLOHMANN_JSON_SERIALIZE_ENUM(RAIDType, { 132 {RAIDType::Invalid, "Invalid"}, 133 {RAIDType::RAID0, "RAID0"}, 134 {RAIDType::RAID1, "RAID1"}, 135 {RAIDType::RAID3, "RAID3"}, 136 {RAIDType::RAID4, "RAID4"}, 137 {RAIDType::RAID5, "RAID5"}, 138 {RAIDType::RAID6, "RAID6"}, 139 {RAIDType::RAID10, "RAID10"}, 140 {RAIDType::RAID01, "RAID01"}, 141 {RAIDType::RAID6TP, "RAID6TP"}, 142 {RAIDType::RAID1E, "RAID1E"}, 143 {RAIDType::RAID50, "RAID50"}, 144 {RAIDType::RAID60, "RAID60"}, 145 {RAIDType::RAID00, "RAID00"}, 146 {RAIDType::RAID10E, "RAID10E"}, 147 {RAIDType::RAID1Triple, "RAID1Triple"}, 148 {RAIDType::RAID10Triple, "RAID10Triple"}, 149 {RAIDType::None, "None"}, 150 }); 151 152 NLOHMANN_JSON_SERIALIZE_ENUM(VolumeType, { 153 {VolumeType::Invalid, "Invalid"}, 154 {VolumeType::RawDevice, "RawDevice"}, 155 {VolumeType::NonRedundant, "NonRedundant"}, 156 {VolumeType::Mirrored, "Mirrored"}, 157 {VolumeType::StripedWithParity, "StripedWithParity"}, 158 {VolumeType::SpannedMirrors, "SpannedMirrors"}, 159 {VolumeType::SpannedStripesWithParity, "SpannedStripesWithParity"}, 160 }); 161 162 NLOHMANN_JSON_SERIALIZE_ENUM(EncryptionTypes, { 163 {EncryptionTypes::Invalid, "Invalid"}, 164 {EncryptionTypes::NativeDriveEncryption, "NativeDriveEncryption"}, 165 {EncryptionTypes::ControllerAssisted, "ControllerAssisted"}, 166 {EncryptionTypes::SoftwareAssisted, "SoftwareAssisted"}, 167 }); 168 169 NLOHMANN_JSON_SERIALIZE_ENUM(WriteHoleProtectionPolicyType, { 170 {WriteHoleProtectionPolicyType::Invalid, "Invalid"}, 171 {WriteHoleProtectionPolicyType::Off, "Off"}, 172 {WriteHoleProtectionPolicyType::Journaling, "Journaling"}, 173 {WriteHoleProtectionPolicyType::DistributedLog, "DistributedLog"}, 174 {WriteHoleProtectionPolicyType::Oem, "Oem"}, 175 }); 176 177 NLOHMANN_JSON_SERIALIZE_ENUM(VolumeUsageType, { 178 {VolumeUsageType::Invalid, "Invalid"}, 179 {VolumeUsageType::Data, "Data"}, 180 {VolumeUsageType::SystemData, "SystemData"}, 181 {VolumeUsageType::CacheOnly, "CacheOnly"}, 182 {VolumeUsageType::SystemReserve, "SystemReserve"}, 183 {VolumeUsageType::ReplicationReserve, "ReplicationReserve"}, 184 }); 185 186 NLOHMANN_JSON_SERIALIZE_ENUM(ReadCachePolicyType, { 187 {ReadCachePolicyType::Invalid, "Invalid"}, 188 {ReadCachePolicyType::ReadAhead, "ReadAhead"}, 189 {ReadCachePolicyType::AdaptiveReadAhead, "AdaptiveReadAhead"}, 190 {ReadCachePolicyType::Off, "Off"}, 191 }); 192 193 NLOHMANN_JSON_SERIALIZE_ENUM(WriteCachePolicyType, { 194 {WriteCachePolicyType::Invalid, "Invalid"}, 195 {WriteCachePolicyType::WriteThrough, "WriteThrough"}, 196 {WriteCachePolicyType::ProtectedWriteBack, "ProtectedWriteBack"}, 197 {WriteCachePolicyType::UnprotectedWriteBack, "UnprotectedWriteBack"}, 198 {WriteCachePolicyType::Off, "Off"}, 199 }); 200 201 NLOHMANN_JSON_SERIALIZE_ENUM(WriteCacheStateType, { 202 {WriteCacheStateType::Invalid, "Invalid"}, 203 {WriteCacheStateType::Unprotected, "Unprotected"}, 204 {WriteCacheStateType::Protected, "Protected"}, 205 {WriteCacheStateType::Degraded, "Degraded"}, 206 }); 207 208 NLOHMANN_JSON_SERIALIZE_ENUM(LBAFormatType, { 209 {LBAFormatType::Invalid, "Invalid"}, 210 {LBAFormatType::LBAFormat0, "LBAFormat0"}, 211 {LBAFormatType::LBAFormat1, "LBAFormat1"}, 212 {LBAFormatType::LBAFormat2, "LBAFormat2"}, 213 {LBAFormatType::LBAFormat3, "LBAFormat3"}, 214 {LBAFormatType::LBAFormat4, "LBAFormat4"}, 215 {LBAFormatType::LBAFormat5, "LBAFormat5"}, 216 {LBAFormatType::LBAFormat6, "LBAFormat6"}, 217 {LBAFormatType::LBAFormat7, "LBAFormat7"}, 218 {LBAFormatType::LBAFormat8, "LBAFormat8"}, 219 {LBAFormatType::LBAFormat9, "LBAFormat9"}, 220 {LBAFormatType::LBAFormat10, "LBAFormat10"}, 221 {LBAFormatType::LBAFormat11, "LBAFormat11"}, 222 {LBAFormatType::LBAFormat12, "LBAFormat12"}, 223 {LBAFormatType::LBAFormat13, "LBAFormat13"}, 224 {LBAFormatType::LBAFormat14, "LBAFormat14"}, 225 {LBAFormatType::LBAFormat15, "LBAFormat15"}, 226 }); 227 228 } 229 // clang-format on 230