Add dbus async call for add/remove ipt rule
[platform/core/connectivity/stc-manager.git] / src / stc-manager-gdbus.c
index 943f466..a5cb068 100755 (executable)
@@ -466,6 +466,34 @@ API GVariant *stc_manager_gdbus_call_sync(GDBusConnection *connection,
        return reply;
 }
 
+API int stc_manager_gdbus_call_async(GDBusConnection *connection,
+                                     const char *dest, const char *path,
+                                     const char *interface_name,
+                                     const char *method, GVariant *params,
+                                     GAsyncReadyCallback notify_func,
+                                     void *user_data)
+{
+       if (connection == NULL) {
+               STC_LOGE("Failed to get GDBusconnection"); //LCOV_EXCL_LINE
+               return STC_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
+       }
+
+       g_dbus_connection_call(connection,
+                           dest,
+                           path,
+                           interface_name,
+                           method,
+                           params,
+                           NULL,
+                           G_DBUS_CALL_FLAGS_NONE,
+                           (5 * 1000),  /* 5 seconds timeout */
+                           NULL,
+                           (GAsyncReadyCallback)notify_func,
+                           (gpointer)user_data);
+
+       return STC_ERROR_NONE;
+}
+
 API guint stc_manager_gdbus_subscribe_signal(GDBusConnection *connection,
                                         const gchar *sender,
                                         const gchar *interface_name,