Tom Joseph | 4a8f34d | 2016-12-06 17:07:46 +0530 | [diff] [blame] | 1 | #include "channel_auth.hpp" |
| 2 | |
| 3 | #include <iostream> |
| 4 | |
| 5 | #include <host-ipmid/ipmid-api.h> |
| 6 | |
| 7 | namespace command |
| 8 | { |
| 9 | |
Tom Joseph | 18a45e9 | 2017-04-11 11:30:44 +0530 | [diff] [blame] | 10 | std::vector<uint8_t> GetChannelCapabilities( |
| 11 | const std::vector<uint8_t>& inPayload, const message::Handler& handler) |
Tom Joseph | 4a8f34d | 2016-12-06 17:07:46 +0530 | [diff] [blame] | 12 | { |
Tom Joseph | 4a8f34d | 2016-12-06 17:07:46 +0530 | [diff] [blame] | 13 | 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 Mills | 541aee7 | 2017-10-25 14:47:10 -0500 | [diff] [blame] | 20 | // Channel Number 1 is arbitrarily applied to primary LAN channel; |
Tom Joseph | 4a8f34d | 2016-12-06 17:07:46 +0530 | [diff] [blame] | 21 | 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 Joseph | 4a8f34d | 2016-12-06 17:07:46 +0530 | [diff] [blame] | 47 | return outPayload; |
| 48 | } |
| 49 | |
| 50 | } // namespace command |