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