Patrick Venture | 4d49ae6 | 2018-09-17 11:35:32 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Patrick Venture | f085d91 | 2019-03-15 08:50:00 -0700 | [diff] [blame] | 3 | #include "handler.hpp" |
| 4 | |
William A. Kennington III | 2c9e162 | 2019-02-07 15:45:19 -0800 | [diff] [blame] | 5 | #include <ipmid/api.h> |
Patrick Venture | 4d49ae6 | 2018-09-17 11:35:32 -0700 | [diff] [blame] | 6 | |
| 7 | namespace google |
| 8 | { |
| 9 | namespace ipmi |
| 10 | { |
| 11 | |
Patrick Venture | 5d26d83 | 2019-03-13 16:31:09 -0700 | [diff] [blame] | 12 | // The reply to the ethdevice command specifies the |
Patrick Venture | 45fad1b | 2019-03-18 16:52:14 -0700 | [diff] [blame] | 13 | // IPMI channel number and the ifName used for the |
Patrick Venture | 5d26d83 | 2019-03-13 16:31:09 -0700 | [diff] [blame] | 14 | // ncis connection. |
| 15 | struct EthDeviceReply |
| 16 | { |
| 17 | uint8_t subcommand; |
| 18 | uint8_t channel; |
Patrick Venture | 45fad1b | 2019-03-18 16:52:14 -0700 | [diff] [blame] | 19 | // ifNameLength doesn't include the null-terminator. |
| 20 | uint8_t ifNameLength; |
| 21 | uint8_t ifName[0]; |
Patrick Venture | 5d26d83 | 2019-03-13 16:31:09 -0700 | [diff] [blame] | 22 | } __attribute__((packed)); |
| 23 | |
Patrick Venture | 4d49ae6 | 2018-09-17 11:35:32 -0700 | [diff] [blame] | 24 | // Handle the eth query command. |
Patrick Venture | 45fad1b | 2019-03-18 16:52:14 -0700 | [diff] [blame] | 25 | // Sys can query the ifName and IPMI channel of the BMC's NCSI ethernet |
Patrick Venture | 4d49ae6 | 2018-09-17 11:35:32 -0700 | [diff] [blame] | 26 | // device. |
Patrick Venture | 45fad1b | 2019-03-18 16:52:14 -0700 | [diff] [blame] | 27 | ipmi_ret_t getEthDevice(const uint8_t* reqBuf, uint8_t* replyBuf, |
Patrick Venture | f085d91 | 2019-03-15 08:50:00 -0700 | [diff] [blame] | 28 | size_t* dataLen, |
| 29 | const HandlerInterface* handler = &handlerImpl); |
Patrick Venture | 4d49ae6 | 2018-09-17 11:35:32 -0700 | [diff] [blame] | 30 | |
| 31 | } // namespace ipmi |
| 32 | } // namespace google |