dbus: Fix a typo in function name (invald -> invalid)

This commit is contained in:
Jouni Malinen 2010-01-01 21:52:29 +02:00
parent 291b60682a
commit db9a76c032
3 changed files with 46 additions and 46 deletions

View file

@ -147,13 +147,13 @@ static DBusMessage * wpas_dbus_error_network_unknown(DBusMessage *message)
/** /**
* wpas_dbus_error_invald_args - Return a new InvalidArgs error message * wpas_dbus_error_invalid_args - Return a new InvalidArgs error message
* @message: Pointer to incoming dbus message this error refers to * @message: Pointer to incoming dbus message this error refers to
* Returns: a dbus error message * Returns: a dbus error message
* *
* Convenience function to create and return an invalid options error * Convenience function to create and return an invalid options error
*/ */
DBusMessage * wpas_dbus_error_invald_args(DBusMessage *message, DBusMessage * wpas_dbus_error_invalid_args(DBusMessage *message,
const char *arg) const char *arg)
{ {
DBusMessage *reply; DBusMessage *reply;
@ -225,14 +225,14 @@ static DBusMessage * set_network_properties(DBusMessage *message,
DBusMessageIter iter_dict; DBusMessageIter iter_dict;
if (!wpa_dbus_dict_open_read(iter, &iter_dict)) if (!wpa_dbus_dict_open_read(iter, &iter_dict))
return wpas_dbus_error_invald_args(message, NULL); return wpas_dbus_error_invalid_args(message, NULL);
while (wpa_dbus_dict_has_dict_entry(&iter_dict)) { while (wpa_dbus_dict_has_dict_entry(&iter_dict)) {
char *value = NULL; char *value = NULL;
size_t size = 50; size_t size = 50;
int ret; int ret;
if (!wpa_dbus_dict_get_entry(&iter_dict, &entry)) { if (!wpa_dbus_dict_get_entry(&iter_dict, &entry)) {
reply = wpas_dbus_error_invald_args(message, NULL); reply = wpas_dbus_error_invalid_args(message, NULL);
break; break;
} }
if (entry.type == DBUS_TYPE_ARRAY && if (entry.type == DBUS_TYPE_ARRAY &&
@ -305,7 +305,7 @@ static DBusMessage * set_network_properties(DBusMessage *message,
error: error:
os_free(value); os_free(value);
reply = wpas_dbus_error_invald_args(message, entry.key); reply = wpas_dbus_error_invalid_args(message, entry.key);
wpa_dbus_dict_entry_clear(&entry); wpa_dbus_dict_entry_clear(&entry);
break; break;
} }
@ -433,8 +433,8 @@ DBusMessage * wpas_dbus_simple_property_setter(DBusMessage *message,
dbus_message_iter_recurse(&iter, &variant_iter); dbus_message_iter_recurse(&iter, &variant_iter);
if (dbus_message_iter_get_arg_type(&variant_iter) != type) { if (dbus_message_iter_get_arg_type(&variant_iter) != type) {
return wpas_dbus_error_invald_args(message, return wpas_dbus_error_invalid_args(message,
"wrong property type"); "wrong property type");
} }
dbus_message_iter_get_basic(&variant_iter, val); dbus_message_iter_get_basic(&variant_iter, val);
@ -644,7 +644,7 @@ out:
return reply; return reply;
error: error:
reply = wpas_dbus_error_invald_args(message, NULL); reply = wpas_dbus_error_invalid_args(message, NULL);
goto out; goto out;
} }
@ -795,7 +795,7 @@ DBusMessage * wpas_dbus_setter_debug_level(DBusMessage *message,
if (wpa_supplicant_set_debug_params(global, val, wpa_debug_timestamp, if (wpa_supplicant_set_debug_params(global, val, wpa_debug_timestamp,
wpa_debug_show_keys)) { wpa_debug_show_keys)) {
dbus_message_unref(reply); dbus_message_unref(reply);
return wpas_dbus_error_invald_args( return wpas_dbus_error_invalid_args(
message, "Wrong debug level value"); message, "Wrong debug level value");
} }
@ -935,7 +935,7 @@ static int wpas_dbus_get_scan_type(DBusMessage *message, DBusMessageIter *var,
if (dbus_message_iter_get_arg_type(var) != DBUS_TYPE_STRING) { if (dbus_message_iter_get_arg_type(var) != DBUS_TYPE_STRING) {
wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: " wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: "
"Type must be a string"); "Type must be a string");
*reply = wpas_dbus_error_invald_args( *reply = wpas_dbus_error_invalid_args(
message, "Wrong Type value type. String required"); message, "Wrong Type value type. String required");
return -1; return -1;
} }
@ -958,7 +958,7 @@ static int wpas_dbus_get_scan_ssids(DBusMessage *message, DBusMessageIter *var,
if (dbus_message_iter_get_arg_type(var) != DBUS_TYPE_ARRAY) { if (dbus_message_iter_get_arg_type(var) != DBUS_TYPE_ARRAY) {
wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: ssids " wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: ssids "
"must be an array of arrays of bytes"); "must be an array of arrays of bytes");
*reply = wpas_dbus_error_invald_args( *reply = wpas_dbus_error_invalid_args(
message, "Wrong SSIDs value type. Array of arrays of " message, "Wrong SSIDs value type. Array of arrays of "
"bytes required"); "bytes required");
return -1; return -1;
@ -971,7 +971,7 @@ static int wpas_dbus_get_scan_ssids(DBusMessage *message, DBusMessageIter *var,
{ {
wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: ssids " wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: ssids "
"must be an array of arrays of bytes"); "must be an array of arrays of bytes");
*reply = wpas_dbus_error_invald_args( *reply = wpas_dbus_error_invalid_args(
message, "Wrong SSIDs value type. Array of arrays of " message, "Wrong SSIDs value type. Array of arrays of "
"bytes required"); "bytes required");
return -1; return -1;
@ -983,7 +983,7 @@ static int wpas_dbus_get_scan_ssids(DBusMessage *message, DBusMessageIter *var,
wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: " wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: "
"Too many ssids specified on scan dbus " "Too many ssids specified on scan dbus "
"call"); "call");
*reply = wpas_dbus_error_invald_args( *reply = wpas_dbus_error_invalid_args(
message, "Too many ssids specified. Specify " message, "Too many ssids specified. Specify "
"at most four"); "at most four");
return -1; return -1;
@ -1032,7 +1032,7 @@ static int wpas_dbus_get_scan_ies(DBusMessage *message, DBusMessageIter *var,
if (dbus_message_iter_get_arg_type(var) != DBUS_TYPE_ARRAY) { if (dbus_message_iter_get_arg_type(var) != DBUS_TYPE_ARRAY) {
wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: ies must " wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: ies must "
"be an array of arrays of bytes"); "be an array of arrays of bytes");
*reply = wpas_dbus_error_invald_args( *reply = wpas_dbus_error_invalid_args(
message, "Wrong IEs value type. Array of arrays of " message, "Wrong IEs value type. Array of arrays of "
"bytes required"); "bytes required");
return -1; return -1;
@ -1045,7 +1045,7 @@ static int wpas_dbus_get_scan_ies(DBusMessage *message, DBusMessageIter *var,
{ {
wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: ies must " wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: ies must "
"be an array of arrays of bytes"); "be an array of arrays of bytes");
*reply = wpas_dbus_error_invald_args( *reply = wpas_dbus_error_invalid_args(
message, "Wrong IEs value type. Array required"); message, "Wrong IEs value type. Array required");
return -1; return -1;
} }
@ -1095,7 +1095,7 @@ static int wpas_dbus_get_scan_channels(DBusMessage *message,
if (dbus_message_iter_get_arg_type(var) != DBUS_TYPE_ARRAY) { if (dbus_message_iter_get_arg_type(var) != DBUS_TYPE_ARRAY) {
wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: " wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: "
"Channels must be an array of structs"); "Channels must be an array of structs");
*reply = wpas_dbus_error_invald_args( *reply = wpas_dbus_error_invalid_args(
message, "Wrong Channels value type. Array of structs " message, "Wrong Channels value type. Array of structs "
"required"); "required");
return -1; return -1;
@ -1107,7 +1107,7 @@ static int wpas_dbus_get_scan_channels(DBusMessage *message,
wpa_printf(MSG_DEBUG, wpa_printf(MSG_DEBUG,
"wpas_dbus_handler_scan[dbus]: Channels must be an " "wpas_dbus_handler_scan[dbus]: Channels must be an "
"array of structs"); "array of structs");
*reply = wpas_dbus_error_invald_args( *reply = wpas_dbus_error_invalid_args(
message, "Wrong Channels value type. Array of structs " message, "Wrong Channels value type. Array of structs "
"required"); "required");
return -1; return -1;
@ -1126,7 +1126,7 @@ static int wpas_dbus_get_scan_channels(DBusMessage *message,
"two UINT32s %c", "two UINT32s %c",
dbus_message_iter_get_arg_type( dbus_message_iter_get_arg_type(
&sub_array_iter)); &sub_array_iter));
*reply = wpas_dbus_error_invald_args( *reply = wpas_dbus_error_invalid_args(
message, "Wrong Channel struct. Two UINT32s " message, "Wrong Channel struct. Two UINT32s "
"required"); "required");
os_free(freqs); os_free(freqs);
@ -1140,7 +1140,7 @@ static int wpas_dbus_get_scan_channels(DBusMessage *message,
wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: " wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: "
"Channel must by specified by struct of " "Channel must by specified by struct of "
"two UINT32s"); "two UINT32s");
*reply = wpas_dbus_error_invald_args( *reply = wpas_dbus_error_invalid_args(
message, message,
"Wrong Channel struct. Two UINT32s required"); "Wrong Channel struct. Two UINT32s required");
os_free(freqs); os_free(freqs);
@ -1242,7 +1242,7 @@ DBusMessage * wpas_dbus_handler_scan(DBusMessage *message,
} else { } else {
wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: " wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: "
"Unknown argument %s", key); "Unknown argument %s", key);
reply = wpas_dbus_error_invald_args(message, key); reply = wpas_dbus_error_invalid_args(message, key);
goto out; goto out;
} }
@ -1252,7 +1252,7 @@ DBusMessage * wpas_dbus_handler_scan(DBusMessage *message,
if (!type) { if (!type) {
wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: " wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: "
"Scan type not specified"); "Scan type not specified");
reply = wpas_dbus_error_invald_args(message, key); reply = wpas_dbus_error_invalid_args(message, key);
goto out; goto out;
} }
@ -1260,7 +1260,7 @@ DBusMessage * wpas_dbus_handler_scan(DBusMessage *message,
if (params.num_ssids || params.extra_ies_len) { if (params.num_ssids || params.extra_ies_len) {
wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: " wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: "
"SSIDs or IEs specified for passive scan."); "SSIDs or IEs specified for passive scan.");
reply = wpas_dbus_error_invald_args( reply = wpas_dbus_error_invalid_args(
message, "You can specify only Channels in " message, "You can specify only Channels in "
"passive scan"); "passive scan");
goto out; goto out;
@ -1277,8 +1277,8 @@ DBusMessage * wpas_dbus_handler_scan(DBusMessage *message,
} else { } else {
wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: " wpa_printf(MSG_DEBUG, "wpas_dbus_handler_scan[dbus]: "
"Unknown scan type: %s", type); "Unknown scan type: %s", type);
reply = wpas_dbus_error_invald_args(message, reply = wpas_dbus_error_invalid_args(message,
"Wrong scan type"); "Wrong scan type");
goto out; goto out;
} }
@ -1418,13 +1418,13 @@ DBusMessage * wpas_dbus_handler_remove_network(DBusMessage *message,
/* is actually a child of this interface */ /* is actually a child of this interface */
iface = wpas_dbus_new_decompose_object_path(op, &net_id, NULL); iface = wpas_dbus_new_decompose_object_path(op, &net_id, NULL);
if (iface == NULL || os_strcmp(iface, wpa_s->dbus_new_path) != 0) { if (iface == NULL || os_strcmp(iface, wpa_s->dbus_new_path) != 0) {
reply = wpas_dbus_error_invald_args(message, op); reply = wpas_dbus_error_invalid_args(message, op);
goto out; goto out;
} }
id = strtoul(net_id, NULL, 10); id = strtoul(net_id, NULL, 10);
if (errno == EINVAL) { if (errno == EINVAL) {
reply = wpas_dbus_error_invald_args(message, op); reply = wpas_dbus_error_invalid_args(message, op);
goto out; goto out;
} }
@ -1480,13 +1480,13 @@ DBusMessage * wpas_dbus_handler_select_network(DBusMessage *message,
/* is actually a child of this interface */ /* is actually a child of this interface */
iface = wpas_dbus_new_decompose_object_path(op, &net_id, NULL); iface = wpas_dbus_new_decompose_object_path(op, &net_id, NULL);
if (iface == NULL || os_strcmp(iface, wpa_s->dbus_new_path) != 0) { if (iface == NULL || os_strcmp(iface, wpa_s->dbus_new_path) != 0) {
reply = wpas_dbus_error_invald_args(message, op); reply = wpas_dbus_error_invalid_args(message, op);
goto out; goto out;
} }
id = strtoul(net_id, NULL, 10); id = strtoul(net_id, NULL, 10);
if (errno == EINVAL) { if (errno == EINVAL) {
reply = wpas_dbus_error_invald_args(message, op); reply = wpas_dbus_error_invalid_args(message, op);
goto out; goto out;
} }
@ -2050,7 +2050,7 @@ DBusMessage * wpas_dbus_setter_ap_scan(DBusMessage *message,
return reply; return reply;
if (wpa_supplicant_set_ap_scan(wpa_s, ap_scan)) { if (wpa_supplicant_set_ap_scan(wpa_s, ap_scan)) {
return wpas_dbus_error_invald_args( return wpas_dbus_error_invalid_args(
message, "ap_scan must equal 0, 1 or 2"); message, "ap_scan must equal 0, 1 or 2");
} }
return NULL; return NULL;

View file

@ -187,8 +187,8 @@ DBusMessage * wpas_dbus_setter_process_credentials(
DBusMessage * wpas_dbus_getter_credentials(DBusMessage *message, DBusMessage * wpas_dbus_getter_credentials(DBusMessage *message,
struct wpa_supplicant *wpa_s); struct wpa_supplicant *wpa_s);
DBusMessage * wpas_dbus_error_invald_args(DBusMessage *message, DBusMessage * wpas_dbus_error_invalid_args(DBusMessage *message,
const char *arg); const char *arg);
DBusMessage * wpas_dbus_error_unknown_error(DBusMessage *message, DBusMessage * wpas_dbus_error_unknown_error(DBusMessage *message,
const char *arg); const char *arg);

View file

@ -67,7 +67,7 @@ DBusMessage * wpas_dbus_handler_wps_start(DBusMessage *message,
"wpas_dbus_handler_wps_start" "wpas_dbus_handler_wps_start"
"[dbus]: " "[dbus]: "
"wrong Role type. string required"); "wrong Role type. string required");
return wpas_dbus_error_invald_args( return wpas_dbus_error_invalid_args(
message, "Role must be a string"); message, "Role must be a string");
} }
dbus_message_iter_get_basic(&variant_iter, &val); dbus_message_iter_get_basic(&variant_iter, &val);
@ -79,8 +79,8 @@ DBusMessage * wpas_dbus_handler_wps_start(DBusMessage *message,
wpa_printf(MSG_DEBUG, wpa_printf(MSG_DEBUG,
"wpas_dbus_handler_wps_start[dbus]: " "wpas_dbus_handler_wps_start[dbus]: "
"unknown role %s", val); "unknown role %s", val);
return wpas_dbus_error_invald_args(message, return wpas_dbus_error_invalid_args(message,
val); val);
} }
} else if (strcmp(key, "Type") == 0) { } else if (strcmp(key, "Type") == 0) {
dbus_message_iter_recurse(&entry_iter, &variant_iter); dbus_message_iter_recurse(&entry_iter, &variant_iter);
@ -89,7 +89,7 @@ DBusMessage * wpas_dbus_handler_wps_start(DBusMessage *message,
wpa_printf(MSG_DEBUG, wpa_printf(MSG_DEBUG,
"wpas_dbus_handler_wps_start[dbus]: " "wpas_dbus_handler_wps_start[dbus]: "
"wrong Type type. string required"); "wrong Type type. string required");
return wpas_dbus_error_invald_args( return wpas_dbus_error_invalid_args(
message, "Type must be a string"); message, "Type must be a string");
} }
dbus_message_iter_get_basic(&variant_iter, &val); dbus_message_iter_get_basic(&variant_iter, &val);
@ -101,8 +101,8 @@ DBusMessage * wpas_dbus_handler_wps_start(DBusMessage *message,
wpa_printf(MSG_DEBUG, wpa_printf(MSG_DEBUG,
"wpas_dbus_handler_wps_start[dbus]: " "wpas_dbus_handler_wps_start[dbus]: "
"unknown type %s", val); "unknown type %s", val);
return wpas_dbus_error_invald_args(message, return wpas_dbus_error_invalid_args(message,
val); val);
} }
} else if (strcmp(key, "Bssid") == 0) { } else if (strcmp(key, "Bssid") == 0) {
dbus_message_iter_recurse(&entry_iter, &variant_iter); dbus_message_iter_recurse(&entry_iter, &variant_iter);
@ -113,7 +113,7 @@ DBusMessage * wpas_dbus_handler_wps_start(DBusMessage *message,
wpa_printf(MSG_DEBUG, wpa_printf(MSG_DEBUG,
"wpas_dbus_handler_wps_start[dbus]: " "wpas_dbus_handler_wps_start[dbus]: "
"wrong Bssid type. byte array required"); "wrong Bssid type. byte array required");
return wpas_dbus_error_invald_args( return wpas_dbus_error_invalid_args(
message, "Bssid must be a byte array"); message, "Bssid must be a byte array");
} }
dbus_message_iter_recurse(&variant_iter, &array_iter); dbus_message_iter_recurse(&variant_iter, &array_iter);
@ -123,7 +123,7 @@ DBusMessage * wpas_dbus_handler_wps_start(DBusMessage *message,
wpa_printf(MSG_DEBUG, wpa_printf(MSG_DEBUG,
"wpas_dbus_handler_wps_start[dbus]: " "wpas_dbus_handler_wps_start[dbus]: "
"wrong Bssid length %d", len); "wrong Bssid length %d", len);
return wpas_dbus_error_invald_args( return wpas_dbus_error_invalid_args(
message, "Bssid is wrong length"); message, "Bssid is wrong length");
} }
} }
@ -134,7 +134,7 @@ DBusMessage * wpas_dbus_handler_wps_start(DBusMessage *message,
wpa_printf(MSG_DEBUG, wpa_printf(MSG_DEBUG,
"wpas_dbus_handler_wps_start[dbus]: " "wpas_dbus_handler_wps_start[dbus]: "
"wrong Pin type. string required"); "wrong Pin type. string required");
return wpas_dbus_error_invald_args( return wpas_dbus_error_invalid_args(
message, "Pin must be a string"); message, "Pin must be a string");
} }
dbus_message_iter_get_basic(&variant_iter, &pin); dbus_message_iter_get_basic(&variant_iter, &pin);
@ -142,7 +142,7 @@ DBusMessage * wpas_dbus_handler_wps_start(DBusMessage *message,
wpa_printf(MSG_DEBUG, wpa_printf(MSG_DEBUG,
"wpas_dbus_handler_wps_start[dbus]: " "wpas_dbus_handler_wps_start[dbus]: "
"unknown key %s", key); "unknown key %s", key);
return wpas_dbus_error_invald_args(message, key); return wpas_dbus_error_invalid_args(message, key);
} }
dbus_message_iter_next(&dict_iter); dbus_message_iter_next(&dict_iter);
@ -151,19 +151,19 @@ DBusMessage * wpas_dbus_handler_wps_start(DBusMessage *message,
if (role == 0) { if (role == 0) {
wpa_printf(MSG_DEBUG, "wpas_dbus_handler_wps_start[dbus]: " wpa_printf(MSG_DEBUG, "wpas_dbus_handler_wps_start[dbus]: "
"Role not specified"); "Role not specified");
return wpas_dbus_error_invald_args(message, return wpas_dbus_error_invalid_args(message,
"Role not specified"); "Role not specified");
} }
else if (role == 1 && type == 0) { else if (role == 1 && type == 0) {
wpa_printf(MSG_DEBUG, "wpas_dbus_handler_wps_start[dbus]: " wpa_printf(MSG_DEBUG, "wpas_dbus_handler_wps_start[dbus]: "
"Type not specified"); "Type not specified");
return wpas_dbus_error_invald_args(message, return wpas_dbus_error_invalid_args(message,
"Type not specified"); "Type not specified");
} }
else if (role == 2 && pin == NULL) { else if (role == 2 && pin == NULL) {
wpa_printf(MSG_DEBUG, "wpas_dbus_handler_wps_start[dbus]: " wpa_printf(MSG_DEBUG, "wpas_dbus_handler_wps_start[dbus]: "
"Pin required for registrar role."); "Pin required for registrar role.");
return wpas_dbus_error_invald_args( return wpas_dbus_error_invalid_args(
message, "Pin required for registrar role."); message, "Pin required for registrar role.");
} }