1 #pragma once
2 
3 #include <cstdint>
4 #include <ipmid/api-types.hpp>
5 
6 namespace ipmi
7 {
8 namespace transport
9 {
10 
11 /** @brief IPMI LAN Parameters */
12 enum class LanParam : uint8_t
13 {
14     SetStatus = 0,
15     AuthSupport = 1,
16     AuthEnables = 2,
17     IP = 3,
18     IPSrc = 4,
19     MAC = 5,
20     SubnetMask = 6,
21     Gateway1 = 12,
22     Gateway1MAC = 13,
23     VLANId = 20,
24     CiphersuiteSupport = 22,
25     CiphersuiteEntries = 23,
26     cipherSuitePrivilegeLevels = 24,
27     IPFamilySupport = 50,
28     IPFamilyEnables = 51,
29     IPv6Status = 55,
30     IPv6StaticAddresses = 56,
31     IPv6DynamicAddresses = 59,
32     IPv6RouterControl = 64,
33     IPv6StaticRouter1IP = 65,
34     IPv6StaticRouter1MAC = 66,
35     IPv6StaticRouter1PrefixLength = 67,
36     IPv6StaticRouter1PrefixValue = 68,
37 };
38 
39 /** @brief IPMI IP Origin Types */
40 enum class IPSrc : uint8_t
41 {
42     Unspecified = 0,
43     Static = 1,
44     DHCP = 2,
45     BIOS = 3,
46     BMC = 4,
47 };
48 
49 /** @brief IPMI Set Status */
50 enum class SetStatus : uint8_t
51 {
52     Complete = 0,
53     InProgress = 1,
54     Commit = 2,
55 };
56 
57 /** @brief IPMI Family Suport Bits */
58 namespace IPFamilySupportFlag
59 {
60 constexpr uint8_t IPv6Only = 0;
61 constexpr uint8_t DualStack = 1;
62 constexpr uint8_t IPv6Alerts = 2;
63 } // namespace IPFamilySupportFlag
64 
65 /** @brief IPMI IPFamily Enables Flag */
66 enum class IPFamilyEnables : uint8_t
67 {
68     IPv4Only = 0,
69     IPv6Only = 1,
70     DualStack = 2,
71 };
72 
73 /** @brief IPMI IPv6 Dyanmic Status Bits */
74 namespace IPv6StatusFlag
75 {
76 constexpr uint8_t DHCP = 0;
77 constexpr uint8_t SLAAC = 1;
78 }; // namespace IPv6StatusFlag
79 
80 /** @brief IPMI IPv6 Source */
81 enum class IPv6Source : uint8_t
82 {
83     Static = 0,
84     SLAAC = 1,
85     DHCP = 2,
86 };
87 
88 /** @brief IPMI IPv6 Address Status */
89 enum class IPv6AddressStatus : uint8_t
90 {
91     Active = 0,
92     Disabled = 1,
93 };
94 
95 namespace IPv6RouterControlFlag
96 {
97 constexpr uint8_t Static = 0;
98 constexpr uint8_t Dynamic = 1;
99 }; // namespace IPv6RouterControlFlag
100 
101 // LAN Handler specific response codes
102 constexpr Cc ccParamNotSupported = 0x80;
103 constexpr Cc ccParamSetLocked = 0x81;
104 constexpr Cc ccParamReadOnly = 0x82;
105 
106 // VLANs are a 12-bit value
107 constexpr uint16_t VLAN_VALUE_MASK = 0x0fff;
108 constexpr uint16_t VLAN_ENABLE_FLAG = 0x8000;
109 
110 // Arbitrary v6 Address Limits to prevent too much output in ipmitool
111 constexpr uint8_t MAX_IPV6_STATIC_ADDRESSES = 15;
112 constexpr uint8_t MAX_IPV6_DYNAMIC_ADDRESSES = 15;
113 
114 } // namespace transport
115 } // namespace ipmi
116