blob: 1ad1472a0ce3c2eec72d8e0de30ed6ae2e7aea48 [file] [log] [blame]
Tom Joseph4a8f34d2016-12-06 17:07:46 +05301#include "channel_auth.hpp"
2
Tom Joseph4a8f34d2016-12-06 17:07:46 +05303#include <host-ipmid/ipmid-api.h>
4
Vernon Mauery9e801a22018-10-12 13:20:49 -07005#include <iostream>
6
Tom Joseph4a8f34d2016-12-06 17:07:46 +05307namespace command
8{
9
Vernon Mauery9e801a22018-10-12 13:20:49 -070010std::vector<uint8_t>
11 GetChannelCapabilities(const std::vector<uint8_t>& inPayload,
12 const message::Handler& handler)
Tom Joseph4a8f34d2016-12-06 17:07:46 +053013{
Tom Joseph4a8f34d2016-12-06 17:07:46 +053014 std::vector<uint8_t> outPayload(sizeof(GetChannelCapabilitiesResp));
Vernon Mauery9e801a22018-10-12 13:20:49 -070015 auto response =
16 reinterpret_cast<GetChannelCapabilitiesResp*>(outPayload.data());
Tom Joseph4a8f34d2016-12-06 17:07:46 +053017
18 // A canned response, since there is no user and channel management.
Vernon Mauery9e801a22018-10-12 13:20:49 -070019 response->completionCode = IPMI_CC_OK;
Tom Joseph4a8f34d2016-12-06 17:07:46 +053020
Gunnar Mills541aee72017-10-25 14:47:10 -050021 // Channel Number 1 is arbitrarily applied to primary LAN channel;
Tom Joseph4a8f34d2016-12-06 17:07:46 +053022 response->channelNumber = 1;
23
Vernon Mauery9e801a22018-10-12 13:20:49 -070024 response->ipmiVersion = 1; // IPMI v2.0 extended capabilities available.
Tom Joseph4a8f34d2016-12-06 17:07:46 +053025 response->reserved1 = 0;
26 response->oem = 0;
27 response->straightKey = 0;
28 response->reserved2 = 0;
29 response->md5 = 0;
30 response->md2 = 0;
31
Tom Joseph4a8f34d2016-12-06 17:07:46 +053032 response->reserved3 = 0;
Vernon Mauery9e801a22018-10-12 13:20:49 -070033 response->KGStatus = 0; // KG is set to default
34 response->perMessageAuth = 0; // Per-message Authentication is enabled
35 response->userAuth = 0; // User Level Authentication is enabled
36 response->nonNullUsers = 1; // Non-null usernames enabled
37 response->nullUsers = 1; // Null usernames enabled
38 response->anonymousLogin = 0; // Anonymous Login disabled
Tom Joseph4a8f34d2016-12-06 17:07:46 +053039
40 response->reserved4 = 0;
Vernon Mauery9e801a22018-10-12 13:20:49 -070041 response->extCapabilities = 0x2; // Channel supports IPMI v2.0 connections
Tom Joseph4a8f34d2016-12-06 17:07:46 +053042
43 response->oemID[0] = 0;
44 response->oemID[1] = 0;
45 response->oemID[2] = 0;
46 response->oemAuxillary = 0;
Tom Joseph4a8f34d2016-12-06 17:07:46 +053047 return outPayload;
48}
49
50} // namespace command