Remove syspopup
[platform/core/connectivity/net-config.git] / src / neterror.c
1 /*
2  * Network Configuration Module
3  *
4  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #include <glib.h>
21
22 #include "neterror.h"
23 #include "netconfig.h"
24
25 #define NETCONFIG_ERROR_INTERFACE NETCONFIG_SERVICE ".Error"
26
27 GQuark netconfig_error_quark(void)
28 {
29         static GQuark quark = 0;
30
31         if (!quark)
32                 quark = g_quark_from_static_string("netconfig_error");
33
34         return quark;
35 }
36
37 void netconfig_error_wifi_load_inprogress(GError **error)
38 {
39         g_set_error(error, netconfig_error_quark(), NETCONFIG_ERROR_WIFI_LOAD_INPROGRESS,
40                         NETCONFIG_ERROR_INTERFACE ".WifiLoadInprogress");
41 }
42
43 void netconfig_error_wifi_driver_failed(GError **error)
44 {
45         g_set_error(error, netconfig_error_quark(), NETCONFIG_ERROR_WIFI_DRIVER_FAILURE,
46                         NETCONFIG_ERROR_INTERFACE ".WifiDriverFailed");
47 }
48
49 void netconfig_error_security_restricted(GError **error)
50 {
51         g_set_error(error, netconfig_error_quark(), NETCONFIG_ERROR_SECURITY_RESTRICTED,
52                         NETCONFIG_ERROR_INTERFACE ".SecurityRestricted");
53 }
54
55 void netconfig_error_wifi_direct_failed(GError **error)
56 {
57         g_set_error(error, netconfig_error_quark(), NETCONFIG_ERROR_WIFI_DRIVER_FAILURE,
58                         NETCONFIG_ERROR_INTERFACE ".WifiDirectFailed");
59 }
60
61 void netconfig_error_fail_get_imsi(GError **error)
62 {
63         g_set_error(error, netconfig_error_quark(), NETCONFIG_ERROR_FAILED_GET_IMSI,
64                         NETCONFIG_ERROR_INTERFACE".FailGetSimImsi");
65 }
66
67 void netconfig_error_fail_req_sim_auth(GError **error)
68 {
69         g_set_error(error, netconfig_error_quark(), NETCONFIG_ERROR_FAILED_REQ_SIM_AUTH,
70                         NETCONFIG_ERROR_INTERFACE".FailReqSimAuth");
71 }
72
73 void netconfig_error_fail_req_sim_auth_wrong_param(GError **error)
74 {
75         g_set_error(error, netconfig_error_quark(), NETCONFIG_ERROR_FAILED_REQ_SIM_AUTH_WRONG_PARAM,
76                         NETCONFIG_ERROR_INTERFACE".FailReqSimAuthWrongParam");
77 }
78
79 void netconfig_error_fail_get_sim_auth_wrong_data(GError **error)
80 {
81         g_set_error(error, netconfig_error_quark(), NETCONFIG_ERROR_FAILED_GET_SIM_AUTH_WRONG_DATA,
82                         NETCONFIG_ERROR_INTERFACE".FailGetSimAuthWrongData");
83 }
84
85 void netconfig_error_fail_get_sim_auth_delay(GError **error)
86 {
87         g_set_error(error, netconfig_error_quark(), NETCONFIG_ERROR_FAILED_GET_SIM_AUTH_DELAY,
88                         NETCONFIG_ERROR_INTERFACE".FailGetSimAuthDelay");
89 }