blob: 69b6d98eb667abde3e9c29063e28586d06e00572 [file] [log] [blame]
Tom Joseph4a8f34d2016-12-06 17:07:46 +05301#include "channel_auth.hpp"
2
William A. Kennington III4f09eae2019-02-12 17:10:35 -08003#include <ipmid/api.h>
Tom Joseph4a8f34d2016-12-06 17:07:46 +05304
5namespace command
6{
7
Vernon Mauery9e801a22018-10-12 13:20:49 -07008std::vector<uint8_t>
9 GetChannelCapabilities(const std::vector<uint8_t>& inPayload,
10 const message::Handler& handler)
Tom Joseph4a8f34d2016-12-06 17:07:46 +053011{
Tom Joseph4a8f34d2016-12-06 17:07:46 +053012 std::vector<uint8_t> outPayload(sizeof(GetChannelCapabilitiesResp));
Vernon Mauery9e801a22018-10-12 13:20:49 -070013 auto response =
14 reinterpret_cast<GetChannelCapabilitiesResp*>(outPayload.data());
Tom Joseph4a8f34d2016-12-06 17:07:46 +053015
16 // A canned response, since there is no user and channel management.
Vernon Mauery9e801a22018-10-12 13:20:49 -070017 response->completionCode = IPMI_CC_OK;
Tom Joseph4a8f34d2016-12-06 17:07:46 +053018
Gunnar Mills541aee72017-10-25 14:47:10 -050019 // Channel Number 1 is arbitrarily applied to primary LAN channel;
Tom Joseph4a8f34d2016-12-06 17:07:46 +053020 response->channelNumber = 1;
21
Vernon Mauery9e801a22018-10-12 13:20:49 -070022 response->ipmiVersion = 1; // IPMI v2.0 extended capabilities available.
Tom Joseph4a8f34d2016-12-06 17:07:46 +053023 response->reserved1 = 0;
24 response->oem = 0;
25 response->straightKey = 0;
26 response->reserved2 = 0;
27 response->md5 = 0;
28 response->md2 = 0;
29
Tom Joseph4a8f34d2016-12-06 17:07:46 +053030 response->reserved3 = 0;
Vernon Mauery9e801a22018-10-12 13:20:49 -070031 response->KGStatus = 0; // KG is set to default
32 response->perMessageAuth = 0; // Per-message Authentication is enabled
33 response->userAuth = 0; // User Level Authentication is enabled
34 response->nonNullUsers = 1; // Non-null usernames enabled
Tom Joseph615e4fd2019-02-09 23:10:48 +053035 response->nullUsers = 0; // Null usernames disabled
Vernon Mauery9e801a22018-10-12 13:20:49 -070036 response->anonymousLogin = 0; // Anonymous Login disabled
Tom Joseph4a8f34d2016-12-06 17:07:46 +053037
38 response->reserved4 = 0;
Vernon Mauery9e801a22018-10-12 13:20:49 -070039 response->extCapabilities = 0x2; // Channel supports IPMI v2.0 connections
Tom Joseph4a8f34d2016-12-06 17:07:46 +053040
41 response->oemID[0] = 0;
42 response->oemID[1] = 0;
43 response->oemID[2] = 0;
44 response->oemAuxillary = 0;
Tom Joseph4a8f34d2016-12-06 17:07:46 +053045 return outPayload;
46}
47
48} // namespace command