1 #include "channel_auth.hpp"
2 
3 #include <iostream>
4 
5 #include <host-ipmid/ipmid-api.h>
6 
7 namespace command
8 {
9 
10 std::vector<uint8_t> GetChannelCapabilities(
11         const std::vector<uint8_t>& inPayload, const message::Handler& handler)
12 {
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 
22     // Channel Number 1 is arbitrarily applied to primary LAN channel;
23     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
55