unit-test: Move processing of interfaces added

Make it easier to unit test and continue reduction of main.cpp

Change-Id: Id360255e1546eda026e5e6ef9f15d29dcc82caaa
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/src/processing.hpp b/src/processing.hpp
index 8ef6e48..d5ed2b4 100644
--- a/src/processing.hpp
+++ b/src/processing.hpp
@@ -23,6 +23,17 @@
     std::string, boost::container::flat_map<
                      std::string, boost::container::flat_set<std::string>>>;
 
+/** @brief InterfacesAdded represents the dbus data from the signal
+ *
+ * There are 2 pairs
+ * pair1: D-bus Interface,vector[pair2]
+ * pair2: D-bus Method,vector[Associations]
+ */
+using InterfacesAdded = std::vector<std::pair<
+    std::string,
+    std::vector<std::pair<
+        std::string, sdbusplus::message::variant<std::vector<Association>>>>>>;
+
 /** @brief Get well known name of input unique name
  *
  * If user passes in well known name then that will be returned.
@@ -70,3 +81,22 @@
     interface_map_type& interfaceMap, AssociationOwnersType& assocOwners,
     AssociationInterfaces& assocInterfaces,
     sdbusplus::asio::object_server& server);
+
+/** @brief Handle an interfaces added signal
+ *
+ * @param[in,out] interfaceMap    - Global map of interfaces
+ * @param[in]     objPath         - New path to process
+ * @param[in]     interfacesAdded - New interfaces to process
+ * @param[in]     wellKnown       - Well known name that has new owner
+ * @param[in,out] assocOwners     - Owners of associations
+ * @param[in,out] assocInterfaces - Associations endpoints
+ * @param[in,out] server          - sdbus system object
+ *
+ */
+void processInterfaceAdded(interface_map_type& interfaceMap,
+                           const sdbusplus::message::object_path& objPath,
+                           const InterfacesAdded& intfAdded,
+                           const std::string& wellKnown,
+                           AssociationOwnersType& assocOwners,
+                           AssociationInterfaces& assocInterfaces,
+                           sdbusplus::asio::object_server& server);