Lei YU | 6505e9d | 2020-09-21 17:34:32 +0800 | [diff] [blame^] | 1 | #include "inspur_oem.hpp" |
| 2 | |
| 3 | #include <ipmid/api.h> |
| 4 | |
| 5 | namespace ipmi |
| 6 | { |
| 7 | |
| 8 | static void registerOEMFunctions() __attribute__((constructor)); |
| 9 | |
| 10 | ipmi_ret_t ipmiOemInspurAssetInfo(ipmi_netfn_t netfn, ipmi_cmd_t cmd, |
| 11 | ipmi_request_t request, |
| 12 | ipmi_response_t response, |
| 13 | ipmi_data_len_t data_len, |
| 14 | ipmi_context_t context) |
| 15 | { |
| 16 | // TODO: handle the oem command |
| 17 | fprintf(stderr, |
| 18 | "netfn 0x%02x, cmd 0x%02x, request %p, response %p, data_len %p, " |
| 19 | "context %p\n", |
| 20 | netfn, cmd, request, response, static_cast<void*>(data_len), |
| 21 | context); |
| 22 | return {}; |
| 23 | } |
| 24 | |
| 25 | void registerOEMFunctions(void) |
| 26 | { |
| 27 | ipmi_register_callback(NETFN_OEM_INSPUR, CMD_OEM_ASSET_INFO, nullptr, |
| 28 | ipmiOemInspurAssetInfo, SYSTEM_INTERFACE); |
| 29 | } |
| 30 | |
| 31 | } // namespace ipmi |