blob: 69456bc00d31d8a5e373e0f9ea91a42fb0e5a9c7 [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
Peter Foley0893ca32023-10-19 16:19:55 -0400117// VLANs are a 12-bit value
118constexpr uint16_t VLAN_VALUE_MASK = 0x0fff;
119constexpr uint16_t VLAN_ENABLE_FLAG = 0x8000;
120
Chanh Nguyen8bd9a9b2024-11-08 09:08:56 +0000121// Arbitrary v4 Address Limits
122constexpr uint8_t MAX_IPV4_ADDRESSES = 2;
123
Peter Foley0893ca32023-10-19 16:19:55 -0400124// Arbitrary v6 Address Limits to prevent too much output in ipmitool
125constexpr uint8_t MAX_IPV6_STATIC_ADDRESSES = 15;
126constexpr uint8_t MAX_IPV6_DYNAMIC_ADDRESSES = 15;
127
128// Prefix length limits of phosphor-networkd
129constexpr uint8_t MIN_IPV4_PREFIX_LENGTH = 1;
130constexpr uint8_t MAX_IPV4_PREFIX_LENGTH = 32;
131constexpr uint8_t MIN_IPV6_PREFIX_LENGTH = 1;
132constexpr uint8_t MAX_IPV6_PREFIX_LENGTH = 128;
133
134/** @enum SolConfParam
135 *
136 * using for Set/Get SOL configuration parameters command.
137 */
138enum class SolConfParam : uint8_t
139{
140 Progress, //!< Set In Progress.
141 Enable, //!< SOL Enable.
142 Authentication, //!< SOL Authentication.
143 Accumulate, //!< Character Accumulate Interval & Send Threshold.
144 Retry, //!< SOL Retry.
145 NonVbitrate, //!< SOL non-volatile bit rate.
146 Vbitrate, //!< SOL volatile bit rate.
147 Channel, //!< SOL payload channel.
148 Port, //!< SOL payload port.
149};
150
Peter Foley0893ca32023-10-19 16:19:55 -0400151} // namespace transport
152} // namespace ipmi