1 #pragma once
2 #include <nlohmann/json.hpp>
3 
4 namespace virtual_media
5 {
6 // clang-format off
7 
8 enum class MediaType{
9     Invalid,
10     CD,
11     Floppy,
12     USBStick,
13     DVD,
14 };
15 
16 enum class ConnectedVia{
17     Invalid,
18     NotConnected,
19     URI,
20     Applet,
21     Oem,
22 };
23 
24 enum class TransferProtocolType{
25     Invalid,
26     CIFS,
27     FTP,
28     SFTP,
29     HTTP,
30     HTTPS,
31     NFS,
32     SCP,
33     TFTP,
34     OEM,
35 };
36 
37 enum class TransferMethod{
38     Invalid,
39     Stream,
40     Upload,
41 };
42 
43 enum class EjectPolicy{
44     Invalid,
45     OnPowerOff,
46     Session,
47     Timed,
48     AfterUse,
49     Persistent,
50 };
51 
52 NLOHMANN_JSON_SERIALIZE_ENUM(MediaType, {
53     {MediaType::Invalid, "Invalid"},
54     {MediaType::CD, "CD"},
55     {MediaType::Floppy, "Floppy"},
56     {MediaType::USBStick, "USBStick"},
57     {MediaType::DVD, "DVD"},
58 });
59 
60 NLOHMANN_JSON_SERIALIZE_ENUM(ConnectedVia, {
61     {ConnectedVia::Invalid, "Invalid"},
62     {ConnectedVia::NotConnected, "NotConnected"},
63     {ConnectedVia::URI, "URI"},
64     {ConnectedVia::Applet, "Applet"},
65     {ConnectedVia::Oem, "Oem"},
66 });
67 
68 NLOHMANN_JSON_SERIALIZE_ENUM(TransferProtocolType, {
69     {TransferProtocolType::Invalid, "Invalid"},
70     {TransferProtocolType::CIFS, "CIFS"},
71     {TransferProtocolType::FTP, "FTP"},
72     {TransferProtocolType::SFTP, "SFTP"},
73     {TransferProtocolType::HTTP, "HTTP"},
74     {TransferProtocolType::HTTPS, "HTTPS"},
75     {TransferProtocolType::NFS, "NFS"},
76     {TransferProtocolType::SCP, "SCP"},
77     {TransferProtocolType::TFTP, "TFTP"},
78     {TransferProtocolType::OEM, "OEM"},
79 });
80 
81 NLOHMANN_JSON_SERIALIZE_ENUM(TransferMethod, {
82     {TransferMethod::Invalid, "Invalid"},
83     {TransferMethod::Stream, "Stream"},
84     {TransferMethod::Upload, "Upload"},
85 });
86 
87 NLOHMANN_JSON_SERIALIZE_ENUM(EjectPolicy, {
88     {EjectPolicy::Invalid, "Invalid"},
89     {EjectPolicy::OnPowerOff, "OnPowerOff"},
90     {EjectPolicy::Session, "Session"},
91     {EjectPolicy::Timed, "Timed"},
92     {EjectPolicy::AfterUse, "AfterUse"},
93     {EjectPolicy::Persistent, "Persistent"},
94 });
95 
96 }
97 // clang-format on
98