blob: e5b8079a510f28b0196e1fafd88739309b0c1404 [file] [log] [blame]
Patrick Venture4d49ae62018-09-17 11:35:32 -07001#pragma once
2
Patrick Venturef085d912019-03-15 08:50:00 -07003#include "handler.hpp"
4
William A. Kennington III2c9e1622019-02-07 15:45:19 -08005#include <ipmid/api.h>
Patrick Venture4d49ae62018-09-17 11:35:32 -07006
7namespace google
8{
9namespace ipmi
10{
11
Patrick Venture5d26d832019-03-13 16:31:09 -070012// The reply to the ethdevice command specifies the
13// IPMI channel number and the if_name used for the
14// ncis connection.
15struct EthDeviceReply
16{
17 uint8_t subcommand;
18 uint8_t channel;
19 // if_name_len doesn't include the null-terminator.
20 uint8_t if_name_len;
21 uint8_t if_name[0];
22} __attribute__((packed));
23
Patrick Venture4d49ae62018-09-17 11:35:32 -070024// Handle the eth query command.
25// Sys can query the if_name and IPMI channel of the BMC's NCSI ethernet
26// device.
27ipmi_ret_t GetEthDevice(const uint8_t* reqBuf, uint8_t* replyBuf,
Patrick Venturef085d912019-03-15 08:50:00 -070028 size_t* dataLen,
29 const HandlerInterface* handler = &handlerImpl);
Patrick Venture4d49ae62018-09-17 11:35:32 -070030
31} // namespace ipmi
32} // namespace google