Add internal interface to create BMC Dump based on the type.
Change-Id: I098e8b29834fd726574126ec589a883ba952b298
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
diff --git a/Makefile.am b/Makefile.am
index 212a10f..6ff8965 100755
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,12 +4,16 @@
noinst_HEADERS = \
dump_entry.hpp
+nobase_nodist_include_HEADERS = \
+ xyz/openbmc_project/Dump/Internal/Create/server.hpp
+
sbin_PROGRAMS = \
phosphor-dump-manager
phosphor_dump_manager_SOURCES = \
dump_manager_main.cpp \
- dump_entry.cpp
+ dump_entry.cpp \
+ xyz/openbmc_project/Dump/Internal/Create/server.cpp
phosphor_dump_manager_CXXFLAGS = \
$(PHOSPHOR_DBUS_INTERFACES_CFLAGS) \
@@ -18,3 +22,25 @@
phosphor_dump_manager_LDADD = \
$(PHOSPHOR_DBUS_INTERFACES_LIBS) \
$(SDBUSPLUS_LIBS)
+
+# Be sure to build needed files before compiling
+BUILT_SOURCES = \
+ xyz/openbmc_project/Dump/Internal/Create/server.cpp \
+ xyz/openbmc_project/Dump/Internal/Create/server.hpp
+
+CLEANFILES = \
+ xyz/openbmc_project/Dump/Internal/Create/server.cpp \
+ xyz/openbmc_project/Dump/Internal/Create/server.hpp
+
+xyz/openbmc_project/Dump/Internal/Create/server.cpp: \
+xyz/openbmc_project/Dump/Internal/Create.interface.yaml \
+xyz/openbmc_project/Dump/Internal/Create/server.hpp
+ @mkdir -p `dirname $@`
+ $(SDBUSPLUSPLUS) -r $(srcdir) interface server-cpp \
+xyz.openbmc_project.Dump.Internal.Create > $@
+
+xyz/openbmc_project/Dump/Internal/Create/server.hpp: \
+xyz/openbmc_project/Dump/Internal/Create.interface.yaml
+ @mkdir -p `dirname $@`
+ $(SDBUSPLUSPLUS) -r $(srcdir) interface server-header \
+xyz.openbmc_project.Dump.Internal.Create > $@
diff --git a/configure.ac b/configure.ac
index 4082293..9cf8ba2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,13 +9,20 @@
AC_PROG_CXX
AC_PROG_INSTALL #Checks/sets the install variable to be used
AC_PROG_MAKE_SET
+AC_PROG_MKDIR_P
+AC_CHECK_PROG([DIRNAME], dirname, dirname)
# Check for libraries
PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces],,\
AC_MSG_ERROR(["Requires phosphor-dbus-interfaces package."]))
-PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,
+PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,\
AC_MSG_ERROR(["Requires sdbusplus package."]))
+# Check for sdbus++
+AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
+AS_IF([test "x$SDBUSPLUSPLUS" == "x"],
+ AC_MSG_ERROR(["Requires sdbus++"]))
+
# Checks for library functions
LT_INIT # Required for systemd linking
diff --git a/xyz/openbmc_project/Dump/Internal/Create.interface.yaml b/xyz/openbmc_project/Dump/Internal/Create.interface.yaml
new file mode 100644
index 0000000..4d3150b
--- /dev/null
+++ b/xyz/openbmc_project/Dump/Internal/Create.interface.yaml
@@ -0,0 +1,34 @@
+description: >
+ Implement to capture BMC Dump based on type.
+
+methods:
+ - name: Create
+ description: >
+ Create BMC Dump based on the Dump type.
+ parameters:
+ - name: Type
+ type: enum[self.Type]
+ description: >
+ Type of the Dump.
+ - name: FullPaths
+ type: array[string]
+ description: >
+ List of absolute paths to the files to be included
+ as part of Dump package.
+ errors:
+ - xyz.openbmc_project.Common.Error.InternalFailure
+ - xyz.openbmc_project.Common.File.Error.Write
+ - xyz.openbmc_project.Dump.Create.Error.Disabled
+ - xyz.openbmc_project.Dump.Create.Error.QuotaExceeded
+
+enumerations:
+ - name: Type
+ description: >
+ Possible types of BMC Dump.
+ values:
+ - name: ApplicationCored
+ description: >
+ Dump triggered due to application core.
+
+
+# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4