#define IEEE80211_CAP_IBSS 0x0002
#define IEEE80211_CAP_PRIVACY 0x0010
+#if defined TIZEN_EXT
+#define COUNTRY_CODE_LENGTH 2
+#endif
+
#define BSS_UNKNOWN_STRENGTH -90
static DBusConnection *connection;
dbus_bool_t ft_ieee8021x;
GSList *vsie_list;
dbus_bool_t hs20;
+ unsigned char country_code[COUNTRY_CODE_LENGTH];
#endif
unsigned int wps_capabilities;
};
char *phase2;
unsigned int keymgmt;
GSList *vsie_list;
+ unsigned char country_code[COUNTRY_CODE_LENGTH];
#endif
};
void *user_data;
};
+#if defined TIZEN_EXT
+struct g_connman_bssids {
+ char bssid[18];
+ uint16_t strength;
+ uint16_t frequency;
+};
+#endif
+
static int network_remove(struct interface_data *data);
static inline void debug(const char *format, ...)
return network->keymgmt;
}
+
+const unsigned char *g_supplicant_network_get_countrycode(GSupplicantNetwork
+ *network)
+{
+ if (!network)
+ return NULL;
+
+ return network->country_code;
+}
#endif
const unsigned char *g_supplicant_peer_get_widi_ies(GSupplicantPeer *peer,
return vsie_list;
}
+
+static void update_bssid_list(gpointer key, gpointer value, gpointer user_data)
+{
+ struct g_supplicant_bss *bss = value;
+ struct g_connman_bssids *bssids = NULL;
+ char buff[18];
+ GSList **list = (GSList **)user_data;
+
+ bssids = (struct g_connman_bssids *)g_try_malloc0(sizeof(struct g_connman_bssids));
+
+ if (bssids) {
+ g_snprintf(buff, 18, "%02x:%02x:%02x:%02x:%02x:%02x",
+ bss->bssid[0], bss->bssid[1], bss->bssid[2], bss->bssid[3],
+ bss->bssid[4], bss->bssid[5]);
+
+ memcpy(bssids->bssid, buff, 18);
+ bssids->bssid[17] = '\0';
+ bssids->strength = bss->signal;
+ bssids->strength += 120;
+
+ if (bssids->strength > 100)
+ bssids->strength = 100;
+
+ bssids->frequency = bss->frequency;
+ *list = g_slist_append(*list, bssids);
+ } else
+ SUPPLICANT_DBG("Failed to allocate memory");
+}
+
+void *g_supplicant_network_get_bssid_list(GSupplicantNetwork *network)
+{
+ GSList *bssid_list = NULL;
+
+ if (g_hash_table_size(network->bss_table) < 1)
+ return NULL;
+
+ g_hash_table_foreach(network->bss_table, update_bssid_list, &bssid_list);
+
+ return bssid_list;
+}
#endif
static void merge_network(GSupplicantNetwork *network)
}
network->isHS20AP = bss->hs20;
+ memcpy(network->country_code, bss->country_code, COUNTRY_CODE_LENGTH);
#endif
SUPPLICANT_DBG("New network %s created", network->name);
#define WPS_CONFIGURED 0x02
#if defined TIZEN_EXT
#define VENDOR_SPECIFIC_INFO 0xDD
+#define WLAN_EID_COUNTRY 7
#endif
dbus_message_iter_recurse(iter, &array);
bss->wps_capabilities = 0;
bss->keymgmt = 0;
+ memset(bss->country_code, 0, COUNTRY_CODE_LENGTH);
for (ie_end = ie + ie_len; ie < ie_end && ie + ie[1] + 1 <= ie_end;
ie += ie[1] + 2) {
SUPPLICANT_DBG("Failed to allocate memory");
continue;
}
+
+ if(ie[0] == WLAN_EID_COUNTRY && ie[1] >= 2) {
+ memcpy(bss->country_code, ie+2, COUNTRY_CODE_LENGTH);
+ continue;
+ }
#endif
if (ie[0] != WMM_WPA1_WPS_INFO || ie[1] < WPS_INFO_MIN_LEN ||
memcmp(ie+2, WPS_OUI, sizeof(WPS_OUI)) != 0)
DBUS_TYPE_STRING,
&ssid->passphrase);
}
+
+static void add_network_security_fast(DBusMessageIter *dict,
+ GSupplicantSSID *ssid)
+{
+ /*
+ * For FAST, we at least need:
+ * id / password
+ * phase1 (provisiong information)
+ * pac_file
+ */
+
+ /* Allow provisioing both authenticated and unauthenticated */
+ const char *phase1 = "fast_provisioning=2";
+ supplicant_dbus_dict_append_basic(dict, "phase1",
+ DBUS_TYPE_STRING,
+ &phase1);
+
+ SUPPLICANT_DBG("pac_file [%s]", ssid->pac_file);
+ if(ssid->pac_file)
+ supplicant_dbus_dict_append_basic(dict, "pac_file",
+ DBUS_TYPE_STRING,
+ &ssid->pac_file);
+
+ supplicant_dbus_dict_append_basic(dict, "password",
+ DBUS_TYPE_STRING,
+ &ssid->passphrase);
+}
#endif
static void add_network_security_eap(DBusMessageIter *dict,
#if defined TIZEN_EXT
} else if (g_strcmp0(ssid->eap, "sim") == 0 ||
- g_strcmp0(ssid->eap, "aka") == 0) {
+ g_strcmp0(ssid->eap, "aka") == 0 ||
+ g_strcmp0(ssid->eap, "aka'") == 0) {
add_network_security_aka_sim(dict, ssid);
+ } else if (g_strcmp0(ssid->eap, "pwd") == 0) {
+ if(!ssid->passphrase)
+ return;
+ supplicant_dbus_dict_append_basic(dict, "password",
+ DBUS_TYPE_STRING,
+ &ssid->passphrase);
+ } else if (g_strcmp0(ssid->eap, "fast") == 0){
+ if (!ssid->identity || !ssid->passphrase)
+ return;
+
+ add_network_security_fast(dict, ssid);
#endif
} else
return;
network_remove(intf_data);
} else
#if defined TIZEN_EXT
- if (ssid->passphrase && g_strcmp0(ssid->passphrase, "") != 0) {
+ if (ssid->passphrase && g_strcmp0(ssid->passphrase, "") != 0 && !ssid->eap) {
ret = send_decryption_request(ssid->passphrase, data);
if (ret < 0)
SUPPLICANT_DBG("Decryption request failed %d", ret);