1 #include "channel_auth.hpp" 2 3 #include <host-ipmid/ipmid-api.h> 4 5 namespace command 6 { 7 8 std::vector<uint8_t> 9 GetChannelCapabilities(const std::vector<uint8_t>& inPayload, 10 const message::Handler& handler) 11 { 12 std::vector<uint8_t> outPayload(sizeof(GetChannelCapabilitiesResp)); 13 auto response = 14 reinterpret_cast<GetChannelCapabilitiesResp*>(outPayload.data()); 15 16 // A canned response, since there is no user and channel management. 17 response->completionCode = IPMI_CC_OK; 18 19 // Channel Number 1 is arbitrarily applied to primary LAN channel; 20 response->channelNumber = 1; 21 22 response->ipmiVersion = 1; // IPMI v2.0 extended capabilities available. 23 response->reserved1 = 0; 24 response->oem = 0; 25 response->straightKey = 0; 26 response->reserved2 = 0; 27 response->md5 = 0; 28 response->md2 = 0; 29 30 response->reserved3 = 0; 31 response->KGStatus = 0; // KG is set to default 32 response->perMessageAuth = 0; // Per-message Authentication is enabled 33 response->userAuth = 0; // User Level Authentication is enabled 34 response->nonNullUsers = 1; // Non-null usernames enabled 35 response->nullUsers = 1; // Null usernames enabled 36 response->anonymousLogin = 0; // Anonymous Login disabled 37 38 response->reserved4 = 0; 39 response->extCapabilities = 0x2; // Channel supports IPMI v2.0 connections 40 41 response->oemID[0] = 0; 42 response->oemID[1] = 0; 43 response->oemID[2] = 0; 44 response->oemAuxillary = 0; 45 return outPayload; 46 } 47 48 } // namespace command 49