gsupplicant: Get the number of scan ssids from supplicant
authorMohamed Abbas <mohamed.abbas@intel.com>
Tue, 13 Sep 2011 06:55:16 +0000 (09:55 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 13 Sep 2011 08:53:59 +0000 (10:53 +0200)
gsupplicant/gsupplicant.h
gsupplicant/supplicant.c

index 8262ad0..a68bba0 100644 (file)
@@ -181,6 +181,8 @@ const void *g_supplicant_interface_get_wps_ssid(GSupplicantInterface *interface,
                                                        unsigned int *ssid_len);
 GSupplicantWpsState g_supplicant_interface_get_wps_state(GSupplicantInterface *interface);
 unsigned int g_supplicant_interface_get_mode(GSupplicantInterface *interface);
+unsigned int g_supplicant_interface_get_max_scan_ssids(
+                                       GSupplicantInterface *interface);
 
 /* Network API */
 struct _GSupplicantNetwork;
index dda2c92..599abd2 100644 (file)
@@ -153,6 +153,7 @@ struct _GSupplicantInterface {
        unsigned int pairwise_capa;
        unsigned int scan_capa;
        unsigned int mode_capa;
+       unsigned int max_scan_ssids;
        dbus_bool_t ready;
        GSupplicantState state;
        dbus_bool_t scanning;
@@ -624,7 +625,13 @@ static void interface_capability(const char *key, DBusMessageIter *iter,
        else if (g_strcmp0(key, "Modes") == 0)
                supplicant_dbus_array_foreach(iter,
                                interface_capability_mode, interface);
-       else
+       else if (g_strcmp0(key, "MaxScanSSID") == 0) {
+               dbus_int32_t max_scan_ssid;
+
+               dbus_message_iter_get_basic(iter, &max_scan_ssid);
+               interface->max_scan_ssids = max_scan_ssid;
+
+       } else
                SUPPLICANT_DBG("key %s type %c",
                                key, dbus_message_iter_get_arg_type(iter));
 }
@@ -727,6 +734,15 @@ unsigned int g_supplicant_interface_get_mode(GSupplicantInterface *interface)
        return interface->mode_capa;
 }
 
+unsigned int g_supplicant_interface_get_max_scan_ssids(
+                               GSupplicantInterface *interface)
+{
+       if (interface == NULL)
+               return 0;
+
+       return interface->max_scan_ssids;
+}
+
 GSupplicantInterface *g_supplicant_network_get_interface(
                                        GSupplicantNetwork *network)
 {