5 * Copyright (C) 2007-2013 Intel Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33 DBusMessage *__connman_error_failed(DBusMessage *msg, int errnum)
35 const char *str = strerror(errnum);
39 return __connman_error_not_registered(msg);
41 return __connman_error_not_found(msg);
44 return __connman_error_permission_denied(msg);
46 return __connman_error_already_exists(msg);
48 return __connman_error_invalid_arguments(msg);
50 return __connman_error_not_implemented(msg);
52 return __connman_error_no_carrier(msg);
54 return __connman_error_not_unique(msg);
56 return __connman_error_not_supported(msg);
58 return __connman_error_operation_aborted(msg);
60 return __connman_error_already_connected(msg);
63 return __connman_error_not_connected(msg);
65 return __connman_error_operation_timeout(msg);
68 return __connman_error_in_progress(msg);
70 return __connman_error_passphrase_required(msg);
72 return __connman_error_operation_canceled(msg);
75 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
76 ".Failed", "%s", str);
79 DBusMessage *__connman_error_invalid_arguments(DBusMessage *msg)
81 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
82 ".InvalidArguments", "Invalid arguments");
85 DBusMessage *__connman_error_permission_denied(DBusMessage *msg)
87 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
88 ".PermissionDenied", "Permission denied");
91 DBusMessage *__connman_error_passphrase_required(DBusMessage *msg)
93 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
94 ".PassphraseRequired", "Passphrase required");
97 DBusMessage *__connman_error_not_registered(DBusMessage *msg)
99 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
100 ".NotRegistered", "Not registered");
103 DBusMessage *__connman_error_not_unique(DBusMessage *msg)
105 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
106 ".NotUnique", "Not unique");
109 DBusMessage *__connman_error_not_supported(DBusMessage *msg)
111 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
112 ".NotSupported", "Not supported");
115 DBusMessage *__connman_error_not_implemented(DBusMessage *msg)
117 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
118 ".NotImplemented", "Not implemented");
121 DBusMessage *__connman_error_not_found(DBusMessage *msg)
123 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
124 ".NotFound", "Not found");
127 DBusMessage *__connman_error_no_carrier(DBusMessage *msg)
129 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
130 ".NoCarrier", "No carrier");
133 DBusMessage *__connman_error_in_progress(DBusMessage *msg)
135 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
136 ".InProgress", "In progress");
139 DBusMessage *__connman_error_already_exists(DBusMessage *msg)
141 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
142 ".AlreadyExists", "Already exists");
145 DBusMessage *__connman_error_already_enabled(DBusMessage *msg)
147 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
148 ".AlreadyEnabled", "Already enabled");
151 DBusMessage *__connman_error_already_disabled(DBusMessage *msg)
153 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
154 ".AlreadyDisabled", "Already disabled");
157 DBusMessage *__connman_error_already_connected(DBusMessage *msg)
159 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
160 ".AlreadyConnected", "Already connected");
163 DBusMessage *__connman_error_not_connected(DBusMessage *msg)
165 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
166 ".NotConnected", "Not connected");
168 DBusMessage *__connman_error_operation_aborted(DBusMessage *msg)
170 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
171 ".OperationAborted", "Operation aborted");
174 DBusMessage *__connman_error_operation_timeout(DBusMessage *msg)
176 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
177 ".OperationTimeout", "Operation timeout");
180 DBusMessage *__connman_error_invalid_service(DBusMessage *msg)
182 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
183 ".InvalidService", "Invalid service");
186 DBusMessage *__connman_error_invalid_property(DBusMessage *msg)
188 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
189 ".InvalidProperty", "Invalid property");
192 #if defined TIZEN_EXT_WIFI_MESH
193 DBusMessage *__connman_error_invalid_command(DBusMessage *msg)
195 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
196 ".InvalidCommand", "Invalid Mesh Command");
199 DBusMessage *__connman_error_scan_abort_failed(DBusMessage *msg)
201 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
202 ".ScanAbortFailed", "Scan Abort Failed");
206 DBusMessage *__connman_error_operation_canceled(DBusMessage *msg)
208 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
209 ".OperationCanceled", "Operation canceled");