| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 1 | /* | 
 | 2 | // Copyright (c) 2018 Intel Corporation | 
 | 3 | // | 
 | 4 | // Licensed under the Apache License, Version 2.0 (the "License"); | 
 | 5 | // you may not use this file except in compliance with the License. | 
 | 6 | // You may obtain a copy of the License at | 
 | 7 | // | 
 | 8 | //      http://www.apache.org/licenses/LICENSE-2.0 | 
 | 9 | // | 
 | 10 | // Unless required by applicable law or agreed to in writing, software | 
 | 11 | // distributed under the License is distributed on an "AS IS" BASIS, | 
 | 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
 | 13 | // See the License for the specific language governing permissions and | 
 | 14 | // limitations under the License. | 
 | 15 | */ | 
 | 16 | #pragma once | 
| Jayaprakash Mutyala | 70bd063 | 2020-10-23 06:24:55 +0000 | [diff] [blame] | 17 | #include <openssl/crypto.h> | 
 | 18 |  | 
| NITIN SHARMA | b541a5a | 2019-07-18 12:46:59 +0000 | [diff] [blame] | 19 | #include <ipmid/api.hpp> | 
| Patrick Williams | fbc6c9d | 2023-05-10 07:50:16 -0500 | [diff] [blame] | 20 |  | 
 | 21 | #include <array> | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 22 | #include <string> | 
 | 23 |  | 
 | 24 | namespace ipmi | 
 | 25 | { | 
 | 26 |  | 
 | 27 | static constexpr uint8_t maxIpmiChannels = 16; | 
| Richard Marian Thomaiyar | a39208e | 2018-12-08 17:27:11 +0530 | [diff] [blame] | 28 | static constexpr uint8_t currentChNum = 0xE; | 
| Vernon Mauery | 735ee95 | 2019-02-15 13:38:52 -0800 | [diff] [blame] | 29 | static constexpr uint8_t invalidChannel = 0xff; | 
| George Liu | 2543bd5 | 2025-07-08 15:29:42 +0800 | [diff] [blame] | 30 |  | 
 | 31 | constexpr Cc ccActionNotSupportedForChannel = 0x82; | 
 | 32 | constexpr Cc ccAccessModeNotSupportedForChannel = 0x83; | 
 | 33 |  | 
 | 34 | static inline auto responseActionNotSupportedForChannel() | 
 | 35 | { | 
 | 36 |     return response(ccActionNotSupportedForChannel); | 
 | 37 | } | 
 | 38 |  | 
 | 39 | static inline auto responseAccessModeNotSupportedForChannel() | 
 | 40 | { | 
 | 41 |     return response(ccAccessModeNotSupportedForChannel); | 
 | 42 | } | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 43 |  | 
| Richard Marian Thomaiyar | 6e1ba9e | 2018-11-29 06:29:21 +0530 | [diff] [blame] | 44 | /** | 
| Sumanth Bhat | e4e633e | 2019-05-14 12:13:57 +0000 | [diff] [blame] | 45 |  * @array of privilege levels | 
 | 46 |  */ | 
 | 47 | extern const std::array<std::string, PRIVILEGE_OEM + 1> privList; | 
 | 48 |  | 
 | 49 | /** | 
| Richard Marian Thomaiyar | 6e1ba9e | 2018-11-29 06:29:21 +0530 | [diff] [blame] | 50 |  * @enum Channel Protocol Type (refer spec sec 6.4) | 
 | 51 |  */ | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 52 | enum class EChannelProtocolType : uint8_t | 
 | 53 | { | 
 | 54 |     na = 0x00, | 
 | 55 |     ipmbV10 = 0x01, | 
 | 56 |     icmbV11 = 0x02, | 
 | 57 |     reserved = 0x03, | 
 | 58 |     ipmiSmbus = 0x04, | 
 | 59 |     kcs = 0x05, | 
 | 60 |     smic = 0x06, | 
 | 61 |     bt10 = 0x07, | 
 | 62 |     bt15 = 0x08, | 
 | 63 |     tMode = 0x09, | 
 | 64 |     oem = 0x1C, | 
 | 65 | }; | 
 | 66 |  | 
| Richard Marian Thomaiyar | 6e1ba9e | 2018-11-29 06:29:21 +0530 | [diff] [blame] | 67 | /** | 
 | 68 |  * @enum Channel Medium Type (refer spec sec 6.5) | 
 | 69 |  */ | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 70 | enum class EChannelMediumType : uint8_t | 
 | 71 | { | 
 | 72 |     reserved = 0x00, | 
 | 73 |     ipmb = 0x01, | 
 | 74 |     icmbV10 = 0x02, | 
 | 75 |     icmbV09 = 0x03, | 
 | 76 |     lan8032 = 0x04, | 
 | 77 |     serial = 0x05, | 
 | 78 |     otherLan = 0x06, | 
 | 79 |     pciSmbus = 0x07, | 
 | 80 |     smbusV11 = 0x08, | 
 | 81 |     smbusV20 = 0x09, | 
 | 82 |     usbV1x = 0x0A, | 
 | 83 |     usbV2x = 0x0B, | 
 | 84 |     systemInterface = 0x0C, | 
 | 85 |     oem = 0x60, | 
 | 86 |     unknown = 0x82, | 
 | 87 | }; | 
 | 88 |  | 
| Richard Marian Thomaiyar | 6e1ba9e | 2018-11-29 06:29:21 +0530 | [diff] [blame] | 89 | /** | 
 | 90 |  * @enum Channel Session Type (refer spec sec 22.24 - | 
 | 91 |  * response data byte 5) | 
 | 92 |  */ | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 93 | enum class EChannelSessSupported : uint8_t | 
 | 94 | { | 
 | 95 |     none = 0, | 
 | 96 |     single = 1, | 
 | 97 |     multi = 2, | 
 | 98 |     any = 3, | 
 | 99 | }; | 
 | 100 |  | 
| Richard Marian Thomaiyar | 6e1ba9e | 2018-11-29 06:29:21 +0530 | [diff] [blame] | 101 | /** | 
 | 102 |  * @enum Channel Access Mode (refer spec sec 6.6) | 
 | 103 |  */ | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 104 | enum class EChannelAccessMode : uint8_t | 
 | 105 | { | 
 | 106 |     disabled = 0, | 
 | 107 |     preboot = 1, | 
 | 108 |     alwaysAvail = 2, | 
 | 109 |     shared = 3, | 
 | 110 | }; | 
 | 111 |  | 
| Richard Marian Thomaiyar | 6e1ba9e | 2018-11-29 06:29:21 +0530 | [diff] [blame] | 112 | /** | 
 | 113 |  * @enum Authentication Types (refer spec sec 13.6 - IPMI | 
 | 114 |  * Session Header) | 
 | 115 |  */ | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 116 | enum class EAuthType : uint8_t | 
 | 117 | { | 
 | 118 |     none = (1 << 0x0), | 
 | 119 |     md2 = (1 << 0x1), | 
 | 120 |     md5 = (1 << 0x2), | 
 | 121 |     reserved = (1 << 0x3), | 
 | 122 |     straightPasswd = (1 << 0x4), | 
 | 123 |     oem = (1 << 0x5), | 
 | 124 | }; | 
 | 125 |  | 
| Saravanan Palanisamy | b5a0f16 | 2019-03-04 18:34:44 +0530 | [diff] [blame] | 126 | // TODO: Remove duplicate 'PayloadType' definition from netipmid's message.hpp | 
 | 127 | // to phosphor-ipmi-host/include | 
 | 128 | /** | 
 | 129 |  * @enum Payload Types (refer spec sec 13.27.3) | 
 | 130 |  */ | 
 | 131 | enum class PayloadType : uint8_t | 
 | 132 | { | 
 | 133 |     IPMI = 0x00, | 
 | 134 |     SOL = 0x01, | 
 | 135 |     OPEN_SESSION_REQUEST = 0x10, | 
 | 136 |     OPEN_SESSION_RESPONSE = 0x11, | 
 | 137 |     RAKP1 = 0x12, | 
 | 138 |     RAKP2 = 0x13, | 
 | 139 |     RAKP3 = 0x14, | 
 | 140 |     RAKP4 = 0x15, | 
 | 141 |     INVALID = 0xFF, | 
 | 142 | }; | 
 | 143 |  | 
| Richard Marian Thomaiyar | 6e1ba9e | 2018-11-29 06:29:21 +0530 | [diff] [blame] | 144 | /** | 
 | 145 |  * @enum Access mode for channel access set/get (refer spec | 
 | 146 |  * sec 22.22 - request byte 2[7:6]) | 
 | 147 |  */ | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 148 | typedef enum | 
 | 149 | { | 
 | 150 |     doNotSet = 0x00, | 
 | 151 |     nvData = 0x01, | 
 | 152 |     activeData = 0x02, | 
 | 153 |     reserved = 0x03, | 
 | 154 | } EChannelActionType; | 
 | 155 |  | 
| Richard Marian Thomaiyar | 6e1ba9e | 2018-11-29 06:29:21 +0530 | [diff] [blame] | 156 | /** | 
 | 157 |  * @enum Access set flag to determine changes that has to be updated | 
 | 158 |  * in channel access data configuration. | 
 | 159 |  */ | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 160 | enum AccessSetFlag | 
 | 161 | { | 
 | 162 |     setAccessMode = (1 << 0), | 
 | 163 |     setUserAuthEnabled = (1 << 1), | 
 | 164 |     setMsgAuthEnabled = (1 << 2), | 
 | 165 |     setAlertingEnabled = (1 << 3), | 
 | 166 |     setPrivLimit = (1 << 4), | 
 | 167 | }; | 
 | 168 |  | 
| Richard Marian Thomaiyar | 6e1ba9e | 2018-11-29 06:29:21 +0530 | [diff] [blame] | 169 | /** @struct ChannelAccess | 
 | 170 |  * | 
 | 171 |  *  Structure to store channel access related information, defined in IPMI | 
 | 172 |  * specification and used in Get / Set channel access (refer spec sec 22.22 | 
 | 173 |  * & 22.23) | 
 | 174 |  */ | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 175 | struct ChannelAccess | 
 | 176 | { | 
 | 177 |     uint8_t accessMode; | 
 | 178 |     bool userAuthDisabled; | 
 | 179 |     bool perMsgAuthDisabled; | 
 | 180 |     bool alertingDisabled; | 
 | 181 |     uint8_t privLimit; | 
 | 182 | }; | 
 | 183 |  | 
| Richard Marian Thomaiyar | 6e1ba9e | 2018-11-29 06:29:21 +0530 | [diff] [blame] | 184 | /** @struct ChannelInfo | 
 | 185 |  * | 
 | 186 |  *  Structure to store data about channel information, which identifies each | 
 | 187 |  *  channel type and information as defined in IPMI specification. (refer spec | 
 | 188 |  * sec 22.22 & 22.23) | 
 | 189 |  */ | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 190 | struct ChannelInfo | 
 | 191 | { | 
 | 192 |     uint8_t mediumType; | 
 | 193 |     uint8_t protocolType; | 
 | 194 |     uint8_t sessionSupported; | 
 | 195 |     bool isIpmi; // Is session IPMI | 
 | 196 |     // This is used in Get LAN Configuration parameter. | 
 | 197 |     // This holds the supported AuthTypes for a given channel. | 
 | 198 |     uint8_t authTypeSupported; | 
 | 199 | }; | 
 | 200 |  | 
 | 201 | /** @brief determines valid channel | 
 | 202 |  * | 
 | 203 |  *  @param[in] chNum- channel number | 
 | 204 |  * | 
 | 205 |  *  @return true if valid, false otherwise | 
 | 206 |  */ | 
| Richard Marian Thomaiyar | a45cb34 | 2018-12-03 15:08:59 +0530 | [diff] [blame] | 207 | bool isValidChannel(const uint8_t chNum); | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 208 |  | 
 | 209 | /** @brief determines whether channel device exist | 
 | 210 |  * | 
 | 211 |  *  @param[in] chNum - channel number | 
 | 212 |  * | 
 | 213 |  *  @return true if valid, false otherwise | 
 | 214 |  */ | 
| Richard Marian Thomaiyar | a45cb34 | 2018-12-03 15:08:59 +0530 | [diff] [blame] | 215 | bool doesDeviceExist(const uint8_t chNum); | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 216 |  | 
 | 217 | /** @brief determines whether privilege limit is valid | 
 | 218 |  * | 
 | 219 |  *  @param[in] privLimit - Privilege limit | 
 | 220 |  * | 
 | 221 |  *  @return true if valid, false otherwise | 
 | 222 |  */ | 
| Richard Marian Thomaiyar | a45cb34 | 2018-12-03 15:08:59 +0530 | [diff] [blame] | 223 | bool isValidPrivLimit(const uint8_t privLimit); | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 224 |  | 
 | 225 | /** @brief determines whether access mode  is valid | 
 | 226 |  * | 
 | 227 |  *  @param[in] accessMode - Access mode | 
 | 228 |  * | 
 | 229 |  *  @return true if valid, false otherwise | 
 | 230 |  */ | 
| Richard Marian Thomaiyar | a45cb34 | 2018-12-03 15:08:59 +0530 | [diff] [blame] | 231 | bool isValidAccessMode(const uint8_t accessMode); | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 232 |  | 
 | 233 | /** @brief determines valid authentication type based on channel number | 
 | 234 |  * | 
 | 235 |  *  @param[in] chNum - channel number | 
 | 236 |  *  @param[in] authType - authentication type | 
 | 237 |  * | 
 | 238 |  *  @return true if valid, false otherwise | 
 | 239 |  */ | 
| Richard Marian Thomaiyar | a45cb34 | 2018-12-03 15:08:59 +0530 | [diff] [blame] | 240 | bool isValidAuthType(const uint8_t chNum, const EAuthType& authType); | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 241 |  | 
 | 242 | /** @brief determines supported session type of a channel | 
 | 243 |  * | 
 | 244 |  *  @param[in] chNum - channel number | 
 | 245 |  * | 
 | 246 |  *  @return EChannelSessSupported - supported session type | 
 | 247 |  */ | 
| Richard Marian Thomaiyar | a45cb34 | 2018-12-03 15:08:59 +0530 | [diff] [blame] | 248 | EChannelSessSupported getChannelSessionSupport(const uint8_t chNum); | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 249 |  | 
 | 250 | /** @brief determines number of active sessions on a channel | 
 | 251 |  * | 
 | 252 |  *  @param[in] chNum - channel number | 
 | 253 |  * | 
 | 254 |  *  @return numer of active sessions | 
 | 255 |  */ | 
| Richard Marian Thomaiyar | a45cb34 | 2018-12-03 15:08:59 +0530 | [diff] [blame] | 256 | int getChannelActiveSessions(const uint8_t chNum); | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 257 |  | 
| Vernon Mauery | 5831712 | 2018-11-28 11:02:43 -0800 | [diff] [blame] | 258 | /** @brief determines maximum transfer size for a channel | 
 | 259 |  * | 
 | 260 |  *  @param[in] chNum - channel number | 
 | 261 |  * | 
 | 262 |  *  @return maximum bytes that can be transferred on this channel | 
 | 263 |  */ | 
 | 264 | size_t getChannelMaxTransferSize(uint8_t chNum); | 
 | 265 |  | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 266 | /** @brief initializes channel management | 
 | 267 |  * | 
| NITIN SHARMA | b541a5a | 2019-07-18 12:46:59 +0000 | [diff] [blame] | 268 |  *  @return ccSuccess for success, others for failure. | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 269 |  */ | 
| NITIN SHARMA | b541a5a | 2019-07-18 12:46:59 +0000 | [diff] [blame] | 270 | Cc ipmiChannelInit(); | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 271 |  | 
 | 272 | /** @brief provides channel info details | 
 | 273 |  * | 
 | 274 |  *  @param[in] chNum - channel number | 
 | 275 |  *  @param[out] chInfo - channel info details | 
 | 276 |  * | 
| NITIN SHARMA | b541a5a | 2019-07-18 12:46:59 +0000 | [diff] [blame] | 277 |  *  @return ccSuccess for success, others for failure. | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 278 |  */ | 
| NITIN SHARMA | b541a5a | 2019-07-18 12:46:59 +0000 | [diff] [blame] | 279 | Cc getChannelInfo(const uint8_t chNum, ChannelInfo& chInfo); | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 280 |  | 
 | 281 | /** @brief provides channel access data | 
 | 282 |  * | 
 | 283 |  *  @param[in] chNum - channel number | 
 | 284 |  *  @param[out] chAccessData -channel access data | 
 | 285 |  * | 
| NITIN SHARMA | b541a5a | 2019-07-18 12:46:59 +0000 | [diff] [blame] | 286 |  *  @return ccSuccess for success, others for failure. | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 287 |  */ | 
| NITIN SHARMA | b541a5a | 2019-07-18 12:46:59 +0000 | [diff] [blame] | 288 | Cc getChannelAccessData(const uint8_t chNum, ChannelAccess& chAccessData); | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 289 |  | 
| Richard Marian Thomaiyar | a39208e | 2018-12-08 17:27:11 +0530 | [diff] [blame] | 290 | /** @brief provides function to convert current channel number (0xE) | 
 | 291 |  * | 
 | 292 |  *  @param[in] chNum - channel number as requested in commands. | 
| Vernon Mauery | 5ed3959 | 2019-05-14 09:16:53 -0700 | [diff] [blame] | 293 |  *  @param[in] devChannel - channel number as provided by device (not 0xE) | 
| Richard Marian Thomaiyar | 30b0112 | 2019-04-03 15:46:03 +0530 | [diff] [blame] | 294 |  * | 
 | 295 |  *  @return same channel number or proper channel number for current channel | 
 | 296 |  * number (0xE). | 
 | 297 |  */ | 
| Patrick Williams | 69b4c28 | 2025-03-03 11:19:13 -0500 | [diff] [blame] | 298 | static inline uint8_t convertCurrentChannelNum(const uint8_t chNum, | 
 | 299 |                                                const uint8_t devChannel) | 
| Richard Marian Thomaiyar | 30b0112 | 2019-04-03 15:46:03 +0530 | [diff] [blame] | 300 | { | 
 | 301 |     if (chNum == currentChNum) | 
 | 302 |     { | 
| Vernon Mauery | 5ed3959 | 2019-05-14 09:16:53 -0700 | [diff] [blame] | 303 |         return devChannel; | 
| Richard Marian Thomaiyar | 30b0112 | 2019-04-03 15:46:03 +0530 | [diff] [blame] | 304 |     } | 
 | 305 |     return chNum; | 
 | 306 | } | 
 | 307 |  | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 308 | /** @brief to set channel access data | 
 | 309 |  * | 
 | 310 |  *  @param[in] chNum - channel number | 
 | 311 |  *  @param[in] chAccessData - channel access data | 
 | 312 |  *  @param[in] setFlag - flag to indicate updatable fields | 
 | 313 |  * | 
| NITIN SHARMA | b541a5a | 2019-07-18 12:46:59 +0000 | [diff] [blame] | 314 |  *  @return ccSuccess for success, others for failure. | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 315 |  */ | 
| NITIN SHARMA | b541a5a | 2019-07-18 12:46:59 +0000 | [diff] [blame] | 316 | Cc setChannelAccessData(const uint8_t chNum, const ChannelAccess& chAccessData, | 
 | 317 |                         const uint8_t setFlag); | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 318 |  | 
 | 319 | /** @brief to get channel access data persistent data | 
 | 320 |  * | 
 | 321 |  *  @param[in] chNum - channel number | 
 | 322 |  *  @param[out] chAccessData - channel access data | 
 | 323 |  * | 
| NITIN SHARMA | b541a5a | 2019-07-18 12:46:59 +0000 | [diff] [blame] | 324 |  *  @return ccSuccess for success, others for failure. | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 325 |  */ | 
| NITIN SHARMA | b541a5a | 2019-07-18 12:46:59 +0000 | [diff] [blame] | 326 | Cc getChannelAccessPersistData(const uint8_t chNum, | 
 | 327 |                                ChannelAccess& chAccessData); | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 328 |  | 
 | 329 | /** @brief to set channel access data persistent data | 
 | 330 |  * | 
 | 331 |  *  @param[in] chNum - channel number | 
 | 332 |  *  @param[in] chAccessData - channel access data | 
 | 333 |  *  @param[in] setFlag - flag to indicate updatable fields | 
 | 334 |  * | 
| NITIN SHARMA | b541a5a | 2019-07-18 12:46:59 +0000 | [diff] [blame] | 335 |  *  @return ccSuccess for success, others for failure. | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 336 |  */ | 
| NITIN SHARMA | b541a5a | 2019-07-18 12:46:59 +0000 | [diff] [blame] | 337 | Cc setChannelAccessPersistData(const uint8_t chNum, | 
 | 338 |                                const ChannelAccess& chAccessData, | 
 | 339 |                                const uint8_t setFlag); | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 340 |  | 
 | 341 | /** @brief provides supported authentication type for the channel | 
 | 342 |  * | 
 | 343 |  *  @param[in] chNum - channel number | 
 | 344 |  *  @param[out] authTypeSupported - supported authentication type | 
 | 345 |  * | 
| NITIN SHARMA | b541a5a | 2019-07-18 12:46:59 +0000 | [diff] [blame] | 346 |  *  @return ccSuccess for success, others for failure. | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 347 |  */ | 
| NITIN SHARMA | b541a5a | 2019-07-18 12:46:59 +0000 | [diff] [blame] | 348 | Cc getChannelAuthTypeSupported(const uint8_t chNum, uint8_t& authTypeSupported); | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 349 |  | 
 | 350 | /** @brief provides enabled authentication type for the channel | 
 | 351 |  * | 
 | 352 |  *  @param[in] chNum - channel number | 
 | 353 |  *  @param[in] priv - privilege | 
 | 354 |  *  @param[out] authType - enabled authentication type | 
 | 355 |  * | 
| NITIN SHARMA | b541a5a | 2019-07-18 12:46:59 +0000 | [diff] [blame] | 356 |  *  @return ccSuccess for success, others for failure. | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 357 |  */ | 
| NITIN SHARMA | b541a5a | 2019-07-18 12:46:59 +0000 | [diff] [blame] | 358 | Cc getChannelEnabledAuthType(const uint8_t chNum, const uint8_t priv, | 
 | 359 |                              EAuthType& authType); | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 360 |  | 
| Johnathan Mantey | 74a2102 | 2018-12-13 13:17:56 -0800 | [diff] [blame] | 361 | /** @brief Retrieves the LAN channel name from the IPMI channel number | 
 | 362 |  * | 
 | 363 |  *  @param[in] chNum - IPMI channel number | 
 | 364 |  * | 
 | 365 |  *  @return the LAN channel name (i.e. eth0) | 
 | 366 |  */ | 
| Richard Marian Thomaiyar | 55768e3 | 2019-03-02 22:54:37 +0530 | [diff] [blame] | 367 | std::string getChannelName(const uint8_t chNum); | 
| Johnathan Mantey | 74a2102 | 2018-12-13 13:17:56 -0800 | [diff] [blame] | 368 |  | 
| Vernon Mauery | 735ee95 | 2019-02-15 13:38:52 -0800 | [diff] [blame] | 369 | /** @brief Retrieves the LAN channel number from the IPMI channel name | 
 | 370 |  * | 
 | 371 |  *  @param[in] chName - IPMI channel name (i.e. eth0) | 
 | 372 |  * | 
 | 373 |  *  @return the LAN channel number | 
 | 374 |  */ | 
 | 375 | uint8_t getChannelByName(const std::string& chName); | 
 | 376 |  | 
| Ayushi Smriti | 6fd812d | 2019-04-12 18:51:31 +0000 | [diff] [blame] | 377 | /** @brief determines whether payload type is valid | 
 | 378 |  * | 
 | 379 |  *	@param[in] payload type - Payload Type | 
 | 380 |  * | 
 | 381 |  *	@return true if valid, false otherwise | 
 | 382 |  */ | 
 | 383 | bool isValidPayloadType(const PayloadType payloadType); | 
 | 384 |  | 
| AppaRao Puli | 071f3f2 | 2018-05-24 16:45:30 +0530 | [diff] [blame] | 385 | } // namespace ipmi |