blob: 85650ddb5169486f20cf836390e9ed5893bd2898 [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;
Patrick Venture5d26d832019-03-13 16:31:09 -070021} __attribute__((packed));
22
Patrick Venture4d49ae62018-09-17 11:35:32 -070023// Handle the eth query command.
Patrick Venture45fad1b2019-03-18 16:52:14 -070024// Sys can query the ifName and IPMI channel of the BMC's NCSI ethernet
Patrick Venture4d49ae62018-09-17 11:35:32 -070025// device.
Patrick Venture45fad1b2019-03-18 16:52:14 -070026ipmi_ret_t getEthDevice(const uint8_t* reqBuf, uint8_t* replyBuf,
Patrick Venturec87de552020-05-20 20:25:39 -070027 size_t* dataLen, const HandlerInterface* handler);
Patrick Venture4d49ae62018-09-17 11:35:32 -070028
29} // namespace ipmi
30} // namespace google