5 * Copyright (C) 2007-2012 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);
43 return __connman_error_permission_denied(msg);
45 return __connman_error_already_exists(msg);
47 return __connman_error_invalid_arguments(msg);
49 return __connman_error_not_implemented(msg);
51 return __connman_error_no_carrier(msg);
53 return __connman_error_not_unique(msg);
55 return __connman_error_not_supported(msg);
57 return __connman_error_operation_aborted(msg);
59 return __connman_error_already_connected(msg);
61 return __connman_error_not_connected(msg);
63 return __connman_error_operation_timeout(msg);
66 return __connman_error_in_progress(msg);
68 return __connman_error_passphrase_required(msg);
71 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
72 ".Failed", "%s", str);
75 DBusMessage *__connman_error_invalid_arguments(DBusMessage *msg)
77 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
78 ".InvalidArguments", "Invalid arguments");
81 DBusMessage *__connman_error_permission_denied(DBusMessage *msg)
83 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
84 ".PermissionDenied", "Permission denied");
87 DBusMessage *__connman_error_passphrase_required(DBusMessage *msg)
89 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
90 ".PassphraseRequired", "Passphrase required");
93 DBusMessage *__connman_error_not_registered(DBusMessage *msg)
95 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
96 ".NotRegistered", "Not registered");
99 DBusMessage *__connman_error_not_unique(DBusMessage *msg)
101 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
102 ".NotUnique", "Not unique");
105 DBusMessage *__connman_error_not_supported(DBusMessage *msg)
107 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
108 ".NotSupported", "Not supported");
111 DBusMessage *__connman_error_not_implemented(DBusMessage *msg)
113 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
114 ".NotImplemented", "Not implemented");
117 DBusMessage *__connman_error_not_found(DBusMessage *msg)
119 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
120 ".NotFound", "Not found");
123 DBusMessage *__connman_error_no_carrier(DBusMessage *msg)
125 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
126 ".NoCarrier", "No carrier");
129 DBusMessage *__connman_error_in_progress(DBusMessage *msg)
131 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
132 ".InProgress", "In progress");
135 DBusMessage *__connman_error_already_exists(DBusMessage *msg)
137 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
138 ".AlreadyExists", "Already exists");
141 DBusMessage *__connman_error_already_enabled(DBusMessage *msg)
143 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
144 ".AlreadyEnabled", "Already enabled");
147 DBusMessage *__connman_error_already_disabled(DBusMessage *msg)
149 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
150 ".AlreadyDisabled", "Already disabled");
153 DBusMessage *__connman_error_already_connected(DBusMessage *msg)
155 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
156 ".AlreadyConnected", "Already connected");
159 DBusMessage *__connman_error_not_connected(DBusMessage *msg)
161 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
162 ".NotConnected", "Not connected");
164 DBusMessage *__connman_error_operation_aborted(DBusMessage *msg)
166 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
167 ".OperationAborted", "Operation aborted");
170 DBusMessage *__connman_error_operation_timeout(DBusMessage *msg)
172 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
173 ".OperationTimeout", "Operation timeout");
176 DBusMessage *__connman_error_invalid_service(DBusMessage *msg)
178 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
179 ".InvalidService", "Invalid service");
182 DBusMessage *__connman_error_invalid_property(DBusMessage *msg)
184 return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
185 ".InvalidProperty", "Invalid property");