blob: b9ce46bed9ed9547b11368ad9d1d85bb0bb5ef06 [file] [log] [blame]
Peter Foley0893ca32023-10-19 16:19:55 -04001#pragma once
2
3#include <ipmid/api-types.hpp>
4#include <stdplus/zstring_view.hpp>
5
6#include <cstdint>
7
8namespace ipmi
9{
10namespace transport
11{
12
13using stdplus::operator""_zsv;
14
15// D-Bus Network Daemon definitions
16constexpr auto PATH_ROOT = "/xyz/openbmc_project/network"_zsv;
17constexpr auto INTF_ETHERNET = "xyz.openbmc_project.Network.EthernetInterface";
18constexpr auto INTF_IP = "xyz.openbmc_project.Network.IP";
19constexpr auto INTF_IP_CREATE = "xyz.openbmc_project.Network.IP.Create";
20constexpr auto INTF_MAC = "xyz.openbmc_project.Network.MACAddress";
21constexpr auto INTF_NEIGHBOR = "xyz.openbmc_project.Network.Neighbor";
22constexpr auto INTF_NEIGHBOR_CREATE_STATIC =
23 "xyz.openbmc_project.Network.Neighbor.CreateStatic";
24constexpr auto INTF_VLAN = "xyz.openbmc_project.Network.VLAN";
25constexpr auto INTF_VLAN_CREATE = "xyz.openbmc_project.Network.VLAN.Create";
26
27/** @brief IPMI LAN Parameters */
28enum class LanParam : uint8_t
29{
30 SetStatus = 0,
31 AuthSupport = 1,
32 AuthEnables = 2,
33 IP = 3,
34 IPSrc = 4,
35 MAC = 5,
36 SubnetMask = 6,
37 Gateway1 = 12,
38 Gateway1MAC = 13,
39 VLANId = 20,
40 CiphersuiteSupport = 22,
41 CiphersuiteEntries = 23,
42 cipherSuitePrivilegeLevels = 24,
43 IPFamilySupport = 50,
44 IPFamilyEnables = 51,
45 IPv6Status = 55,
46 IPv6StaticAddresses = 56,
47 IPv6DynamicAddresses = 59,
48 IPv6RouterControl = 64,
49 IPv6StaticRouter1IP = 65,
50 IPv6StaticRouter1MAC = 66,
51 IPv6StaticRouter1PrefixLength = 67,
52 IPv6StaticRouter1PrefixValue = 68,
53};
54
55/** @brief IPMI IP Origin Types */
56enum class IPSrc : uint8_t
57{
58 Unspecified = 0,
59 Static = 1,
60 DHCP = 2,
61 BIOS = 3,
62 BMC = 4,
63};
64
65/** @brief IPMI Set Status */
66enum class SetStatus : uint8_t
67{
68 Complete = 0,
69 InProgress = 1,
70 Commit = 2,
71};
72
73/** @brief IPMI Family Suport Bits */
74namespace IPFamilySupportFlag
75{
76constexpr uint8_t IPv6Only = 0;
77constexpr uint8_t DualStack = 1;
78constexpr uint8_t IPv6Alerts = 2;
79} // namespace IPFamilySupportFlag
80
81/** @brief IPMI IPFamily Enables Flag */
82enum class IPFamilyEnables : uint8_t
83{
84 IPv4Only = 0,
85 IPv6Only = 1,
86 DualStack = 2,
87};
88
89/** @brief IPMI IPv6 Dyanmic Status Bits */
90namespace IPv6StatusFlag
91{
92constexpr uint8_t DHCP = 0;
93constexpr uint8_t SLAAC = 1;
94}; // namespace IPv6StatusFlag
95
96/** @brief IPMI IPv6 Source */
97enum class IPv6Source : uint8_t
98{
99 Static = 0,
100 SLAAC = 1,
101 DHCP = 2,
102};
103
104/** @brief IPMI IPv6 Address Status */
105enum class IPv6AddressStatus : uint8_t
106{
107 Active = 0,
108 Disabled = 1,
109};
110
111namespace IPv6RouterControlFlag
112{
113constexpr uint8_t Static = 0;
114constexpr uint8_t Dynamic = 1;
115}; // namespace IPv6RouterControlFlag
116
117// LAN Handler specific response codes
118constexpr Cc ccParamNotSupported = 0x80;
119constexpr Cc ccParamSetLocked = 0x81;
120constexpr Cc ccParamReadOnly = 0x82;
121
122// VLANs are a 12-bit value
123constexpr uint16_t VLAN_VALUE_MASK = 0x0fff;
124constexpr uint16_t VLAN_ENABLE_FLAG = 0x8000;
125
126// Arbitrary v6 Address Limits to prevent too much output in ipmitool
127constexpr uint8_t MAX_IPV6_STATIC_ADDRESSES = 15;
128constexpr uint8_t MAX_IPV6_DYNAMIC_ADDRESSES = 15;
129
130// Prefix length limits of phosphor-networkd
131constexpr uint8_t MIN_IPV4_PREFIX_LENGTH = 1;
132constexpr uint8_t MAX_IPV4_PREFIX_LENGTH = 32;
133constexpr uint8_t MIN_IPV6_PREFIX_LENGTH = 1;
134constexpr uint8_t MAX_IPV6_PREFIX_LENGTH = 128;
135
136/** @enum SolConfParam
137 *
138 * using for Set/Get SOL configuration parameters command.
139 */
140enum class SolConfParam : uint8_t
141{
142 Progress, //!< Set In Progress.
143 Enable, //!< SOL Enable.
144 Authentication, //!< SOL Authentication.
145 Accumulate, //!< Character Accumulate Interval & Send Threshold.
146 Retry, //!< SOL Retry.
147 NonVbitrate, //!< SOL non-volatile bit rate.
148 Vbitrate, //!< SOL volatile bit rate.
149 Channel, //!< SOL payload channel.
150 Port, //!< SOL payload port.
151};
152
153constexpr uint8_t ipmiCCParamNotSupported = 0x80;
154constexpr uint8_t ipmiCCWriteReadParameter = 0x82;
155
156} // namespace transport
157} // namespace ipmi