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