blob: 9f2abe1b5d4f25bdc8d259aac09ec1aaca811238 [file] [log] [blame]
Tom Joseph4a8f34d2016-12-06 17:07:46 +05301#pragma once
2
Tom Joseph4a8f34d2016-12-06 17:07:46 +05303#include "message_handler.hpp"
4
Vernon Mauery9e801a22018-10-12 13:20:49 -07005#include <vector>
6
Tom Joseph4a8f34d2016-12-06 17:07:46 +05307namespace command
8{
9
Tom Joseph3563f8f2017-05-08 15:42:54 +053010/**
11 * @struct GetChannelCapabilitiesReq
Tom Joseph4a8f34d2016-12-06 17:07:46 +053012 *
13 * IPMI Request data for Get Channel Authentication Capabilities command
14 */
15struct GetChannelCapabilitiesReq
16{
17 uint8_t channelNumber;
18 uint8_t reqMaxPrivLevel;
19} __attribute__((packed));
20
Tom Joseph3563f8f2017-05-08 15:42:54 +053021/**
22 * @struct GetChannelCapabilitiesResp
Tom Joseph4a8f34d2016-12-06 17:07:46 +053023 *
24 * IPMI Response data for Get Channel Authentication Capabilities command
25 */
26struct GetChannelCapabilitiesResp
27{
Vernon Mauery9e801a22018-10-12 13:20:49 -070028 uint8_t completionCode; // Completion Code
Tom Joseph4a8f34d2016-12-06 17:07:46 +053029
Vernon Mauery9e801a22018-10-12 13:20:49 -070030 uint8_t channelNumber; // Channel number that the request was
Tom Joseph4a8f34d2016-12-06 17:07:46 +053031 // received on
32
33#if BYTE_ORDER == LITTLE_ENDIAN
34 uint8_t none : 1;
35 uint8_t md2 : 1;
36 uint8_t md5 : 1;
37 uint8_t reserved2 : 1;
Vernon Mauery9e801a22018-10-12 13:20:49 -070038 uint8_t straightKey : 1; // Straight password/key support
Tom Joseph4a8f34d2016-12-06 17:07:46 +053039 // Support OEM identified by the IANA OEM ID in RMCP+ ping response
40 uint8_t oem : 1;
41 uint8_t reserved1 : 1;
Vernon Mauery9e801a22018-10-12 13:20:49 -070042 uint8_t ipmiVersion : 1; // 0b = IPMIV1.5 support only, 1B = IPMI V2.0
Tom Joseph4a8f34d2016-12-06 17:07:46 +053043 // support
44#endif
45
46#if BYTE_ORDER == BIG_ENDIAN
Vernon Mauery9e801a22018-10-12 13:20:49 -070047 uint8_t ipmiVersion : 1; // 0b = IPMIV1.5 support only, 1B = IPMI V2.0
Tom Joseph4a8f34d2016-12-06 17:07:46 +053048 // support
49 uint8_t reserved1 : 1;
50 // Support OEM identified by the IANA OEM ID in RMCP+ ping response
51 uint8_t oem : 1;
Vernon Mauery9e801a22018-10-12 13:20:49 -070052 uint8_t straightKey : 1; // Straight password/key support
Tom Joseph4a8f34d2016-12-06 17:07:46 +053053 uint8_t reserved2 : 1;
54 uint8_t md5 : 1;
55 uint8_t md2 : 1;
56 uint8_t none : 1;
57#endif
58
59#if BYTE_ORDER == LITTLE_ENDIAN
Tom Joseph4a8f34d2016-12-06 17:07:46 +053060 // Anonymous login status for anonymous login enabled/disabled
61 uint8_t anonymousLogin : 1;
Tom Josephdc3e8b92019-02-09 20:21:33 +053062 // Anonymous login status for null usernames enabled/disabled
63 uint8_t nullUsers : 1;
64 // Anonymous login status for non-null usernames enabled/disabled
65 uint8_t nonNullUsers : 1;
66 uint8_t userAuth : 1; // User level authentication status
67 uint8_t perMessageAuth : 1; // Per-message authentication support
68 // Two key login status . only for IPMI V2.0 RMCP+ RAKP
69 uint8_t KGStatus : 1;
Tom Joseph4a8f34d2016-12-06 17:07:46 +053070 uint8_t reserved3 : 2;
71#endif
72
73#if BYTE_ORDER == BIG_ENDIAN
74 uint8_t reserved3 : 2;
Tom Joseph4a8f34d2016-12-06 17:07:46 +053075 // Two key login status . only for IPMI V2.0 RMCP+ RAKP
76 uint8_t KGStatus : 1;
Tom Josephdc3e8b92019-02-09 20:21:33 +053077 uint8_t perMessageAuth : 1; // Per-message authentication support
78 uint8_t userAuth : 1; // User level authentication status
79 // Anonymous login status for non-null usernames enabled/disabled
80 uint8_t nonNullUsers : 1;
81 // Anonymous login status for null usernames enabled/disabled
82 uint8_t nullUsers : 1;
83 // Anonymous login status for anonymous login enabled/disabled
84 uint8_t anonymousLogin : 1;
Tom Joseph4a8f34d2016-12-06 17:07:46 +053085#endif
86
87#if BYTE_ORDER == LITTLE_ENDIAN
88 // Extended capabilities will be present only if IPMI version is V2.0
89 uint8_t extCapabilities : 2; // Channel support for IPMI V2.0 connections
90 uint8_t reserved4 : 6;
91#endif
92
93#if BYTE_ORDER == BIG_ENDIAN
94 // Extended capabilities will be present only if IPMI version is V2.0
95 uint8_t reserved4 : 6;
96 uint8_t extCapabilities : 2; // Channel support for IPMI V2.0 connections
97#endif
98
99 // Below 4 bytes will all the 0's if no OEM authentication type available.
Vernon Mauery9e801a22018-10-12 13:20:49 -0700100 uint8_t oemID[3]; // IANA enterprise number for OEM/organization
101 uint8_t oemAuxillary; // Addition OEM specific information..
Tom Joseph4a8f34d2016-12-06 17:07:46 +0530102} __attribute__((packed));
103
Tom Joseph3563f8f2017-05-08 15:42:54 +0530104/**
Tom Joseph4a8f34d2016-12-06 17:07:46 +0530105 * @brief Get Channel Authentication Capabilities
106 *
107 * This message exchange provides a way for a remote console to discover what
108 * IPMI version is supported i.e. whether or not the BMC supports the IPMI
109 * v2.0 / RMCP+ packet format. It also provides information that the remote
110 * console can use to determine whether anonymous, “one-key”, or “two-key”
111 * logins are used.This information can guide a remote console in how it
112 * presents queries to users for username and password information. This is a
113 * ‘session-less’ command that the BMC accepts in both IPMI v1.5 and v2.0/RMCP+
114 * packet formats.
115 *
116 * @param[in] inPayload - Request Data for the command
117 * @param[in] handler - Reference to the Message Handler
118 *
119 * @return Response data for the command
120 */
Vernon Mauery9e801a22018-10-12 13:20:49 -0700121std::vector<uint8_t>
122 GetChannelCapabilities(const std::vector<uint8_t>& inPayload,
123 const message::Handler& handler);
Tom Joseph4a8f34d2016-12-06 17:07:46 +0530124
125} // namespace command