mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
D-Bus: Add WPS model name as property
Signed-off-by: Avichal Agarwal <avichal.a@samsung.com> Signed-off-by: Kyeong-Chae Lim <kcya.lim@samsung.com>
This commit is contained in:
parent
318d4b5beb
commit
ae66822cd8
@ -3246,6 +3246,12 @@ static const struct wpa_dbus_property_desc wpas_dbus_interface_properties[] = {
|
||||
wpas_dbus_setter_wps_manufacturer,
|
||||
NULL
|
||||
},
|
||||
{
|
||||
"ModelName", WPAS_DBUS_NEW_IFACE_WPS, "s",
|
||||
wpas_dbus_getter_wps_device_model_name,
|
||||
wpas_dbus_setter_wps_device_model_name,
|
||||
NULL
|
||||
},
|
||||
#endif /* CONFIG_WPS */
|
||||
#ifdef CONFIG_P2P
|
||||
{ "P2PDeviceConfig", WPAS_DBUS_NEW_IFACE_P2PDEVICE, "a{sv}",
|
||||
|
@ -190,6 +190,8 @@ DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_name);
|
||||
DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_name);
|
||||
DECLARE_ACCESSOR(wpas_dbus_getter_wps_manufacturer);
|
||||
DECLARE_ACCESSOR(wpas_dbus_setter_wps_manufacturer);
|
||||
DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_model_name);
|
||||
DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_model_name);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_tdls_discover(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
@ -572,3 +572,61 @@ dbus_bool_t wpas_dbus_setter_wps_manufacturer(
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpas_dbus_getter_wps_device_model_name - Get current device model name
|
||||
* @iter: Pointer to incoming dbus message iter
|
||||
* @error: Location to store error on failure
|
||||
* @user_data: Function specific data
|
||||
* Returns: TRUE on success, FALSE on failure
|
||||
*
|
||||
* Getter for "ModelName" property.
|
||||
*/
|
||||
dbus_bool_t wpas_dbus_getter_wps_device_model_name(
|
||||
const struct wpa_dbus_property_desc *property_desc,
|
||||
DBusMessageIter *iter, DBusError *error, void *user_data)
|
||||
{
|
||||
struct wpa_supplicant *wpa_s = user_data;
|
||||
char *model_name = wpa_s->conf->model_name;
|
||||
|
||||
if (!model_name)
|
||||
model_name = "";
|
||||
return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_STRING,
|
||||
&model_name, error);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpas_dbus_setter_wps_device_model_name - Set current device model name
|
||||
* @iter: Pointer to incoming dbus message iter
|
||||
* @error: Location to store error on failure
|
||||
* @user_data: Function specific data
|
||||
* Returns: TRUE on success, FALSE on failure
|
||||
*
|
||||
* Setter for "ModelName" property.
|
||||
*/
|
||||
dbus_bool_t wpas_dbus_setter_wps_device_model_name(
|
||||
const struct wpa_dbus_property_desc *property_desc,
|
||||
DBusMessageIter *iter, DBusError *error, void *user_data)
|
||||
{
|
||||
struct wpa_supplicant *wpa_s = user_data;
|
||||
char *methods, *model_name;
|
||||
|
||||
if (!wpas_dbus_simple_property_setter(iter, error, DBUS_TYPE_STRING,
|
||||
&methods))
|
||||
return FALSE;
|
||||
|
||||
if (os_strlen(methods) > WPS_MODEL_NAME_MAX_LEN)
|
||||
return FALSE;
|
||||
|
||||
model_name = os_strdup(methods);
|
||||
if (!model_name)
|
||||
return FALSE;
|
||||
os_free(wpa_s->conf->model_name);
|
||||
wpa_s->conf->model_name = model_name;
|
||||
wpa_s->conf->changed_parameters |= CFG_CHANGED_WPS_STRING;
|
||||
wpa_supplicant_update_config(wpa_s);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user