1 #pragma once
2 #include <nlohmann/json.hpp>
3 
4 namespace network_port
5 {
6 // clang-format off
7 
8 enum class LinkStatus{
9     Invalid,
10     Down,
11     Up,
12     Starting,
13     Training,
14 };
15 
16 enum class LinkNetworkTechnology{
17     Invalid,
18     Ethernet,
19     InfiniBand,
20     FibreChannel,
21 };
22 
23 enum class SupportedEthernetCapabilities{
24     Invalid,
25     WakeOnLAN,
26     EEE,
27 };
28 
29 enum class FlowControl{
30     Invalid,
31     None,
32     TX,
33     RX,
34     TX_RX,
35 };
36 
37 enum class PortConnectionType{
38     Invalid,
39     NotConnected,
40     NPort,
41     PointToPoint,
42     PrivateLoop,
43     PublicLoop,
44     Generic,
45     ExtenderFabric,
46 };
47 
48 NLOHMANN_JSON_SERIALIZE_ENUM(LinkStatus, {
49     {LinkStatus::Invalid, "Invalid"},
50     {LinkStatus::Down, "Down"},
51     {LinkStatus::Up, "Up"},
52     {LinkStatus::Starting, "Starting"},
53     {LinkStatus::Training, "Training"},
54 });
55 
56 NLOHMANN_JSON_SERIALIZE_ENUM(LinkNetworkTechnology, {
57     {LinkNetworkTechnology::Invalid, "Invalid"},
58     {LinkNetworkTechnology::Ethernet, "Ethernet"},
59     {LinkNetworkTechnology::InfiniBand, "InfiniBand"},
60     {LinkNetworkTechnology::FibreChannel, "FibreChannel"},
61 });
62 
63 NLOHMANN_JSON_SERIALIZE_ENUM(SupportedEthernetCapabilities, {
64     {SupportedEthernetCapabilities::Invalid, "Invalid"},
65     {SupportedEthernetCapabilities::WakeOnLAN, "WakeOnLAN"},
66     {SupportedEthernetCapabilities::EEE, "EEE"},
67 });
68 
69 NLOHMANN_JSON_SERIALIZE_ENUM(FlowControl, {
70     {FlowControl::Invalid, "Invalid"},
71     {FlowControl::None, "None"},
72     {FlowControl::TX, "TX"},
73     {FlowControl::RX, "RX"},
74     {FlowControl::TX_RX, "TX_RX"},
75 });
76 
77 NLOHMANN_JSON_SERIALIZE_ENUM(PortConnectionType, {
78     {PortConnectionType::Invalid, "Invalid"},
79     {PortConnectionType::NotConnected, "NotConnected"},
80     {PortConnectionType::NPort, "NPort"},
81     {PortConnectionType::PointToPoint, "PointToPoint"},
82     {PortConnectionType::PrivateLoop, "PrivateLoop"},
83     {PortConnectionType::PublicLoop, "PublicLoop"},
84     {PortConnectionType::Generic, "Generic"},
85     {PortConnectionType::ExtenderFabric, "ExtenderFabric"},
86 });
87 
88 }
89 // clang-format on
90