blob: c1361d3d5db5b8df9ecb971b2720e4861f8e71c0 [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>
Alexander Hansende7abb92025-11-14 14:40:50 +01005#include <xyz/openbmc_project/Network/IP/common.hpp>
Peter Foley0893ca32023-10-19 16:19:55 -04006
7#include <cstdint>
8
Alexander Hansende7abb92025-11-14 14:40:50 +01009using NetworkIP = sdbusplus::common::xyz::openbmc_project::network::IP;
10
Peter Foley0893ca32023-10-19 16:19:55 -040011namespace ipmi
12{
13namespace transport
14{
15
16using stdplus::operator""_zsv;
17
18// D-Bus Network Daemon definitions
19constexpr auto PATH_ROOT = "/xyz/openbmc_project/network"_zsv;
20constexpr auto INTF_ETHERNET = "xyz.openbmc_project.Network.EthernetInterface";
Peter Foley0893ca32023-10-19 16:19:55 -040021constexpr auto INTF_IP_CREATE = "xyz.openbmc_project.Network.IP.Create";
22constexpr auto INTF_MAC = "xyz.openbmc_project.Network.MACAddress";
23constexpr auto INTF_NEIGHBOR = "xyz.openbmc_project.Network.Neighbor";
24constexpr auto INTF_NEIGHBOR_CREATE_STATIC =
25 "xyz.openbmc_project.Network.Neighbor.CreateStatic";
26constexpr auto INTF_VLAN = "xyz.openbmc_project.Network.VLAN";
27constexpr auto INTF_VLAN_CREATE = "xyz.openbmc_project.Network.VLAN.Create";
28
29/** @brief IPMI LAN Parameters */
30enum class LanParam : uint8_t
31{
32 SetStatus = 0,
33 AuthSupport = 1,
34 AuthEnables = 2,
35 IP = 3,
36 IPSrc = 4,
37 MAC = 5,
38 SubnetMask = 6,
39 Gateway1 = 12,
40 Gateway1MAC = 13,
41 VLANId = 20,
42 CiphersuiteSupport = 22,
43 CiphersuiteEntries = 23,
44 cipherSuitePrivilegeLevels = 24,
45 IPFamilySupport = 50,
46 IPFamilyEnables = 51,
47 IPv6Status = 55,
48 IPv6StaticAddresses = 56,
49 IPv6DynamicAddresses = 59,
50 IPv6RouterControl = 64,
51 IPv6StaticRouter1IP = 65,
52 IPv6StaticRouter1MAC = 66,
53 IPv6StaticRouter1PrefixLength = 67,
54 IPv6StaticRouter1PrefixValue = 68,
55};
56
57/** @brief IPMI IP Origin Types */
58enum class IPSrc : uint8_t
59{
60 Unspecified = 0,
61 Static = 1,
62 DHCP = 2,
63 BIOS = 3,
64 BMC = 4,
65};
66
67/** @brief IPMI Set Status */
68enum class SetStatus : uint8_t
69{
70 Complete = 0,
71 InProgress = 1,
72 Commit = 2,
73};
74
75/** @brief IPMI Family Suport Bits */
76namespace IPFamilySupportFlag
77{
78constexpr uint8_t IPv6Only = 0;
79constexpr uint8_t DualStack = 1;
80constexpr uint8_t IPv6Alerts = 2;
81} // namespace IPFamilySupportFlag
82
83/** @brief IPMI IPFamily Enables Flag */
84enum class IPFamilyEnables : uint8_t
85{
86 IPv4Only = 0,
87 IPv6Only = 1,
88 DualStack = 2,
89};
90
91/** @brief IPMI IPv6 Dyanmic Status Bits */
92namespace IPv6StatusFlag
93{
94constexpr uint8_t DHCP = 0;
95constexpr uint8_t SLAAC = 1;
96}; // namespace IPv6StatusFlag
97
98/** @brief IPMI IPv6 Source */
99enum class IPv6Source : uint8_t
100{
101 Static = 0,
102 SLAAC = 1,
103 DHCP = 2,
104};
105
106/** @brief IPMI IPv6 Address Status */
107enum class IPv6AddressStatus : uint8_t
108{
109 Active = 0,
110 Disabled = 1,
111};
112
113namespace IPv6RouterControlFlag
114{
115constexpr uint8_t Static = 0;
116constexpr uint8_t Dynamic = 1;
117}; // namespace IPv6RouterControlFlag
118
Peter Foley0893ca32023-10-19 16:19:55 -0400119// VLANs are a 12-bit value
120constexpr uint16_t VLAN_VALUE_MASK = 0x0fff;
121constexpr uint16_t VLAN_ENABLE_FLAG = 0x8000;
122
Chanh Nguyen8bd9a9b2024-11-08 09:08:56 +0000123// Arbitrary v4 Address Limits
124constexpr uint8_t MAX_IPV4_ADDRESSES = 2;
125
Peter Foley0893ca32023-10-19 16:19:55 -0400126// 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
Peter Foley0893ca32023-10-19 16:19:55 -0400153} // namespace transport
154} // namespace ipmi