Define the create interface for VLAN
Network Manager may implement multiple interface object
Create interface helps in creating specific interface.
Create interface declares the interface for creating
a specific object.
Change-Id: I7433a8569f7e08f9ceb0ff8d01e8c42b04b3b5af
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/Makefile.am b/Makefile.am
index 6f95786..abc5067 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,7 @@
+# Build these headers, don't install them
+nobase_nodist_include_HEADERS = \
+ xyz/openbmc_project/Network/VLAN/Create/server.hpp
+
sbin_PROGRAMS = netman_watch_dns phosphor-network-manager
@@ -11,7 +15,17 @@
phosphor_network_manager_SOURCES = \
ethernet_interface.cpp \
- network_manager_main.cpp
+ network_manager_main.cpp \
+ xyz/openbmc_project/Network/VLAN/Create/server.cpp
+
+CLEANFILES = \
+ xyz/openbmc_project/Network/VLAN/Create/server.cpp \
+ xyz/openbmc_project/Network/VLAN/Create/server.hpp
+
+BUILT_SOURCES = \
+ xyz/openbmc_project/Network/VLAN/Create/server.cpp \
+ xyz/openbmc_project/Network/VLAN/Create/server.hpp
+
phosphor_network_manager_LDFLAGS = \
$(SYSTEMD_LIBS) \
@@ -22,3 +36,11 @@
$(SYSTEMD_CFLAGS) \
$(SDBUSPLUS_CFLAGS) \
$(PHOSPHOR_DBUS_INTERFACES_CFLAGS)
+
+xyz/openbmc_project/Network/VLAN/Create/server.cpp: xyz/openbmc_project/Network/VLAN/Create.interface.yaml xyz/openbmc_project/Network/VLAN/Create/server.hpp
+ @mkdir -p `dirname $@`
+ $(SDBUSPLUSPLUS) -r $(srcdir) interface server-cpp xyz.openbmc_project.Network.VLAN.Create > $@
+
+xyz/openbmc_project/Network/VLAN/Create/server.hpp: xyz/openbmc_project/Network/VLAN/Create.interface.yaml
+ @mkdir -p `dirname $@`
+ $(SDBUSPLUSPLUS) -r $(srcdir) interface server-header xyz.openbmc_project.Network.VLAN.Create > $@
diff --git a/configure.ac b/configure.ac
index 56a430c..17a8efb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,6 +27,9 @@
PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],,\
AC_MSG_ERROR(["Requires sdbusplus package."]))
+
+AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
+
PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],,\
AC_MSG_ERROR(["Requires phosphor-logging package."]))
diff --git a/xyz/openbmc_project/Network/VLAN/Create.interface.yaml b/xyz/openbmc_project/Network/VLAN/Create.interface.yaml
new file mode 100644
index 0000000..591b0db
--- /dev/null
+++ b/xyz/openbmc_project/Network/VLAN/Create.interface.yaml
@@ -0,0 +1,14 @@
+description: >
+methods:
+ - name: VLAN
+ description: >
+ Create VLANInterface Object.
+ parameters:
+ - name: InterfaceName
+ type: string
+ description: >
+ Name of the interface.
+ - name: Id
+ type: uint16
+ description: >
+ VLAN Identifier.