blob: 6b757a6c24f0235397eb3d8f1b7313e338975342 [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{
13 std::cout << ">> GetChannelCapabilities\n";
14
15 std::vector<uint8_t> outPayload(sizeof(GetChannelCapabilitiesResp));
16 auto response = reinterpret_cast<GetChannelCapabilitiesResp*>
17 (outPayload.data());
18
19 // A canned response, since there is no user and channel management.
20 response->completionCode = IPMI_CC_OK ;
21
Gunnar Mills541aee72017-10-25 14:47:10 -050022 // Channel Number 1 is arbitrarily applied to primary LAN channel;
Tom Joseph4a8f34d2016-12-06 17:07:46 +053023 response->channelNumber = 1;
24
25 response->ipmiVersion = 1 ; //IPMI v2.0 extended capabilities available.
26 response->reserved1 = 0;
27 response->oem = 0;
28 response->straightKey = 0;
29 response->reserved2 = 0;
30 response->md5 = 0;
31 response->md2 = 0;
32
33
34 response->reserved3 = 0;
35 response->KGStatus = 0; //KG is set to default
36 response->perMessageAuth = 0; //Per-message Authentication is enabled
37 response->userAuth = 0; //User Level Authentication is enabled
38 response->nonNullUsers = 1; //Non-null usernames enabled
39 response->nullUsers = 1; //Null usernames enabled
40 response->anonymousLogin = 0; //Anonymous Login disabled
41
42 response->reserved4 = 0;
43 response->extCapabilities = 0x2; //Channel supports IPMI v2.0 connections
44
45 response->oemID[0] = 0;
46 response->oemID[1] = 0;
47 response->oemID[2] = 0;
48 response->oemAuxillary = 0;
49
50 std::cout << "<< GetChannelCapabilities\n";
51 return outPayload;
52}
53
54} // namespace command