blob: fee363d967ebc1497517ba2a41053e12d85618e2 [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
Patrick Venture45fad1b2019-03-18 16:52:14 -070013// IPMI channel number and the ifName used for the
Patrick Venture5d26d832019-03-13 16:31:09 -070014// ncis connection.
15struct EthDeviceReply
16{
17 uint8_t subcommand;
18 uint8_t channel;
Patrick Venture45fad1b2019-03-18 16:52:14 -070019 // ifNameLength doesn't include the null-terminator.
20 uint8_t ifNameLength;
21 uint8_t ifName[0];
Patrick Venture5d26d832019-03-13 16:31:09 -070022} __attribute__((packed));
23
Patrick Venture4d49ae62018-09-17 11:35:32 -070024// Handle the eth query command.
Patrick Venture45fad1b2019-03-18 16:52:14 -070025// Sys can query the ifName and IPMI channel of the BMC's NCSI ethernet
Patrick Venture4d49ae62018-09-17 11:35:32 -070026// device.
Patrick Venture45fad1b2019-03-18 16:52:14 -070027ipmi_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