Add initial meson.build and empty code
Add initial meson.build and make sure it generates the shared library.
Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: If04fcbeb4bcfeb67bb3654e15c17eb99352e97a3
diff --git a/src/inspur_oem.cpp b/src/inspur_oem.cpp
new file mode 100644
index 0000000..657f13b
--- /dev/null
+++ b/src/inspur_oem.cpp
@@ -0,0 +1,31 @@
+#include "inspur_oem.hpp"
+
+#include <ipmid/api.h>
+
+namespace ipmi
+{
+
+static void registerOEMFunctions() __attribute__((constructor));
+
+ipmi_ret_t ipmiOemInspurAssetInfo(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
+ ipmi_request_t request,
+ ipmi_response_t response,
+ ipmi_data_len_t data_len,
+ ipmi_context_t context)
+{
+ // TODO: handle the oem command
+ fprintf(stderr,
+ "netfn 0x%02x, cmd 0x%02x, request %p, response %p, data_len %p, "
+ "context %p\n",
+ netfn, cmd, request, response, static_cast<void*>(data_len),
+ context);
+ return {};
+}
+
+void registerOEMFunctions(void)
+{
+ ipmi_register_callback(NETFN_OEM_INSPUR, CMD_OEM_ASSET_INFO, nullptr,
+ ipmiOemInspurAssetInfo, SYSTEM_INTERFACE);
+}
+
+} // namespace ipmi