[PATCH] Adding fields channel and frequency in interface capability properties on dbus

Jouni Malinen j at w1.fi
Sun Dec 11 10:25:07 PST 2016


On Wed, Dec 07, 2016 at 08:04:20PM +0530, Avichal Agarwal wrote:
> -static int ctrl_iface_get_capability_channels(struct wpa_supplicant *wpa_s,
> +int ctrl_iface_get_capability_channels(struct wpa_supplicant *wpa_s,

This function returns a more or less human readable text string with
channels on each mode..

> -static int ctrl_iface_get_capability_freq(struct wpa_supplicant *wpa_s,
> +int ctrl_iface_get_capability_freq(struct wpa_supplicant *wpa_s,
>  					  char *buf, size_t buflen)

Same here..

> diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
> @@ -2642,6 +2642,27 @@ dbus_bool_t wpas_dbus_getter_capabilities(
> +	if (res >= 0) {
> +		char buf[4096];
> +		int len=4096;
> +		if( ctrl_iface_get_capability_freq(wpa_s, buf, len))
> +		{
> +			if(!wpa_dbus_dict_append_string(&iter_dict, "Frequency", buf))

This would expose that exact text string through the D-Bus interface.
That does not sound very convenient and consistent with D-Bus
expectations. Shouldn't this build a D-Bus array of integer values
instead? Or whatever more native D-Bus data structure that would fit in
here for the use case.

> +	if (res >= 0) {
> +		char buf[4096];
> +		int len=4096;
> +		 if(ctrl_iface_get_capability_channels(wpa_s, buf, len))
> +		 {
> +			 if(!wpa_dbus_dict_append_string(&iter_dict, "Channels", buf))

And same here.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list