Move codes which set DBus error to gdbus related source file 30/194730/1
authorYu <jiung.yu@samsung.com>
Fri, 7 Dec 2018 05:34:13 +0000 (14:34 +0900)
committerYu <jiung.yu@samsung.com>
Fri, 7 Dec 2018 05:34:23 +0000 (14:34 +0900)
Change-Id: Ie1ed3b8c122ad26f5c859684fa24f405066efaa7
Signed-off-by: Yu Jiung <jiung.yu@samsung.com>
src/CMakeLists.txt
src/inm-apagent.c [deleted file]
src/inm-error.c [deleted file]
src/inm-gdbus.c
src/inm-netaccess.c [deleted file]

index 2d8cc96c754f1e8230ee48d0d7589de94023512d..7dbd3b17f312aebc76a3dc5661353a7da9eaecfe 100644 (file)
@@ -49,7 +49,6 @@ SET(SRCS
        ${CMAKE_SOURCE_DIR}/src/inm-connman-mgr.c
        ${CMAKE_SOURCE_DIR}/src/inm-connman-service.c
        ${CMAKE_SOURCE_DIR}/src/inm-connman-tech.c
-       ${CMAKE_SOURCE_DIR}/src/inm-error.c
        ${CMAKE_SOURCE_DIR}/src/inm-supplicant.c
        ${CMAKE_SOURCE_DIR}/src/inm-supplicant-iface.c
        ${CMAKE_SOURCE_DIR}/src/inm-supplicant-wps.c
diff --git a/src/inm-apagent.c b/src/inm-apagent.c
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/src/inm-error.c b/src/inm-error.c
deleted file mode 100644 (file)
index d3785be..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Network Monitoring Module
- *
- * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/**
- * This file implements functions for error.
- *
- * @file        nm-error.c
- * @author      Jiung Yu (jiung.yu@samsung.com)
- * @version     0.1
- */
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <glib.h>
-#include <gio/gio.h>
-
-#include "inm-manager.h"
-#include "inm-util.h"
-#include "inm-manager-log.h"
-#include "inm-error.h"
-
-
-#define INM_MANAGER_ERROR_QUARK g_quark_from_string("nm-manager-error-quark")
-
-#define INM_ERR_STR_INVALID_PARAM "net.inmmanager.Error.InvalidParameter"
-#define INM_ERR_STR_NOT_PERMITTED "net.inmmanager.Error.NotPermitted"
-#define INM_ERR_STR_OUT_OF_MEMORY "net.inmmanager.Error.OutOfMemory"
-#define INM_ERR_STR_OP_FAILED "net.inmmanager.Error.OperationFailed"
-#define INM_ERR_STR_IN_PROGRESS "net.inmmanager.Error.InProgress"
-
-//LCOV_EXCL_START
-static void inm_error_invalid_parameter(GError **error)
-{
-       *error = g_dbus_error_new_for_dbus_error(
-                       INM_ERR_STR_INVALID_PARAM,
-                       INM_ERR_STR_INVALID_PARAM);
-}
-
-static void inm_error_not_permitted(GError **error)
-{
-       *error = g_dbus_error_new_for_dbus_error(
-                       INM_ERR_STR_NOT_PERMITTED,
-                       INM_ERR_STR_NOT_PERMITTED);
-}
-
-static void inm_error_out_of_memory(GError **error)
-{
-       *error = g_dbus_error_new_for_dbus_error(
-                       INM_ERR_STR_OUT_OF_MEMORY,
-                       INM_ERR_STR_OUT_OF_MEMORY);
-}
-
-static void inm_error_operation_failed(GError **error)
-{
-       *error = g_dbus_error_new_for_dbus_error(
-                       INM_ERR_STR_OP_FAILED,
-                       INM_ERR_STR_OP_FAILED);
-}
-
-static void inm_error_in_progress(GError **error)
-{
-       *error = g_dbus_error_new_for_dbus_error(
-                       INM_ERR_STR_IN_PROGRESS,
-                       INM_ERR_STR_IN_PROGRESS);
-}
-
-
-void inm_error_set_gerror(inm_manager_error_e error_code, GError **error)
-{
-       switch (error_code) {
-       case INM_MANAGER_ERROR_INVALID_PARAM:
-               inm_error_invalid_parameter(error);
-               break;
-       case INM_MANAGER_ERROR_NOT_PERMITTED:
-               inm_error_not_permitted(error);
-               break;
-       case INM_MANAGER_ERROR_OUT_OF_MEMORY:
-               inm_error_out_of_memory(error);
-               break;
-       case INM_MANAGER_ERROR_OPERATION_FAILED:
-               inm_error_operation_failed(error);
-               break;
-       case INM_MANAGER_ERROR_IN_PROGRESS:
-               inm_error_in_progress(error);
-               break;
-       default:
-               INM_LOGI("Error Not handled [%d]", error_code);
-               inm_error_operation_failed(error);
-       }
-}
-void inm_error_register(void)
-{
-       g_dbus_error_register_error(INM_MANAGER_ERROR_QUARK,
-                       INM_MANAGER_ERROR_INVALID_PARAM,
-                       INM_ERR_STR_INVALID_PARAM);
-
-       g_dbus_error_register_error(INM_MANAGER_ERROR_QUARK,
-                       INM_MANAGER_ERROR_NOT_PERMITTED,
-                       INM_ERR_STR_NOT_PERMITTED);
-
-       g_dbus_error_register_error(INM_MANAGER_ERROR_QUARK,
-                       INM_MANAGER_ERROR_OUT_OF_MEMORY,
-                       INM_ERR_STR_OUT_OF_MEMORY);
-
-       g_dbus_error_register_error(INM_MANAGER_ERROR_QUARK,
-                       INM_MANAGER_ERROR_OPERATION_FAILED,
-                       INM_ERR_STR_OP_FAILED);
-
-       g_dbus_error_register_error(INM_MANAGER_ERROR_QUARK,
-                       INM_MANAGER_ERROR_IN_PROGRESS,
-                       INM_ERR_STR_IN_PROGRESS);
-
-}
-
-void inm_error_deregister(void)
-{
-       g_dbus_error_unregister_error(INM_MANAGER_ERROR_QUARK,
-                       INM_MANAGER_ERROR_INVALID_PARAM,
-                       INM_ERR_STR_INVALID_PARAM);
-
-
-       g_dbus_error_unregister_error(INM_MANAGER_ERROR_QUARK,
-                       INM_MANAGER_ERROR_NOT_PERMITTED,
-                       INM_ERR_STR_NOT_PERMITTED);
-
-
-       g_dbus_error_unregister_error(INM_MANAGER_ERROR_QUARK,
-                       INM_MANAGER_ERROR_OUT_OF_MEMORY,
-                       INM_ERR_STR_OUT_OF_MEMORY);
-
-       g_dbus_error_unregister_error(INM_MANAGER_ERROR_QUARK,
-                       INM_MANAGER_ERROR_OPERATION_FAILED,
-                       INM_ERR_STR_OP_FAILED);
-
-       g_dbus_error_unregister_error(INM_MANAGER_ERROR_QUARK,
-                       INM_MANAGER_ERROR_IN_PROGRESS,
-                       INM_ERR_STR_IN_PROGRESS);
-
-}
-//LCOV_EXCL_STOP
index 9eb67cd4f7adeece165cecfc58d000fec4b12725..50c5de56a3fce2d5ad1068d8676315ca2c80f724 100644 (file)
 #include "inm-error.h"
 #include "inm-gdbus.h"
 
+#define INM_MANAGER_ERROR_QUARK g_quark_from_string("nm-manager-error-quark")
+
+#define INM_ERR_STR_INVALID_PARAM "net.inmmanager.Error.InvalidParameter"
+#define INM_ERR_STR_NOT_PERMITTED "net.inmmanager.Error.NotPermitted"
+#define INM_ERR_STR_OUT_OF_MEMORY "net.inmmanager.Error.OutOfMemory"
+#define INM_ERR_STR_OP_FAILED "net.inmmanager.Error.OperationFailed"
+#define INM_ERR_STR_IN_PROGRESS "net.inmmanager.Error.InProgress"
+
 #define INM_WIFI_SERVICE INM_MANAGER_SERVICE ".wifi"
 #define INM_WIFI_IFACE INM_MANAGER_SERVICE ".wifi"
 #define INM_WIFI_OBJ INM_MANAGER_OBJ "/wifi"
@@ -276,6 +284,117 @@ static const gchar inm_conn_introspection_xml[] = {
 
 gdbus_mon_s gdbus_mon;
 
+//LCOV_EXCL_START
+static void inm_error_invalid_parameter(GError **error)
+{
+       *error = g_dbus_error_new_for_dbus_error(
+                       INM_ERR_STR_INVALID_PARAM,
+                       INM_ERR_STR_INVALID_PARAM);
+}
+
+static void inm_error_not_permitted(GError **error)
+{
+       *error = g_dbus_error_new_for_dbus_error(
+                       INM_ERR_STR_NOT_PERMITTED,
+                       INM_ERR_STR_NOT_PERMITTED);
+}
+
+static void inm_error_out_of_memory(GError **error)
+{
+       *error = g_dbus_error_new_for_dbus_error(
+                       INM_ERR_STR_OUT_OF_MEMORY,
+                       INM_ERR_STR_OUT_OF_MEMORY);
+}
+
+static void inm_error_operation_failed(GError **error)
+{
+       *error = g_dbus_error_new_for_dbus_error(
+                       INM_ERR_STR_OP_FAILED,
+                       INM_ERR_STR_OP_FAILED);
+}
+
+static void inm_error_in_progress(GError **error)
+{
+       *error = g_dbus_error_new_for_dbus_error(
+                       INM_ERR_STR_IN_PROGRESS,
+                       INM_ERR_STR_IN_PROGRESS);
+}
+
+void inm_error_set_gerror(inm_manager_error_e error_code, GError **error)
+{
+       switch (error_code) {
+       case INM_MANAGER_ERROR_INVALID_PARAM:
+               inm_error_invalid_parameter(error);
+               break;
+       case INM_MANAGER_ERROR_NOT_PERMITTED:
+               inm_error_not_permitted(error);
+               break;
+       case INM_MANAGER_ERROR_OUT_OF_MEMORY:
+               inm_error_out_of_memory(error);
+               break;
+       case INM_MANAGER_ERROR_OPERATION_FAILED:
+               inm_error_operation_failed(error);
+               break;
+       case INM_MANAGER_ERROR_IN_PROGRESS:
+               inm_error_in_progress(error);
+               break;
+       default:
+               INM_LOGI("Error Not handled [%d]", error_code);
+               inm_error_operation_failed(error);
+       }
+}
+
+void inm_error_register(void)
+{
+       g_dbus_error_register_error(INM_MANAGER_ERROR_QUARK,
+                       INM_MANAGER_ERROR_INVALID_PARAM,
+                       INM_ERR_STR_INVALID_PARAM);
+
+       g_dbus_error_register_error(INM_MANAGER_ERROR_QUARK,
+                       INM_MANAGER_ERROR_NOT_PERMITTED,
+                       INM_ERR_STR_NOT_PERMITTED);
+
+       g_dbus_error_register_error(INM_MANAGER_ERROR_QUARK,
+                       INM_MANAGER_ERROR_OUT_OF_MEMORY,
+                       INM_ERR_STR_OUT_OF_MEMORY);
+
+       g_dbus_error_register_error(INM_MANAGER_ERROR_QUARK,
+                       INM_MANAGER_ERROR_OPERATION_FAILED,
+                       INM_ERR_STR_OP_FAILED);
+
+       g_dbus_error_register_error(INM_MANAGER_ERROR_QUARK,
+                       INM_MANAGER_ERROR_IN_PROGRESS,
+                       INM_ERR_STR_IN_PROGRESS);
+
+}
+
+void inm_error_deregister(void)
+{
+       g_dbus_error_unregister_error(INM_MANAGER_ERROR_QUARK,
+                       INM_MANAGER_ERROR_INVALID_PARAM,
+                       INM_ERR_STR_INVALID_PARAM);
+
+
+       g_dbus_error_unregister_error(INM_MANAGER_ERROR_QUARK,
+                       INM_MANAGER_ERROR_NOT_PERMITTED,
+                       INM_ERR_STR_NOT_PERMITTED);
+
+
+       g_dbus_error_unregister_error(INM_MANAGER_ERROR_QUARK,
+                       INM_MANAGER_ERROR_OUT_OF_MEMORY,
+                       INM_ERR_STR_OUT_OF_MEMORY);
+
+       g_dbus_error_unregister_error(INM_MANAGER_ERROR_QUARK,
+                       INM_MANAGER_ERROR_OPERATION_FAILED,
+                       INM_ERR_STR_OP_FAILED);
+
+       g_dbus_error_unregister_error(INM_MANAGER_ERROR_QUARK,
+                       INM_MANAGER_ERROR_IN_PROGRESS,
+                       INM_ERR_STR_IN_PROGRESS);
+
+}
+//LCOV_EXCL_STOP
+
 GDBusConnection *inm_gdbus_get_connection(void)
 {
        return gdbus_mon.conn;
diff --git a/src/inm-netaccess.c b/src/inm-netaccess.c
deleted file mode 100644 (file)
index e69de29..0000000