blob: fbb72426dc9a46faa5c4d755763f6752f0168303 [file] [log] [blame]
Tom Joseph4a8f34d2016-12-06 17:07:46 +05301#include "channel_auth.hpp"
2
3#include <iostream>
4
5#include <host-ipmid/ipmid-api.h>
6
7namespace command
8{
9
Tom Joseph18a45e92017-04-11 11:30:44 +053010std::vector<uint8_t> GetChannelCapabilities(
11 const std::vector<uint8_t>& inPayload, const message::Handler& handler)
Tom Joseph4a8f34d2016-12-06 17:07:46 +053012{
Tom Joseph4a8f34d2016-12-06 17:07:46 +053013 std::vector<uint8_t> outPayload(sizeof(GetChannelCapabilitiesResp));
14 auto response = reinterpret_cast<GetChannelCapabilitiesResp*>
15 (outPayload.data());
16
17 // A canned response, since there is no user and channel management.
18 response->completionCode = IPMI_CC_OK ;
19
Gunnar Mills541aee72017-10-25 14:47:10 -050020 // Channel Number 1 is arbitrarily applied to primary LAN channel;
Tom Joseph4a8f34d2016-12-06 17:07:46 +053021 response->channelNumber = 1;
22
23 response->ipmiVersion = 1 ; //IPMI v2.0 extended capabilities available.
24 response->reserved1 = 0;
25 response->oem = 0;
26 response->straightKey = 0;
27 response->reserved2 = 0;
28 response->md5 = 0;
29 response->md2 = 0;
30
31
32 response->reserved3 = 0;
33 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
39
40 response->reserved4 = 0;
41 response->extCapabilities = 0x2; //Channel supports IPMI v2.0 connections
42
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